Bug 313123: Implement $component->create and $component->update based on Object.pm - Patch by Frédéric Buclin <LpSolit@gmail.com> r/a=mkanat

git-svn-id: svn://10.0.0.236/trunk@237626 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
lpsolit%gmail.com
2007-10-11 23:07:24 +00:00
parent 5e5fc0f6d3
commit 8c36973d40
12 changed files with 442 additions and 357 deletions

View File

@@ -95,8 +95,6 @@
<hr>
<input type="submit" id="create" value="Add">
<input type="hidden" name="action" value="new">
<input type="hidden" name='open_name' value='All Open'>
<input type="hidden" name='nonopen_name' value='All Closed'>
<input type="hidden" name='product' value="[% product.name FILTER html %]">
<input type="hidden" name="token" value="[% token FILTER html %]">
</form>

View File

@@ -21,27 +21,12 @@
#%]
[%# INTERFACE:
#
# 'updated_XXX' variables are booleans, and are defined if the
# 'XXX' field was updated during the edit just being handled.
#
# updated_name: the name of the component updated
#
# updated_description: the component description updated
#
# updated_initialowner: the default assignee updated
#
# updated_initialqacontact: the default qa contact updated
#
# updated_initialcc: the default initial cc list
# changes: hashref; contains changes made to the component.
#
# comp: object; Bugzilla::Component object representing the component
# user updated.
# product: object; Bugzilla::Product object representing the product to
# which the component belongs.
#
# initial_cc_names: a comma-separated list of the login names of
# the Initial CC, if it was updated.
#%]
[% title = BLOCK %]Updating Component '[% comp.name FILTER html %]' of Product
@@ -50,7 +35,11 @@
title = title
%]
[% IF updated_description %]
[% IF changes.name.defined %]
<p>Updated Component name to: '[% comp.name FILTER html %]'.</p>
[% END %]
[% IF changes.description.defined %]
<table>
<tr>
<td>Updated description to:</td>
@@ -59,11 +48,11 @@
</table>
[% END %]
[% IF updated_initialowner %]
[% IF changes.initialowner.defined %]
<p>Updated Default Assignee to: '[% comp.default_assignee.login FILTER html %]'.</p>
[% END %]
[% IF updated_initialqacontact %]
[% IF changes.initialqacontact.defined %]
<p>
[% IF comp.default_qa_contact.id %]
Updated Default QA Contact to '[% comp.default_qa_contact.login FILTER html %]'.
@@ -73,22 +62,19 @@
</p>
[% END %]
[% IF updated_name %]
<p>Updated Component name to: '[% comp.name FILTER html %]'.</p>
[% END %]
[% IF updated_initialcc %]
[% IF initial_cc_names %]
<p>Updated Default CC list to:
'[% initial_cc_names FILTER html %]'.</p>
[% IF changes.cc_list.defined %]
[% IF comp.initial_cc.size %]
[% cc_list = [] %]
[% FOREACH cc_user = comp.initial_cc %]
[% cc_list.push(cc_user.login) %]
[% END %]
<p>Updated Default CC list to: [% cc_list.join(", ") FILTER html %].</p>
[% ELSE %]
<p>Removed the Default CC list.</p>
[% END %]
[% END %]
[% UNLESS updated_description || updated_initialowner ||
updated_initialqacontact || updated_name ||
updated_initialcc %]
[% UNLESS changes.keys.size %]
<p>Nothing changed for component '[% comp.name FILTER html %]'.</p>
[% END %]

View File

@@ -451,6 +451,12 @@
# we can still use get_text(). %]
[% PROCESS "admin/sanitycheck/messages.html.tmpl" %]
[% ELSIF message_tag == "series_all_open" %]
All Open
[% ELSIF message_tag == "series_all_closed" %]
All Closed
[% ELSIF message_tag == "sudo_started" %]
[% title = "Sudo session started" %]
The sudo session has been started. For the next 6 hours, or until you

View File

@@ -298,12 +298,13 @@
[% ELSIF error == "component_already_exists" %]
[% title = "Component Already Exists" %]
A component with the name '[% name FILTER html %]' already exists.
The <em>[% product.name FILTER html %]</em> product already has
a component named <em>[% name FILTER html %]</em>.
[% ELSIF error == "component_blank_description" %]
[% title = "Blank Component Description Not Allowed" %]
You must enter a non-blank description for component '[% name FILTER html %]'.
You must enter a non-blank description for this component.
[% ELSIF error == "component_blank_name" %]
[% title = "Blank Component Name Not Allowed" %]
You must enter a name for this new component.
@@ -317,16 +318,11 @@
[% ELSIF error == "component_name_too_long" %]
[% title = "Component Name Is Too Long" %]
The name of a component is limited to 64 characters.
'[% name FILTER html %]' is too long ([% name.size %] characters).
'[% name FILTER html %]' is too long ([% name.length %] characters).
[% ELSIF error == "component_need_initialowner" %]
[% title = "Component Requires Default Assignee" %]
You must enter a default assignee for component '[% name FILTER html %]'.
[% ELSIF error == "component_not_valid" %]
[% title = "Specified Component Does Not Exist" %]
Product [% product FILTER html %] does not have a component
named [% name FILTER html %].
A default assignee is required for this component.
[% ELSIF error == "customfield_nonexistent" %]
[% title = "Unknown Custom Field" %]
@@ -1620,6 +1616,8 @@
[% BLOCK object_name %]
[% IF class == "Bugzilla::User" %]
user
[% ELSIF class == "Bugzilla::Component" %]
component
[% ELSIF class == "Bugzilla::Version" %]
version
[% ELSIF class == "Bugzilla::Milestone" %]