[Rt-commit] rt branch, 4.2/approvals-edit, created. rt-4.2.3-84-gf294fec
Alex Vandiver
alexmv at bestpractical.com
Mon Apr 7 18:46:29 EDT 2014
The branch, 4.2/approvals-edit has been created
at f294fec4e684e0c176037ed5c02d49ddca1865ce (commit)
- Log -----------------------------------------------------------------
commit 1f410fbb7104c3a7858f26ea606bd6749caa77a2
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Mon Apr 7 15:05:49 2014 -0400
Hide queue name for __Approvals
Renaming the __Approvals queue would break approvals, which load it by name
diff --git a/share/html/Admin/Queues/Modify.html b/share/html/Admin/Queues/Modify.html
index 98f1f5c..3afb5d0 100644
--- a/share/html/Admin/Queues/Modify.html
+++ b/share/html/Admin/Queues/Modify.html
@@ -56,9 +56,13 @@
<input type="hidden" class="hidden" name="id" value="<% $Create? 'new': $QueueObj->Id %>" />
<table>
-<tr><td align="right"><&|/l&>Queue Name</&>:</td>
-<td colspan="3"><input name="Name" value="<% $Create ? "" : $QueueObj->Name || $Name %>" /></td>
-</tr>
+<tr><td align="right"><&|/l&>Queue Name</&>:</td><td colspan="3">
+% if ($InternalQueue) {
+<% $QueueObj->Name %>
+% } else {
+<input name="Name" value="<% $Create ? "" : $QueueObj->Name || $Name %>" />
+% }
+</td></tr>
<tr><td align="right"><&|/l&>Description</&>:</td>
<td colspan="3"><input name="Description" value="<% $Create ? "" : $QueueObj->Description || $Description || '' %>" size="60" /></td>
@@ -227,6 +231,8 @@ if ( $QueueObj->Id ) {
$title = loc("Create a queue");
}
+my $InternalQueue = ($QueueObj->Id and $QueueObj->Disabled == 2);
+
# This code does automatic redirection if any updates happen.
MaybeRedirectForResults(
Actions => \@results,
commit e02c9b4949abb8ca22501aa657f0ad6036320593
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Mon Apr 7 15:09:05 2014 -0400
The lifecyles drop-down does not list approvals; prevent changing away from it
Pressing submit on the Approvals queue page set its lifecycle to
"default", as "approvals" is filtered out of the list of lifecycles to
display. Once changed by accident, it is also impossible to undo. If
changed intentionally, it may break lifecycles if the new lifecycle
contains different statuses or transitions.
Prevent this family of errors by hiding the lifecycle dropdown for the
approvals queue.
diff --git a/share/html/Admin/Queues/Modify.html b/share/html/Admin/Queues/Modify.html
index 3afb5d0..e3259d2 100644
--- a/share/html/Admin/Queues/Modify.html
+++ b/share/html/Admin/Queues/Modify.html
@@ -68,14 +68,18 @@
<td colspan="3"><input name="Description" value="<% $Create ? "" : $QueueObj->Description || $Description || '' %>" size="60" /></td>
</tr>
-<tr><td align="right"><&|/l&>Lifecycle</&>:</td>
-<td colspan="3"><& /Widgets/Form/Select:InputOnly,
+<tr><td align="right"><&|/l&>Lifecycle</&>:</td><td colspan="3">
+% if ($InternalQueue) {
+<% $QueueObj->Lifecycle %>
+% } else {
+<& /Widgets/Form/Select:InputOnly,
Name => 'Lifecycle',
Values => [ sort { loc($a) cmp loc($b) } RT::Lifecycle->List ],
CurrentValue => $Create ? "default" : $QueueObj->Lifecycle || $ARGS{'Lifecycle'},
Default => 0,
-&></td>
-</tr>
+&>
+% }
+</td></tr>
<tr><td align="right"><&|/l&>Subject Tag</&>:</td>
<td colspan="3"><input name="SubjectTag" value="<% $ARGS{'SubjectTag'} || ($Create ? "" : $QueueObj->SubjectTag || '' ) %>" size="60" /></td>
commit f294fec4e684e0c176037ed5c02d49ddca1865ce
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Mon Apr 7 15:12:56 2014 -0400
Hide the Disabled box on the Approvals queue
The Approvals queue is flagged by Diabled = 2; this presents as
"disabled" in the UI. While marking it "enabled" does not cause many
problems, attempting to mark it re-Disabled leaves it as Disabled = 1,
which does not allow tickets to be created in it.
Hide the Disabled box entirely to prevent these sorts of problems. This
also requires moving the SetEnabled hidden form field to only display if
Enabled was actually displayed. The defaults for signing and encryption
are moved out of the SetEnabled block and inside their own SetCrypt
check, as their presence on the page is now orthogonal to the Enabled
checkbox.
diff --git a/share/html/Admin/Queues/Modify.html b/share/html/Admin/Queues/Modify.html
index e3259d2..f497e6c 100644
--- a/share/html/Admin/Queues/Modify.html
+++ b/share/html/Admin/Queues/Modify.html
@@ -52,7 +52,6 @@
<form action="<%RT->Config->Get('WebPath')%>/Admin/Queues/Modify.html" name="ModifyQueue" method="post" enctype="multipart/form-data">
-<input type="hidden" class="hidden" name="SetEnabled" value="1" />
<input type="hidden" class="hidden" name="id" value="<% $Create? 'new': $QueueObj->Id %>" />
<table>
@@ -129,13 +128,17 @@
<td colspan="3"><&|/l_unsafe, "<b>","</b>","<i>","</i>"&>Sign all auto-generated mail. [_1]Caution[_2]: Enabling this option alters the signature from providing [_3]authentication[_4] to providing [_3]integrity[_4].</&></td></tr>
% }
+% unless ($InternalQueue) {
<tr><td align="right"><input type="checkbox" class="checkbox" id="Enabled" name="Enabled" value="1" <%$EnabledChecked|n%> /></td>
<td colspan="3"><label for="Enabled"><&|/l&>Enabled (Unchecking this box disables this queue)</&></label><br />
+<input type="hidden" class="hidden" name="SetEnabled" value="1" />
% $m->callback( %ARGS, QueueObj => $QueueObj, results => \@results );
</td></tr>
+% }
% if ( RT->Config->Get('Crypt')->{'Enable'} ) {
<tr><td colspan="4">
+<input type="hidden" class="hidden" name="SetCrypt" value="1" />
% if ( my $email = $QueueObj->CorrespondAddress || RT->Config->Get('CorrespondAddress') ) {
<& /Admin/Elements/ShowKeyInfo, Type => 'private', EmailAddress => $email &>
% } else {
@@ -194,8 +197,10 @@ if ( $QueueObj->Id ) {
# we're asking about enabled on the web page but really care about disabled
if ( $SetEnabled ) {
$Disabled = $ARGS{'Disabled'} = $Enabled? 0: 1;
+ }
+ if ( $SetCrypt ) {
$ARGS{$_} = 0 foreach grep !defined $ARGS{$_} || !length $ARGS{$_},
- qw(Sign SignAuto Encrypt Disabled);
+ qw(Sign SignAuto Encrypt);
}
$m->callback(
@@ -259,5 +264,6 @@ $InitialPriority => undef
$FinalPriority => undef
$DefaultDueIn => undef
$SetEnabled => undef
+$SetCrypt => undef
$Enabled => undef
</%ARGS>
-----------------------------------------------------------------------
More information about the rt-commit
mailing list