calendar::do_notifications (public)
calendar::do_notifications -mode mode -cal_item_id cal_item_id
Defined in packages/calendar/tcl/calendar-procs.tcl
Perform the notifications
- Switches:
- -mode (required)
- -cal_item_id (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- cal_item_add_delete
Source code: # Select all the important information calendar::item::get -cal_item_id $cal_item_id -array cal_item set cal_item_id $cal_item(cal_item_id) set n_attachments $cal_item(n_attachments) set ansi_start_date $cal_item(start_date_ansi) set ansi_end_date $cal_item(end_date_ansi) set start_time $cal_item(start_time) set end_time $cal_item(end_time) set title $cal_item(name) set description $cal_item(description) set repeat_p $cal_item(recurrence_id) set item_type $cal_item(item_type) set item_type_id $cal_item(item_type_id) set calendar_id $cal_item(calendar_id) set time_p $cal_item(time_p) set url "[ad_url][ad_conn package_url]" set new_content "" append new_content "[_ calendar.Calendar]: <a href=\"[ns_quotehtml $url]\">[ad_conn instance_name]</a><br>\n" append new_content "[_ calendar.Calendar_Item]: <a href=\"[ns_quotehtml ${url}cal-item-view?cal_item_id=$cal_item_id]\">$cal_item(name)</a><br>\n" append new_content "[_ calendar.Start_Time]: $cal_item(start_date_ansi) $cal_item(start_time)<br>\n" append new_content "[_ calendar.to]: $cal_item(end_date_ansi) $cal_item(end_time)<br>\n" if {$repeat_p ne "" && $repeat_p} { append new_content "[_ calendar.is_recurring]" } append new_content "\n<br>\n" append new_content $cal_item(description) acs_user::get -user_id $cal_item(creation_user) -array user_info append new_content "<br>Author: <a href=\"mailto:$user_info(email)\">$user_info(first_names) $user_info(last_name)</a><br>\n" # send text for now. set new_content [ad_html_to_text -- $new_content] if {[lang::message::message_exists_p en_US calendar.$mode]} { set mode [_ calendar.$mode] } # Do the notification for the calendar notification::new -type_id [notification::type::get_type_id -short_name calendar_notif] -object_id [ad_conn package_id] -response_id $cal_item(cal_item_id) -notif_subject "$mode [_ calendar.Calendar_Item]: $cal_item(name)" -notif_text $new_contentGeneric XQL file: packages/calendar/tcl/calendar-procs.xql
PostgreSQL XQL file: packages/calendar/tcl/calendar-procs-postgresql.xql
Oracle XQL file: packages/calendar/tcl/calendar-procs-oracle.xql