[Rt-commit] r9781 - in rt/branches/3.6-RELEASE/html: Helpers Ticket

audreyt at bestpractical.com audreyt at bestpractical.com
Sat Dec 1 21:31:45 EST 2007


Author: audreyt
Date: Sat Dec  1 21:31:45 2007
New Revision: 9781

Modified:
   rt/branches/3.6-RELEASE/html/Helpers/EmailAutocomplete
   rt/branches/3.6-RELEASE/html/SelfService/Create.html
   rt/branches/3.6-RELEASE/html/Ticket/Create.html
   rt/branches/3.6-RELEASE/html/Ticket/Update.html

Log:
* Convert SelfService and Ticket Create/Update to EmailAutocomplete.

Modified: rt/branches/3.6-RELEASE/html/Helpers/EmailAutocomplete
==============================================================================
--- rt/branches/3.6-RELEASE/html/Helpers/EmailAutocomplete	(original)
+++ rt/branches/3.6-RELEASE/html/Helpers/EmailAutocomplete	Sat Dec  1 21:31:45 2007
@@ -48,12 +48,18 @@
 <body>
 <ul>
 % while (my $addr = $users->next) {
-<li><span class="informal"><% $addr->EmailAddress %></span><span class="hidden_value"><% $prefix %><% $addr->EmailAddress %>, </span></li>
+%   my $email = $addr->EmailAddress or next;
+%   my $name = $addr->Name;
+%   undef $name if $name eq $email;
+%   my $this = Mail::Address->new($name, $email)->format;
+<li><span class="informal"><% $this %></span><span class="hidden_value"><% $prefix %><% $this %>, </span></li>
 % }
 </ul>
 </body>
 % $m->abort;
 <%INIT>
+require Mail::Address;
+
 $r->content_type('text/xml; charset=UTF-8');
 $Value =~ s/^\s+//;
 $Value =~ s/\s+$//;
@@ -71,10 +77,12 @@
 
 my $users = RT::Users->new($session{'CurrentUser'});
 $users->Limit(
-    FIELD    => 'Name',
-    OPERATOR => 'LIKE',
-    VALUE    => $lookup->format,
-);
+    FIELD           => $_,
+    OPERATOR        => 'LIKE',
+    VALUE           => $lookup->format,
+    SUBCLAUSE       => 'EmailAutocomplete',
+    ENTRYAGGREGATOR => 'OR',
+) for qw< EmailAddress Name >;
 $users->OrderBy( FIELD => 'Name' );
 
 </%INIT>

Modified: rt/branches/3.6-RELEASE/html/SelfService/Create.html
==============================================================================
--- rt/branches/3.6-RELEASE/html/SelfService/Create.html	(original)
+++ rt/branches/3.6-RELEASE/html/SelfService/Create.html	Sat Dec  1 21:31:45 2007
@@ -65,7 +65,7 @@
 <&|/l&>Requestors</&>:
 </td>
 <td class="value">
-<input name="Requestors" value="<%$session{CurrentUser}->EmailAddress%>" size="20" />
+ <& /Elements/EmailInput, Name => 'Requestors', Size => '20', Default => $session{CurrentUser}->EmailAddress &>
 </td>
 </tr>
 <tr>
@@ -73,7 +73,7 @@
 <&|/l&>Cc</&>:
 </td>
 <td class="value">
- <input name="Cc" size="20" />
+ <& /Elements/EmailInput, Name => 'Cc', Size => '20' &>
 </td>
 </tr>
 <tr>

Modified: rt/branches/3.6-RELEASE/html/Ticket/Create.html
==============================================================================
--- rt/branches/3.6-RELEASE/html/Ticket/Create.html	(original)
+++ rt/branches/3.6-RELEASE/html/Ticket/Create.html	Sat Dec  1 21:31:45 2007
@@ -82,7 +82,7 @@
 <&|/l&>Requestors</&>:
 </td>
 <td class="value" colspan="5">
-<input name="Requestors" value="<% ($ARGS{Requestors}) || $session{CurrentUser}->EmailAddress %>" size="40" />
+<& /Elements/EmailInput, Name => 'Requestors', Size => '40', Default => $ARGS{Requestors} || $session{CurrentUser}->EmailAddress &>
 </td>
 </tr>
 <tr>
@@ -90,7 +90,7 @@
 <&|/l&>Cc</&>:
 </td>
 <td class="value" colspan="5">
-<input name="Cc" size="40" value="<% $ARGS{Cc} %>" /><br />
+<& /Elements/EmailInput, Name => 'Cc', Size => '40', Default => $ARGS{Cc} &><br />
 <i><font size="-2">
 <&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of email addresses. These people <strong>will</strong> receive future updates.)</&></font></i>
 </td>
@@ -100,7 +100,7 @@
 <&|/l&>Admin Cc</&>:
 </td>
 <td class="value" colspan="5">
-<input name="AdminCc" size="40" value="<% $ARGS{AdminCc} %>" /><br />
+<& /Elements/EmailInput, Name => 'AdminCc', Size => '40', Default => $ARGS{AdminCc} &><br />
 <i><font size="-2">
 <&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of administrative email addresses. These people <strong>will</strong> receive future updates.)</&></font></i>
 </td>

Modified: rt/branches/3.6-RELEASE/html/Ticket/Update.html
==============================================================================
--- rt/branches/3.6-RELEASE/html/Ticket/Update.html	(original)
+++ rt/branches/3.6-RELEASE/html/Ticket/Update.html	Sat Dec  1 21:31:45 2007
@@ -82,12 +82,11 @@
 </select> 
 </td></tr>
 <tr><td align="right"><&|/l&>Subject</&>:</td><td> <input name="UpdateSubject" size="60" value="<% $ARGS{UpdateSubject} || $TicketObj->Subject()%>" /></td></tr>
-<tr><td align="right"><&|/l&>Cc</&>:</td><td> <input name="UpdateCc" size="60"
-value="<%$ARGS{UpdateCc}||""%>" /><br />
+<tr><td align="right"><&|/l&>Cc</&>:</td><td> <& /Elements/EmailInput, Name => 'UpdateCc', Size => '60', Default => $ARGS{UpdateCc} &><br />
 <i><font size="-2">
 <&|/l&>(Sends a carbon-copy of this update to a comma-delimited list of email addresses. Does <strong>not</strong> change who will receive future updates.)</&></font></i>
 </td></tr>
-<tr><td align="right"><&|/l&>Bcc</&>:</td><td> <input name="UpdateBcc" size="60" value="<%$ARGS{UpdateBcc}||""%>" /><br />
+<tr><td align="right"><&|/l&>Bcc</&>:</td><td> <& /Elements/EmailInput, Name => 'UpdateBcc', Size => '60', Default => $ARGS{UpdateBcc} &><br />
 <i><font size="-2">
 <&|/l&>(Sends a blind carbon-copy of this update to a comma-delimited list of email addresses. Does <strong>not</strong> change who will receive future updates.)</&></font></i>
 </td></tr>


More information about the Rt-commit mailing list