[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.6-173-g4cbc2c3

Alex Vandiver alexmv at bestpractical.com
Tue Nov 23 18:42:55 EST 2010


The branch, 3.9-trunk has been updated
       via  4cbc2c3867c498624a9f854f3e09f05e994780a7 (commit)
       via  a43cc31a496b1aa0798826f97ee7b031fd65eb1b (commit)
       via  fafce4240c4c791f4f60314e19c91dbd72b2361d (commit)
       via  1c027193b6315ed8beacbad52ac20745a8d92e91 (commit)
       via  3d58212c5e4317ead98b3773c3d0aa45d87aa7cc (commit)
       via  90f5d4e382653f59ef1c48e1359cef40ed9a9b10 (commit)
       via  5f5935fc820252672f798fc285bff45d5068ca0f (commit)
       via  fe9ac7a0523e5a942dc6016b660e0e06fb52d796 (commit)
       via  c252120977932e4d6166e4c4b019cdd87295ef84 (commit)
       via  e4e90f46bee6ff3ce1263ae78cb4b8e01e19ea23 (commit)
       via  fb836bf4302a7450beaa1e3d36dc0509fe2119c0 (commit)
       via  7d9ba2a3e3b2e774ab5f91241d91aaa0a277e957 (commit)
       via  057552287159e801535e59b8fbd5bd98d1322069 (commit)
       via  432df1da150eff66d7b17b2b0812114e0db9896a (commit)
       via  10572e20930fb78647124ee3ec30c046d0acf797 (commit)
       via  280bdc1961def7707392ba828f29a4ea8882163a (commit)
       via  d37f3e93f799824e84aa146dba44e5669525cb01 (commit)
       via  a87820750251000aba859cc45f510db27b0c1049 (commit)
       via  a813943bb23cb4692dabb634c53a2213f8a2300d (commit)
       via  e71c90f88c0f12936f3cae192ee4dc10bf11292c (commit)
       via  6fa0a4e500a8be35a30fa9a7d9f7415ebb2d7405 (commit)
       via  23a912a292ad0c3d4bca4d3f9aae39c0100bc042 (commit)
       via  87408ef895b625d44512392de68c76a5c35fdd26 (commit)
       via  fbf7e7066d7d17df218c19cb4ef7e52871aef762 (commit)
       via  917c211820590950f7eb0521f7f43b31aeed44c4 (commit)
       via  87e5c159689c48631623cb135b6d7383310edf24 (commit)
       via  5e90c854bb5f752137fa2973c3044330eaf41bd0 (commit)
       via  6c44641cd50c4f3ad631f4cb22292bb37a3c6c97 (commit)
       via  90e89d2463651c3198981c0e32d2ec0ea1c480dc (commit)
       via  0c497482a988d296d9188edb07f5e9b72efe3b0c (commit)
       via  94e96b44439dfdea1e98e514f5835eed1be5a3d0 (commit)
       via  13b6c93483d67f09c7c8990afeaa30d87f0baaf9 (commit)
       via  3fcf977a7f1fa77f581eab7ee7d221d4152b6ff7 (commit)
       via  f7b602e68d04a92b0a860403720cc61cb868cc36 (commit)
       via  89a15ccf9867d902214817d123f32bd6f2e43f6d (commit)
       via  8342cef017077b3bd0dea087d710ab87de49c4b4 (commit)
       via  7eab3d7d5322dce5ed377eb739b3b8d102efb303 (commit)
       via  8105bc6c556e429915a2e566bfaa7661891e2115 (commit)
       via  cae63fc21aef7e836324cb2b969117b838abaf33 (commit)
      from  ff87ce6ac66df55473cdacdd1c2376ee668b0bc9 (commit)

Summary of changes:
 config.layout                                      |   15 +-
 etc/initialdata                                    |    2 +-
 etc/upgrade/3.8.9/content                          |   23 ++
 lib/RT/Handle.pm                                   |    2 +-
 lib/RT/Interface/Web.pm                            |  193 ++++++++++++++--
 lib/RT/Interface/Web/Handler.pm                    |   42 ++++-
 lib/RT/SQL.pm                                      |    2 +-
 lib/RT/Transaction_Overlay.pm                      |    2 +-
 share/html/Admin/Elements/EditQueueWatchers        |    3 +-
 share/html/Dashboards/Elements/SelectPrivacy       |   22 ++-
 share/html/Elements/ListActions                    |    3 +-
 share/html/Elements/Login                          |   83 +------
 share/html/Elements/MyReminders                    |    2 +-
 share/html/Elements/QuickCreate                    |    2 +-
 share/html/Elements/ShowLink                       |    2 +-
 share/html/Elements/ShowUserVerbose                |    2 +-
 share/html/Helpers/Toggle/TicketBookmark           |    3 +-
 .../EditCustomFieldIPAddress => NoAuth/Login.html} |    8 +-
 share/html/NoAuth/css/base/login.css               |    4 +
 share/html/Search/Elements/SearchPrivacy           |   16 +-
 share/html/Search/Elements/SelectSearchObject      |    6 +-
 .../html/Search/Elements/SelectSearchesForObjects  |    6 +-
 share/html/SelfService/Display.html                |   10 +-
 .../Ticket/Elements/EditTransactionCustomFields    |    4 +
 share/html/Ticket/Elements/Reminders               |    3 +-
 share/html/Ticket/Elements/ShowAttachments         |    3 +-
 share/html/Ticket/Elements/ShowDates               |    6 +-
 share/html/Ticket/Elements/ShowDependencies        |    5 +-
 share/html/Ticket/Elements/ShowTransaction         |    2 +-
 .../Ticket/Elements/ShowTransactionAttachments     |    2 +-
 share/html/Ticket/ModifyAll.html                   |    2 +-
 share/html/Ticket/Update.html                      |    2 +-
 t/web/attachment_encoding.t                        |   18 +-
 t/web/html_template.t                              |   10 +-
 t/web/query_builder.t                              |   12 +-
 t/web/redirect-after-login.t                       |  243 ++++++++++++++++++++
 36 files changed, 601 insertions(+), 164 deletions(-)
 copy share/html/{Elements/EditCustomFieldIPAddress => NoAuth/Login.html} (92%)
 mode change 100644 => 100755
 create mode 100644 t/web/redirect-after-login.t

