[Rt-commit] rt branch, 4.2/status-selector-for-approvals, created. rt-4.1.13-63-g2930ee8
Ruslan Zakirov
ruz at bestpractical.com
Tue Jul 2 09:47:40 EDT 2013
The branch, 4.2/status-selector-for-approvals has been created
at 2930ee883bbf9d240b5017cd9915cbb57aa7a5d0 (commit)
- Log -----------------------------------------------------------------
commit 44d8bf406d14722d90edbb1e025c2688397f569c
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Fri Dec 9 00:52:18 2011 +0400
drop not used variables
diff --git a/share/html/Approvals/index.html b/share/html/Approvals/index.html
index 14d430a..4ed676f 100644
--- a/share/html/Approvals/index.html
+++ b/share/html/Approvals/index.html
@@ -60,8 +60,6 @@ foreach my $arg ( keys %ARGS ) {
next unless ( $arg =~ /Approval-(\d+)-Action/ );
- my ( $notesval, $notesmsg );
-
my $ticket = LoadTicket($1);
if ( $ARGS{ "Approval-" . $ticket->Id . "-Notes" } ) {
commit efdb1fae27aa9dc109d39320829e4f60a5815fc9
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Fri Dec 9 01:10:57 2011 +0400
make it possible to pass status as approvals' action
diff --git a/share/html/Approvals/index.html b/share/html/Approvals/index.html
index 4ed676f..a1a843d 100644
--- a/share/html/Approvals/index.html
+++ b/share/html/Approvals/index.html
@@ -58,10 +58,21 @@
my (@actions);
foreach my $arg ( keys %ARGS ) {
- next unless ( $arg =~ /Approval-(\d+)-Action/ );
+ next unless ( $arg =~ /Approval-(\d+)-(Action|Status)/ );
my $ticket = LoadTicket($1);
+ my $set_status_to;
+ if ( $2 eq 'Action' ) {
+ $set_status_to =
+ $ARGS{$arg} eq 'deny' ? 'rejected'
+ : $ARGS{$arg} eq 'approve' ? 'resolved'
+ : undef
+ ;
+ } else {
+ $set_status_to = $ARGS{$arg};
+ }
+
if ( $ARGS{ "Approval-" . $ticket->Id . "-Notes" } ) {
my $notes = MIME::Entity->build(
Data => [ $ARGS{ "Approval-" . $ticket->Id . "-Notes" } ]
@@ -76,13 +87,9 @@ foreach my $arg ( keys %ARGS ) {
}
}
- my ($val, $msg);
- if ( $ARGS{$arg} eq 'deny' && $ticket->Status !~ /^(rejected|deleted)/ ) {
- ( $val, $msg ) = $ticket->SetStatus('rejected');
- }
- elsif ( $ARGS{$arg} eq 'approve' && $ticket->Status ne 'resolved') {
- ( $val, $msg ) = $ticket->SetStatus('resolved');
+ if ( $set_status_to ) {
+ my ( $val, $msg ) = $ticket->SetStatus( $set_status_to );
+ push @actions, loc("Approval #[_1]: [_2]",$ticket->id, $msg ) if ($msg);
}
- push ( @actions, loc("Approval #[_1]: [_2]",$ticket->id, $msg )) if ($msg);
}
</%init>
commit 5438d357e6fb29b1c225eedac0e37fd09f7798e0
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Fri Dec 9 03:42:43 2011 +0400
show status selector for approvals instead of radio
diff --git a/share/html/Approvals/Elements/Approve b/share/html/Approvals/Elements/Approve
index af061d0..a597079 100644
--- a/share/html/Approvals/Elements/Approve
+++ b/share/html/Approvals/Elements/Approve
@@ -65,31 +65,13 @@
% }
% }
<div class="form">
- <div class="action">
- <div>
-% if ( $inactive && $status eq 'resolved' ) {
- <input type="radio" class="radio" id="Approval-<%$ticket->Id%>-Action-approve" name="Approval-<%$ticket->Id%>-Action" value="approve" checked="checked" />
- <label for="Approval-<%$ticket->Id%>-Action-approve"><% loc('[_1] (Unchanged)', loc('Approve')) %></label>
-% } else {
- <input type="radio" class="radio" id="Approval-<%$ticket->Id%>-Action-approve" name="Approval-<%$ticket->Id%>-Action" value="approve" />
- <label for="Approval-<%$ticket->Id%>-Action-approve"><&|/l&>Approve</&></label>
-% }
- </div>
- <div>
-% if ( $inactive && $status ne 'resolved' ) {
- <input type="radio" class="radio" id="Approval-<%$ticket->Id%>-Action-deny" name="Approval-<%$ticket->Id%>-Action" value="deny" checked="checked" />
- <label for="Approval-<%$ticket->Id%>-Action-deny"><% loc('[_1] (Unchanged)', loc('Deny')) %></label>
-% } else {
- <input type="radio" class="radio" id="Approval-<%$ticket->Id%>-Action-deny" name="Approval-<%$ticket->Id%>-Action" value="deny" />
- <label for="Approval-<%$ticket->Id%>-Action-deny"><&|/l&>Deny</&></label>
-% }
- </div>
-% unless ( $inactive ) {
- <div>
- <input type="radio" class="radio" id="Approval-<%$ticket->Id%>-Action-none" name="Approval-<%$ticket->Id%>-Action" value="none" checked="checked" />
- <label for="Approval-<%$ticket->Id%>-Action-none"><&|/l&>No action</&></label>
- </div>
-% }
+ <div class="status">
+ <label for="Approval-<%$ticket->Id%>-Status"><&|/l&>Status</&></label>
+ <& /Elements/SelectStatus,
+ TicketObj => $ticket,
+ Name => 'Approval-'. $ticket->Id .'-Status',
+ DefaultLabel => loc("[_1] (Unchanged)",loc($ticket->Status)),
+ &>
</div>
<div class="notes">
<label for="Approval-<%$ticket->Id%>-Notes"><&|/l&>Notes</&></label>
commit 2930ee883bbf9d240b5017cd9915cbb57aa7a5d0
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Fri Dec 9 03:55:40 2011 +0400
don't allow approvals to go back to new status
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 345a747..a185415 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -2561,11 +2561,11 @@ Set(%Lifecycles,
# from => [ to list ],
new => [qw(open stalled resolved rejected deleted)],
- open => [qw(new stalled resolved rejected deleted)],
- stalled => [qw(new open rejected resolved deleted)],
- resolved => [qw(new open stalled rejected deleted)],
- rejected => [qw(new open stalled resolved deleted)],
- deleted => [qw(new open stalled rejected resolved)],
+ open => [qw(stalled resolved rejected deleted)],
+ stalled => [qw(open rejected resolved deleted)],
+ resolved => [qw(open stalled rejected deleted)],
+ rejected => [qw(open stalled resolved deleted)],
+ deleted => [qw(open stalled rejected resolved)],
},
rights => {
'* -> deleted' => 'DeleteTicket',
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list