Index: openacs-4/packages/acs-admin/www/apm/version-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/apm/version-edit.tcl,v diff -u -r1.10 -r1.11 --- openacs-4/packages/acs-admin/www/apm/version-edit.tcl 13 Apr 2009 23:10:27 -0000 1.10 +++ openacs-4/packages/acs-admin/www/apm/version-edit.tcl 27 Oct 2014 16:38:53 -0000 1.11 @@ -7,39 +7,51 @@ @creation-date 9 May 2000 @cvs-id $Id$ } { - {version_id:integer} + {version_id:naturalnum,notnull} } -db_1row apm_all_version_info {} +db_1row apm_all_version_info { + select version_id, package_key, package_uri, pretty_name, version_name, + version_uri, auto_mount, summary, description_format, description, release_date, + vendor, vendor_uri, enabled_p, installed_p, tagged_p, imported_p, + data_model_loaded_p, activation_date, tarball_length, + deactivation_date, distribution_uri, distribution_date, singleton_p, + initial_install_p, implements_subsite_p, inherit_templates_p + from apm_package_version_info where version_id = :version_id +} -doc_body_append "[apm_header -form "action=\"version-edit-2\" method=post" [list "version-view?version_id=$version_id" "$pretty_name $version_name"] "Edit a Version"] +set title "Edit a Version" +set context [list \ + [list "/acs-admin/apm/" "Package Manager"] \ + [list "version-view?version_id=$version_id" "$pretty_name $version_name"] \ + $title] -" +set body "
" # If the version name is incorporated into the version URL (it will almost always be!) # then generate some JavaScript to automatically update the version URL when the # version name changes. set version_name_index [string first $version_name $version_uri] if { $version_name_index >= 0 } { - set version_uri_prefix [string range $version_uri 0 [expr { $version_name_index - 1 }]] - set version_uri_suffix [string range $version_uri [expr { $version_name_index + [string length $version_name] }] end] + set version_uri_prefix [string range $version_uri 0 $version_name_index-1] + set version_uri_suffix [string range $version_uri $version_name_index+[string length $version_name] end] - doc_body_append " - -" +}] set version_name_on_change "onChange=\"updateVersionURL()\"" } else { set version_name_on_change "" } -doc_body_append " - -[export_form_vars version_id release_date] +[export_vars -form {version_id release_date}] - + - + - + - + - + - + - + - - + + @@ -99,39 +111,39 @@ - - + - - + + - - - + + + - - + -" +}] # Dynamic package version attributes array set all_attributes [apm::package_version::attributes::get_spec] array set attributes [apm::package_version::attributes::get \ -version_id $version_id \ -array attributes] foreach attribute_name [array names all_attributes] { - array set attribute $all_attributes($attribute_name) + set attribute $all_attributes($attribute_name) if { [info exists attributes($attribute_name)] } { # Attribute is already in db @@ -140,14 +152,16 @@ # The attribute is not in the db yet set attribute_value [apm::package_version::attributes::default_value $attribute_name] } - - doc_body_append " + # provide default size + if {![dict exists $attribute size]} { + dict set attribute size 30 + } + append body [subst { - - + + -" + }] } # Build a list of owners. Ensure that there are at least two. @@ -173,30 +187,30 @@ set prompt "Owner #$counter" } - doc_body_append " + append body [subst { - + - + -" + }] } -doc_body_append " +append body [subst { - + - + -" +}] -doc_body_append " +append body [subst {
Package Key:Package Key: $package_key
Package URL:Package URL: $package_uri
Package Name:Package Name: $pretty_name
OpenACS Core:OpenACS Core: [ad_decode $initial_install_p t Yes No]
Singleton:Singleton: [ad_decode $singleton_p t Yes No]
Implements Subsite:Implements Subsite: [ad_decode $implements_subsite_p t Yes No]
Inherit Templates:Inherit Templates: [ad_decode $inherit_templates_p t Yes No]
Auto-mount:Auto-mount:
Version: + Version:
Version URL:Version URL:

Summary:

Summary:

Description:

-This description is

Description:

+This description is
${attribute(pretty_name)}: -[dict get $attribute pretty_name]:
$prompt:
$prompt URL:
Vendor:
Vendor URL:
@@ -208,12 +222,12 @@

- +
-[ad_footer] -" +}] +ad_return_template apm