[bugzilla-gnome-org-customizations/production] attachment status: Add status combobox in attachment creation page
- From: Krzesimir Nowak <krnowak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [bugzilla-gnome-org-customizations/production] attachment status: Add status combobox in attachment creation page
- Date: Tue, 24 Feb 2015 16:51:04 +0000 (UTC)
commit 461c6042cd7f6e69e35efcde5d389dc4fbaaab5e
Author: Krzesimir Nowak <qdlacz gmail com>
Date: Mon Feb 2 16:02:24 2015 +0100
attachment status: Add status combobox in attachment creation page
extensions/GnomeAttachmentStatus/lib/Ops.pm | 18 +++++++++++++++---
...reateformcontents-attachment_is_patch.html.tmpl | 5 +++++
2 files changed, 20 insertions(+), 3 deletions(-)
---
diff --git a/extensions/GnomeAttachmentStatus/lib/Ops.pm b/extensions/GnomeAttachmentStatus/lib/Ops.pm
index e7c93e3..14f2dec 100644
--- a/extensions/GnomeAttachmentStatus/lib/Ops.pm
+++ b/extensions/GnomeAttachmentStatus/lib/Ops.pm
@@ -89,7 +89,8 @@ sub _cgi_hack_update {
my $status = $cgi->param(g_a_s());
my $action = $cgi->param('action');
- if (defined($status) && defined($action) && $action eq 'update') {
+ if (defined($status) && defined($action) &&
+ ($action eq 'update' || $action eq 'insert')) {
$attachment->set_gnome_attachment_status($status);
}
}
@@ -154,14 +155,24 @@ sub maybe_fixup_final_status_param
}
}
-sub _attachment_edit_handler {
- my ($file, $vars, $context) = @_;
+sub _set_all_status_values {
+ my ($vars) = @_;
my $var_name = 'all_' . g_a_s() . '_values';
my @values = Bugzilla::Field::Choice->type(fd_a_g_a_s())->get_all();
$vars->set($var_name, \ values);
}
+sub _attachment_create_handler {
+ my ($file, $vars, $context) = @_;
+ _set_all_status_values($vars);
+}
+
+sub _attachment_edit_handler {
+ my ($file, $vars, $context) = @_;
+ _set_all_status_values($vars);
+}
+
sub _attachment_list_handler {
my ($file, $vars, $context) = @_;
my $bug_id = $vars->get('bugid');
@@ -184,6 +195,7 @@ sub _attachment_list_handler {
unless (defined ($handlers))
{
$handlers = {
+ 'attachment/create.html.tmpl' => \&_attachment_create_handler,
'attachment/edit.html.tmpl' => \&_attachment_edit_handler,
'attachment/list.html.tmpl' => \&_attachment_list_handler
};
diff --git
a/extensions/GnomeAttachmentStatus/template/en/default/hook/attachment/createformcontents-attachment_is_patch.html.tmpl
b/extensions/GnomeAttachmentStatus/template/en/default/hook/attachment/createformcontents-attachment_is_patch.html.tmpl
new file mode 100644
index 0000000..c3f0a18
--- /dev/null
+++
b/extensions/GnomeAttachmentStatus/template/en/default/hook/attachment/createformcontents-attachment_is_patch.html.tmpl
@@ -0,0 +1,5 @@
+[% INCLUDE gnomeattachmentstatus/combo.html.tmpl
+ enabled = 0
+ current_status = "none"
+ statuses = all_gnome_attachment_status_values
+%]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]