[Rt-commit] [svn] r1086 - in rt/branches/rt-3.1: html/Elements
html/SelfService html/Ticket html/Ticket/Elements html/Tools
lib/RT/Interface
alexmv at pallas.eruditorum.org
alexmv at pallas.eruditorum.org
Wed Jun 16 14:49:43 EDT 2004
Author: alexmv
Date: Wed Jun 16 14:49:43 2004
New Revision: 1086
Modified:
rt/branches/rt-3.1/html/Elements/SelectOwner
rt/branches/rt-3.1/html/Elements/SelectStatus
rt/branches/rt-3.1/html/SelfService/Display.html
rt/branches/rt-3.1/html/SelfService/Update.html
rt/branches/rt-3.1/html/Ticket/Create.html
rt/branches/rt-3.1/html/Ticket/Elements/EditBasics
rt/branches/rt-3.1/html/Ticket/Elements/EditPeople
rt/branches/rt-3.1/html/Ticket/Update.html
rt/branches/rt-3.1/html/Tools/MyDay.html
rt/branches/rt-3.1/lib/RT/Interface/Web.pm
Log:
RT-Ticket: 3800
RT-Status: resolved
RT-Update: correspond
* Update the "-" line in Owner and Status drop-downs to be more
descriptive in several cases, taking the form "Nobody (Unchanged)";
this allows it to become the default without losing information.
* Fixed the border cases where owner or status were attempted to be
set to "" by accident
Modified: rt/branches/rt-3.1/html/Elements/SelectOwner
==============================================================================
--- rt/branches/rt-3.1/html/Elements/SelectOwner (original)
+++ rt/branches/rt-3.1/html/Elements/SelectOwner Wed Jun 16 14:49:43 2004
@@ -22,10 +22,12 @@
%#
%# END LICENSE BLOCK
<SELECT NAME="<%$Name%>">
-<OPTION VALUE="">-</OPTION>
+%if ($DefaultValue) {
+<OPTION <% !$Default && "SELECTED" %> VALUE=""><%$DefaultLabel%></OPTION>
+%}
<OPTION <% ($RT::Nobody->Id() == $Default) && "SELECTED" %> VALUE="<%$RT::Nobody->Id%>"><%$RT::Nobody->Name%></OPTION>
%while ( my $User = $Users->Next()) {
-<OPTION VALUE="<%$User->Id()%>" <% ($User->Id() == $Default) && "SELECTED" %>><%$User->Name()%></OPTION>
+<OPTION <% ($User->Id == $Default) && "SELECTED" %> VALUE="<%$User->Id()%>"><%$User->Name()%></OPTION>
%}
</SELECT>
@@ -56,4 +58,6 @@
$Default => undef
$User => undef
$TicketObj => undef
+$DefaultValue => 1
+$DefaultLabel => "-"
</%ARGS>
Modified: rt/branches/rt-3.1/html/Elements/SelectStatus
==============================================================================
--- rt/branches/rt-3.1/html/Elements/SelectStatus (original)
+++ rt/branches/rt-3.1/html/Elements/SelectStatus Wed Jun 16 14:49:43 2004
@@ -22,10 +22,12 @@
%#
%# END LICENSE BLOCK
<SELECT NAME ="<%$Name%>">
-<OPTION VALUE="">-</OPTION>
+%if ($DefaultValue) {
+<OPTION <% !$Default && "SELECTED" %> VALUE=""><%$DefaultLabel%></OPTION>
+%}
%foreach my $status (@status) {
%next if ($SkipDeleted && $status eq 'deleted');
-<OPTION VALUE="<%$status%>" <%($Default eq $status) && 'SELECTED'%>><%loc($status)%></OPTION>
+<OPTION <% ($status eq $Default) && "SELECTED" %> VALUE="<%$status%>"><%loc($status)%></OPTION>
% }
</SELECT>
<%ONCE>
@@ -36,4 +38,6 @@
$Name => undef
$Default => undef
$SkipDeleted => 0
+$DefaultValue => 1
+$DefaultLabel => "-"
</%ARGS>
Modified: rt/branches/rt-3.1/html/SelfService/Display.html
==============================================================================
--- rt/branches/rt-3.1/html/SelfService/Display.html (original)
+++ rt/branches/rt-3.1/html/SelfService/Display.html Wed Jun 16 14:49:43 2004
@@ -129,7 +129,7 @@
my ( $code, $msg );
#Update the status
-if ( ( defined $ARGS{'Status'} )
+if ( ( defined $ARGS{'Status'} ) and $ARGS{'Status'}
and ( $ARGS{'Status'} ne $Ticket->Status ) ) {
( $code, $msg ) = $Ticket->SetStatus( $ARGS{'Status'} );
push @results, "$msg";
Modified: rt/branches/rt-3.1/html/SelfService/Update.html
==============================================================================
--- rt/branches/rt-3.1/html/SelfService/Update.html (original)
+++ rt/branches/rt-3.1/html/SelfService/Update.html Wed Jun 16 14:49:43 2004
@@ -27,7 +27,7 @@
<FORM ACTION="Display.html" METHOD=POST ENCTYPE="multipart/form-data">
<input type=hidden name="UpdateType" value="response">
-<&|/l&>Status</&>: <& /Elements/SelectStatus, Name=>"Status", Default => $DefaultStatus &><br>
+<&|/l&>Status</&>: <& /Elements/SelectStatus, Name=>"Status", DefaultLabel => loc("[_1] (Unchanged)",$DefaultStatus) &><br>
<&|/l&>Subject</&>: <input name="UpdateSubject" size=60 value="Re: <% $Ticket->Subject %>"> <br>
<table>
<tr>
Modified: rt/branches/rt-3.1/html/Ticket/Create.html
==============================================================================
--- rt/branches/rt-3.1/html/Ticket/Create.html (original)
+++ rt/branches/rt-3.1/html/Ticket/Create.html Wed Jun 16 14:49:43 2004
@@ -41,13 +41,13 @@
<TD class=label><&|/l&>Status</&>:
</TD>
<TD class=value>
-<& /Elements/SelectStatus, Name => "Status", Default => $ARGS{Status}||'new' &>
+<& /Elements/SelectStatus, Name => "Status", Default => $ARGS{Status}||'new', DefaultValue => 0 &>
</TD>
<TD class=label>
<&|/l&>Owner</&>:
</TD>
<TD class=value>
-<& /Elements/SelectOwner, Name => "Owner", QueueObj => $QueueObj, Default => $ARGS{Owner}||undef &>
+<& /Elements/SelectOwner, Name => "Owner", QueueObj => $QueueObj, Default => $ARGS{Owner}||$RT::Nobody->Id, DefaultValue => 0 &>
</TD>
</TR>
<TR>
Modified: rt/branches/rt-3.1/html/Ticket/Elements/EditBasics
==============================================================================
--- rt/branches/rt-3.1/html/Ticket/Elements/EditBasics (original)
+++ rt/branches/rt-3.1/html/Ticket/Elements/EditBasics Wed Jun 16 14:49:43 2004
@@ -63,7 +63,7 @@
<%INIT>
#It's hard to do this inline, so we'll preload the html of the selectstatus in here.
-my $SelectStatus = $m->scomp("/Elements/SelectStatus", Name => 'Status', Default=> $TicketObj->Status);
+my $SelectStatus = $m->scomp("/Elements/SelectStatus", Name => 'Status', DefaultLabel => loc("[_1] (Unchanged)",$TicketObj->Status));
my $SelectQueue = $m->scomp("/Elements/SelectQueue", Name => 'Queue', Default =>$TicketObj->QueueObj->Id);
</%INIT>
Modified: rt/branches/rt-3.1/html/Ticket/Elements/EditPeople
==============================================================================
--- rt/branches/rt-3.1/html/Ticket/Elements/EditPeople (original)
+++ rt/branches/rt-3.1/html/Ticket/Elements/EditPeople Wed Jun 16 14:49:43 2004
@@ -40,7 +40,7 @@
GroupField => $GroupField, PrivilegedOnly => $PrivilegedOnly &>
</TD><TD VALIGN=TOP>
<h3><&|/l&>Owner</&></h3>
-<&|/l&>Owner</&>: <& /Elements/SelectOwner, Name => 'Owner', QueueObj => $Ticket->QueueObj, TicketObj => $Ticket, Default => $Ticket->OwnerObj->Id &>
+<&|/l&>Owner</&>: <& /Elements/SelectOwner, Name => 'Owner', QueueObj => $Ticket->QueueObj, TicketObj => $Ticket, Default => $Ticket->OwnerObj->Id, DefaultValue => 0&>
<h3><&|/l&>Current watchers</&></h3>
<&|/l&>(Check box to delete)</&><br>
Modified: rt/branches/rt-3.1/html/Ticket/Update.html
==============================================================================
--- rt/branches/rt-3.1/html/Ticket/Update.html (original)
+++ rt/branches/rt-3.1/html/Ticket/Update.html Wed Jun 16 14:49:43 2004
@@ -36,9 +36,9 @@
<tr><td align=right><&|/l&>Status</&>:</td>
<td>
-<& /Elements/SelectStatus, Name=>"Status", Default => $DefaultStatus &>
+<& /Elements/SelectStatus, Name=>"Status", DefaultLabel => loc("[_1] (Unchanged)", $TicketObj->Status), Default => ($TicketObj->Status eq $DefaultStatus ? undef : $DefaultStatus)&>
<&|/l&>Owner</&>:
-<& /Elements/SelectOwner, Name=>"Owner", Default => ($ARGS{'Owner'} || $TicketObj->OwnerObj->Id()), QueueObj => $TicketObj->QueueObj, TicketObj => $TicketObj &>
+<& /Elements/SelectOwner, Name=>"Owner", DefaultLabel => loc("[_1] (Unchanged)", $TicketObj->OwnerObj->Name()), QueueObj => $TicketObj->QueueObj, TicketObj => $TicketObj &>
<&|/l&>Worked</&>: <input size=4 name="UpdateTimeWorked" value="<% $ARGS{UpdateTimeWorked}%>"> <&|/l&>minutes</&></td></tr>
% my $skip;
<& /Elements/Callback, _CallbackName => 'BeforeUpdateType', skip => \$skip, %ARGS &>
Modified: rt/branches/rt-3.1/html/Tools/MyDay.html
==============================================================================
--- rt/branches/rt-3.1/html/Tools/MyDay.html (original)
+++ rt/branches/rt-3.1/html/Tools/MyDay.html Wed Jun 16 14:49:43 2004
@@ -17,7 +17,7 @@
cols=60></textarea></TD></TR>
<TR <%$class|n%>>
<TD><SPAN CLASS="label">Status:</SPAN> <& /Elements/SelectStatus, Name=> 'UpdateStatus-'.$Ticket->Id,
- Default => $Ticket->Status() &></TD>
+ DefaultLabel => loc("[_1] (Unchanged)",$Ticket->Status()) &></TD>
</TR>
% }
Modified: rt/branches/rt-3.1/lib/RT/Interface/Web.pm
==============================================================================
--- rt/branches/rt-3.1/lib/RT/Interface/Web.pm (original)
+++ rt/branches/rt-3.1/lib/RT/Interface/Web.pm Wed Jun 16 14:49:43 2004
@@ -1048,6 +1048,8 @@
}
}
+ $ARGSRef->{'Status'} ||= $TicketObj->Status;
+
my @results = UpdateRecordObject(
AttributesRef => \@attribs,
Object => $TicketObj,
More information about the Rt-commit
mailing list