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.18.8.11 -r1.18.8.12 --- openacs-4/packages/acs-admin/tcl/apm-admin-procs.tcl 12 Aug 2014 17:39:26 -0000 1.18.8.11 +++ openacs-4/packages/acs-admin/tcl/apm-admin-procs.tcl 17 Aug 2014 08:11:10 -0000 1.18.8.12 @@ -94,94 +94,57 @@ ad_proc -private apm_package_selection_widget { - -install_enable:boolean pkg_info_list {to_install ""} - {to_enable ""} } { Provides a widget for selecting packages. Displays dependency information if available. - - @param intall_enable Set this flag if you want separate install and enable checkboxes to be displayed. If you don't set it, - only the enable checkbox will be displayed, and the resulting page is expected to assume that enable also means install. + @param pkg_info_list list of package infos for all packages to be listed + @param to_install list of package_keys to install } { if {$pkg_info_list eq ""} { return "" } - - set checkbox_count 0 + set counter 0 - set band_colors { white "#ececec" } - set widget "
-[ad_decode $install_enable_p 1 "" ""] - " + set widget "
InstallEnablePackageDirectoryComment
+ " foreach pkg_info $pkg_info_list { incr counter set package_key [pkg_info_key $pkg_info] set package_path [pkg_info_path $pkg_info] - set package_rel_path [string range $package_path [string length $::acs::rootdir] end] set spec_file [pkg_info_spec $pkg_info] array set package [apm_read_package_info_file $spec_file] set version_name $package(name) ns_log Debug "Selection widget: $package_key, Dependency: [pkg_info_dependency_p $pkg_info]" - - append widget " " + append widget " " if { [pkg_info_dependency_p $pkg_info] == "t" } { # Dependency passed. - if { $install_enable_p } { - if { $package_key in $to_install } { - append widget " " - } else { - append widget " " - } - } - if { $package_key in $to_enable } { + if { $package_key in $to_install } { append widget " - - - + + " } elseif { [pkg_info_dependency_p $pkg_info] == "f" } { #Dependency failed. - if { $install_enable_p } { - append widget " " - } append widget " - + - - + " - - if { $package_key in $to_install } { - set install_checked "checked" - } else { - set install_checked "" - } - if { $package_key in $to_enable } { - set enable_checked "checked" - } else { - set enable_checked "" - } - - if { $install_enable_p } { - append widget " - " - } else { - append widget " - " - } - + set install_checked [lindex {"" checked} [expr {$package_key in $to_install}]] append widget " + - + " } - incr checkbox_count 2 } - append widget "
InstallPackagePackage KeyComment
$package(package-name) $package(name)$package_rel_pathDependencies satisfied.$package_keyDependencies satisfied.
$package(package-name) $package(name)$package_rel_path + $package_key " foreach comment [pkg_info_comment $pkg_info] { append widget "$comment
" @@ -208,38 +171,16 @@ set comment "Installing older version of package." } - append widget "
$package(package-name) $package(name)$package_rel_path$package_key $comment
" + append widget "\n" return $widget } @@ -268,7 +209,9 @@ # LARS: Default to 1 (the package_key/version_name you supplied was higher than what's on the system) # for the case where nothing it returned, because this implies that there was no highest version installed, # i.e., no version at all of the package was installed. - return [db_string apm_higher_version_installed_p {} -default 1] + set result [db_string apm_higher_version_installed_p {} -default 1] + ns_log notice "apm_higher_version_installed_p <$package_key> <$version_name> -> $result" + return $result }