Index: openacs.org-dev/packages/bug-tracker/www/admin/component-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/bug-tracker/www/admin/component-ae.tcl,v diff -u -r1.1.1.2 -r1.1.1.3 --- openacs.org-dev/packages/bug-tracker/www/admin/component-ae.tcl 25 Jul 2002 18:47:00 -0000 1.1.1.2 +++ openacs.org-dev/packages/bug-tracker/www/admin/component-ae.tcl 8 Oct 2002 15:46:57 -0000 1.1.1.3 @@ -1,13 +1,10 @@ ad_page_contract { @author Lars Pind (lars@pinds.com) - @date 2002-03-26 + @creation-date 2002-03-26 @cvs-id $Id$ } { cancel:optional component_id:integer,optional - name:optional - description:optional - maintainer:integer,optional {return_url ""} } @@ -16,7 +13,7 @@ ad_script_abort } -set project_name [bt_conn project_name] +set project_name [bug_tracker::conn project_name] set package_id [ad_conn package_id] set package_key [ad_conn package_key] @@ -27,65 +24,74 @@ } set context_bar [ad_context_bar $page_title] -template::form create component +form create component -template::element create component return_url -datatype text -widget hidden -value $return_url +element create component return_url -datatype text -widget hidden -value $return_url -template::element create component name \ +element create component name \ -datatype text \ -html { size 50 } \ -label "Component Name" -template::element create component description \ +element create component description \ -datatype text \ -widget textarea \ -label "Description" \ -optional \ -html { cols 50 rows 8 } -template::element create component maintainer \ +element create component url_name \ + -datatype text \ + -html { size 50 } \ + -label "Name in shortcut URL" \ + -optional + +element create component maintainer \ -datatype integer \ -widget select \ -label "Maintainer" \ -options [concat {{ "--None--" "" }} [db_list_of_lists users { select first_names || ' ' || last_name, user_id from cc_users }]] -optional -template::element create component component_id \ +element create component component_id \ -datatype integer \ -widget hidden -if { [template::form is_request component] } { +if { [form is_request component] } { if { ![info exists component_id] } { - template::element set_properties component component_id -value [db_nextval "acs_object_id_seq"] + element set_properties component component_id -value [db_nextval "acs_object_id_seq"] } else { db_1row component_info { - select component_name as name, description, maintainer + select component_id, + component_name as name, + description, + maintainer, + url_name from bt_components where component_id = :component_id - } - template::element set_properties component component_id -value $component_id - template::element set_properties component name -value $name - template::element set_properties component description -value $description - template::element set_properties component maintainer -value $maintainer - + } -column_array component_info + form set_values component component_info } } -if { [template::form is_valid component] } { +if { [form is_valid component] } { + form get_values component name description maintainer url_name + set count [db_0or1row num_components { select 1 from bt_components where component_id = :component_id }] if { $count == 0 } { db_dml component_create { insert into bt_components - (component_id, project_id, component_name, description, maintainer) + (component_id, project_id, component_name, description, url_name, maintainer) values - (:component_id, :package_id, :name, :description, :maintainer) + (:component_id, :package_id, :name, :description, :url_name, :maintainer) } } else { db_dml component_update { update bt_components - set component_name = :name, - description = :description, - maintainer = :maintainer + set component_name = :name, + description = :description, + maintainer = :maintainer, + url_name = :url_name where component_id = :component_id } }