caldav::calendars proc calendar_clause (public)

 caldav::calendars[i] calendar_clause [ -calendar_ids calendar_ids ] \
    [ -user_id user_id ] [ -attr attr ]

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

When calendar_ids are empty, user_id has to be specified

Switches:
-calendar_ids (optional, integer)
-user_id (optional, integer)
-attr (optional, defaults to "c.on_which_calendar")

Testcases:
No testcase defined.
Source code:
#
# When calendar_ids are empty, user_id has to be specified
#

if {$calendar_ids eq ""} {
    lappend clauses  {*}[:communityCalendarClause $user_id]  {*}[:alwaysQueriedClause $user_id]
    set clause [subst { and $attr in ([join $clauses " union "]) }]
} elseif {[llength $calendar_ids] == 1} {
    set clause [subst {and $attr = :calendar_ids}]
} else {
    set clause [subst {and $attr in ( [ns_dbquotelist $calendar_ids] )}]
}
:debug calendar_clause=$clause-calendar_ids=$calendar_ids
return $clause
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: