From e679c1864efe76002b2b202dfbaa42acbba516a0 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Wed, 7 Sep 2005 06:53:58 +0000 Subject: Bug 301743: Replace old code from editcomponents.cgi by methods and routines from Component.pm and Product.pm - Patch by Tiago R. Mello r=LpSolit a=justdave --- .../admin/components/confirm-delete.html.tmpl | 81 ++++++++++------------ .../en/default/admin/components/edit.html.tmpl | 55 ++++++--------- .../en/default/admin/components/list.html.tmpl | 33 ++++++--- template/en/default/filterexceptions.pl | 4 +- template/en/default/global/user-error.html.tmpl | 10 --- 5 files changed, 82 insertions(+), 101 deletions(-) (limited to 'template') diff --git a/template/en/default/admin/components/confirm-delete.html.tmpl b/template/en/default/admin/components/confirm-delete.html.tmpl index 5e108e7a8..dabace154 100644 --- a/template/en/default/admin/components/confirm-delete.html.tmpl +++ b/template/en/default/admin/components/confirm-delete.html.tmpl @@ -20,29 +20,13 @@ #%] [%# INTERFACE: - # name: string; The name of the component - # - # description: string; Component description, may be empty - # - # bug_count: number; The number of bugs belonging to the component - # - # initialowner: string; default assignee, may be empty - # - # initialqacontact: string; if system parameter is set to use the default - # qa contact field, then this will be it, - # may be empty - # - # milestoneurl: string; milestone url, if milestones are in use, - # may be empty - # - # product: string; The name of the product - # - # disallownew: boolean; Are new bugs allowed for the product flag - # - # product_description: string; Description of product + # comp: object; Bugzilla::Component object representing the component the + # user wants to delete. + # prod: object; Bugzilla::Product object representing the product to + # which the component belongs. #%] -[% title = BLOCK %]Delete Component of Product '[% product FILTER html %]' +[% title = BLOCK %]Delete Component of Product '[% prod.name FILTER html %]' [% END %] [% PROCESS global/header.html.tmpl @@ -56,54 +40,58 @@ Component: - [% name FILTER html %] + [% comp.name FILTER html %] Component Description: - [% description FILTER html %] + [% comp.description FILTER html %] Default assignee: - [% initialowner FILTER html %] + [% comp.default_assignee.login FILTER html %] [% IF Param('useqacontact') %] Default QA contact: - [% initialqacontact FILTER html %] + [% comp.default_qa_contact.login FILTER html %] [% END %] Component of Product: - [% product FILTER html %] + [% prod.name FILTER html %] -[% IF product_description %] +[% IF prod.description %] Product Description: - [% product_description FILTER html %] + [% prod.description FILTER html %] [% END %] [% IF Param('usetargetmilestone') %] Product Milestone URL: - [% milestoneurl FILTER html %] + + + [% prod.milestone_url FILTER html %] + + [% END %] Closed for [% terms.bugs %]: - [% IF $disallownew %]Yes[% ELSE %]No[% END %] + [% IF prod.disallow_new %]Yes[% ELSE %]No[% END %] [% terms.Bugs %]: -[% IF bug_count %] - [% bug_count %] +[% IF comp.bug_count %] + [% comp.bug_count %] [% ELSE %] None [% END %] @@ -113,21 +101,21 @@

Confirmation

-[% IF bug_count %] +[% IF comp.bug_count %] [% IF !Param("allowbugdeletion") %] Sorry, there - [% IF bug_count > 1 %] - are [% bug_count %] [%+ terms.bugs %] + [% IF comp.bug_count > 1 %] + are [% comp.bug_count %] [%+ terms.bugs %] [% ELSE %] - is [% bug_count %] [%+ terms.bug %] + is [% comp.bug_count %] [%+ terms.bug %] [% END %] outstanding for this component. You must reassign - [% IF bug_count > 1 %] + [% IF comp.bug_count > 1 %] those [% terms.bugs %] [% ELSE %] that [% terms.bug %] @@ -139,8 +127,8 @@ + [%- comp.name FILTER html %]"> @@ -60,7 +53,7 @@ [% INCLUDE global/userselect.html.tmpl name => "initialowner" id => "initialowner" - value => initialowner + value => comp.default_assignee.login size => 64 emptyok => 1 %] @@ -74,7 +67,7 @@ [% INCLUDE global/userselect.html.tmpl name => "initialqacontact" id => "initialqacontact" - value => initialqacontact + value => comp.default_qa_contact.login size => 64 emptyok => 1 %] @@ -85,11 +78,11 @@
- There [% IF bug_count > 1 %] - are [% bug_count %] [%+ terms.bugs %] + There [% IF comp.bug_count > 1 %] + are [% comp.bug_count %] [%+ terms.bugs %] [% ELSE %] is 1 [% terms.bug %] [% END %] @@ -153,19 +141,22 @@ [% END %] -[% IF bug_count == 0 || Param('allowbugdeletion') %] +[% IF comp.bug_count == 0 || Param('allowbugdeletion') %]

Do you really want to delete this component?

- - + +
[% END %] -[% PROCESS admin/components/footer.html.tmpl %] +[% PROCESS admin/components/footer.html.tmpl + name = comp.name + product = prod.name +%] [% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/components/edit.html.tmpl b/template/en/default/admin/components/edit.html.tmpl index 64959ad96..8b350d9e8 100644 --- a/template/en/default/admin/components/edit.html.tmpl +++ b/template/en/default/admin/components/edit.html.tmpl @@ -20,22 +20,15 @@ #%] [%# INTERFACE: - # name: string; The name of the component. - # - # description: string; Component description, may be empty - # - # initialowner: string; default assignee, may be empty - # - # initialqacontact: string; default qa contact, may be empty - # - # product: string; The product the component belongs to - # - # bug_count: number; number of bugs belonging to the component + # comp: object; Bugzilla::Component object representing the component the + # user wants to edit. + # prod: object; Bugzilla::Product object representing the product to + # which the component belongs. #%] [% PROCESS global/variables.none.tmpl %] -[% title = BLOCK %]Edit Component '[% name FILTER html %]'[% END %] +[% title = BLOCK %]Edit Component '[% comp.name FILTER html %]'[% END %] [% PROCESS global/header.html.tmpl title = title %] @@ -46,12 +39,12 @@
Component:
Component Description: + name="description">[% comp.description FILTER html %]
[% terms.Bugs %]: -[% IF bug_count > 0 %] - 0 %] + [% bug_count %] + [%- comp.name FILTER url_quote %]&product= + [%- prod.name FILTER url_quote %]">[% comp.bug_count %] [% ELSE %] None [% END %] @@ -98,26 +91,20 @@
- - - - - - + + or Delete this component. - + [%- prod.name FILTER url_quote %]&component= + [%- comp.name FILTER url_quote %]">Delete this component. [% PROCESS admin/components/footer.html.tmpl - no_edit_component_link = 1 %] + no_edit_component_link = 1 + name = comp.name + product = prod.name +%] [% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/components/list.html.tmpl b/template/en/default/admin/components/list.html.tmpl index c321219fc..71444936d 100644 --- a/template/en/default/admin/components/list.html.tmpl +++ b/template/en/default/admin/components/list.html.tmpl @@ -20,16 +20,8 @@ #%] [%# INTERFACE: - # components: array of hashes having the properties: - # - name: string; The name of the component. - # - description: string; The description of the component. - # - initialowner: string; The default assignee of the component. - # - initialqacontact: string; The qa_contact of the component. - # - bug_count: number; The number of bugs in the component - # (if showbugcounts defined). - # + # components: array of component objects # showbugcounts: if defined, then bug counts should be included in the table - # # product: string; the name of the product we are editing components for #%] @@ -96,10 +88,31 @@ contentlink => delete_contentlink }) %] +[%# Overrides the initialowner and the initialqacontact with right values %] +[% overrides.initialowner = [] %] +[% overrides.initialqacontact = [] %] + +[% FOREACH component = components %] + [% overrides.initialowner.push({ + match_value => component.name + match_field => 'name' + override_content => 1 + content => component.default_assignee.login + }) + %] + [% overrides.initialqacontact.push({ + match_value => component.name + match_field => 'name' + override_content => 1 + content => component.default_qa_contact.login + }) + %] +[% END %] + [% PROCESS admin/table.html.tmpl columns = columns data = components - footer = footer_row + overrides = overrides %]

Add diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl index f9e2bd241..bb4582260 100644 --- a/template/en/default/filterexceptions.pl +++ b/template/en/default/filterexceptions.pl @@ -574,7 +574,7 @@ 'admin/components/confirm-delete.html.tmpl' => [ - 'bug_count' + 'comp.bug_count' ], 'admin/components/deleted.html.tmpl' => [ @@ -608,7 +608,7 @@ ], 'admin/components/edit.html.tmpl' => [ - 'bug_count' + 'comp.bug_count' ], 'admin/components/list.html.tmpl' => [ diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index b339ccc85..34340fc41 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -288,16 +288,6 @@ [% title = "Component Requires Default Assignee" %] You must enter a default assignee for component '[% name FILTER html %]'. - [% ELSIF error == "component_need_valid_initialowner" %] - [% title = "Component Requires A Valid Default Assignee" %] - You must use an existing [% terms.Bugzilla %] account as the default assignee for - component '[% name FILTER html %]'. - - [% ELSIF error == "component_need_valid_initialqacontact" %] - [% title = "Component Requires A Valid Default QA Contact" %] - You must use an existing [% terms.Bugzilla %] account as default QA contact for - component '[% name FILTER html %]'. - [% ELSIF error == "product_not_specified" %] [% title = "No Product Specified" %] No product specified when trying to edit components, milestones or -- cgit v1.2.3-24-g4f1b