[Rt-commit] rt branch, 4.0/status-selector-for-approvals, created. rt-4.0.4-122-g922c420
Ruslan Zakirov
ruz at bestpractical.com
Thu Dec 8 19:15:02 EST 2011
The branch, 4.0/status-selector-for-approvals has been created
at 922c4206ace7b2761c3b4b1a2c1f06a0a1a13d79 (commit)
- Log -----------------------------------------------------------------
commit cfa44bb3bb411bdad888a529a886c0260fc21c09
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 fc04fce..9dc9bc0 100755
--- 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 7f0c764817dc7e09879bb38dd78630bc9be6b3c1
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 9dc9bc0..23913ce 100755
--- 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' ) {
- ( $val, $msg ) = $ticket->SetStatus('rejected');
- }
- elsif ( $ARGS{$arg} eq 'approve' ) {
- ( $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 c71e13a036bd915e7f0e222e20c56b2c82131ac1
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 f651139..f016bbb 100755
--- a/share/html/Approvals/Elements/Approve
+++ b/share/html/Approvals/Elements/Approve
@@ -65,19 +65,13 @@
% }
% }
<div class="form">
- <div class="action">
- <div>
- <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>
- <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>
- <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 922c4206ace7b2761c3b4b1a2c1f06a0a1a13d79
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 c4e7c85..49fcbe3 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -2361,11 +2361,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