Index: openacs-4/packages/acs-subsite/www/admin/site-map/unmounted.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/site-map/unmounted.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-subsite/www/admin/site-map/unmounted.tcl 7 Aug 2017 23:47:58 -0000 1.7 +++ openacs-4/packages/acs-subsite/www/admin/site-map/unmounted.tcl 3 Sep 2024 15:37:34 -0000 1.8 @@ -12,16 +12,54 @@ set context [list [list "." "Site Map"] $page_title] set user_id [ad_conn user_id] -db_multirow -extend {instance_delete_url delete_id} packages_normal packages_normal_select {} { +set the_public [acs_magic_object the_public] + + +db_multirow -extend {instance_delete_url delete_id} all_packages_unmounted all_packages_unmounted_select { + select + p.package_id, p.instance_name as name, p.package_key, apt.singleton_p + from + ( + select orig_object_id as package_id + from + acs_permission.permission_p_recursive_array(array( + select package_id + from apm_packages ap + + EXCEPT + + select object_id + from site_nodes), :user_id, 'read') as u + UNION + select orig_object_id as package_id + from + acs_permission.permission_p_recursive_array(array( + select package_id + from apm_packages ap + + EXCEPT + + select object_id + from site_nodes), :the_public, 'read') as p + ) as p_ids, apm_packages p, apm_package_types apt + where p.package_key = apt.package_key + and p_ids.package_id = p.package_id +} { set instance_delete_url [export_vars -base instance-delete package_id] set delete_id action-delete-$package_id template::add_confirm_handler -id $delete_id -message "Are you sure you want to delete package $name" } -db_multirow -extend {instance_delete_url delete_id} packages_singleton packages_singleton_select {} { - set instance_delete_url [export_vars -base instance-delete package_id] - set delete_id action-delete-$package_id - template::add_confirm_handler -id $delete_id -message "Are you sure you want to delete package $name" +template::multirow create packages_normal package_id name package_key instance_delete_url delete_id +template::multirow create packages_singleton package_id name package_key instance_delete_url delete_id + + +template::multirow foreach all_packages_unmounted { + if {$singleton_p} { + template::multirow append packages_singleton $package_id $name $package_key $instance_delete_url $delete_id + } else { + template::multirow append packages_normal $package_id $name $package_key $instance_delete_url $delete_id + } } # Local variables: