]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1541618 - Add triage owner to edit components view columns.
authorKohei Yoshino <kohei.yoshino@gmail.com>
Fri, 10 May 2019 20:49:42 +0000 (16:49 -0400)
committerGitHub <noreply@github.com>
Fri, 10 May 2019 20:49:42 +0000 (16:49 -0400)
extensions/ComponentWatching/template/en/default/hook/admin/components/list-before_table.html.tmpl [deleted file]
template/en/default/admin/components/list.html.tmpl

diff --git a/extensions/ComponentWatching/template/en/default/hook/admin/components/list-before_table.html.tmpl b/extensions/ComponentWatching/template/en/default/hook/admin/components/list-before_table.html.tmpl
deleted file mode 100644 (file)
index ed8d6e3..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-[%# This Source Code Form is subject to the terms of the Mozilla Public
-  # License, v. 2.0. If a copy of the MPL was not distributed with this
-  # file, You can obtain one at http://mozilla.org/MPL/2.0/.
-  #
-  # This Source Code Form is "Incompatible With Secondary Licenses", as
-  # defined by the Mozilla Public License, v. 2.0.
-  #%]
-
-[% CALL columns.splice(5, 0, { name => 'watch_user', heading => 'Watch User' }) %]
-
-[% FOREACH my_component = product.components %]
-  [% overrides.watch_user.name.${my_component.name} = {
-        override_content => 1
-        content          => my_component.watch_user.login
-     }
-  %]
-[% END %]
index aca4c95a7938d7a6734816ec561e0b243096d188..4fa7683eaa109dcc2c2a86058ba52da9a7ded3b3 100644 (file)
        heading => "Description"
        allow_html_content => 1
      },
+     {
+       name => "isactive"
+       heading => "Active"
+       yesno_field => 1
+     },
      {
        name => "default_bug_type"
        heading => "Default $terms.Bug Type"
@@ -61,9 +66,8 @@
        heading => "Default Assignee"
      },
      {
-       name => "isactive"
-       heading => "Active"
-       yesno_field => 1
+       name => "triage_owner"
+       heading => "Triage Owner"
      },
    ]
 %]
 
 [%# Overrides the initialowner and the initialqacontact with right values %]
 [% overrides.initialowner = {} %]
+[% overrides.triage_owner = {} %]
 [% overrides.initialqacontact = {} %]
 
 [%# "component" is a reserved word in Template Toolkit. %]
 [% FOREACH my_component = product.components %]
-  [% overrides.initialowner.name.${my_component.name} = {
-       override_content => 1
-       content => my_component.default_assignee.login
-     }
-  %]
-  [% overrides.initialqacontact.name.${my_component.name} = {
-       override_content => 1
-       content => my_component.default_qa_contact.login
-     }
+  [%
+    users = [
+      { field_name => 'default_assignee',   column_name => 'initialowner' },
+      { field_name => 'triage_owner',       column_name => 'triage_owner' },
+      { field_name => 'default_qa_contact', column_name => 'initialqacontact' },
+    ];
+    FOREACH user IN users;
+      email = my_component.${user.field_name}.login;
+      IF (email.match('^nobody@') || email.match('\.bugs$'));
+        email = '';
+      END;
+      overrides.${user.column_name}.name.${my_component.name} = {
+        override_content => 1,
+        content => email || '(nobody)',
+      };
+    END;
   %]
 [% END %]