Index: openacs-4/packages/assessment/tcl/as-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/tcl/as-callback-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/assessment/tcl/as-callback-procs.tcl 10 Mar 2006 15:11:58 -0000 1.4 +++ openacs-4/packages/assessment/tcl/as-callback-procs.tcl 25 May 2006 13:14:24 -0000 1.5 @@ -25,3 +25,86 @@ -community_id $community_id] } } +ad_proc -callback application-track::getApplicationName -impl assessments {} { + callback implementation + } { + return "assessments" + } + + ad_proc -callback application-track::getGeneralInfo -impl assessments {} { + callback implementation + } { + db_1row my_query { + select count(1) as result + FROM as_assessments a,dotlrn_communities_all com, acs_objects ac, acs_objects ac2,acs_objects ac3,cr_revisions cr, cr_items ci, cr_folders cf + WHERE com.community_id = :comm_id + and a.assessment_id = ac.object_id + and ac.context_id = ac2.object_id + and ac2.package_id = ac3.object_id + and ac3.context_id = com.package_id + and cr.revision_id = ci.latest_revision + and ci.parent_id = cf.folder_id + and a.assessment_id = cr.revision_id + } + + return "$result" + } + + ad_proc -callback application-track::getSpecificInfo -impl assessments {} { + callback implementation + } { + + upvar $query_name my_query + upvar $elements_name my_elements + + set my_query { + SELECT ac.title as name,assessment_id as id,a.start_time as initial_date, + a.end_time as finish_date, + a.number_tries as number_tries + FROM as_assessments a,dotlrn_communities_all com, acs_objects ac, acs_objects ac2,acs_objects ac3,cr_revisions cr, cr_items ci, cr_folders cf + WHERE com.community_id = :class_instance_id + and a.assessment_id = ac.object_id + and ac.context_id = ac2.object_id + and ac2.package_id = ac3.object_id + and ac3.context_id = com.package_id + and cr.revision_id = ci.latest_revision + and ci.parent_id = cf.folder_id + and a.assessment_id = cr.revision_id + + } + + set my_elements { + + name { + label "name" + display_col name + html {align center} + + } + + id { + label "id" + display_col id + html {align center} + } + creation_date { + label "creation_date" + display_col initial_date + html {align center} + } + finish_date { + label "finish_date" + display_col finish_date + html {align center} + } + number_tries { + label "number_tries" + display_col number_tries + html {align center} + } + + + } + + return "OK" + } \ No newline at end of file Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/faq/tcl/faq-callback-procs.tcl'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/photo-album/tcl/photo-album-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/photo-album/tcl/photo-album-callback-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/photo-album/tcl/photo-album-callback-procs.tcl 10 Nov 2005 14:02:35 -0000 1.2 +++ openacs-4/packages/photo-album/tcl/photo-album-callback-procs.tcl 25 May 2006 13:05:53 -0000 1.3 @@ -15,12 +15,21 @@ callback implementation } { db_1row my_query { - select count(p.pa_album_id) as result - from pa_albums p, cr_items cr,acs_objects a,dotlrn_communities_all d - where d.community_id = :comm_id - and cr.live_revision = p.pa_album_id - and a.object_id = cr.parent_id - and apm_package__parent_id(a.context_id) = d.package_id + select count(distinct p.pa_photo_id) as result + from acs_objects ac,acs_objects ac2,acs_objects ac1,acs_objects ac3,dotlrn_communities_all d,pa_albums p1,pa_photos p + where p1.pa_album_id = ac.object_id + and ac.context_id = ac1.object_id + and ac1.context_id = ac2.object_id + and ac2.context_id = ac3.object_id + and ac3.context_id = d.package_id + and d.community_id = :comm_id + and p1.pa_album_id IN + (select distinct p2.pa_album_id + from pa_albums p2,cr_revisions c,cr_revisions c2, cr_items c1 + where p.pa_photo_id = c.revision_id + and c.item_id = c1.item_id + and c2.revision_id = p2.pa_album_id + and c2.item_id = c1.parent_id) } @@ -37,22 +46,37 @@ set my_query { - select p.pa_photo_id as id,p.story as story,p.photographer as photographer - from pa_photos p, dotlrn_communities com,acs_objects ac,acs_objects ac2,acs_objects ac1 - where com.community_id=:class_instance_id - and ac.object_id = p.pa_photo_id - and ac.context_id = ac1.object_id - and ac1.context_id = ac2.object_id - and ac2.context_id - IN (select ac1.context_id - from pa_albums p, dotlrn_communities com,acs_objects ac,acs_objects ac1 - where com.community_id=:class_instance_id - and ac.object_id = p.pa_album_id - and ac.context_id = ac1.object_id - ) + + select distinct ac.title as name_album,p.user_filename as name,p.pa_photo_id as id,p.story as story,p1.photographer as photographer + from acs_objects ac,acs_objects ac2,acs_objects ac1,acs_objects ac3,dotlrn_communities_all d,pa_albums p1,pa_photos p + where p1.pa_album_id = ac.object_id + and ac.context_id = ac1.object_id + and ac1.context_id = ac2.object_id + and ac2.context_id = ac3.object_id + and ac3.context_id = d.package_id + and d.community_id = :class_instance_id + and p1.pa_album_id IN + (select distinct p2.pa_album_id + from pa_albums p2,cr_revisions c,cr_revisions c2, cr_items c1 + where p.pa_photo_id = c.revision_id + and c.item_id = c1.item_id + and c2.revision_id = p2.pa_album_id + and c2.item_id = c1.parent_id) + } set my_elements { + + album_name { + label "Album Name" + display_col name_album + html {align center} + } + photo_name { + label "Photo name" + display_col name + html {align center} + } photo_id { label "Photo_id" display_col id @@ -64,10 +88,11 @@ html {align center} } p_photographer { - label "photographer" + label "Photographer" display_col photographer html {align center} } + }