Index: openacs-4/packages/acs-admin/www/apm/package-instances.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/package-instances.tcl,v diff -u -r1.1.2.1 -r1.1.2.2 --- openacs-4/packages/acs-admin/www/apm/package-instances.tcl 3 Sep 2014 12:59:26 -0000 1.1.2.1 +++ openacs-4/packages/acs-admin/www/apm/package-instances.tcl 3 Sep 2014 19:06:22 -0000 1.1.2.2 @@ -10,7 +10,7 @@ set version_id [apm_highest_version $package_key] apm_version_info $version_id -set title "Instances of $pretty_name $version_name" +set title "Instances of Package $pretty_name $version_name ($package_key)" set context [list \ [list "../developer" "Developer's Administration"] \ [list "/acs-admin/apm/" "Package Manager"] \ @@ -30,14 +30,16 @@ set node_id [dict get [site_node::get -url $url] node_id] append body [subst {
  • $package_id $instance_name $url (node_id $node_id): - delete, - Site Map. + \[delete, + Site Map\]
  • }] } } else { append body [subst { -
  • $package_id $instance_name: (unmounted)
  • +
  • $package_id $instance_name (unmounted): + \[delete\] +
  • }] } } Index: openacs-4/packages/acs-subsite/www/admin/applications/application-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/applications/application-delete.tcl,v diff -u -r1.4.20.3 -r1.4.20.4 --- openacs-4/packages/acs-subsite/www/admin/applications/application-delete.tcl 3 Sep 2014 14:13:39 -0000 1.4.20.3 +++ openacs-4/packages/acs-subsite/www/admin/applications/application-delete.tcl 3 Sep 2014 19:06:22 -0000 1.4.20.4 @@ -2,51 +2,72 @@ Delete an application. @author Lars Pind (lars@collaboraid.biz) + @author Gustaf Neumann + @creation-date 2003-05-28 @cvs-id $Id$ } { - node_id:naturalnum,multiple + {node_id:naturalnum,multiple ""} + {package_id:naturalnum,multiple ""} {return_url .} {confirm_p 0} } + +foreach id $package_id { + set id [site_node::get_node_id_from_object_id -object_id $id] + if {$id ne ""} { + lappend node_id $id + set p [lsearch $package_id $id] + set package_id [lreplace $package_id $p $p] + } +} +ns_log notice "package_id <$package_id> node_id <$node_id>" + +set num [expr {[llength $node_id] + [llength $package_id]}] +set page_title "Delete [ad_decode $num 1 "Application" "Applications"]" +set context [list [list "." "Applications"] $page_title] +set yes_url [export_vars -base [ad_conn url] { node_id:multiple package_id:multiple return_url { confirm_p 1 } }] +set no_url $return_url set listing "" if { !$confirm_p } { - set num [llength $node_id] if { $num == 0 } { ad_returnredirect . return } - set page_title "Delete [ad_decode $num 1 "Application" "Applications"]" - set context [list [list "." "Applications"] $page_title] - set yes_url [export_vars -base [ad_conn url] { node_id:multiple return_url { confirm_p 1 } }] - set no_url "." - - set package_ids "" append listing \n return } # First unmount and delete the site-nodes, then delete the package, in separate transactions, # so even if the package deletion fails, it'll be gone from this subsite. -set package_id [list] +set package_ids $package_id db_transaction { foreach id $node_id { - lappend package_id [site_node::get_object_id -node_id $id] + lappend package_ids [site_node::get_object_id -node_id $id] # Unmount the application site_node::unmount -node_id $id @@ -57,7 +78,7 @@ } db_transaction { - foreach id $package_id { + foreach id $package_ids { # Delete the instance apm_package_instance_delete $id } Index: openacs-4/packages/acs-subsite/www/admin/site-map/instance-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/site-map/instance-delete.tcl,v diff -u -r1.9.10.1 -r1.9.10.2 --- openacs-4/packages/acs-subsite/www/admin/site-map/instance-delete.tcl 5 Aug 2014 09:49:25 -0000 1.9.10.1 +++ openacs-4/packages/acs-subsite/www/admin/site-map/instance-delete.tcl 3 Sep 2014 19:06:23 -0000 1.9.10.2 @@ -10,7 +10,6 @@ } { package_id:naturalnum - {root_id:naturalnum ""} } db_transaction { @@ -25,11 +24,10 @@ # will go to the deleted node's parent page which should either be the site map page # you were at when you clicked "delete" or its parent (the case mentioned above). - set parent \ - [site_node::closest_ancestor_package \ - -node_id $node_id \ - -package_key acs-subsite \ - -element url] + set parent [site_node::closest_ancestor_package \ + -node_id $node_id \ + -package_key acs-subsite \ + -element url] # node_id was null so we're not deleting a mounted subsite instance if {$parent eq "" } { Index: openacs-4/packages/acs-subsite/www/admin/site-map/unmounted-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/site-map/Attic/unmounted-oracle.xql,v diff -u -r1.2 -r1.2.26.1 --- openacs-4/packages/acs-subsite/www/admin/site-map/unmounted-oracle.xql 21 Jun 2002 19:08:33 -0000 1.2 +++ openacs-4/packages/acs-subsite/www/admin/site-map/unmounted-oracle.xql 3 Sep 2014 19:06:23 -0000 1.2.26.1 @@ -5,7 +5,7 @@ - select package_id, acs_object.name(package_id) as name + select package_id, acs_object.name(package_id) as name, package_key from apm_packages where (acs_permission.permission_p(package_id, :user_id, 'read') = 't' or acs_permission.permission_p(package_id, acs.magic_object_id('the_public'), 'read') = 't') @@ -19,7 +19,7 @@ - select package_id, acs_object.name(package_id) as name + select package_id, acs_object.name(package_id) as name, package_key from apm_packages where (acs_permission.permission_p(package_id, :user_id, 'read') = 't' or acs_permission.permission_p(package_id, acs.magic_object_id('the_public'), 'read') = 't') Index: openacs-4/packages/acs-subsite/www/admin/site-map/unmounted-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/site-map/Attic/unmounted-postgresql.xql,v diff -u -r1.3 -r1.3.26.1 --- openacs-4/packages/acs-subsite/www/admin/site-map/unmounted-postgresql.xql 21 Jun 2002 19:08:33 -0000 1.3 +++ openacs-4/packages/acs-subsite/www/admin/site-map/unmounted-postgresql.xql 3 Sep 2014 19:06:23 -0000 1.3.26.1 @@ -5,7 +5,7 @@ - select package_id, acs_object__name(package_id) as name + select package_id, acs_object__name(package_id) as name, package_key from apm_packages where (acs_permission__permission_p(package_id, :user_id, 'read') = 't' or acs_permission__permission_p(package_id, acs__magic_object_id('the_public'), 'read') = 't') @@ -19,7 +19,7 @@ - select package_id, acs_object__name(package_id) as name + select package_id, acs_object__name(package_id) as name, package_key from apm_packages where (acs_permission__permission_p(package_id, :user_id, 'read') = 't' or acs_permission__permission_p(package_id, acs__magic_object_id('the_public'), 'read') = 't') Index: openacs-4/packages/acs-subsite/www/admin/site-map/unmounted.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/site-map/unmounted.adp,v diff -u -r1.1.16.1 -r1.1.16.2 --- openacs-4/packages/acs-subsite/www/admin/site-map/unmounted.adp 11 Sep 2013 18:40:17 -0000 1.1.16.1 +++ openacs-4/packages/acs-subsite/www/admin/site-map/unmounted.adp 3 Sep 2014 19:06:23 -0000 1.1.16.2 @@ -7,7 +7,7 @@
      -
    • @packages_normal.name@ [delete]
    • +
    • @packages_normal.name@ (@packages_normal.package_key@): [delete]
    • @@ -20,7 +20,7 @@
        -
      • @packages_singleton.name@ [delete]
      • +
      • @packages_singleton.name@ (@packages_singleton.package_key@): [delete]