calendar-procs.tcl

Utility functions for Calendar Applications

Location:
packages/calendar/tcl/calendar-procs.tcl
Created:
Dec 14, 2000
Authors:
Dirk Gomez <openacs@dirkgomez.de>
Gary Jin <gjin@arsdigita.com>
Ben Adida <ben@openforce.net>
CVS Identification:
$Id: calendar-procs.tcl,v 1.39.2.21 2023/06/06 14:37:01 antoniop Exp $

Procedures in this file

Detailed information

calendar::adjust_date (public, deprecated)

 calendar::adjust_date [ -date date ] [ -julian_date julian_date ]
Deprecated. Invoking this procedure generates a warning.

Switches:
-date (optional)
-julian_date (optional)
Returns:
the date if it is provided. Otherwise, the julian date in ANSI format, if provided, or the system date. DEPRECATED: this proc implements a trivial defaulting logic that can be inlined just as well.
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 ad_log_deprecated ad_log_deprecated (public) dt_julian_to_ansi dt_julian_to_ansi (public) dt_sysdate dt_sysdate (public) calendar::adjust_date calendar::adjust_date calendar::adjust_date->ad_log_deprecated calendar::adjust_date->dt_julian_to_ansi calendar::adjust_date->dt_sysdate

Testcases:
No testcase defined.

calendar::assign_permissions (public, deprecated)

 calendar::assign_permissions calendar_id party_id cal_privilege \
    [ revoke ]
Deprecated. Invoking this procedure generates a warning.

Given a calendar_id, party_id and a permission this proc will assign the permission to the party the legal permissions are: public, private, calendar_read, calendar_write, calendar_delete If the revoke is set, then the given permission will be removed for the party. DEPRECATED: this api is a trivial wrapper to the permission api

Parameters:
calendar_id (required)
party_id (required)
cal_privilege (required)
revoke (optional)
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 calendar_assign_permissions calendar_assign_permissions (public, deprecated) calendar::assign_permissions calendar::assign_permissions calendar_assign_permissions->calendar::assign_permissions acs_magic_object acs_magic_object (public) calendar::assign_permissions->acs_magic_object ad_log_deprecated ad_log_deprecated (public) calendar::assign_permissions->ad_log_deprecated permission::grant permission::grant (public) calendar::assign_permissions->permission::grant permission::revoke permission::revoke (public) calendar::assign_permissions->permission::revoke

Testcases:
No testcase defined.

calendar::attachments_enabled_p (public)

 calendar::attachments_enabled_p [ -package_id package_id ]
Switches:
-package_id (optional)
the package_id, assumed to belong to a calendar package instance. When not specified, we will determine the package from the connection. When no package can be determined, this proc will return 0.
Returns:
1 if the attachments are enabled, otherwise 0.

Partial Call Graph (max 5 caller/called nodes):
%3 test_attachments_enabled attachments_enabled (test calendar) calendar::attachments_enabled_p calendar::attachments_enabled_p test_attachments_enabled->calendar::attachments_enabled_p ad_conn ad_conn (public) calendar::attachments_enabled_p->ad_conn ad_log ad_log (public) calendar::attachments_enabled_p->ad_log site_node::get_children site_node::get_children (public) calendar::attachments_enabled_p->site_node::get_children site_node::get_node_id_from_object_id site_node::get_node_id_from_object_id (public) calendar::attachments_enabled_p->site_node::get_node_id_from_object_id calendar::item::get calendar::item::get (public) calendar::item::get->calendar::attachments_enabled_p packages/calendar/www/cal-item-view.tcl packages/calendar/ www/cal-item-view.tcl packages/calendar/www/cal-item-view.tcl->calendar::attachments_enabled_p

Testcases:
attachments_enabled

calendar::calendar_list (public)

 calendar::calendar_list [ -package_id package_id ] \
    [ -user_id user_id ] [ -privilege privilege ]
