caldav::calendars proc communityCalendarClause (public)

 caldav::calendars[i] communityCalendarClause user_id

Defined in packages/xotcl-core/tcl/01-debug-procs.tcl

Get calendars from communities, when DotLRN is active.

Parameters:
user_id (required, integer)

Testcases:
No testcase defined.
Source code:
#
# Get calendars from communities, when DotLRN is active.
#
if {[info commands ::dotlrn_calendar::my_package_key] ne ""} {
    set result [list "
        WITH communities AS (
                             select distinct dcc.community_id
                             from dotlrn_communities_core dcc
                             inner join dotlrn_member_rels_approved dma
                             on dcc.community_id = dma.community_id
                             and dma.user_id = $user_id
                             and dcc.archived_p = 'f'
                             )
        select calendar_id
        from communities m, calendars c
        join dotlrn_community_applets a on (a.package_id = c.package_id)
        join dotlrn_applets ap on (ap.applet_id = a.applet_id) where
        ap.package_key = 'dotlrn-calendar' and
        a.community_id = m.community_id
    "]
} else {
    set result {}
}
return $result
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: