| |
17 |
17 |
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] |
| |
18 |
18 |
|
| |
19 |
19 |
set grade_item_id [db_string "getgradeid" "select eg.grade_item_id as grade_item_id |
| |
20 |
20 |
from evaluation_grades eg, acs_objects ao, cr_items cri |
| |
21 |
21 |
where cri.live_revision = eg.grade_id |
| |
22 |
22 |
and eg.grade_item_id = ao.object_id |
| |
23 |
23 |
and ao.context_id = :attendance_package_id |
| |
24 |
24 |
and eg.grade_name = 'Attendance'"] |
| |
25 |
25 |
|
| |
26 |
26 |
# ns_log Notice " -- Attendance Package ID : $attendance_package_id, Grade Item : $grade_item_id --" |
| |
27 |
27 |
|
| |
28 |
28 |
attendance::add_sessions -community_id $community_id -grade_item_id $grade_item_id -package_id $attendance_package_id |
| |
29 |
29 |
|
| |
30 |
30 |
template::list::create \ |
| |
31 |
31 |
-name session_list \ |
| |
32 |
32 |
-multirow session_list \ |
| |
33 |
33 |
-pass_properties { attendance_url current_url calendar_url calendar_id item_type_id } \ |
| |
34 |
34 |
-key task_id \ |
| |
35 |
35 |
-no_data "No sessions" \ |
| |
36 |
36 |
-elements { |
| |
37 |
|
task_name { |
| |
|
37 |
session_name { |
| |
38 |
38 |
label "Session" |
| |
39 |
39 |
} |
| |
40 |
40 |
date_time { |
| |
41 |
41 |
label "Date and Time" |
| |
42 |
42 |
} |
| |
43 |
43 |
action { |
| |
44 |
44 |
label "Actions" |
| |
45 |
45 |
html "nowrap" |
| |
46 |
|
display_template { <a href="@calendar_url@cal-item-new?cal_item_id=@session_list.cal_item_id@&return_url=@current_url@" >Edit</a> | <a href="@attendance_url@admin/mark?item_id=@session_list.item_id@&return_url=@current_url@">Attendance</a> | <a href="@attendance_url@admin/task-delete?task_id=@session_list.task_id@&grade_id=@session_list.grade_id@&return_url=@current_url@"> Delete</a> } |
| |
|
46 |
display_template { <a href="@calendar_url@cal-item-new?cal_item_id=@session_list.cal_item_id@&return_url=@current_url@" >Edit</a> | <a href="@attendance_url@admin/mark?item_id=@session_list.item_id@&return_url=@current_url@">Attendance</a> | <a href="@attendance_url@admin/task-delete?task_id=@session_list.task_id@&grade_id=@session_list.grade_id@&return_url=@current_url@"> Delete</a><!-- <br> <a href="@attendance_url@admin/spam?item_id=@session_list.cal_item_id@&return_url=@current_url@">Email Attendees</a>--> } |
| |
47 |
47 |
} |
| |
48 |
48 |
} |
| |
49 |
49 |
|
| |
50 |
50 |
|
| |
51 |
|
db_multirow -extend {cal_item_id date_time grade_id} session_list get_sessions { |
| |
|
51 |
db_multirow -extend {session_name cal_item_id date_time grade_id} session_list get_sessions { |
| |
52 |
52 |
select et.task_name, et.number_of_members, et.task_id, et.grade_item_id, |
| |
53 |
53 |
to_char(et.due_date,'YYYY-MM-DD HH24:MI:SS') as due_date_ansi, |
| |
54 |
54 |
et.online_p, |
| |
55 |
55 |
et.late_submit_p, |
| |
56 |
56 |
et.item_id, |
| |
57 |
57 |
et.task_item_id, |
| |
58 |
58 |
et.due_date, |
| |
59 |
59 |
et.requires_grade_p, et.description, et.grade_item_id, |
| |
60 |
60 |
cr.title as task_title, |
| |
61 |
61 |
et.data as task_data, |
| |
62 |
62 |
et.task_id as revision_id, |
| |
63 |
63 |
coalesce(round(cr.content_length/1024,0),0) as content_length, |
| |
64 |
64 |
et.late_submit_p, |
| |
65 |
65 |
crmt.label as pretty_mime_type |
| |
66 |
66 |
from cr_revisions cr, |
| |
67 |
67 |
evaluation_tasksi et, |
| |
68 |
68 |
cr_items cri, |
| |
69 |
69 |
cr_mime_types crmt |
| |
70 |
70 |
where cr.revision_id = et.revision_id |
| |
71 |
71 |
and grade_item_id = :grade_item_id |
| |
72 |
72 |
and cri.live_revision = et.task_id |
| |
73 |
73 |
and et.mime_type = crmt.mime_type |
| |
74 |
74 |
} { |
| |
75 |
75 |
set cal_item_id [db_string "getcalid" "select cal_item_id from evaluation_cal_task_map where task_item_id=:item_id"] |
| |
|
76 |
set session_name [db_string "geteventname" "select name from acs_events where event_id=:cal_item_id"] |
| |
76 |
77 |
set grade_id [db_string "getgradeid" "select grade_id from evaluation_grades where grade_item_id = :grade_item_id"] |
| |
77 |
78 |
set date_time [db_string datetime { |
| |
78 |
79 |
select to_char(start_date, 'Mon dd, yyyy hh:miam-')||to_char(end_date, 'hh:miam') |
| |
79 |
80 |
from cal_items ci, acs_events e, acs_activities a, timespans s, time_intervals t |
| |
80 |
81 |
where e.timespan_id = s.timespan_id |
| |
81 |
82 |
and s.interval_id = t.interval_id |
| |
82 |
83 |
and e.activity_id = a.activity_id |
| |
83 |
84 |
and e.event_id = ci.cal_item_id |
| |
84 |
85 |
and ci.cal_item_id = :cal_item_id |
| |
85 |
86 |
} -default ""] |
| |
86 |
87 |
} |