- Log -----------------------------------------------------------------
commit 4cbc2c3867c498624a9f854f3e09f05e994780a7
Merge: ff87ce6 a43cc31
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Tue Nov 23 18:27:43 2010 -0500

    Merge branch '3.8-trunk' into 3.9-trunk
    
    Conflicts:
    	lib/RT/Transaction_Overlay.pm
    	share/html/Elements/HeaderJavascript
    	share/html/Elements/Login
    	share/html/Elements/MyReminders
    	share/html/Elements/QuickCreate
    	share/html/Elements/SelectOwner
    	share/html/NoAuth/js/util.js
    	share/html/Search/Elements/SelectSearchesForObjects
    	share/html/Ticket/Create.html
    	share/html/Ticket/Elements/Bookmark
    	share/html/Ticket/Elements/EditTransactionCustomFields
    	share/html/Ticket/Elements/Reminders
    	share/html/Ticket/Elements/ShowDates
    	share/html/Ticket/Update.html
    	t/web/basic.t
    	t/web/compilation_errors.t
    	t/web/html_template.t
    	t/web/query_builder.t
    	t/web/rights1.t

diff --cc config.layout
index 3da8e07,9c1ce4c..a7683b5
--- a/config.layout
+++ b/config.layout
@@@ -154,13 -144,12 +154,13 @@@
    exec_prefix:		${prefix}
    bindir:		${exec_prefix}/bin
    sbindir:		${exec_prefix}/sbin
-   sysconfdir:		/etc/rt
+   sysconfdir:           /etc/rt3
    mandir:		${prefix}/man
-   libdir:		${prefix}/lib/rt
-   datadir:		/var/rt
+   libdir:               ${prefix}/lib/rt3
+   datadir:              /var/rt3
    htmldir:		${datadir}/html
    fontdir:		${datadir}/fonts
 +  lexdir:		${datadir}/po
    manualdir:		${datadir}/doc
    plugindir:		${datadir}/plugins
    localstatedir:	/var
@@@ -172,9 -161,9 +172,10 @@@
    customhtmldir:	${customdir}/html
    customlexdir:		${customdir}/po
    customlibdir:		${customdir}/lib
 +  customplugindir:  ${customdir}/plugins
  </Layout>
  
