Index: openacs-4/packages/acs-subsite/www/admin/attributes/edit-one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/attributes/edit-one.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/acs-subsite/www/admin/attributes/edit-one.tcl 7 Aug 2017 23:47:58 -0000 1.6 +++ openacs-4/packages/acs-subsite/www/admin/attributes/edit-one.tcl 3 Sep 2024 15:37:34 -0000 1.7 @@ -1,5 +1,3 @@ -# /packages/mbryzek-subsite/www/admin/attributes/edit-one.tcl - ad_page_contract { Edits one attribute @@ -16,7 +14,7 @@ } -properties { context:onevalue focus:onevalue - attribute_pretty_name:onevalue + attribute_pretty_name:onevalue } permission::require_permission -object_id $id_column -privilege "write" @@ -29,55 +27,53 @@ template::form create edit_attribute template::element create edit_attribute attribute_id -value $attribute_id \ - -label "Attribute ID" -datatype text -widget hidden + -label "Attribute ID" -datatype text -widget hidden template::element create edit_attribute object_type -value $object_type \ - -label "Object type" -datatype text -widget hidden + -label "Object type" -datatype text -widget hidden # add the space to avoid looking like a switch template::element create edit_attribute id_column -value " $id_column" \ - -datatype text -widget hidden + -datatype text -widget hidden template::element create edit_attribute return_url -value $return_url \ - -optional -datatype text -widget hidden + -optional -datatype text -widget hidden if {$datatype eq "enumeration"} { set focus "" set option_list [db_list_of_lists select_enum_values { - select enum.pretty_name, enum.enum_value - from acs_enum_values enum - where enum.attribute_id = :attribute_id - order by enum.sort_order + select enum.pretty_name, enum.enum_value + from acs_enum_values enum + where enum.attribute_id = :attribute_id + order by enum.sort_order }] if { $min_n_values == 0 } { - # This is not a required option list... offer a default - lappend option_list [list " (no value) " ""] + # This is not a required option list... offer a default + lappend option_list [list " (no value) " ""] } template::element create edit_attribute attribute_value \ - -value $current_value \ - -datatype "text" \ - -widget select \ - -optional \ - -options $option_list \ - -label "$attribute_pretty_name" + -value $current_value \ + -datatype "text" \ + -widget select \ + -optional \ + -options $option_list \ + -label "$attribute_pretty_name" } else { set focus "edit_attribute.attribute_value" template::element create edit_attribute attribute_value \ - -value $current_value \ - -datatype "text" \ - -optional \ - -label "$attribute_pretty_name" + -value $current_value \ + -datatype "text" \ + -optional \ + -label "$attribute_pretty_name" } if { [template::form is_valid edit_attribute] } { - - set attribute_value [ns_set get [ns_getform] "attribute_value"] db_dml attribute_update \ - "update $type_table - set $attribute_column = :attribute_value + "update $type_table + set $attribute_column = :attribute_value where $type_column = :id_column" ad_returnredirect $return_url