Index: openacs-4/packages/ams/www/object.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ams/www/object.tcl,v diff -u -r1.1 -r1.1.2.1 --- openacs-4/packages/ams/www/object.tcl 30 Oct 2004 00:23:54 -0000 1.1 +++ openacs-4/packages/ams/www/object.tcl 30 Nov 2005 16:21:53 -0000 1.1.2.1 @@ -20,39 +20,33 @@ -name object_attributes \ -multirow object_attributes \ -key attribute_name \ - -row_pretty_plural "AMS Attributes" \ + -row_pretty_plural "[_ ams.AMS_Attributes]" \ -checkbox_name checkbox \ -selected_format "normal" \ -class "list" \ -main_class "list" \ -sub_class "narrow" \ -pass_properties { object_type - } -actions [list "Add" "attribute-add?object_type=$object_type" "Add an AMS Attribute"] \ + } -actions [list "[_ acs-kernel.common_Add]" "attribute-add?object_type=$object_type" "[_ ams.Add_an_AMS_Attribute]"] \ -bulk_actions { } -elements { edit { label {} } pretty_name { display_col pretty_name - label "Pretty Name" + label "[_ ams.Pretty_Name_1]" link_url_eval $ams_attribute_url } attribute_name { display_col attribute_name - label "Attribute Name" - link_url_eval $ams_attribute_url + label "[_ ams.Attribute_Name]" } - widget_name { - display_col widget_name - label "Widget Name" - link_url_eval widgets - } - actions { - label "" + widget { + label "[_ ams.Widget_1]" display_template { - Upgrade to AMS Attribute + [_ ams.Define_Widget]@object_attributes.widget@ } } } -filters { @@ -72,42 +66,35 @@ label attribute_name multirow_cols {ams_attribute_p attribute_name pretty_name} } - widget_name { + widget { label widget_name - multirow_cols {ams_attribute_p widget_name pretty_name attribute_name} + multirow_cols {ams_attribute_p widget pretty_name attribute_name} } } -formats { normal { - label "Table" + label "[_ ams.Table]" layout table row { pretty_name {} attribute_name {} - widget_name {} - actions {} + widget {} } } } db_multirow -extend { ams_attribute_url ams_attribute_p } object_attributes select_object_attributes { - select acs.attribute_name, - acs.pretty_name, - acs.pretty_plural, - acs.attribute_id, - ams.ams_attribute_id, - ams.widget_name - from acs_attributes acs, ams_attributes ams - where acs.object_type = :object_type - and acs.attribute_id = ams.attribute_id + select attribute_name, + pretty_name, + pretty_plural, + attribute_id, + widget + from ams_attributes + where object_type = :object_type + order by upper(pretty_name) } { if { [exists_and_not_null ams_attribute_id] } { set ams_attribute_p 1 } else { set ams_attribute_p 0 } - - if { [exists_and_not_null ams_attribute_id] } { - set ams_attribute_url "attribute?ams_attribute_id=$ams_attribute_id" - } else { - set ams_attribute_url "" - } + set ams_attribute_url "attribute?attribute_id=$attribute_id" if { [lang::message::message_exists_p en_US $pretty_name] } { set pretty_name [_ $pretty_name] } @@ -128,66 +115,9 @@ -# This code lets me setup AMS Attribute Upgrades for Attributes that were not created by AMS -# -# eventually we will allow these attributes to be "upgraded" to ams_attributes. We first need to provision a way -# for them to not be deleted at package drop time, since other packages created these attributes they may need them. -list::create \ - -name non_ams_attributes \ - -multirow non_ams_object_attributes \ - -key attribute_name \ - -row_pretty_plural "Attributes not managed by AMS" \ - -checkbox_name checkbox \ - -selected_format "normal" \ - -class "list" \ - -main_class "list" \ - -sub_class "narrow" \ - -pass_properties { - variable - } -actions { - } -bulk_actions { - } -elements { - pretty_name { - display_col pretty_name - label "Pretty Name" - } - attribute_name { - display_col attribute_name - label "Attribute Name" - } - actions { - label "" - display_template { - Upgrade to AMS Attribute - } - } - } -filters { - object_type {} - } -groupby { - } -orderby { - } -formats { - normal { - label "Table" - layout table - row { - pretty_name {} - attribute_name {} - } - } - } -db_multirow non_ams_object_attributes select_non_ams_object_attributess { - select acs.attribute_name, - acs.pretty_name, - acs.pretty_plural, - acs.attribute_id - from acs_attributes acs - where acs.object_type = :object_type - and acs.attribute_id not in ( select attribute_id from ams_attributes ) -} { -} @@ -203,11 +133,6 @@ - - - - - # AMS Lists associated with this object type list::create \ @@ -285,12 +210,4 @@ - - - - - - - - ad_return_template