Index: openacs-4/packages/calendar/tcl/cal-item-2-procs-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/cal-item-2-procs-oracle.xql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/calendar/tcl/cal-item-2-procs-oracle.xql 3 Jun 2002 04:08:17 -0000 1.1
+++ openacs-4/packages/calendar/tcl/cal-item-2-procs-oracle.xql 2 Jul 2002 21:17:07 -0000 1.2
@@ -8,6 +8,7 @@
select
cal_items.cal_item_id,
+ 0 as n_attachments,
to_char(start_date,'HH:MIpm')as start_time,
start_date as start_date,
to_char(start_date, 'MM/DD/YYYY') as pretty_short_start_date,
@@ -33,4 +34,35 @@
+
+
+
+ select
+ cal_items.cal_item_id,
+ (select count(*) from attachments where object_id = cal_item_id) as n_attachments,
+ to_char(start_date,'HH:MIpm')as start_time,
+ start_date as start_date,
+ to_char(start_date, 'MM/DD/YYYY') as pretty_short_start_date,
+ to_char(end_date, 'HH:MIpm') as end_time,
+ nvl(e.name, a.name) as name,
+ nvl(e.description, a.description) as description,
+ recurrence_id,
+ cal_items.item_type_id,
+ cal_item_types.type as item_type,
+ on_which_calendar as calendar_id
+ from acs_activities a,
+ acs_events e,
+ timespans s,
+ time_intervals t,
+ cal_items,
+ cal_item_types
+ where e.timespan_id = s.timespan_id
+ and s.interval_id = t.interval_id
+ and e.activity_id = a.activity_id
+ and e.event_id = :cal_item_id
+ and cal_items.cal_item_id= :cal_item_id
+ and cal_item_types.item_type_id(+)= cal_items.item_type_id
+
+
+
Index: openacs-4/packages/calendar/tcl/cal-item-2-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/cal-item-2-procs.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/calendar/tcl/cal-item-2-procs.tcl 3 Jun 2002 04:08:17 -0000 1.1
+++ openacs-4/packages/calendar/tcl/cal-item-2-procs.tcl 2 Jul 2002 21:17:07 -0000 1.2
@@ -29,7 +29,13 @@
} {
upvar $array row
- db_1row select_item_data {} -column_array row
+ if {[calendar::attachments_enabled_p]} {
+ set query_name select_item_data_with_attachment
+ } else {
+ set query_name select_item_data
+ }
+
+ db_1row $query_name {} -column_array row
}
ad_proc -public edit {
Index: openacs-4/packages/calendar/tcl/calendar-2-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/Attic/calendar-2-procs.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/calendar/tcl/calendar-2-procs.tcl 3 Jun 2002 07:30:53 -0000 1.3
+++ openacs-4/packages/calendar/tcl/calendar-2-procs.tcl 2 Jul 2002 21:17:07 -0000 1.4
@@ -184,4 +184,10 @@
}
}
+ ad_proc -public attachments_enabled_p {} {
+ check if attachments enabled
+ } {
+ return [apm_package_registered_p attachments]
+ }
+
}
Index: openacs-4/packages/calendar/tcl/calendar-outlook-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/tcl/calendar-outlook-procs.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/calendar/tcl/calendar-outlook-procs.tcl 29 May 2002 23:20:55 -0000 1.2
+++ openacs-4/packages/calendar/tcl/calendar-outlook-procs.tcl 2 Jul 2002 21:17:07 -0000 1.3
@@ -77,8 +77,7 @@
set DTEND [ics_timestamp_format -timestamp $end_date]
# Put it together
- set ics_event "
- BEGIN:VCALENDAR\r\nPRODID:-//OpenACS//OpenACS 4.5 MIMEDIR//EN\r\nVERSION:2.0\r\nMETHOD:PUBLISH\r\nBEGIN:VEVENT\r\nDTSTART$DTSTART\r\nDTEND$DTEND\r\n"
+ set ics_event "BEGIN:VCALENDAR\r\nPRODID:-//OpenACS//OpenACS 4.5 MIMEDIR//EN\r\nVERSION:2.0\r\nMETHOD:PUBLISH\r\nBEGIN:VEVENT\r\nDTSTART$DTSTART\r\nDTEND$DTEND\r\n"
set creation_date $DTSTART
set DESCRIPTION $description
@@ -310,7 +309,7 @@
ns_return 200 application/x-msoutlook $ics_event
}
- ad_register_proc GET /*.ics cal_output_outlook_event
- ad_register_proc POST /*.ics cal_output_outlook_event
+ # ad_register_proc GET /*.ics cal_output_outlook_event
+ # ad_register_proc POST /*.ics cal_output_outlook_event
}
Index: openacs-4/packages/calendar/www/cal-item-outlook.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-outlook.tcl,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/calendar/www/cal-item-outlook.tcl 3 Jun 2002 04:08:17 -0000 1.1
+++ openacs-4/packages/calendar/www/cal-item-outlook.tcl 2 Jul 2002 21:17:08 -0000 1.2
@@ -11,6 +11,4 @@
cal_item_id:integer
}
-set ics_stuff [calendar::outlook::format_item -cal_item_id $cal_item_id]
-
-ns_return 200 application/x-msoutlook $ics_stuff
+ad_returnredirect "ics/${cal_item_id}.ics"
Index: openacs-4/packages/calendar/www/cal-item-view.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-view.adp,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/calendar/www/cal-item-view.adp 3 Jun 2002 04:08:17 -0000 1.8
+++ openacs-4/packages/calendar/www/cal-item-view.adp 2 Jul 2002 21:17:08 -0000 1.9
@@ -25,10 +25,19 @@
Date and Time: | @cal_item.pretty_short_start_date@, from @cal_item.start_time@ to @cal_item.end_time@ |
Title: | @cal_item.name@ |
Type: | @cal_item.item_type@ |
+ Attachments: |
+<%
+foreach attachment $item_attachments {
+ template::adp_puts "[lindex $attachment 1] "
+}
+%>
+ |
- edit | delete
+ edit | delete @attachment_options@
+
+sync with Outlook
Index: openacs-4/packages/calendar/www/cal-item-view.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/cal-item-view.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/calendar/www/cal-item-view.tcl 3 Jun 2002 04:08:17 -0000 1.5
+++ openacs-4/packages/calendar/www/cal-item-view.tcl 2 Jul 2002 21:17:08 -0000 1.6
@@ -17,6 +17,9 @@
set package_id [ad_conn package_id]
+# Require read permission (FIXME)
+# ad_require_permission $cal_item_id read
+
# write permission
set edit_p [ad_permission_p $cal_item_id cal_item_write]
@@ -28,9 +31,21 @@
calendar::item::get -cal_item_id $cal_item_id -array cal_item
+# Attachments?
+if {$cal_item(n_attachments) > 0} {
+ set item_attachments [attachments::get_attachments -object_id $cal_item(cal_item_id)]
+} else {
+ set item_attachments [list]
+}
+
# no time?
set cal_item(no_time_p) [dt_no_time_p -start_time $cal_item(start_time) -end_time $cal_item(end_time)]
+# Attachment URLs
+if {[calendar::attachments_enabled_p]} {
+ set attachment_options " | add attachment"
+}
+
# cal nav
set cal_nav [dt_widget_calendar_navigation "view" day $cal_item(start_date) "calendar_id="]
Index: openacs-4/packages/calendar/www/ics/index.vuh
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/www/ics/index.vuh,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/calendar/www/ics/index.vuh 2 Jul 2002 21:17:08 -0000 1.1
@@ -0,0 +1,25 @@
+
+ad_page_contract {
+
+ Output an item as ics for Outlook
+ The expected URL is .ics
+
+ @author Ben Adida (ben@openforce)
+ @creation-date June 20, 2002
+ @cvs-id $Id: index.vuh,v 1.1 2002/07/02 21:17:08 ben Exp $
+}
+
+set path [ad_conn path_info]
+
+# Match the path
+if {![regexp {([0-9]*)\.ics} $path all cal_item_id]} {
+ ad_returnredirect "../"
+ ad_script_abort
+}
+
+# Permission (FIXME: ben)
+# ad_require_permission $cal_item_id read
+
+set ics_stuff [calendar::outlook::format_item -cal_item_id $cal_item_id]
+
+ns_return 200 application/x-msoutlook $ics_stuff