Switches:
-package_id (optional)
-user_id (optional)
-privilege (optional)
Returns:
a list of calendars

Partial Call Graph (max 5 caller/called nodes):
%3 test_cal_item_add_delete cal_item_add_delete (test calendar) calendar::calendar_list calendar::calendar_list test_cal_item_add_delete->calendar::calendar_list ad_conn ad_conn (public) calendar::calendar_list->ad_conn db_list_of_lists db_list_of_lists (public) calendar::calendar_list->db_list_of_lists packages/calendar/www/cal-item-new.tcl packages/calendar/ www/cal-item-new.tcl packages/calendar/www/cal-item-new.tcl->calendar::calendar_list packages/calendar/www/cal-options.tcl packages/calendar/ www/cal-options.tcl packages/calendar/www/cal-options.tcl->calendar::calendar_list packages/calendar/www/view.tcl packages/calendar/ www/view.tcl packages/calendar/www/view.tcl->calendar::calendar_list

Testcases:
cal_item_add_delete

calendar::compare_day_items_by_current_hour (private)

 calendar::compare_day_items_by_current_hour a b

Compare a day item by the current hour (field 0). This is needed by the one-day view for sorting.

Parameters:
a (required)
b (required)

Partial Call Graph (max 5 caller/called nodes):
%3

Testcases:
No testcase defined.

calendar::create (public)

 calendar::create owner_id private_p [ calendar_name ]

Create a new calendar.