+ 
  <Layout relative>
    prefix:		/opt/rt3
    exec_prefix:		${prefix}
diff --cc lib/RT/Interface/Web/Handler.pm
index cff1a86,b123734..c7b5e16
--- a/lib/RT/Interface/Web/Handler.pm
+++ b/lib/RT/Interface/Web/Handler.pm
@@@ -181,13 -153,51 +181,53 @@@ sub NewApacheHandler 
  
  sub NewCGIHandler {
      require HTML::Mason::CGIHandler;
-     return NewHandler('HTML::Mason::CGIHandler', @_);
+     return NewHandler(
+         'HTML::Mason::CGIHandler',
+         out_method => sub {
+             my $m = HTML::Mason::Request->instance;
+             my $r = $m->cgi_request;
+ 
+             # Send headers if they have not been sent by us or by user.
+             $r->send_http_header unless $r->http_header_sent;
+ 
+             # Set up a default
+             $r->content_type('text/html; charset=utf-8')
+                 unless $r->content_type;
+ 
+             if ( $r->content_type =~ /charset=([\w-]+)$/ ) {
+                 my $enc = $1;
+                 if ( lc $enc !~ /utf-?8$/ ) {
+                     for my $str (@_) {
+                         next unless $str;
+ 
+                         # only encode perl internal strings
+                         next unless utf8::is_utf8($str);
+                         $str = Encode::encode( $enc, $str );
+                     }
+                 }
+             }
+ 
+             # default to utf8 encoding
+             for my $str (@_) {
+                 next unless $str;
+                 next unless utf8::is_utf8($str);
+                 $str = Encode::encode( 'utf8', $str );
+             }
+ 
+             # We could perhaps install a new, faster out_method here that
+             # wouldn't have to keep checking whether headers have been
+             # sent and what the $r->method is.  That would require
+             # additions to the Request interface, though.
+             print STDOUT grep {defined} @_;
+         },
+         @_
+     );
  }
  
 +use UNIVERSAL::require;
  sub NewHandler {
      my $class = shift;
 +    $class->require or die $!;
      my $handler = $class->new(
          DefaultHandlerArgs(),
          @_
diff --cc share/html/Elements/ListActions
index c19ad53,1e76bfe..707fd54
--- a/share/html/Elements/ListActions
+++ b/share/html/Elements/ListActions
@@@ -43,10 -43,10 +43,10 @@@
  %# royalty-free, perpetual, license to use, copy, create derivative
  %# works based on those contributions, and sublicense and distribute
  %# those contributions and any derivatives thereof.
 -%# 
 +%#
  %# END BPS TAGGED BLOCK }}}
  <div class="results">
- <&| /Widgets/TitleBox, title => loc('Results') &>
+ <&| /Widgets/TitleBox, title => loc('Results'), %{$titlebox || {}} &>
    <ul class="action-results">
  % foreach my $action (@actions) {
      <li><%$action%></li>
diff --cc share/html/Elements/Login
index 0855a92,a7820c3..12fd82d
--- a/share/html/Elements/Login
+++ b/share/html/Elements/Login
@@@ -43,61 -43,22 +43,18 @@@
  %# royalty-free, perpetual, license to use, copy, create derivative
  %# works based on those contributions, and sublicense and distribute
  %# those contributions and any derivatives thereof.
 -%# 
 +%#
  %# END BPS TAGGED BLOCK }}}
  % $m->callback( %ARGS, CallbackName => 'Header' );
  <& /Elements/Header, Title => loc('Login'), Focus => 'user' &>
  
--
--%# End of div#quickbar from /Elements/Header
--</div>
--
  <div id="body" class="login-body">
- % if ($Error) {
- <&| "/Widgets/TitleBox", title => loc('Error'), hideable => 0, class => 'error'  &>
- <% $Error %>
- </&>
- % }
+ 
+ <& /Elements/ListActions,
+     title       => loc('Error'),
+     titlebox    => { class => 'error', hideable => 0 },
+     actions     => $actions
+ &>
  
  % $m->callback( %ARGS, CallbackName => 'BeforeForm' );
  
diff --cc share/html/Elements/MyReminders
index d454a4e,24a2a96..00ab113
--- a/share/html/Elements/MyReminders
+++ b/share/html/Elements/MyReminders
@@@ -49,24 -49,18 +49,24 @@@
  <&|/Widgets/TitleBox,
      class => 'reminders',
      title => loc("Reminders") &>
 -<table width="100%">
 -% my $i =0;
 -% while (my $reminder = $reminders->Next) {
 -% $i++;
 -% if ($reminder->RefersTo->First) {
 -% my $ticket= $reminder->RefersTo->First->TargetObj;
 -% if ( $ticket ) {
 -<tr class="<%$i%2 ? 'evenline' : 'oddline'%>"><td><a href="<%RT->Config->Get('WebPath')%>/Ticket/Display.html?id=<%$ticket->id%>"><%$reminder->Subject%></a><br />
 -<blockquote>
 +<table width="100%" class="reminders">
 +<%perl>
 +my $i =0;
 +while (my $reminder = $reminders->Next) {
 +$i++;
 +my $targets = RT::Tickets->new($session{'CurrentUser'});
 +$targets->FromSQL("ReferredToBy = ".$reminder->id);
 +
 +if (my $ticket= $targets->First) {
 +
 +</%perl>
 +<tr class="<%$i%2 ? 'evenline' : 'oddline'%>">
 +<td><a href="<%RT->Config->Get('WebPath')%>/Ticket/Display.html?id=<%$ticket->id%>"><%$reminder->Subject%></a><br />
 +<span>
  #<%$ticket->id%>: <%$ticket->Subject%><br />
- <%$reminder->OwnerObj->Name %>
 -<& /Elements/ShowUser, User => $reminder->OwnerObj &>  <%$reminder->DueObj->Unix >0 ? '&bull; '.$reminder->DueObj->AgeAsString : '' |n %>
 -</blockquote>
++<& /Elements/ShowUser, User => $reminder->OwnerObj &>
 +<%$reminder->DueObj->Unix >0 ? '&bull; '.$reminder->DueObj->AgeAsString : '' |n %>
 +</span>
  </td>
  </tr>
  % }
diff --cc share/html/Elements/QuickCreate
index 55ad275,2620651..09d9e04
--- a/share/html/Elements/QuickCreate
+++ b/share/html/Elements/QuickCreate
@@@ -61,8 -57,8 +61,8 @@@
  </td>
  <td class="label"><&|/l&>Owner</&>:</td><td class="value">
  <select type="select" name="Owner">  
- <option value="<%$session{'CurrentUser'}->id%>" selected="selected"><%$session{'CurrentUser'}->Name %></option>
+ <option value="<%$session{'CurrentUser'}->id%>" selected="selected"><&|/l&>Me</&></option>
 -<option value="<%$RT::Nobody->id%>"><%loc('Nobody')%></option>
 +<option value="<%RT->Nobody->id%>"><%loc('Nobody')%></option>
  </select>
  </td>
  </tr>
diff --cc share/html/NoAuth/css/base/login.css
index 2aee3f2,0000000..d205449
mode 100644,000000..100644
--- a/share/html/NoAuth/css/base/login.css
+++ b/share/html/NoAuth/css/base/login.css
@@@ -1,98 -1,0 +1,102 @@@
 +%# BEGIN BPS TAGGED BLOCK {{{
 +%#
 +%# COPYRIGHT:
 +%#
 +%# This software is Copyright (c) 1996-2010 Best Practical Solutions, LLC
 +%#                                          <jesse at bestpractical.com>
 +%#
 +%# (Except where explicitly superseded by other copyright notices)
 +%#
 +%#
 +%# LICENSE:
 +%#
 +%# This work is made available to you under the terms of Version 2 of
 +%# the GNU General Public License. A copy of that license should have
 +%# been provided with this software, but in any event can be snarfed
 +%# from www.gnu.org.
 +%#
 +%# This work is distributed in the hope that it will be useful, but
 +%# WITHOUT ANY WARRANTY; without even the implied warranty of
 +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 +%# General Public License for more details.
 +%#
 +%# You should have received a copy of the GNU General Public License
 +%# along with this program; if not, write to the Free Software
 +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 +%# 02110-1301 or visit their web page on the internet at
 +%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
 +%#
 +%#
 +%# CONTRIBUTION SUBMISSION POLICY:
 +%#
 +%# (The following paragraph is not intended to limit the rights granted
 +%# to you to modify and distribute this software under the terms of
 +%# the GNU General Public License and is only of importance to you if
 +%# you choose to contribute your changes and enhancements to the
 +%# community by submitting them to Best Practical Solutions, LLC.)
 +%#
 +%# By intentionally submitting any modifications, corrections or
 +%# derivatives to this work, or any other work intended for use with
 +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
 +%# you are the copyright holder for those contributions and you grant
 +%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
 +%# royalty-free, perpetual, license to use, copy, create derivative
 +%# works based on those contributions, and sublicense and distribute
 +%# those contributions and any derivatives thereof.
 +%#
 +%# END BPS TAGGED BLOCK }}}
++.login-body .action-results {
++    list-style: none;
++}
++
 +#login-box hr {
 + display: none;
 +}
 +
 +#login-box {
 +
 + width: 30em;
 +
 +margin-right:auto;margin-left:auto;
 + padding-top: 2em;
 + padding-bottom: 2em;
 +
 +
 +}
 +
 +
 +#login-box .input-row {
 +  position: relative;
 +  height: 1.5em;
 +  padding-top: 1em;
 +}
 +
 +#login-box .input-row .label {
 +
 + float: left;
 + width: 8em;
 + text-align: right;
 + font-weight: bold;
 +
 +
 +}
 +
 +#login-box .button-row {
 +  margin-top: 0.5em;
 +}
 +
 +#quick-personal {
 +    position: absolute;
 +    z-index: 9999;
 +    left: 0;
 +    /* This avoids a very weird bug in Chrome where opening a select causes a
 +     * hover event at (0,0), which will be over top of the menu sometimes */
 +    top: 1px;
 +}
 +
 +#quick-personal #not-logged-in {
 +    display: block;
 +    padding-top: 0.5em;
 +    padding-left: 1em;
 +}
 +
