[Rt-commit] rt branch, 4.0/quick-create-retain-values-on-failure, created. rt-4.0.20rc1-1-gc980376
? sunnavy
sunnavy at bestpractical.com
Mon May 12 10:28:23 EDT 2014
The branch, 4.0/quick-create-retain-values-on-failure has been created
at c980376b459d528ed8b81e7479bf22af0d25abac (commit)
- Log -----------------------------------------------------------------
commit c980376b459d528ed8b81e7479bf22af0d25abac
Author: sunnavy <sunnavy at bestpractical.com>
Date: Mon May 12 21:47:21 2014 +0800
retain form values for QuickCreate when it fails to create
so users can try again more easily.
note that this also causes SelectNewTicketQueue to respect top arg "Queue"
see also #14136
diff --git a/share/html/Elements/QuickCreate b/share/html/Elements/QuickCreate
index 425694c..7ce7af3 100644
--- a/share/html/Elements/QuickCreate
+++ b/share/html/Elements/QuickCreate
@@ -55,24 +55,25 @@
<input type="hidden" class="hidden" name="QuickCreate" value="1" />
<table>
<tr class="input-row"><td class="label"><&|/l&>Subject</&>:</td>
- <td colspan="3" class="value"><input type="text" size="50" name="Subject" /></td>
+ <td colspan="3" class="value"><input type="text" size="50" name="Subject" value="<% $DECODED_ARGS->{Subject} || '' %>" /></td>
</tr><tr class="input-row">
<td class="label"><&|/l&>Queue</&>:</td><td class="value"><& /Elements/SelectNewTicketQueue, Name => 'Queue' &>
</td>
<td class="label"><&|/l&>Owner</&>:</td><td class="value">
<select type="select" name="Owner">
-<option value="<%$session{'CurrentUser'}->id%>" selected="selected"><&|/l&>Me</&></option>
-<option value="<%RT->Nobody->id%>"><%loc('Nobody')%></option>
+% my $default_owner = $DECODED_ARGS->{Owner} || $session{'CurrentUser'}->id;
+<option value="<%$session{'CurrentUser'}->id%>" <% $default_owner == $session{'CurrentUser'}->id ? 'selected="selected"' : '' |n %>><&|/l&>Me</&></option>
+<option value="<%RT->Nobody->id%>" <% $default_owner == RT->Nobody->id ? 'selected="selected"' : '' |n %>><%loc('Nobody')%></option>
</select>
</td>
</tr>
<tr class="input-row">
<td class="label"><&|/l&>Requestors</&>:</td>
- <td colspan="3" class="value"><& /Elements/EmailInput, Name => 'Requestors', Size => '40', Default => $ARGS{Requestors} || $session{CurrentUser}->EmailAddress &></td>
+ <td colspan="3" class="value"><& /Elements/EmailInput, Name => 'Requestors', Size => '40', Default => $DECODED_ARGS->{Requestors} || $session{CurrentUser}->EmailAddress &></td>
</tr>
<tr class="input-row">
<td class="labeltop"><&|/l&>Content</&>:</td>
-<td colspan="3" class="value"><textarea name="Content" cols="50" rows="3"></textarea></td></tr>
+<td colspan="3" class="value"><textarea name="Content" cols="50" rows="3"><% $DECODED_ARGS->{Content} || ''%></textarea></td></tr>
</table>
<& /Elements/Submit, Label => loc('Create') &>
</form>
diff --git a/share/html/Elements/SelectNewTicketQueue b/share/html/Elements/SelectNewTicketQueue
index dd966ed..8286ac6 100644
--- a/share/html/Elements/SelectNewTicketQueue
+++ b/share/html/Elements/SelectNewTicketQueue
@@ -49,11 +49,14 @@
<& /Elements/SelectQueue, Name => 'Queue', Default => $queue, %ARGS, ShowNullOption => 0, ShowAllQueues => 0 &>
</label>
<%INIT>
-my $queue = RT->Config->Get("DefaultQueue", $session{'CurrentUser'});
+my $queue = $DECODED_ARGS->{Queue};
+unless ( $queue ) {
+ $queue = RT->Config->Get("DefaultQueue", $session{'CurrentUser'});
-if (RT->Config->Get("RememberDefaultQueue", $session{'CurrentUser'})) {
- if (my $session_default = $session{'DefaultQueue'}) {
- $queue = $session_default;
+ if (RT->Config->Get("RememberDefaultQueue", $session{'CurrentUser'})) {
+ if (my $session_default = $session{'DefaultQueue'}) {
+ $queue = $session_default;
+ }
}
}
-----------------------------------------------------------------------
More information about the rt-commit
mailing list