Index: openacs-4/packages/attendance/lib/cp-attendance.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attendance/lib/cp-attendance.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/attendance/lib/cp-attendance.tcl 16 Jul 2005 12:53:07 -0000 1.5 +++ openacs-4/packages/attendance/lib/cp-attendance.tcl 16 Jul 2005 13:06:32 -0000 1.6 @@ -9,20 +9,13 @@ set community_id [dotlrn_community::get_community_id] } -set attendance_package_id [db_string "getattpack" "select object_id from acs_objects a, apm_packages b where a.object_id = b.package_id and a.context_id = :package_id and b.package_key = 'attendance';"] +set attendance_package_id [db_string "getattpack" ""] set attendance_url [apm_package_url_from_id $attendance_package_id] - set calendar_id [dotlrn_calendar::get_group_calendar_id -community_id $community_id] set calendar_url [calendar_portlet_display::get_url_stub $calendar_id] -set item_type_id [db_string item_type_id "select item_type_id from cal_item_types where type='Session' and calendar_id = :calendar_id limit 1" -default 0] +set item_type_id [db_string item_type_id "" -default 0] +set grade_item_id [db_string "getgradeid" ""] -set grade_item_id [db_string "getgradeid" "select eg.grade_item_id as grade_item_id - from evaluation_grades eg, acs_objects ao, cr_items cri - where cri.live_revision = eg.grade_id - and eg.grade_item_id = ao.object_id - and ao.context_id = :attendance_package_id - and eg.grade_name = 'Attendance'"] - # ns_log Notice " -- Attendance Package ID : $attendance_package_id, Grade Item : $grade_item_id --" attendance::add_sessions -community_id $community_id -grade_item_id $grade_item_id -package_id $attendance_package_id @@ -43,38 +36,14 @@ action { label "Actions" html "nowrap" - display_template { Edit | Attendance | Delete } + display_template { Edit | Attendance | Delete
Email Attendees } } } - -db_multirow -extend {session_name cal_item_id date_time grade_id} session_list get_sessions { - select et.task_name, et.number_of_members, et.task_id, et.grade_item_id, - to_char(et.due_date,'YYYY-MM-DD HH24:MI:SS') as due_date_ansi, - et.online_p, - et.late_submit_p, - et.item_id, - et.task_item_id, - et.due_date, - et.requires_grade_p, et.description, et.grade_item_id, - cr.title as task_title, - et.data as task_data, - et.task_id as revision_id, - coalesce(round(cr.content_length/1024,0),0) as content_length, - et.late_submit_p, - crmt.label as pretty_mime_type - from cr_revisions cr, - evaluation_tasksi et, - cr_items cri, - cr_mime_types crmt - where cr.revision_id = et.revision_id - and grade_item_id = :grade_item_id - and cri.live_revision = et.task_id - and et.mime_type = crmt.mime_type -} { - set cal_item_id [db_string "getcalid" "select cal_item_id from evaluation_cal_task_map where task_item_id=:item_id"] - set session_name [db_string "geteventname" "select name from acs_events where event_id=:cal_item_id"] - set grade_id [db_string "getgradeid" "select grade_id from evaluation_grades where grade_item_id = :grade_item_id"] +db_multirow -extend {session_name cal_item_id date_time grade_id} session_list get_sessions { } { + set cal_item_id [db_string "getcalid" "select cal_item_id from evaluation_cal_task_map where task_item_id=:item_id" -default ""] + set session_name [db_string "geteventname" "select name from acs_events where event_id=:cal_item_id" -default ""] + set grade_id [db_string "getgradeid" "select grade_id from evaluation_grades where grade_item_id = :grade_item_id" -default ""] set date_time [db_string datetime { select to_char(start_date, 'Mon dd, yyyy hh:miam-')||to_char(end_date, 'hh:miam') from cal_items ci, acs_events e, acs_activities a, timespans s, time_intervals t