diff --cc share/html/Search/Elements/SelectSearchesForObjects
index c3202ac,194b4a9..c15d5df
--- a/share/html/Search/Elements/SelectSearchesForObjects
+++ b/share/html/Search/Elements/SelectSearchesForObjects
@@@ -51,15 -51,10 +51,11 @@@ $Name => unde
  $SearchType => 'Ticket',
  </%args>
  <select id="<%$Name%>" name="<%$Name%>">
 -<option value="" selected>&nbsp;</option>
 +<option value="">-</option>
  % foreach my $object (@Objects) {
 -<optgroup label="<& SearchPrivacy, Object => $object &>">
  % my @searches = $object->Attributes->Named('SavedSearch');
 +% if ( @searches ) {
- % if (ref($object) eq 'RT::User' && $object->id == $session{'CurrentUser'}->Id) {
- <optgroup label="<&|/l&>My saved searches</&>">
- % } else {
- <optgroup label="<&|/l, $object->Name&>[_1]'s saved searches</&>">
- % }
++<optgroup label="<& SearchPrivacy, Object => $object &>">
  % foreach my $search (@searches) { 
  %     # Skip it if it is not of search type we want.
  %     next if ($search->SubValue('SearchType')
diff --cc share/html/Ticket/Elements/EditTransactionCustomFields
index 1f2b28e,ac1a0f2..54dcd5a
--- a/share/html/Ticket/Elements/EditTransactionCustomFields
+++ b/share/html/Ticket/Elements/EditTransactionCustomFields
@@@ -60,11 -56,15 +60,15 @@@
      CustomField => $CF,
      NamePrefix => $NamePrefix
  &>
 -<em><% $CF->FriendlyType %></em>
+ %  if (my $msg = $m->notes('InvalidField-' . $CF->Id)) {
+         <br />
+         <span class="cfinvalidfield"><% $msg %></span>
+ %  }
 -</td>
 -</td></tr>
 +</<% $CELL %>>
 +</<% $FIELD %>>
  % }
  % }
 +</div>
  % $m->callback( CallbackName => 'AfterTransactionCustomFields', TicketObj => $TicketObj, QueueObj => $QueueObj, NamePrefix => $NamePrefix );
  
  <%INIT>
diff --cc share/html/Ticket/Elements/Reminders
index be95a0f,52a55ff..43da890
--- a/share/html/Ticket/Elements/Reminders
+++ b/share/html/Ticket/Elements/Reminders
@@@ -160,9 -168,12 +161,9 @@@ $Ticke
  $Reminder
  $Ticket
  </%args>
 -<input
 -    type="checkbox" 
 -    name="Complete-Reminder-<%$Reminder->id%>" 
 -    <% $Reminder->Status eq 'resolved' ? 'checked="checked"' : '' %> 
 -/> 
 -    <%$Reminder->Subject%> &bull; 
 -    <& /Elements/ShowUser, User => $Reminder->OwnerObj &>
 +<input type="checkbox" name="Complete-Reminder-<%$Reminder->id%>" \
 +    <% $Reminder->Status eq 'resolved' ? 'checked="checked"' : '' %> />
 +    <%$Reminder->Subject%> &bull; \
-     <%$Reminder->OwnerObj->Name%> \
++    <& /Elements/ShowUser, User => $Reminder->OwnerObj &> \
      <%$Reminder->DueObj->Unix>0  ? "&bull; ". $Reminder->DueObj->AgeAsString : '' |n%><br />
  </%method>
diff --cc share/html/Ticket/Elements/ShowDates
index 141dec7,7595341..bbb5264
--- a/share/html/Ticket/Elements/ShowDates
+++ b/share/html/Ticket/Elements/ShowDates
@@@ -43,45 -43,45 +43,45 @@@
  %# royalty-free, perpetual, license to use, copy, create derivative
  %# works based on those contributions, and sublicense and distribute
  %# those contributions and any derivatives thereof.
 -%# 
 +%#
  %# END BPS TAGGED BLOCK }}}
  <table>
 -  <tr>
 -    <td class="label date created"><&|/l&>Created</&>:</td>
 -    <td class="value date created"><% $Ticket->CreatedObj->AsString %></td>
 +  <tr class="date created">
 +    <td class="label"><&|/l&>Created</&>:</td>\
 +    <td class="value"><% $Ticket->CreatedObj->AsString %></td>
    </tr>
 -  <tr>
 -    <td class="label date starts"><&|/l&>Starts</&>:</td>
 -    <td class="value date starts"><% $Ticket->StartsObj->AsString %></td>
 +  <tr class="date starts">
 +    <td class="label"><&|/l&>Starts</&>:</td>\
 +    <td class="value"><% $Ticket->StartsObj->AsString %></td>
    </tr>
 -  <tr>
 -    <td class="label date started"><&|/l&>Started</&>:</td>
 -    <td class="value date started"><% $Ticket->StartedObj->AsString %></td>
 +  <tr class="date started">
 +    <td class="label"><&|/l&>Started</&>:</td>\
 +    <td class="value"><% $Ticket->StartedObj->AsString %></td>
    </tr>
 -  <tr>
 -    <td class="label date told"><a href="<% RT->Config->Get('WebPath') %>/Ticket/Display.html?id=<% $Ticket->id %>&Action=SetTold"><&|/l&>Last Contact</&></a>:</td>
 -    <td class="value date told"><% $Ticket->ToldObj->AsString %></td>
 +  <tr class="date told">
 +    <td class="label"><a href="<% RT->Config->Get('WebPath') %>/Ticket/Display.html?id=<% $Ticket->id %>&Action=SetTold"><&|/l&>Last Contact</&></a>:</td>\
 +    <td class="value"><% $Ticket->ToldObj->AsString %></td>
    </tr>
 -  <tr>
 -    <td class="label date due"><&|/l&>Due</&>:</td>
 +  <tr class="date due">
 +    <td class="label"><&|/l&>Due</&>:</td>\
  % my $due = $Ticket->DueObj;
  % if ( $due && $due->Unix > 0 && $due->Diff < 0 ) {
 -    <td class="value date due"><span class="overdue"><% $due->AsString  %></span></td>
 +    <td class="value"><% $due->AsString  %></span></td>
  % } else {
 -    <td class="value date due"><% $due->AsString  %></td>
 +    <td class="value"><% $due->AsString  %></td>
  % }
    </tr>
 -  <tr>
 -    <td class="label date resolved"><&|/l&>Closed</&>:</td>
 -    <td class="value date resolved"><% $Ticket->ResolvedObj->AsString  %></td>
 +  <tr class="date resolved">
 +    <td class="label"><&|/l&>Closed</&>:</td>\
 +    <td class="value"><% $Ticket->ResolvedObj->AsString  %></td>
    </tr>
 -  <tr>
 -    <td class="label date updated"><&|/l&>Updated</&>:</td>
 +  <tr class="date updated">
 +    <td class="label"><&|/l&>Updated</&>:</td>\
- % my $UpdatedString = $Ticket->LastUpdated ? loc("[_1] by [_2]", $Ticket->LastUpdatedAsString, $Ticket->LastUpdatedByObj->Name) : loc("Never");
+ % my $UpdatedString = $Ticket->LastUpdated ? loc("[_1] by [_2]", $Ticket->LastUpdatedAsString, $m->scomp('/Elements/ShowUser', User => $Ticket->LastUpdatedByObj)) : loc("Never");
  % if ($UpdatedLink) {
-     <td class="value"><a href="#lasttrans"><% $UpdatedString | h %></a></td>
 -    <td class="value date updated"><a href="#lasttrans"><% $UpdatedString |n%></a></td>
++    <td class="value"><a href="#lasttrans"><% $UpdatedString | n %></a></td>
  % } else {
-     <td class="value"><% $UpdatedString | h %></td>
 -    <td class="value date updated"><% $UpdatedString |n%></td>
++    <td class="value"><% $UpdatedString | n %></td>
  % }
    </tr>
  % $m->callback( %ARGS, CallbackName => 'EndOfList', TicketObj => $Ticket );
diff --cc share/html/Ticket/Elements/ShowTransaction
index d20653a,53756ff..986d512
--- a/share/html/Ticket/Elements/ShowTransaction
+++ b/share/html/Ticket/Elements/ShowTransaction
@@@ -43,10 -43,11 +43,10 @@@
  %# royalty-free, perpetual, license to use, copy, create derivative
  %# works based on those contributions, and sublicense and distribute
  %# those contributions and any derivatives thereof.
 -%# 
 +%#
  %# END BPS TAGGED BLOCK }}}
- <div class="ticket-transaction <% $type_class %> <% $RowNum % 2 ? 'odd' : 'even' %>">
+ <div class="ticket-transaction <% $type_class %> <%$type%> <% $RowNum % 2 ? 'odd' : 'even' %>">
  % $m->callback( titlebar_cmd => \$titlebar_commands, Transaction => $Transaction, %ARGS, CallbackName => 'ModifyDisplay' );
 -
  <div class="ticket-transaction">
  % $m->callback( titlebar_cmd => \$titlebar_commands, Transaction => $Transaction, %ARGS, CallbackName => 'ModifyCommand' );
    <div class="metadata">
diff --cc share/html/Ticket/Update.html
index 6582719,c669c48..420f436
--- a/share/html/Ticket/Update.html
+++ b/share/html/Ticket/Update.html
@@@ -79,75 -97,29 +79,75 @@@
  <option value="response" <% ($ARGS{'UpdateType'} && $ARGS{'UpdateType'} eq "response") ? qq[ selected="selected"] : !$ARGS{'UpdateType'}&&$ResponseDefault |n %>><&|/l&>Reply to requestors</&></option>
  % }
  </select> 
 +
 +<script type="text/javascript">
 +    jQuery(function() {
 +        jQuery("#UpdateType").change(function(ev) {
 +            jQuery(".messagebox-container")
 +                .removeClass("action-response action-private")
 +                .addClass("action-"+ev.target.value);
 +        });
 +    });
 +    jQuery(function() {
 +        jQuery("input[name=TxnSendMailTo]").change(function(ev) {
 +            jQuery("input[name=TxnSendMailTo][value="+ev.target.value+"]")
 +                  .attr("checked",jQuery(ev.target).attr('checked'));
 +        });
 +    });
 +</script>
 +
  % $m->callback( %ARGS, CallbackName => 'AfterUpdateType' );
  </td></tr>
 -<tr><td class="label"><&|/l&>Subject</&>:</td><td> <input name="UpdateSubject" size="60" value="<% $ARGS{UpdateSubject} || $TicketObj->Subject()%>" />
 -% $m->callback( %ARGS, CallbackName => 'AfterSubject' );
 -</td></tr>
  
 -<& /Ticket/Elements/UpdateCc, %ARGS, TicketObj => $TicketObj &>
 +<& /Ticket/Elements/EditBasics,
 +    TicketObj => $TicketObj,
 +    InTable   => 1,
 +    fields    => [
 +        {   name => 'Status',
 +            comp => '/Elements/SelectStatus',
 +            args => {
 +                Name => 'Status',
 +                DefaultLabel => loc("[_1] (Unchanged)", loc($TicketObj->Status)),
 +                Default => $ARGS{'Status'} || ($TicketObj->Status eq $DefaultStatus ? undef : $DefaultStatus),
 +                TicketObj => $TicketObj,
 +                QueueObj => $TicketObj->QueueObj
 +            },
 +        },
 +        {   name => 'Owner',
 +            comp => '/Elements/SelectOwner',
 +            args => {
 +                Name         => "Owner",
 +                TicketObj    => $TicketObj,
 +                QueueObj     => $TicketObj->QueueObj,
-                 DefaultLabel => loc("[_1] (Unchanged)", $TicketObj->OwnerObj->Name),
++                DefaultLabel => loc("[_1] (Unchanged)", $m->scomp('/Elements/ShowUser', User => $TicketObj->OwnerObj)),
 +                Default      => $ARGS{'Owner'}
 +            }
 +        },
 +        {   name => 'Worked',
 +            comp => '/Elements/EditTimeValue',
 +            args => {
 +                Name => 'UpdateTimeWorked',
 +                Default => $ARGS{UpdateTimeWorked}||'',
 +                InUnits => $ARGS{'UpdateTimeWorked-TimeUnits'}||'minutes',
 +            }
 +        },
 +    ]
 +&>
  
 -<& /Ticket/Elements/EditTransactionCustomFields, %ARGS, TicketObj => $TicketObj &>
 +% $m->callback( %ARGS, CallbackName => 'AfterWorked', Ticket => $TicketObj );
  
 -% if (exists $session{'Attachments'}) {
 -<tr><td><&|/l&>Attached file</&>:</td>
 -<td>
 -<&|/l&>Check box to delete</&><br />
 -% foreach my $attach_name (keys %{$session{'Attachments'}}) {
 -<input type="checkbox" class="checkbox" name="DeleteAttach-<%$attach_name%>" value="1" /><%$attach_name%><br />
 -% } # end of foreach
 -</td>
 -</tr>
 -% } # end of if
 +<& /Ticket/Elements/EditTransactionCustomFields, %ARGS, TicketObj => $TicketObj, AsTable => 1 &>
  
 -<tr><td class="label"><&|/l&>Attach</&>:</td><td><input name="Attach" type="file" /><input type="submit" class="button" name="AddMoreAttach" value="<&|/l&>Add More Files</&>" /><input type="hidden" class="hidden" name="UpdateAttach" value="1" />
 -</td></tr>
 +  </table>
 +  </&>
 +</div>
 +
 +<div id="ticket-update-message">
 +  <& /Ticket/Elements/ShowSimplifiedRecipients, TicketObj => $TicketObj, %ARGS &>
 +
 +  <&|/Widgets/TitleBox, title => loc('Message'), class => 'messagedetails' &>
 +  <table width="100%" border="0">
 +<& /Ticket/Elements/UpdateCc, %ARGS, TicketObj => $TicketObj &>
  
  % if ( $gnupg_widget ) {
  <tr><td>&nbsp;</td><td>
diff --cc t/web/html_template.t
index b83a524,a2461dc..f46158c
--- a/t/web/html_template.t
+++ b/t/web/html_template.t
@@@ -3,7 -3,7 +3,7 @@@
  use strict;
  use warnings;
  
- use RT::Test tests => 16;
 -use RT::Test tests => 19;
++use RT::Test tests => 17;
  use Encode;
  my ( $baseurl, $m ) = RT::Test->started_ok;
  ok $m->login, 'logged in as root';
@@@ -41,9 -46,11 +41,10 @@@ diag('create a ticket to see the autore
  {
      $m->get_ok( $baseurl . '/Ticket/Create.html?Queue=1' );
  
 -    $m->form_number(3);
      $m->submit_form(
 -        form_number => 3,
 +        form_name => 'TicketCreate',
-         fields      => { Subject => '标题', Content => '测试', },
+         fields      => { Subject => '标题', Content => '<h1>测试</h1>',
+         ContentType => 'text/html' },
      );
      $m->content_like( qr/Ticket \d+ created/i, 'created the ticket' );
      $m->follow_link( text => 'Show' );

-----------------------------------------------------------------------


More information about the Rt-commit mailing list