Parameters:
owner_id (required)
private_p (required)
defaults to true since the default calendar is a private calendar.
calendar_name (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_cal_item_add_delete cal_item_add_delete (test calendar) calendar::create calendar::create test_cal_item_add_delete->calendar::create test_cal_item_edit_recurrence cal_item_edit_recurrence (test calendar) test_cal_item_edit_recurrence->calendar::create ad_conn ad_conn (public) calendar::create->ad_conn db_exec_plsql db_exec_plsql (public) calendar::create->db_exec_plsql permission::set_not_inherit permission::set_not_inherit (public) calendar::create->permission::set_not_inherit calendar_create calendar_create (public, deprecated) calendar_create->calendar::create packages/calendar/www/admin/calendar-create.tcl packages/calendar/ www/admin/calendar-create.tcl packages/calendar/www/admin/calendar-create.tcl->calendar::create

Testcases:
cal_item_edit_recurrence, cal_item_add_delete

calendar::delete (public)

 calendar::delete -calendar_id calendar_id

Delete a calendar

Switches:
-calendar_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_cal_item_add_delete cal_item_add_delete (test calendar) calendar::delete calendar::delete test_cal_item_add_delete->calendar::delete test_calendar_basic_api calendar_basic_api (test calendar) test_calendar_basic_api->calendar::delete db_exec_plsql db_exec_plsql (public) calendar::delete->db_exec_plsql calendar::apm::before_uninstantiate calendar::apm::before_uninstantiate (private) calendar::apm::before_uninstantiate->calendar::delete packages/calendar/www/admin/calendar-delete.tcl packages/calendar/ www/admin/calendar-delete.tcl packages/calendar/www/admin/calendar-delete.tcl->calendar::delete

Testcases:
cal_item_add_delete, calendar_basic_api

calendar::do_notifications (public)

 calendar::do_notifications -mode mode -cal_item_id cal_item_id

Perform the notifications

Switches:
-mode (required)
-cal_item_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_cal_item_add_delete cal_item_add_delete (test calendar) calendar::do_notifications calendar::do_notifications test_cal_item_add_delete->calendar::do_notifications _ _ (public) calendar::do_notifications->_ acs_user::get acs_user::get (public) calendar::do_notifications->acs_user::get ad_conn ad_conn (public) calendar::do_notifications->ad_conn ad_html_to_text ad_html_to_text (public) calendar::do_notifications->ad_html_to_text ad_url ad_url (public) calendar::do_notifications->ad_url calendar::item::edit calendar::item::edit (public) calendar::item::edit->calendar::do_notifications calendar::item::new calendar::item::new (public) calendar::item::new->calendar::do_notifications

Testcases:
cal_item_add_delete

calendar::from_sql_datetime (public, deprecated)

 calendar::from_sql_datetime -sql_date sql_date -format format
Deprecated. Invoking this procedure generates a warning.

Converts a date in a specified format into a templating date dict.

Switches:
-sql_date (required)
a date in one of the supported format.
-format (required)
one of the supported format, "YYYY-MM-DD", "HH12:MIam" or "HH24:MI". When unspecified or invalid, we will try to treat the date as an ansi date. DEPRECATED: this api has been superseded by api in acs-templating.
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 ad_log_deprecated ad_log_deprecated (public) template::util::date::create template::util::date::create (public) template::util::date::set_property template::util::date::set_property (public) calendar::from_sql_datetime calendar::from_sql_datetime calendar::from_sql_datetime->ad_log_deprecated calendar::from_sql_datetime->template::util::date::create calendar::from_sql_datetime->template::util::date::set_property

Testcases:
No testcase defined.

calendar::get (public)

 calendar::get -calendar_id calendar_id [ -array array ]

Get calendar info

Switches:
-calendar_id (required)
-array (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 test_calendar_basic_api calendar_basic_api (test calendar) calendar::get calendar::get test_calendar_basic_api->calendar::get db_1row db_1row (public) calendar::get->db_1row calendar::personal_p calendar::personal_p (public) calendar::personal_p->calendar::get

Testcases:
calendar_basic_api

calendar::get_item_types (public)

 calendar::get_item_types -calendar_id calendar_id

return the item types

Switches:
-calendar_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_calendar_basic_api calendar_basic_api (test calendar) calendar::get_item_types calendar::get_item_types test_calendar_basic_api->calendar::get_item_types db_list_of_lists db_list_of_lists (public) calendar::get_item_types->db_list_of_lists packages/calendar/www/cal-item-new.tcl packages/calendar/ www/cal-item-new.tcl packages/calendar/www/cal-item-new.tcl->calendar::get_item_types packages/calendar/www/calendar-item-types.tcl packages/calendar/ www/calendar-item-types.tcl packages/calendar/www/calendar-item-types.tcl->calendar::get_item_types

Testcases:
calendar_basic_api

calendar::get_month_multirow_information (private)

 calendar::get_month_multirow_information -current_day current_day \
    -today_julian_date today_julian_date \
    -first_julian_date_of_month first_julian_date_of_month

Builds a multirow with information about the month. Used to display the month calendar view.

Switches:
-current_day (required)
-today_julian_date (required)
-first_julian_date_of_month (required)
Author:
Dirk Gomez <openacs@dirkgomez.de>
Created:
20-July-2003

Partial Call Graph (max 5 caller/called nodes):
%3 packages/calendar/www/view-month-display.tcl packages/calendar/ www/view-month-display.tcl calendar::get_month_multirow_information calendar::get_month_multirow_information packages/calendar/www/view-month-display.tcl->calendar::get_month_multirow_information lc_get lc_get (public) calendar::get_month_multirow_information->lc_get

Testcases:
No testcase defined.

calendar::have_private_p (public)

 calendar::have_private_p [ -return_id return_id ] \
    [ -calendar_id_list calendar_id_list ] [ -party_id party_id ]

Check to see if the user has a private calendar. When the provided -return_id is 1, then proc will return the calendar_id

Switches:
-return_id (optional, defaults to "0")
when set to 1, this proc will return the calendar_id
-calendar_id_list (optional)
If you supply the calendar_id_list, then we'll only search for a personal calendar among the calendars supplied here.
-party_id (optional, defaults to "party_id")
Returns:
boolean or the calendar_id according to 'return_id' flag.

Partial Call Graph (max 5 caller/called nodes):
%3 test_cal_item_add_delete cal_item_add_delete (test calendar) calendar::have_private_p calendar::have_private_p test_cal_item_add_delete->calendar::have_private_p db_string db_string (public) calendar::have_private_p->db_string calendar_have_private_p calendar_have_private_p (public, deprecated) calendar_have_private_p->calendar::have_private_p packages/calendar/www/cal-item-new.tcl packages/calendar/ www/cal-item-new.tcl packages/calendar/www/cal-item-new.tcl->calendar::have_private_p packages/calendar/www/index.tcl packages/calendar/ www/index.tcl packages/calendar/www/index.tcl->calendar::have_private_p

Testcases:
cal_item_add_delete

calendar::item_type_delete (public)

 calendar::item_type_delete -calendar_id calendar_id \
    -item_type_id item_type_id

Delete an item type

Switches:
-calendar_id (required)
-item_type_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_calendar_basic_api calendar_basic_api (test calendar) calendar::item_type_delete calendar::item_type_delete test_calendar_basic_api->calendar::item_type_delete db_dml db_dml (public) calendar::item_type_delete->db_dml db_transaction db_transaction (public) calendar::item_type_delete->db_transaction calendar::apm::before_uninstantiate calendar::apm::before_uninstantiate (private) calendar::apm::before_uninstantiate->calendar::item_type_delete packages/calendar/www/item-type-delete.tcl packages/calendar/ www/item-type-delete.tcl packages/calendar/www/item-type-delete.tcl->calendar::item_type_delete

Testcases:
calendar_basic_api

calendar::item_type_new (public)

 calendar::item_type_new -calendar_id calendar_id \
    [ -item_type_id item_type_id ] -type type

creates a new item type

Switches:
-calendar_id (required)
-item_type_id (optional)
-type (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_calendar_basic_api calendar_basic_api (test calendar) calendar::item_type_new calendar::item_type_new test_calendar_basic_api->calendar::item_type_new db_dml db_dml (public) calendar::item_type_new->db_dml db_nextval db_nextval (public) calendar::item_type_new->db_nextval packages/calendar/www/item-type-new.tcl packages/calendar/ www/item-type-new.tcl packages/calendar/www/item-type-new.tcl->calendar::item_type_new

Testcases:
calendar_basic_api

calendar::make_datetime (public, deprecated)

 calendar::make_datetime event_date [ event_time ]
Deprecated. Invoking this procedure generates a warning.

given a date, and a time, construct the proper date string to be imported into oracle. (yyyy-mm-dd hh24:mi format)s DEPRECATED: clock idioms and HTML5 feature make this date conversion api less useful

Parameters:
event_date (required)
event_time (optional)
See Also:
  • clock

Partial Call Graph (max 5 caller/called nodes):
%3 calendar_make_datetime calendar_make_datetime (public, deprecated) calendar::make_datetime calendar::make_datetime calendar_make_datetime->calendar::make_datetime ad_log_deprecated ad_log_deprecated (public) calendar::make_datetime->ad_log_deprecated

Testcases:
No testcase defined.

calendar::name (public)

 calendar::name calendar_id

Return a calendar's name

Parameters:
calendar_id (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_calendar_basic_api calendar_basic_api (test calendar) calendar::name calendar::name test_calendar_basic_api->calendar::name db_string db_string (public) calendar::name->db_string packages/calendar/www/admin/calendar-edit.tcl packages/calendar/ www/admin/calendar-edit.tcl packages/calendar/www/admin/calendar-edit.tcl->calendar::name

Testcases:
calendar_basic_api

calendar::new (public)

 calendar::new -owner_id owner_id [ -private_p private_p ] \
    -calendar_name calendar_name [ -package_id package_id ]

Create a new calendar

Switches:
-owner_id (required)
-private_p (optional, defaults to "f")
-calendar_name (required)
-package_id (optional)
Returns:
the new calendar_id

Partial Call Graph (max 5 caller/called nodes):
%3 test_calendar_basic_api calendar_basic_api (test calendar) calendar::new calendar::new test_calendar_basic_api->calendar::new ad_conn ad_conn (public) calendar::new->ad_conn package_instantiate_object package_instantiate_object (public) calendar::new->package_instantiate_object packages/calendar/www/admin/calendar-edit.tcl packages/calendar/ www/admin/calendar-edit.tcl packages/calendar/www/admin/calendar-edit.tcl->calendar::new packages/calendar/www/cal-item-new.tcl packages/calendar/ www/cal-item-new.tcl packages/calendar/www/cal-item-new.tcl->calendar::new packages/calendar/www/index.tcl packages/calendar/ www/index.tcl packages/calendar/www/index.tcl->calendar::new

Testcases:
calendar_basic_api

calendar::notification::get_url (public)

 calendar::notification::get_url object_id
Parameters:
object_id (required)
Returns:
a full URL to the object_id

Partial Call Graph (max 5 caller/called nodes):
%3 test_cal_item_add_delete cal_item_add_delete (test calendar) calendar::notification::get_url calendar::notification::get_url test_cal_item_add_delete->calendar::notification::get_url site_node::get_url_from_object_id site_node::get_url_from_object_id (public) calendar::notification::get_url->site_node::get_url_from_object_id AcsSc.notificationtype.geturl.calendar_notif_type AcsSc.notificationtype.geturl.calendar_notif_type (private) AcsSc.notificationtype.geturl.calendar_notif_type->calendar::notification::get_url

Testcases:
cal_item_add_delete

calendar::personal_p (public)

 calendar::personal_p -calendar_id calendar_id [ -user_id user_id ]
Switches:
-calendar_id (required)
-user_id (optional)
The user whose calendar you want to check
Returns:
true (1) if this is the user's personal calendar, false (0) otherwise.

Partial Call Graph (max 5 caller/called nodes):
%3 test_cal_item_add_delete cal_item_add_delete (test calendar) calendar::personal_p calendar::personal_p test_cal_item_add_delete->calendar::personal_p ad_conn ad_conn (public) calendar::personal_p->ad_conn calendar::get calendar::get (public) calendar::personal_p->calendar::get calendar::item::new calendar::item::new (public) calendar::item::new->calendar::personal_p packages/calendar/www/cal-item-new.tcl packages/calendar/ www/cal-item-new.tcl packages/calendar/www/cal-item-new.tcl->calendar::personal_p packages/calendar/www/view.tcl packages/calendar/ www/view.tcl packages/calendar/www/view.tcl->calendar::personal_p

Testcases:
cal_item_add_delete

calendar::rename (public)

 calendar::rename -calendar_id calendar_id -calendar_name calendar_name

rename a calendar

Switches:
-calendar_id (required)
-calendar_name (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_calendar_basic_api calendar_basic_api (test calendar) calendar::rename calendar::rename test_calendar_basic_api->calendar::rename db_dml db_dml (public) calendar::rename->db_dml packages/calendar/www/admin/calendar-edit.tcl packages/calendar/ www/admin/calendar-edit.tcl packages/calendar/www/admin/calendar-edit.tcl->calendar::rename

Testcases:
calendar_basic_api

calendar::to_sql_datetime (public, deprecated)

 calendar::to_sql_datetime -date date -time time [ -time_p time_p ]
Deprecated. Invoking this procedure generates a warning.

This takes two date chunks, one for date one for time, and combines them correctly. The issue here is the incoming format. date: ANSI SQL YYYY-MM-DD time: we return HH24. DEPRECATED: this api has been superseded by api in acs-templating.

Switches:
-date (required)
-time (required)
-time_p (optional, defaults to "1")
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 ad_log_deprecated ad_log_deprecated (public) template::util::date::get_property template::util::date::get_property (public) calendar::to_sql_datetime calendar::to_sql_datetime calendar::to_sql_datetime->ad_log_deprecated calendar::to_sql_datetime->template::util::date::get_property

Testcases:
No testcase defined.
[ show source ]