Index: openacs-4/packages/acs-admin/tcl/apm-admin-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/tcl/apm-admin-procs.tcl,v diff -u -r1.32.2.2 -r1.32.2.3 --- openacs-4/packages/acs-admin/tcl/apm-admin-procs.tcl 6 Sep 2019 15:58:06 -0000 1.32.2.2 +++ openacs-4/packages/acs-admin/tcl/apm-admin-procs.tcl 13 May 2020 19:29:28 -0000 1.32.2.3 @@ -100,6 +100,7 @@ pkg_info_list {to_install ""} {operation "all"} + {form pkgsForm} } { Provides a widget for selecting packages. Displays dependency information if available. @@ -112,11 +113,24 @@ return "" } - set label [dict get {install Install upgrade Upgrade all Install/Update} $operation] set counter 0 - set widget [subst {
- }] + if {[llength $to_install] > 0} { + set label [dict get {install Install upgrade Upgrade all Install/Update} $operation] + } else { + set label [subst { + + }] + template::add_event_listener \ + -id bulkaction-control \ + -preventdefault=false \ + -script [subst {acs_ListCheckAll('$form', this.checked);}] + } + set widget [subst { +
$labelPackagePackage KeyComment
+ + }] + foreach pkg_info $pkg_info_list { incr counter @@ -126,53 +140,60 @@ set package [apm_read_package_info_file $spec_file] set package_name [dict get $package package-name] set version_name [dict get $package name] + set id $form-$package_key ns_log Debug "Selection widget: $package_key, Dependency: [pkg_info_dependency_p $pkg_info]" - append widget [subst {}] if { [pkg_info_dependency_p $pkg_info] == "t" } { + # # Dependency passed. - - if { $package_key in $to_install } { - append widget " - + # + set checked [expr { $package_key in $to_install ? "checked " : "" }] + append widget [subst { + + - }] + + }] } elseif { [pkg_info_dependency_p $pkg_info] == "f" } { - #Dependency failed. + # + # Dependency failed. + # append widget [subst { - + + + append widget \ + \ - } } else { + # # No dependency information. # See if the install is already installed with a higher version number. + # if {[apm_package_registered_p $package_key]} { set higher_version_p [apm_higher_version_installed_p $package_key $version_name] } else { set higher_version_p 2 } if {$higher_version_p == 2 } { - if {$operation eq "upgrade"} continue + if {$operation eq "upgrade"} { + incr counter -1 + continue + } set comment "New install." } elseif {$higher_version_p == 1 } { - if {$operation eq "install"} continue + if {$operation eq "install"} { + incr counter -1 + continue + } set comment "Upgrade." } elseif {$higher_version_p == 0} { set comment "Package version already installed." @@ -182,14 +203,20 @@ set install_checked [expr {$package_key in $to_install ? "checked" : ""}] append widget [subst { - - - - - }] + + + + + + + }] } } - append widget {
$labelPackagePackage KeyComment
$package_name $version_name $package_key Dependencies satisfied.
$package_name $version_name $package_key }] foreach comment [pkg_info_comment $pkg_info] { append widget "$comment
" } - append widget { -
$package_name $version_name$package_key$comment
$package_name $version_name$package_key$comment
} + if {$counter == 0} { + set widget "" + } else { + append widget {} + } return $widget } Index: openacs-4/packages/acs-admin/tcl/site-wide-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/tcl/site-wide-procs.tcl,v diff -u -r1.1.2.4 -r1.1.2.5 --- openacs-4/packages/acs-admin/tcl/site-wide-procs.tcl 27 Feb 2020 21:54:26 -0000 1.1.2.4 +++ openacs-4/packages/acs-admin/tcl/site-wide-procs.tcl 13 May 2020 19:29:28 -0000 1.1.2.5 @@ -48,7 +48,7 @@ Require a package under the site-wide subsite. If such a package does not exist, it is created with the provided - parameters. When a configuratioon command is passed-in + parameters. When a configuration command is passed-in it will be called with "-package_id $package_id" of the new instance appended. @@ -83,7 +83,7 @@ # During bootstrap, the package_id might be empty, because # the after_initiate callback might call the # site-wide-init, which in turn might initiate another - # instance. Thefore, we might be called between site-node + # instance. Therefore, we might be called between site-node # creation and mounting .. which will result in an empty # package_id. # Index: openacs-4/packages/acs-admin/www/apm/packages-install.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/packages-install.tcl,v diff -u -r1.28.2.4 -r1.28.2.5 --- openacs-4/packages/acs-admin/www/apm/packages-install.tcl 16 Apr 2019 07:00:36 -0000 1.28.2.4 +++ openacs-4/packages/acs-admin/www/apm/packages-install.tcl 13 May 2020 19:29:28 -0000 1.28.2.5 @@ -93,6 +93,8 @@ }] } else { + ns_log notice "spec_files <$spec_files>" + append body [subst {

Select Packages to $operation

Please select the set of packages you'd like to [string tolower $operation].

@@ -102,29 +104,6 @@ }] set formName "pkgsForm" - template::add_event_listener \ - -id check_all \ - -script [subst { - var install_form = document.getElementsByName('$formName')\[0\]; - for (var i = 0; i < install_form.length; ++i) { - install_form.elements\[i\].checked = true; - //install_form.elements\[i\].href = ''; - } - }] - - template::add_event_listener \ - -id uncheck_all \ - -script [subst { - var install_form = document.getElementsByName('$formName')\[0\]; - for (var i = 0; i < install_form.length; ++i) { - install_form.elements\[i\].checked = false; - } - }] - - append body { - uncheck all boxes | - check all boxes - } #packages-install?checked_by_default_p=1 append body "
\n" @@ -138,6 +117,7 @@ set pkg_info_list [list] set pkg_key_list [list] apm_log APMDebug "APM: Specification files available: $spec_files" + foreach spec_file $spec_files { ### Parse the package. if { [catch { @@ -154,28 +134,28 @@ } if { $checked_by_default_p } { - set widget [apm_package_selection_widget $pkg_info_list $pkg_key_list $operation] + set widget [apm_package_selection_widget $pkg_info_list $pkg_key_list $operation $formName] } else { - set widget [apm_package_selection_widget $pkg_info_list "" $operation] + set widget [apm_package_selection_widget $pkg_info_list "" $operation $formName] } if {$widget eq ""} { - append body "There are no new packages available." - ad_script_abort - } + append body \ + "There are no packages to [string tolower $operation]." + } else { - append body $widget - append body [subst { -
-
- }] - + append body \ + $widget \ + [subst { +
+ + }] + } if {$errors ne ""} { - append body "The following errors were generated - - " + append body [subst {The following errors were generated: + }] } }