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 -r1.29 --- openacs-4/packages/acs-admin/www/apm/packages-install.tcl 9 May 2018 15:33:28 -0000 1.28 +++ openacs-4/packages/acs-admin/www/apm/packages-install.tcl 3 Sep 2024 15:37:29 -0000 1.29 @@ -6,8 +6,8 @@ @cvs-id $Id$ } { - {checked_by_default_p:boolean 0} - {operation:word all} + {checked_by_default_p:boolean,notnull 0} + {operation:word,notnull all} } set title "Package Installation" @@ -16,10 +16,10 @@ set dimensional_list { { operation "Operation:" all { - { upgrade "Upgrade" {} } - { install "Install" {} } - { all "All" {} } - } + { upgrade "Upgrade" {} } + { install "Install" {} } + { all "All" {} } + } } } @@ -30,7 +30,7 @@ # # If a package is in the apm_workspace dir then we assume that this is # the package that should be installed and we ignore any such package -# in the packages dir. +# in the packages dir. # # TODO: make sure that it's a later version than that in the packages dir? # @@ -60,7 +60,7 @@ set package_name $version(package-name) set package_key $version(package.key) if { [apm_package_supports_rdbms_p -package_key $package_key] } { - if { [apm_package_registered_p $package_key] } { + if { [apm_package_registered_p $package_key] && [apm_package_installed_p $package_key] } { # This package is already on the system if { [apm_higher_version_installed_p $package_key $version_name] } { ns_log Notice "higher version installed of $package_key $version_name" @@ -85,49 +85,27 @@ if { $spec_files eq "" } { # No spec files to work with. append body [subst { -

No New Packages to Install

+

No New Packages to $operation

- There are no new packages to install. Please load some + There are no new packages to [string tolower $operation]. Please load some using the Package Loader.

Return to the APM.

}] -} else { - - append body { -

Select Packages to Install

-

Please select the set of packages you'd like to install.

- } [subst { +} 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].

$dimensional_list
}] - - 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 - } + set formName "pkgsForm" #packages-install?checked_by_default_p=1 - + append body "
\n" # Client properties do not deplete the limited URL variable space. @@ -139,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 { @@ -147,37 +126,37 @@ lappend errors "
  • Unable to parse $spec_file. The following error was generated:
    [ns_quotehtml $errmsg]

    " } else { - apm_log APMDebug "APM: Adding $package(package.key) to list for installation." + apm_log APMDebug "APM: Adding $package(package.key) to list for installation." lappend pkg_info_list [pkg_info_new $package(package.key) $spec_file \ $package(embeds) $package(extends) $package(provides) $package(requires) ""] lappend pkg_key_list $package(package.key) } } - + 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: + }] + } } if { [llength $not_compatible_list] > 0 } {