Index: openacs-4/packages/assessment/www/asm-admin/sessions.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/sessions.tcl,v diff -u -r1.2.2.3 -r1.2.2.4 --- openacs-4/packages/assessment/www/asm-admin/sessions.tcl 22 Feb 2007 03:11:56 -0000 1.2.2.3 +++ openacs-4/packages/assessment/www/asm-admin/sessions.tcl 7 Jul 2007 00:27:51 -0000 1.2.2.4 @@ -6,6 +6,7 @@ @author Roel Canicula (roel@solutiongrove.com) @creation-date 2006-06-05 + @arch-tag: cdb2d596-15fc-45ba-9ce1-d648a49a20b7 @cvs-id $Id$ } { @@ -21,16 +22,15 @@ permission::require_permission -object_id $package_id -privilege create set folder_id [as::assessment::folder_id -package_id $package_id] set user_id [ad_conn user_id] - -# hack for dotlrn ideally ad_conn subsite_id would pretend dotlrn was a subsite -if {![apm_package_installed_p dotlrn] \ - || [set members_party_id [dotlrn_community::get_community_id]] eq ""} { - set members_party_id [application_group::group_id_from_package_id \ - -package_id [ad_conn subsite_id]] -} - +set context_object_id $package_id set form [rp_getform] ns_set delkey $form status +set page_title [_ assessment.All_Users] +if {[info exists assessment_id]} { + set context [list [list index [_ assessment.admin]] [list [export_vars -base one-a {assessment_id}] $assessment_data(title)] $page_title] +} else { + set context [list [list index [_ assessment.admin]] $page_title] +} set base_url [ad_return_url] set actions [list] @@ -48,7 +48,7 @@ if { [info exists assessment_id] } { as::assessment::data -assessment_id $assessment_id - + set context_object_id $assessment_id set actions [linsert $actions 0 "[_ assessment.All_Assessments]" ? "[_ assessment.All_Assessments]"] lappend actions "[_ assessment.Summary]" [export_vars -base item-stats { assessment_id {return_url [ad_return_url]} }] "[_ assessment.Summary]" } @@ -123,7 +123,7 @@ (case when :status = 'complete' then not cs.completed_datetime is null when :status = 'incomplete' - then cs.completed_datetime is null and not ns.session_id is null + then cs.completed_datetime is null and ns.session_id is not null else cs.completed_datetime is null and ns.session_id is null end) } } @@ -140,24 +140,23 @@ from (select a.assessment_id, cr.title, cr.item_id, cr.revision_id, u.user_id, u.first_names, u.last_name - from as_assessments a, cr_revisions cr, cr_items ci, acs_users_all u, - group_member_map g - + from as_assessments a, cr_revisions cr, cr_items ci, acs_users_all u where a.assessment_id = cr.revision_id and cr.revision_id = ci.latest_revision and ci.parent_id = :folder_id - - and g.group_id = :members_party_id - and g.member_id = u.user_id - and acs_permission__permission_p(cr.item_id, u.user_id, 'read')) a - + and u.user_id <> 0 + and exists ( + select 1 from acs_object_party_privilege_map + where object_id = :context_object_id + and party_id = u.user_id + and privilege = 'read')) a left join (select as_sessions.*, cr.item_id from as_sessions, cr_revisions cr where session_id in (select max(session_id) from as_sessions, acs_objects o where not completed_datetime is null - and o.object_id = session_id - and o.package_id = :package_id + and o.object_id = session_id + and o.package_id = :package_id group by subject_id, assessment_id ) and revision_id=assessment_id) cs on (a.user_id = cs.subject_id and a.item_id = cs.item_id) @@ -167,20 +166,13 @@ where session_id in (select max(session_id) from as_sessions, acs_objects o where completed_datetime is null - and o.object_id = session_id - and o.package_id = :package_id - group by subject_id, assessment_id)) ns + and o.object_id = session_id + and o.package_id = :package_id + group by subject_id, assessment_id)) ns on (a.user_id = ns.subject_id and a.assessment_id = ns.assessment_id) where true [list::filter_where_clauses -and -name "sessions"] order by lower(a.title), lower(a.last_name), lower(a.first_names) }] - - - - - - -