Index: openacs-4/packages/bug-tracker/bug-tracker.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/bug-tracker.info,v diff -u -r1.3 -r1.4 --- openacs-4/packages/bug-tracker/bug-tracker.info 29 Aug 2002 13:42:32 -0000 1.3 +++ openacs-4/packages/bug-tracker/bug-tracker.info 29 Aug 2002 15:15:09 -0000 1.4 @@ -7,7 +7,7 @@ f f - + oracle postgresql @@ -36,6 +36,7 @@ + @@ -56,6 +57,7 @@ + Index: openacs-4/packages/bug-tracker/lib/nav-bar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/lib/nav-bar.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bug-tracker/lib/nav-bar.tcl 3 May 2002 16:29:59 -0000 1.1 +++ openacs-4/packages/bug-tracker/lib/nav-bar.tcl 29 Aug 2002 15:15:10 -0000 1.2 @@ -9,6 +9,7 @@ set package_id [ad_conn package_id] set package_url [ad_conn package_url] +set component_id [bug_tracker::conn component_id] set admin_p [ad_permission_p $package_id admin] @@ -17,7 +18,7 @@ multirow append links "List" "[ad_conn package_url]" if { [ad_permission_p [ad_conn package_id] create] } { - multirow append links "New Bug" "[ad_conn package_url]bug-add" + multirow append links "New Bug" "[ad_conn package_url]bug-add[ad_decode $component_id "" "" "?[export_vars { component_id }]"]" } if { [ad_conn user_id] != 0 } { Index: openacs-4/packages/bug-tracker/sql/postgresql/bug-tracker-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/sql/postgresql/bug-tracker-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/bug-tracker/sql/postgresql/bug-tracker-create.sql 29 Aug 2002 13:39:00 -0000 1.3 +++ openacs-4/packages/bug-tracker/sql/postgresql/bug-tracker-create.sql 29 Aug 2002 15:15:11 -0000 1.4 @@ -9,6 +9,8 @@ constraint bt_projects_pk primary key, description text, + -- short string will be included in the subject line of emails + email_subject_name text, maintainer integer constraint bt_projects_maintainer_fk references users(user_id) @@ -141,6 +143,8 @@ references bt_projects(project_id), component_name varchar(500) not null, description text, + -- This is what the component can be referred to in the URL + url_name text, -- a component can be without maintainer, in which case we just default to the project maintainer maintainer integer constraint bt_components_maintainer_fk Index: openacs-4/packages/bug-tracker/sql/postgresql/upgrade-0.7d4-0.7d5.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/sql/postgresql/upgrade-0.7d4-0.7d5.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/bug-tracker/sql/postgresql/upgrade-0.7d4-0.7d5.sql 29 Aug 2002 15:15:11 -0000 1.1 @@ -0,0 +1,3 @@ +alter table bt_projects add column email_subject_name text; +alter table bt_components add column url_name text; + Index: openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl 29 Aug 2002 13:39:01 -0000 1.7 +++ openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl 29 Aug 2002 15:15:11 -0000 1.8 @@ -50,6 +50,9 @@ return $bt_conn($var) } } + component_id { + return {} + } default { error "Unknown variable $var" } Index: openacs-4/packages/bug-tracker/www/bug-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/bug-add.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/bug-tracker/www/bug-add.tcl 28 Aug 2002 15:44:18 -0000 1.3 +++ openacs-4/packages/bug-tracker/www/bug-add.tcl 29 Aug 2002 15:15:12 -0000 1.4 @@ -6,9 +6,17 @@ @cvs-id $Id$ } { cancel:optional + component_id:optional {return_url ""} } +if { [empty_string_p $return_url] } { + set return_url "." + if { [info exists component_id] } { + append return_url "?[export_vars { component_id }]" + } +} + # If the user hit cancel, ignore everything else if { [exists_and_not_null cancel] } { ad_returnredirect $return_url @@ -107,6 +115,10 @@ element set_properties bug severity -value [bug_tracker::severity_get_default] element set_properties bug priority -value [bug_tracker::priority_get_default] + + if { [info exists component_id] } { + element set_properties bug component_id -value $component_id + } element set_properties bug desc_format -value "plain" @@ -117,15 +129,7 @@ db_transaction { - set bug_id [element::get_value bug bug_id] - set component_id [element::get_value bug component_id] - set bug_type [element::get_value bug bug_type] - set severity [element::get_value bug severity] - set priority [element::get_value bug priority] - set found_in_version [element::get_value bug found_in_version] - set summary [element::get_value bug summary] - set description [element::get_value bug description] - set desc_format [element::get_value bug desc_format] + form get_values bug bug_id component_id bug_type severity priority found_in_version summary description desc_format set ip_address [ns_conn peeraddr] set user_agent [ns_set get [ns_conn headers] "User-Agent"] Index: openacs-4/packages/bug-tracker/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/index.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/bug-tracker/www/index.tcl 29 Aug 2002 13:03:46 -0000 1.4 +++ openacs-4/packages/bug-tracker/www/index.tcl 29 Aug 2002 15:15:12 -0000 1.5 @@ -39,7 +39,6 @@ return } - # # Filter management # @@ -87,6 +86,7 @@ if { [info exists component_id] } { lappend where_clauses "b.component_id = :component_id" append human_readable_filter " in [db_string component_name { select component_name from bt_components where component_id = :component_id }]" + bug_tracker::conn -set component_id $component_id } if { [info exists fix_for_version] } { @@ -179,7 +179,7 @@ set latest_estimate_pretty [ad_decode $latest_estimate_minutes "" "" 0 "" "$latest_estimate_minutes minutes"] set elapsed_time_pretty [ad_decode $elapsed_time_minutes "" "" 0 "" "$elapsed_time_minutes minutes"] set assignee_url [acs_community_member_url -user_id $assignee_user_id] - set bug_url "bug?[export_vars -url { bug_number }]" + set bug_url "[ad_conn package_url]bug?[export_vars -url { bug_number }]" } db_multirow -extend { name name_url } by_status by_status { @@ -191,7 +191,7 @@ order by bt_bug__status_sort_order(b.status) } { set name "[bug_tracker::status_pretty $unique_id] Bugs" - set name_url "?[export_vars -url { { status $unique_id } }]" + set name_url "[ad_conn package_url]?[export_vars -url { { status $unique_id } }]" } db_multirow -extend { name name_url stat_name } stats stats { @@ -205,7 +205,7 @@ } { set stat_name "Type of bug" set name [bug_tracker::bug_type_pretty $unique_id] - set name_url "?[export_vars -url { { bug_type $unique_id } }]" + set name_url "[ad_conn package_url]?[export_vars -url { { bug_type $unique_id } }]" } db_multirow -extend { name_url stat_name } -append stats stats { @@ -223,12 +223,12 @@ if { [empty_string_p $unique_id] } { set name "Undecided" } - set name_url "?[export_vars -url { { fix_for_version $unique_id } }]" + set name_url "[ad_conn package_url]?[export_vars -url { { fix_for_version $unique_id } }]" } set stat_name_val "Severity" if { ![string equal $orderby "severity"] } { - append stat_name_val " (order)" + append stat_name_val " (order)" } else { append stat_name_val " (*)" } @@ -245,12 +245,12 @@ order by name } { set stat_name $stat_name_val - set name_url "?[export_vars { { severity $unique_id } }]" + set name_url "[ad_conn package_url]?[export_vars { { severity $unique_id } }]" } set stat_name_val "Priority" if { ![string equal $orderby "priority"] } { - append stat_name_val " (order)" + append stat_name_val " (order)" } else { append stat_name_val " (*)" } @@ -267,7 +267,7 @@ order by name } { set stat_name $stat_name_val - set name_url "?[export_vars { { priority $unique_id } }]" + set name_url "[ad_conn package_url]?[export_vars { { priority $unique_id } }]" } db_multirow -extend { name_url stat_name } -append stats stats { @@ -285,7 +285,7 @@ if { [empty_string_p $unique_id] } { set name "Unassigned" } - set name_url "?[export_vars -url { { assignee $unique_id } }]" + set name_url "[ad_conn package_url]?[export_vars -url { { assignee $unique_id } }]" } db_multirow -extend { name_url stat_name } -append stats stats { @@ -300,7 +300,7 @@ order by name } { set stat_name "Components" - set name_url "?[export_vars -url { { component_id $unique_id } }]" + set name_url "[ad_conn package_url]?[export_vars -url { { component_id $unique_id } }]" } ad_return_template Index: openacs-4/packages/bug-tracker/www/admin/component-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/component-ae.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/bug-tracker/www/admin/component-ae.tcl 28 Aug 2002 15:44:18 -0000 1.3 +++ openacs-4/packages/bug-tracker/www/admin/component-ae.tcl 29 Aug 2002 15:15:12 -0000 1.4 @@ -5,9 +5,6 @@ } { cancel:optional component_id:integer,optional - name:optional - description:optional - maintainer:integer,optional {return_url ""} } @@ -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 } } Index: openacs-4/packages/bug-tracker/www/admin/project-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/project-edit.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/bug-tracker/www/admin/project-edit.tcl 28 Aug 2002 15:44:18 -0000 1.3 +++ openacs-4/packages/bug-tracker/www/admin/project-edit.tcl 29 Aug 2002 15:15:12 -0000 1.4 @@ -6,8 +6,6 @@ @cvs-id $Id$ } { cancel:optional - name:optional - description:optional {return_url ""} } @@ -23,35 +21,49 @@ set page_title "Edit Project" set context_bar [ad_context_bar $page_title] -template::form create project_info +form create project_info -template::element create project_info return_url -datatype text -widget hidden -value $return_url +element create project_info return_url -datatype text -widget hidden -value $return_url -template::element create project_info name \ +element create project_info name \ -datatype text \ -html { size 50 } \ -label "Project Name" -template::element create project_info description \ +element create project_info description \ -datatype text \ -widget textarea \ -label "Description" \ -optional \ -html { cols 50 rows 8 } -if { [template::form is_request project_info] } { - template::element set_properties project_info name \ +element create project_info email_subject_name \ + -datatype text \ + -html { size 50 } \ + -label "Email subject tag" + +if { [form is_request project_info] } { + db_1row project_info { + select description, email_subject_name + from bt_projects + where project_id = :package_id + } -column_array project_info + + form set_values project_info project_info + + element set_properties project_info name \ -value [bug_tracker::conn project_name] - - template::element set_properties project_info description \ - -value [db_string project_description { select description from bt_projects where project_id = :package_id }] + } -if { [template::form is_valid project_info] } { +if { [form is_valid project_info] } { + form get_values project_info description email_subject_name name + db_transaction { db_dml project_info_update { update bt_projects - set description = :description + set description = :description, + email_subject_name = :email_subject_name where project_id = :package_id } Index: openacs-4/packages/bug-tracker/www/com/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/com/index.vuh,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/bug-tracker/www/com/index.vuh 29 Aug 2002 15:15:13 -0000 1.1 @@ -0,0 +1,14 @@ +set extra_url_list [split [ad_conn extra_url] "/"] + +set url_name [lindex $extra_url_list 1] +set package_id [ad_conn package_id] + +set found_p [db_0or1row component { select component_id from bt_components where project_id = :package_id and url_name = :url_name }] + +if { $found_p } { + rp_form_put component_id $component_id + rp_internal_redirect [file join / packages bug-tracker www index] + +} else { + ns_returnnotfound +}