• Publicity: Public Only All

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.4 2021/12/28 11:40:24 antoniop Exp $

Procedures in this file

Detailed information

calendar::adjust_date (public)

 calendar::adjust_date [ -date date ] [ -julian_date julian_date ]
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.

Partial Call Graph (max 5 caller/called nodes):
%3 packages/calendar/www/cal-item-new.tcl packages/calendar/ www/cal-item-new.tcl calendar::adjust_date calendar::adjust_date packages/calendar/www/cal-item-new.tcl->calendar::adjust_date packages/calendar/www/view.tcl packages/calendar/ www/view.tcl packages/calendar/www/view.tcl->calendar::adjust_date dt_julian_to_ansi dt_julian_to_ansi (public) calendar::adjust_date->dt_julian_to_ansi dt_sysdate dt_sysdate (public) calendar::adjust_date->dt_sysdate

Testcases:
No testcase defined.

calendar::assign_permissions (public)

 calendar::assign_permissions calendar_id party_id cal_privilege \
    [ revoke ]

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

Parameters:
calendar_id
party_id
cal_privilege
revoke (optional)

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 packages/calendar/www/admin/calendar-create.tcl packages/calendar/ www/admin/calendar-create.tcl packages/calendar/www/admin/calendar-create.tcl->calendar::assign_permissions acs_magic_object acs_magic_object (public) calendar::assign_permissions->acs_magic_object 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
Returns:
1 if the attachments are enabled, otherwise 0.

Partial Call Graph (max 5 caller/called nodes):
%3 calendar::item::get calendar::item::get (public) calendar::attachments_enabled_p calendar::attachments_enabled_p 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 site_node_apm_integration::child_package_exists_p site_node_apm_integration::child_package_exists_p (public) calendar::attachments_enabled_p->site_node_apm_integration::child_package_exists_p

Testcases:
No testcase defined.

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 packages/calendar/www/cal-item-new.tcl packages/calendar/ www/cal-item-new.tcl calendar::calendar_list calendar::calendar_list 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 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

Testcases:
No testcase defined.

calendar::create (public)

 calendar::create owner_id private_p [ calendar_name ]

create a new calendar private_p is default to true since the default calendar is a private calendar

Parameters:
owner_id
private_p
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 calendar::item::edit calendar::item::edit (public) calendar::do_notifications calendar::do_notifications calendar::item::edit->calendar::do_notifications calendar::item::new calendar::item::new (public) calendar::item::new->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

Testcases:
No testcase defined.

calendar::from_sql_datetime (public)

 calendar::from_sql_datetime -sql_date sql_date -format format
Switches:
-sql_date (required)
-format (required)

Partial Call Graph (max 5 caller/called nodes):
%3 packages/calendar/www/cal-item-create-recurrence.tcl packages/calendar/ www/cal-item-create-recurrence.tcl calendar::from_sql_datetime calendar::from_sql_datetime packages/calendar/www/cal-item-create-recurrence.tcl->calendar::from_sql_datetime packages/calendar/www/cal-item-new.tcl packages/calendar/ www/cal-item-new.tcl packages/calendar/www/cal-item-new.tcl->calendar::from_sql_datetime template::util::date::create template::util::date::create (public) calendar::from_sql_datetime->template::util::date::create template::util::date::set_property template::util::date::set_property (public) 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 calendar::personal_p calendar::personal_p (public) calendar::get calendar::get calendar::personal_p->calendar::get db_1row db_1row (public) calendar::get->db_1row

Testcases:
No testcase defined.

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 packages/calendar/www/cal-item-new.tcl packages/calendar/ www/cal-item-new.tcl calendar::get_item_types calendar::get_item_types 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 db_list_of_lists db_list_of_lists (public) calendar::get_item_types->db_list_of_lists

Testcases:
No testcase defined.

calendar::get_month_multirow_information (public)

 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
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 (defaults to "0") (optional)
-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 (defaults to "party_id") (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 calendar_have_private_p calendar_have_private_p (public, deprecated) calendar::have_private_p calendar::have_private_p 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 db_string db_string (public) calendar::have_private_p->db_string

Testcases:
No testcase defined.

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 calendar::apm::before_uninstantiate calendar::apm::before_uninstantiate (private) calendar::item_type_delete calendar::item_type_delete 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 db_dml db_dml (public) calendar::item_type_delete->db_dml db_transaction db_transaction (public) calendar::item_type_delete->db_transaction

Testcases:
No testcase defined.

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 packages/calendar/www/item-type-new.tcl packages/calendar/ www/item-type-new.tcl calendar::item_type_new calendar::item_type_new packages/calendar/www/item-type-new.tcl->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

Testcases:
No testcase defined.

calendar::make_datetime (public)

 calendar::make_datetime event_date [ event_time ]

given a date, and a time, construct the proper date string to be imported into oracle. (yyyy-mm-dd hh24:mi format)s

Parameters:
event_date
event_time (optional)

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

Testcases:
No testcase defined.

calendar::name (public)

 calendar::name calendar_id

Return a calendar's name

Parameters:
calendar_id

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 (defaults to "f") (optional)
-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
Returns:
a full URL to the object_id

Partial Call Graph (max 5 caller/called nodes):
%3 AcsSc.notificationtype.geturl.calendar_notif_type AcsSc.notificationtype.geturl.calendar_notif_type (private) calendar::notification::get_url calendar::notification::get_url AcsSc.notificationtype.geturl.calendar_notif_type->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

Testcases:
No testcase defined.

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 calendar::item::new calendar::item::new (public) calendar::personal_p calendar::personal_p 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 ad_conn ad_conn (public) calendar::personal_p->ad_conn calendar::get calendar::get (public) calendar::personal_p->calendar::get template::util::is_true template::util::is_true (public) calendar::personal_p->template::util::is_true

Testcases:
No testcase defined.

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)

 calendar::to_sql_datetime -date date -time time [ -time_p time_p ]

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.

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

Partial Call Graph (max 5 caller/called nodes):
%3 packages/calendar/www/cal-item-create-recurrence.tcl packages/calendar/ www/cal-item-create-recurrence.tcl calendar::to_sql_datetime calendar::to_sql_datetime packages/calendar/www/cal-item-create-recurrence.tcl->calendar::to_sql_datetime packages/calendar/www/cal-item-new.tcl packages/calendar/ www/cal-item-new.tcl packages/calendar/www/cal-item-new.tcl->calendar::to_sql_datetime template::util::date::get_property template::util::date::get_property (public) calendar::to_sql_datetime->template::util::date::get_property

Testcases:
No testcase defined.
[ show source ]