[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-974-ge3e391e

Jesse Vincent jesse at bestpractical.com
Tue Sep 28 01:12:00 EDT 2010


The branch, 3.9-trunk has been updated
       via  e3e391e60c6778d28dc5cf8d4a1b8b47a3acbfc2 (commit)
       via  57f3d1074be442247e56f4d62a4744ded9795327 (commit)
      from  75f49e588c2c30e01a5b2bab44d42fbb48da5444 (commit)

Summary of changes:
 share/html/Elements/MyReminders |   36 +++++++++++++++++++++---------------
 share/html/Elements/ShowSearch  |    1 +
 2 files changed, 22 insertions(+), 15 deletions(-)

- Log -----------------------------------------------------------------
commit 57f3d1074be442247e56f4d62a4744ded9795327
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Mon Sep 27 23:33:20 2010 -0400

    quiet down a warning on homepage dispaly with bad searches

diff --git a/share/html/Elements/ShowSearch b/share/html/Elements/ShowSearch
index d3f04c6..c681654 100644
--- a/share/html/Elements/ShowSearch
+++ b/share/html/Elements/ShowSearch
@@ -120,6 +120,7 @@ $m->callback(
 
 foreach ( $SearchArg, $ProcessedSearchArg ) {
     $_->{'Format'} ||= '';
+    $_->{'Query'} ||= '';
 
     $_->{'Format'} =~ s/__(Web(?:Path|Base|BaseURL))__/scalar RT->Config->Get($1)/ge;
     # extract-message-catalog would "$1", so we avoid quotes for loc calls

commit e3e391e60c6778d28dc5cf8d4a1b8b47a3acbfc2
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Tue Sep 28 01:14:51 2010 -0400

    halve the # of SQL queries the MyReminders portlet does.

diff --git a/share/html/Elements/MyReminders b/share/html/Elements/MyReminders
index 4e96f44..d454a4e 100755
--- a/share/html/Elements/MyReminders
+++ b/share/html/Elements/MyReminders
@@ -49,34 +49,40 @@
 <&|/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 %>  <%$reminder->DueObj->Unix >0 ? '&bull; '.$reminder->DueObj->AgeAsString : '' |n %>
-</blockquote>
+<%$reminder->OwnerObj->Name %>
+<%$reminder->DueObj->Unix >0 ? '&bull; '.$reminder->DueObj->AgeAsString : '' |n %>
+</span>
 </td>
 </tr>
 % }
 % else {
     <div class="error"><div class="error">
-Couldn't find TargetObj for reminder <% $reminder->id %>.<br/>
-Maybe Organization config was changed? Please contact administrator.
+<&|/l, $reminder->id &>Couldn't find a ticket for reminder [_1].</&><br/>
+<&|/l&>Please contact your administrator.</&>
     </div></div>
-% }}}
+% }}
 </table>
 </&>
 
 <%init>
 return unless RT->Config->Get('EnableReminders');
 my $reminders = RT::Tickets->new($session{'CurrentUser'});
-$reminders->FromSQL('(Owner = "Nobody" OR Owner = "'.$session{'CurrentUser'}->Name.'")' .
+$reminders->FromSQL('(Owner = "Nobody" OR Owner = "'.$session{'CurrentUser'}->id.'")' .
     ' AND Type = "reminder" AND (Status = "new" OR Status = "open")'); 
 $reminders->OrderBy(FIELD => 'Due', ORDER => 'ASC');
 </%init>

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


More information about the Rt-commit mailing list