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.7 -r1.8 --- openacs-4/packages/bug-tracker/bug-tracker.info 30 Nov 2002 17:27:05 -0000 1.7 +++ openacs-4/packages/bug-tracker/bug-tracker.info 9 Dec 2002 21:23:50 -0000 1.8 @@ -43,7 +43,6 @@ - @@ -84,6 +83,12 @@ + + + + + + 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.5 -r1.6 --- openacs-4/packages/bug-tracker/sql/postgresql/bug-tracker-create.sql 11 Sep 2002 14:03:22 -0000 1.5 +++ openacs-4/packages/bug-tracker/sql/postgresql/bug-tracker-create.sql 9 Dec 2002 21:24:01 -0000 1.6 @@ -6,6 +6,7 @@ project_id integer not null constraint bt_projects_apm_packages_fk references apm_packages(package_id) + on delete cascade constraint bt_projects_pk primary key, description text, @@ -747,3 +748,5 @@ constraint bt_patch_bug_map_un unique (patch_id, bug_id) ); + +\i bug-tracker-notifications-init.sql 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.15 -r1.16 --- openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl 30 Nov 2002 17:27:18 -0000 1.15 +++ openacs-4/packages/bug-tracker/tcl/bug-tracker-procs.tcl 9 Dec 2002 21:24:12 -0000 1.16 @@ -494,6 +494,7 @@ resolve "Resolved" reopen "Reopened" close "Closed" + patched "Patched" } if { [info exists action_codes($action)] } { @@ -552,12 +553,12 @@ set sql { select distinct q.* from ( - select u.first_names || ' ' || u.last_name as name, u.user_id + select u.first_names || ' ' || u.last_name || ' (' || u.email || ')' as name, u.user_id from bt_bugs b, cc_users u where b.project_id = :package_id and u.user_id = b.assignee union - select u.first_names || ' ' || u.last_name as name, u.user_id + select u.first_names || ' ' || u.last_name || ' (' || u.email || ')' as name, u.user_id from cc_users u where u.user_id = :user_id ) q @@ -631,7 +632,7 @@ assignee.first_names as assignee_first_names, assignee.last_name as assignee_last_name, assignee.email as assignee_email, - to_char(now(), 'fmMM/DDfm/YYYY') as now_pretty + to_char(now(), 'fmMon/DDfm/YYYY') as now_pretty from bt_bugs b left outer join cc_users assignee on (assignee.user_id = b.assignee), acs_objects o, @@ -648,37 +649,34 @@ and submitter.user_id = o.creation_user } -column_array bug - set subject_start "Bug #$bug(bug_number). [ad_html_to_text -- [string_truncate -len 30 $bug(summary)]]" - set body_start "Bug #$bug(bug_number). $bug(summary)" + set subject "Bug #$bug(bug_number). [ad_html_to_text -- [string_truncate -len 30 $bug(summary)]]: [bug_action_pretty $action $resolution] by [conn user_first_names] [conn user_last_name]" + set body "Bug no: #$bug(bug_number) +Summary: $bug(summary) + +Component: $bug(component_name) +Status: [status_pretty $bug(status)] +Severity: $bug(severity_pretty) +Priority: $bug(priority_pretty) +Found in version: $bug(found_in_version_name) + +Action: [bug_action_pretty $action $resolution] +By user: [conn user_first_names] [conn user_last_name] <[conn user_email]> + +" + if { ![string equal $action "patched"] } { - set subject "$subject_start: [bug_action_pretty $action $resolution] by [conn user_first_names] [conn user_last_name]" - - set body "$body_start - - Action: [bug_action_pretty $action $resolution] by [conn user_first_names] [conn user_last_name] - " if { ![empty_string_p $comment] } { - append body " - Comment: - - [bug_convert_comment_to_text -comment $comment -format $comment_format] - " - } + append body "Comment:\n\n[bug_convert_comment_to_text -comment $comment -format $comment_format]\n\n" + } } else { - # The bug was patched - we use different text in this case - set subject "$subject_start was patched by [conn user_first_names] [conn user_last_name]" - - set body "$body_start - - A patch with summary \"$patch_summary\" has been entered for this bug." + append body "\n\nSummary: $patch_summary\n\n" } - - append body " - [ad_url][ad_conn package_url]bug?[export_vars -url { { bug_number $bug(bug_number) } }] - " + + append body "--\nTo comment on, edit, resolve, close, or reopen this bug, go to:\n[ad_url][ad_conn package_url]bug?[export_vars -url { { bug_number $bug(bug_number) } }]\n" + # Use the Notification service to alert (could be immediately, or daily, or weekly) # people who have signed up for notification on this bug notification::new \ @@ -723,8 +721,12 @@ set notification_link [list] # Only present the link to logged in users. - if { $user_id != "0" } { + if { $user_id != 0 } { set type_id [notification::type::get_type_id -short_name $type] + if { [empty_string_p $type_id] } { + ns_log Error "Can't find notification of type '$type'" + return "" + } set request_id [notification::request::get_request_id -type_id $type_id -object_id $object_id -user_id $user_id] Index: openacs-4/packages/bug-tracker/www/bug.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/bug.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/bug-tracker/www/bug.tcl 4 Dec 2002 16:33:13 -0000 1.15 +++ openacs-4/packages/bug-tracker/www/bug.tcl 9 Dec 2002 21:24:22 -0000 1.16 @@ -228,7 +228,7 @@ -options [bug_tracker::users_get_options] \ -optional \ -search_query { - select distinct u.first_names || ' ' || u.last_name as name, u.user_id + select distinct u.first_names || ' ' || u.last_name || ' (' || u.email || ')' as name, u.user_id from cc_users u where upper(coalesce(u.first_names || ' ', '') || coalesce(u.last_name || ' ', '') || u.email || ' ' || coalesce(u.screen_name, '')) like upper('%'||:value||'%') order by name 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.11 -r1.12 --- openacs-4/packages/bug-tracker/www/index.tcl 20 Sep 2002 13:40:46 -0000 1.11 +++ openacs-4/packages/bug-tracker/www/index.tcl 9 Dec 2002 21:24:22 -0000 1.12 @@ -37,11 +37,6 @@ set num_bugs [db_string num_bugs { select count(bug_id) from bt_bugs where project_id = :package_id }] -if { $num_bugs == 0 } { - ad_return_template "no-bugs" - return -} - set user_id [ad_conn user_id] # Notifications for a project. Provide a link for logged in users @@ -51,6 +46,11 @@ -url $return_url \ -pretty_name "project"] +if { $num_bugs == 0 } { + ad_return_template "no-bugs" + return +} + # # Filter management # Index: openacs-4/packages/bug-tracker/www/no-bugs.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/no-bugs.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/bug-tracker/www/no-bugs.adp 3 May 2002 16:29:59 -0000 1.1 +++ openacs-4/packages/bug-tracker/www/no-bugs.adp 9 Dec 2002 21:24:22 -0000 1.2 @@ -1,6 +1,7 @@ @project_name@ @context_bar@ +@notification_link@ No bugs in this bug-tracker. 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.5 -r1.6 --- openacs-4/packages/bug-tracker/www/admin/component-ae.tcl 10 Sep 2002 22:22:28 -0000 1.5 +++ openacs-4/packages/bug-tracker/www/admin/component-ae.tcl 9 Dec 2002 21:24:31 -0000 1.6 @@ -47,11 +47,21 @@ -optional element create component maintainer \ - -datatype integer \ - -widget select \ + -widget search \ + -datatype search \ + -result_datatype integer \ -label "Maintainer" \ - -options [concat {{ "--None--" "" }} [db_list_of_lists users { select first_names || ' ' || last_name, user_id from cc_users }]] -optional + -options [bug_tracker::users_get_options] \ + -optional \ + -search_query { + select distinct u.first_names || ' ' || u.last_name || ' (' || u.email || ')' as name, u.user_id + from cc_users u + where upper(coalesce(u.first_names || ' ', '') || coalesce(u.last_name || ' ', '') || u.email || ' ' || coalesce(u.screen_name, '')) like upper('%'||:value||'%') + order by name +} + + element create component component_id \ -datatype integer \ -widget hidden Index: openacs-4/packages/bug-tracker/www/admin/version-ae.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/bug-tracker/www/admin/version-ae.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/bug-tracker/www/admin/version-ae.tcl 28 Aug 2002 15:44:18 -0000 1.3 +++ openacs-4/packages/bug-tracker/www/admin/version-ae.tcl 9 Dec 2002 21:24:31 -0000 1.4 @@ -30,73 +30,87 @@ # no primary key and you're only inserting, you can just ignore it. # Add handling for any other incoming URL variables that should become part of the form. -template::form create version +form create version -template::element create version version_id -widget hidden -template::element create version return_url -datatype text -widget hidden -value $return_url +element create version version_id -widget hidden +element create version return_url -datatype text -widget hidden -value $return_url -template::element create version version_name -label "Version name" -widget text -datatype text -html { size 50 } -template::element create version description -label "Description" -widget textarea -datatype text -optional -html { cols 50 rows 8 } -template::element create version supported_platforms -label "Supported platforms" -widget text -datatype text \ +element create version version_name -label "Version name" -widget text -datatype text -html { size 50 } +element create version description -label "Description" -widget textarea -datatype text -optional -html { cols 50 rows 8 } +element create version supported_platforms -label "Supported platforms" -widget text -datatype text \ -html { size 50 } -optional -template::element create version maintainer -label "Maintainer" -widget select -datatype integer \ - -options [concat {{ "--None--" "" }} [db_list_of_lists users { select first_names || ' ' || last_name, user_id from cc_users }]] -optional -template::element create version anticipated_freeze_date -label "Anticipated freeze date" -widget date -datatype date -optional -format "MONTH DD, YYYY" -template::element create version anticipated_release_date -label "Anticipated release date" -widget date -datatype date -optional -format "MONTH DD, YYYY" -template::element create version assignable_p -label "Assignable?" -widget select -datatype text -optional -options {{Yes t} {No f}} -template::element create version insert_or_update -widget hidden -datatype text +element create version maintainer \ + -widget search \ + -datatype search \ + -result_datatype integer \ + -label "Maintainer" \ + -options [bug_tracker::users_get_options] \ + -optional \ + -search_query { + select distinct u.first_names || ' ' || u.last_name || ' (' || u.email || ')' as name, u.user_id + from cc_users u + where upper(coalesce(u.first_names || ' ', '') || coalesce(u.last_name || ' ', '') || u.email || ' ' || coalesce(u.screen_name, '')) like upper('%'||:value||'%') + order by name +} -if { [template::form is_request version] } { + +element create version anticipated_freeze_date -label "Anticipated freeze date" -widget date -datatype date -optional -format "MONTH DD, YYYY" +element create version anticipated_release_date -label "Anticipated release date" -widget date -datatype date -optional -format "MONTH DD, YYYY" +element create version assignable_p -label "Assignable?" -widget select -datatype text -optional -options {{Yes t} {No f}} + +element create version insert_or_update -widget hidden -datatype text + +if { [form is_request version] } { if {[empty_string_p $version_id]} { set insert_or_update insert - template::element set_properties version insert_or_update -value insert + element set_properties version insert_or_update -value insert set version_id [db_nextval "acs_object_id_seq"] - template::element set_properties version version_id -value $version_id + element set_properties version version_id -value $version_id } else { set insert_or_update update - template::element set_properties version insert_or_update -value update + element set_properties version insert_or_update -value update db_1row get_current_values " select version_id, version_name, description, to_char(anticipated_freeze_date, 'YYYY MM DD HH24 MI') as anticipated_freeze_date, to_char(anticipated_release_date, 'YYYY MM DD HH24 MI') as anticipated_release_date, maintainer, supported_platforms, assignable_p from bt_versions where version_id = :version_id " - template::element set_properties version version_id -value $version_id - template::element set_properties version version_name -value $version_name - template::element set_properties version description -value $description - template::element set_properties version anticipated_freeze_date -value $anticipated_freeze_date - template::element set_properties version anticipated_release_date -value $anticipated_release_date - template::element set_properties version maintainer -value $maintainer - template::element set_properties version supported_platforms -value $supported_platforms - template::element set_properties version assignable_p -value $assignable_p + element set_properties version version_id -value $version_id + element set_properties version version_name -value $version_name + element set_properties version description -value $description + element set_properties version anticipated_freeze_date -value $anticipated_freeze_date + element set_properties version anticipated_release_date -value $anticipated_release_date + element set_properties version maintainer -value $maintainer + element set_properties version supported_platforms -value $supported_platforms + element set_properties version assignable_p -value $assignable_p } } -set insert_or_update [template::element::get_value version insert_or_update] +set insert_or_update [element::get_value version insert_or_update] -if { [template::form is_valid version] } { +if { [form is_valid version] } { # valid form submission - set version_id [template::element::get_value version version_id] + set version_id [element::get_value version version_id] set project_id [ad_conn package_id] - set version_name [template::element::get_value version version_name] - set description [template::element::get_value version description] - set anticipated_freeze_date [template::element::get_value version anticipated_freeze_date] + set version_name [element::get_value version version_name] + set description [element::get_value version description] + set anticipated_freeze_date [element::get_value version anticipated_freeze_date] if {![empty_string_p $anticipated_freeze_date]} { - set anticipated_freeze_date [template::util::date::get_property sql_date $anticipated_freeze_date] + set anticipated_freeze_date [util::date::get_property sql_date $anticipated_freeze_date] } else { set anticipated_freeze_date NULL } - set anticipated_release_date [template::element::get_value version anticipated_release_date] + set anticipated_release_date [element::get_value version anticipated_release_date] if {![empty_string_p $anticipated_release_date]} { - set anticipated_release_date [template::util::date::get_property sql_date $anticipated_release_date] + set anticipated_release_date [util::date::get_property sql_date $anticipated_release_date] } else { set anticipated_release_date NULL } - set maintainer [template::element::get_value version maintainer] - set supported_platforms [template::element::get_value version supported_platforms] - set assignable_p [template::element::get_value version assignable_p] + set maintainer [element::get_value version maintainer] + set supported_platforms [element::get_value version supported_platforms] + set assignable_p [element::get_value version assignable_p] if {$insert_or_update == "insert"} { if {[db_0or1row check_exists "