[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.7-934-gfdbe6f9
Jesse Vincent
jesse at bestpractical.com
Fri Dec 17 13:26:23 EST 2010
The branch, 3.9-trunk has been updated
via fdbe6f9d481b5b18140d0f794c3f1f43e054847d (commit)
via eaabcead5f99f20deb8725934a6f78b6b4f5b602 (commit)
via 0ed61badfb64d62b6a9feb20a323746a5b51937e (commit)
via 3c1e1ca7103c7309f12d4260dde9819318dec2f4 (commit)
via 84668d515757cd89b2e3bf76966566d01ad95ed5 (commit)
via 16645c0c25f4dca706d3bc78c5553a4c1ae389e1 (commit)
via e48e6daca9b8284eec6f212f4340f3065961f90b (commit)
via 7a0e84c263bf5e410cc51f88261d6d37c7e2fb50 (commit)
via 8964cf3f52edaa099308f4eb6450de3c35307608 (commit)
from f939e1eb4868f541583c0a21d128ee3c7b332d88 (commit)
Summary of changes:
lib/RT/Reminders.pm | 77 +++++++-------
lib/RT/Ticket_Overlay.pm | 2 +-
share/html/Elements/MyReminders | 34 +-----
share/html/Elements/{MyReminders => ShowReminders} | 81 ++++++++------
share/html/Elements/Tabs | 6 +
share/html/Ticket/Elements/Reminders | 116 ++++++++++++--------
share/html/Ticket/Reminders.html | 3 +-
.../index.html => Tools/MyReminders.html} | 14 ++-
8 files changed, 176 insertions(+), 157 deletions(-)
copy share/html/Elements/{MyReminders => ShowReminders} (52%)
mode change 100755 => 100644
copy share/html/{Dashboards/index.html => Tools/MyReminders.html} (84%)
- Log -----------------------------------------------------------------
commit 8964cf3f52edaa099308f4eb6450de3c35307608
Author: Christian Loos <cloos at netcologne.de>
Date: Thu Dec 16 13:05:08 2010 +0100
reminder code cleanups
diff --git a/lib/RT/Reminders.pm b/lib/RT/Reminders.pm
index 13dd12a..70cf67c 100644
--- a/lib/RT/Reminders.pm
+++ b/lib/RT/Reminders.pm
@@ -52,7 +52,6 @@ use base qw/RT::Base/;
our $REMINDER_QUEUE = 'General';
-
sub new {
my $class = shift;
my $self = {};
@@ -61,7 +60,6 @@ sub new {
return($self);
}
-
sub Ticket {
my $self = shift;
$self->{'_ticket'} = shift if (@_);
@@ -74,10 +72,9 @@ sub TicketObj {
$self->{'_ticketobj'} = RT::Ticket->new($self->CurrentUser);
$self->{'_ticketobj'}->Load($self->Ticket);
}
- return $self->{'_ticketobj'};
+ return $self->{'_ticketobj'};
}
-
=head2 Collection
Returns an RT::Tickets object containing reminders for this object's "Ticket"
@@ -88,8 +85,8 @@ sub Collection {
my $self = shift;
my $col = RT::Tickets->new($self->CurrentUser);
- my $query = 'Type = "reminder" AND RefersTo = "'.$self->Ticket.'"';
-
+ my $query = 'Type = "reminder" AND RefersTo = "'.$self->Ticket.'"';
+
$col->FromSQL($query);
$col->OrderBy( FIELD => 'Due' );
@@ -107,55 +104,56 @@ Takes
Owner
Due
-
=cut
-
sub Add {
my $self = shift;
- my %args = ( Subject => undef,
- Owner => undef,
- Due => undef,
- @_);
+ my %args = (
+ Subject => undef,
+ Owner => undef,
+ Due => undef,
+ @_
+ );
my $reminder = RT::Ticket->new($self->CurrentUser);
- $reminder->Create( Subject => $args{'Subject'},
- Owner => $args{'Owner'},
- Due => $args{'Due'},
- RefersTo => $self->Ticket,
- Type => 'reminder',
- Queue => $self->TicketObj->Queue,
-
- );
- $self->TicketObj->_NewTransaction(Type => 'AddReminder',
- Field => 'RT::Ticket',
- NewValue => $reminder->id);
-
-
+ $reminder->Create(
+ Subject => $args{'Subject'},
+ Owner => $args{'Owner'},
+ Due => $args{'Due'},
+ RefersTo => $self->Ticket,
+ Type => 'reminder',
+ Queue => $self->TicketObj->Queue,
+ );
+ $self->TicketObj->_NewTransaction(
+ Type => 'AddReminder',
+ Field => 'RT::Ticket',
+ NewValue => $reminder->id
+ );
}
-
sub Open {
my $self = shift;
- my $reminder = shift;
+ my $reminder = shift;
$reminder->SetStatus('open');
- $self->TicketObj->_NewTransaction(Type => 'OpenReminder',
- Field => 'RT::Ticket',
- NewValue => $reminder->id);
+ $self->TicketObj->_NewTransaction(
+ Type => 'OpenReminder',
+ Field => 'RT::Ticket',
+ NewValue => $reminder->id
+ );
}
-
sub Resolve {
my $self = shift;
my $reminder = shift;
$reminder->SetStatus('resolved');
- $self->TicketObj->_NewTransaction(Type => 'ResolveReminder',
- Field => 'RT::Ticket',
- NewValue => $reminder->id);
+ $self->TicketObj->_NewTransaction(
+ Type => 'ResolveReminder',
+ Field => 'RT::Ticket',
+ NewValue => $reminder->id
+ );
}
- RT::Base->_ImportOverlays();
-
+RT::Base->_ImportOverlays();
1;
commit 7a0e84c263bf5e410cc51f88261d6d37c7e2fb50
Author: Christian Loos <cloos at netcologne.de>
Date: Thu Dec 16 13:17:15 2010 +0100
only record transaction on success
diff --git a/lib/RT/Reminders.pm b/lib/RT/Reminders.pm
index 70cf67c..49d8183 100644
--- a/lib/RT/Reminders.pm
+++ b/lib/RT/Reminders.pm
@@ -116,7 +116,7 @@ sub Add {
);
my $reminder = RT::Ticket->new($self->CurrentUser);
- $reminder->Create(
+ my ( $status, $msg ) = $reminder->Create(
Subject => $args{'Subject'},
Owner => $args{'Owner'},
Due => $args{'Due'},
@@ -128,30 +128,33 @@ sub Add {
Type => 'AddReminder',
Field => 'RT::Ticket',
NewValue => $reminder->id
- );
+ ) if $status;
+ return ( $status, $msg );
}
sub Open {
my $self = shift;
my $reminder = shift;
- $reminder->SetStatus('open');
+ my ( $status, $msg ) = $reminder->SetStatus('open');
$self->TicketObj->_NewTransaction(
Type => 'OpenReminder',
Field => 'RT::Ticket',
NewValue => $reminder->id
- );
+ ) if $status;
+ return ( $status, $msg );
}
sub Resolve {
my $self = shift;
my $reminder = shift;
- $reminder->SetStatus('resolved');
+ my ( $status, $msg ) = $reminder->SetStatus('resolved');
$self->TicketObj->_NewTransaction(
Type => 'ResolveReminder',
Field => 'RT::Ticket',
NewValue => $reminder->id
- );
+ ) if $status;
+ return ( $status, $msg );
}
RT::Base->_ImportOverlays();
commit e48e6daca9b8284eec6f212f4340f3065961f90b
Author: Christian Loos <cloos at netcologne.de>
Date: Thu Dec 16 13:36:21 2010 +0100
don't record link transaction on reminder create
Don't record an link transaction on reminder create because the reminder
themself records an transaction of type 'AddReminder'
diff --git a/lib/RT/Ticket_Overlay.pm b/lib/RT/Ticket_Overlay.pm
index e95481f..22dbf20 100755
--- a/lib/RT/Ticket_Overlay.pm
+++ b/lib/RT/Ticket_Overlay.pm
@@ -636,7 +636,7 @@ sub Create {
my ( $wval, $wmsg ) = $self->_AddLink(
Type => $LINKTYPEMAP{$type}->{'Type'},
$LINKTYPEMAP{$type}->{'Mode'} => $link,
- Silent => !$args{'_RecordTransaction'},
+ Silent => !$args{'_RecordTransaction'} || $self->Type eq 'reminder',
'Silent'. ( $LINKTYPEMAP{$type}->{'Mode'} eq 'Base'? 'Target': 'Base' )
=> 1,
);
commit 16645c0c25f4dca706d3bc78c5553a4c1ae389e1
Author: Christian Loos <cloos at netcologne.de>
Date: Thu Dec 16 14:46:15 2010 +0100
create ShowReminders element and use it in MyReminders
diff --git a/share/html/Elements/MyReminders b/share/html/Elements/MyReminders
index 00ab113..8b20fbe 100755
--- a/share/html/Elements/MyReminders
+++ b/share/html/Elements/MyReminders
@@ -49,40 +49,11 @@
<&|/Widgets/TitleBox,
class => 'reminders',
title => loc("Reminders") &>
-<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) {
+<& /Elements/ShowReminders, OnlyOverdue => 1 &>
-</%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 />
-<& /Elements/ShowUser, User => $reminder->OwnerObj &>
-<%$reminder->DueObj->Unix >0 ? '• '.$reminder->DueObj->AgeAsString : '' |n %>
-</span>
-</td>
-</tr>
-% }
-% else {
- <div class="error"><div class="error">
-<&|/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'}->id.'")' .
- ' AND Type = "reminder" AND (Status = "new" OR Status = "open")');
-$reminders->OrderBy(FIELD => 'Due', ORDER => 'ASC');
</%init>
diff --git a/share/html/Elements/MyReminders b/share/html/Elements/ShowReminders
old mode 100755
new mode 100644
similarity index 52%
copy from share/html/Elements/MyReminders
copy to share/html/Elements/ShowReminders
index 00ab113..51c1614
--- a/share/html/Elements/MyReminders
+++ b/share/html/Elements/ShowReminders
@@ -3,7 +3,7 @@
%# COPYRIGHT:
%#
%# This software is Copyright (c) 1996-2010 Best Practical Solutions, LLC
-%# <jesse at bestpractical.com>
+%# <jesse at bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
%#
@@ -17,7 +17,7 @@
%#
%# 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
+%# 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
@@ -39,50 +39,63 @@
%# 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,
+%# 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 }}}
-%# DEPRECATED
-<&|/Widgets/TitleBox,
- class => 'reminders',
- title => loc("Reminders") &>
-<table width="100%" class="reminders">
-<%perl>
+% if ( $reminders->Count ) {
+<table border="0" cellpadding="1" cellspacing="0" width="100%" class="collection-as-table">
+<tr>
+<th class="collection-as-table"><&|/l&>Reminder</&></th>
+<th class="collection-as-table"><&|/l&>Due</&></th>
+<th class="collection-as-table"><&|/l&>Ticket</&></th>
+</tr>
+<%PERL>
my $i =0;
-while (my $reminder = $reminders->Next) {
+while ( my $reminder = $reminders->Next ) {
$i++;
-my $targets = RT::Tickets->new($session{'CurrentUser'});
-$targets->FromSQL("ReferredToBy = ".$reminder->id);
+my $dueobj = $reminder->DueObj;
+my $overdue = $dueobj->Unix > 0 && $dueobj->Diff < 0 ? 1 : 0;
-if (my $ticket= $targets->First) {
+my $targets = RT::Tickets->new($session{'CurrentUser'});
+$targets->FromSQL( "ReferredToBy = " . $reminder->id );
-</%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 />
-<& /Elements/ShowUser, User => $reminder->OwnerObj &>
-<%$reminder->DueObj->Unix >0 ? '• '.$reminder->DueObj->AgeAsString : '' |n %>
-</span>
+if ( my $ticket= $targets->First ) {
+</%PERL>
+<tr class="<% $i%2 ? 'oddline' : 'evenline' %>">
+<td class="collection-as-table">
+<a href="<% RT->Config->Get('WebPath') %>/Ticket/Reminders.html?id=<% $ticket->id %>"><% $reminder->Subject %></a>
+</td>
+<td class="collection-as-table">
+<% $overdue ? '<span class="overdue">' : '' |n %><% $dueobj->AgeAsString || loc('Not set') %><% $overdue ? '</span>' : '' |n %>
+</td>
+<td class="collection-as-table">
+<a href="<% RT->Config->Get( 'WebPath' ) %>/Ticket/Display.html?id=<% $ticket->id %>">#<% $ticket->Id %>: <% $ticket->Subject %></a>
+</td>
+% } else {
+<td colspan="3" class="collection-as-table>
+<div class="error"><div class="error">Couldn't find Ticket for reminder <% $reminder->id %>. Please contact administrator.</div></div>
</td>
+% }
</tr>
% }
-% else {
- <div class="error"><div class="error">
-<&|/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');
+<%INIT>
my $reminders = RT::Tickets->new($session{'CurrentUser'});
-$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>
+my $tsql = 'Type = "reminder"' .
+ ' AND ( Owner = "Nobody" OR Owner ="' . $session{'CurrentUser'}->id . '")' .
+ ' AND ( Status = "new" OR Status = "open" )';
+
+$tsql .= ' AND Due < "now"' if $OnlyOverdue;
+
+$reminders->FromSQL($tsql);
+$reminders->OrderBy( FIELD => 'Due', ORDER => 'ASC' );
+</%INIT>
+
+<%ARGS>
+$OnlyOverdue => 0
+</%ARGS>
commit 84668d515757cd89b2e3bf76966566d01ad95ed5
Author: Christian Loos <cloos at netcologne.de>
Date: Thu Dec 16 15:19:26 2010 +0100
create reminder view tool and link it to MyReminders
diff --git a/share/html/Elements/MyReminders b/share/html/Elements/MyReminders
index 8b20fbe..c3e4450 100755
--- a/share/html/Elements/MyReminders
+++ b/share/html/Elements/MyReminders
@@ -48,7 +48,8 @@
%# DEPRECATED
<&|/Widgets/TitleBox,
class => 'reminders',
- title => loc("Reminders") &>
+ title => loc("Reminders"),
+ title_href => RT->Config->Get('WebPath') . '/Tools/MyReminders.html' &>
<& /Elements/ShowReminders, OnlyOverdue => 1 &>
diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index 59a4b9d..06015c4 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -111,6 +111,12 @@ if ( $request_path !~ m{^/SelfService/} ) {
$tools->child( my_day => title => loc('My Day'), path => '/Tools/MyDay.html', sort_order => 5,
description => loc('Easy updating of your open tickets') );
+ if ( RT->Config->Get('EnableReminders') )
+ {
+ $tools->child( my_reminders => title => loc('My Reminders'), path => '/Tools/MyReminders.html', sort_order => 6,
+ description => loc('Easy viewing of your reminders') );
+ }
+
$tools->child( offline => title => loc('Offline'), path => '/Tools/Offline.html', sort_order => 10,
description => loc('Create tickets offline') );
diff --git a/share/html/Elements/MyReminders b/share/html/Tools/MyReminders.html
old mode 100755
new mode 100644
similarity index 83%
copy from share/html/Elements/MyReminders
copy to share/html/Tools/MyReminders.html
index 8b20fbe..5415cdf
--- a/share/html/Elements/MyReminders
+++ b/share/html/Tools/MyReminders.html
@@ -3,7 +3,7 @@
%# COPYRIGHT:
%#
%# This software is Copyright (c) 1996-2010 Best Practical Solutions, LLC
-%# <jesse at bestpractical.com>
+%# <jesse at bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
%#
@@ -17,7 +17,7 @@
%#
%# 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
+%# 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
@@ -39,21 +39,17 @@
%# 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,
+%# 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 }}}
-%# DEPRECATED
-<&|/Widgets/TitleBox,
- class => 'reminders',
- title => loc("Reminders") &>
+<& /Elements/Header, Title => loc('My reminders') &>
+<& /Elements/Tabs &>
-<& /Elements/ShowReminders, OnlyOverdue => 1 &>
+<& /Elements/ShowReminders, OnlyOverdue => 0 &>
-</&>
-
-<%init>
+<%INIT>
return unless RT->Config->Get('EnableReminders');
-</%init>
+</%INIT>
commit 3c1e1ca7103c7309f12d4260dde9819318dec2f4
Author: Christian Loos <cloos at netcologne.de>
Date: Thu Dec 16 15:26:56 2010 +0100
more constistent naming of save button
diff --git a/share/html/Ticket/Reminders.html b/share/html/Ticket/Reminders.html
index 64fef40..fae8105 100755
--- a/share/html/Ticket/Reminders.html
+++ b/share/html/Ticket/Reminders.html
@@ -57,7 +57,9 @@
<& /Ticket/Elements/Reminders, Ticket => $Ticket, ShowCompleted => 1, Edit => 1 &>
</&>
-<& /Elements/Submit, Label => loc('Save') &>
+<& /Elements/Submit,
+ Label => loc('Save Changes'),
+ Caption => loc("If you've updated anything above, be sure to") &>
</form>
commit 0ed61badfb64d62b6a9feb20a323746a5b51937e
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Fri Dec 17 12:12:03 2010 -0500
Remove a new "Be sure to" since it's not actually that widely used or
easy to loc
diff --git a/share/html/Ticket/Reminders.html b/share/html/Ticket/Reminders.html
index fae8105..f728512 100755
--- a/share/html/Ticket/Reminders.html
+++ b/share/html/Ticket/Reminders.html
@@ -58,8 +58,7 @@
<& /Ticket/Elements/Reminders, Ticket => $Ticket, ShowCompleted => 1, Edit => 1 &>
</&>
<& /Elements/Submit,
- Label => loc('Save Changes'),
- Caption => loc("If you've updated anything above, be sure to") &>
+ Label => loc('Save Changes') &>
</form>
commit eaabcead5f99f20deb8725934a6f78b6b4f5b602
Author: Christian Loos <cloos at netcologne.de>
Date: Thu Dec 16 16:25:18 2010 +0100
redesign ticket reminder element
diff --git a/share/html/Ticket/Elements/Reminders b/share/html/Ticket/Elements/Reminders
index 43da890..33aa480 100644
--- a/share/html/Ticket/Elements/Reminders
+++ b/share/html/Ticket/Elements/Reminders
@@ -76,23 +76,26 @@ if ( $request_args->{'update-reminders'} ) {
$reminder->SetOwner( $request_args->{ 'Reminder-Owner-' . $reminder->id } , "Force" ) ;
}
- if ( exists( $request_args->{ 'Reminder-Due-' . $reminder->id } ) && ( $reminder->DueObj->Date ne $request_args->{ 'Reminder-Due-' . $reminder->id } )) {
- $reminder->SetDue( $request_args->{ 'Reminder-Due-' . $reminder->id } ) ;
+ if ( exists( $request_args->{ 'Reminder-Due-' . $reminder->id } ) && $request_args->{ 'Reminder-Due-' . $reminder->id } ne '' ) {
+ my $DateObj = RT::Date->new( $session{'CurrentUser'} );
+ $DateObj->Set(
+ Format => 'unknown',
+ Value => $request_args->{ 'Reminder-Due-' . $reminder->id }
+ );
+ if ( defined $DateObj->Unix && $DateObj->Unix != $reminder->DueObj->Unix ) {
+ $reminder->SetDue( $DateObj->ISO );
+ }
}
}
}
if ( $request_args->{'NewReminder-Subject'} ) {
my $due_obj = RT::Date->new( $session{'CurrentUser'} );
- my $date = Time::ParseDate::parsedate(
- $request_args->{'NewReminder-Due'},
- UK => RT->Config->Get('DateDayBeforeMonth'),
- PREFER_PAST => 0,
- PREFER_FUTURE => 1
+ $due_obj->Set(
+ Format => 'unknown',
+ Value => $request_args->{'NewReminder-Due'}
);
- $due_obj->Set( Value => $date, Format => 'unix' );
my ( $add_id, $msg, $txnid ) = $Ticket->Reminders->Add(
-
Subject => $request_args->{'NewReminder-Subject'},
Owner => $request_args->{'NewReminder-Owner'},
Due => $due_obj->ISO
@@ -105,42 +108,51 @@ $reminder_collection = $Ticket->Reminders->Collection;
</%init>
<input type="hidden" class="hidden" name="id" value="<% $Ticket->id %>" />
<input type="hidden" class="hidden" name="update-reminders" value="1" />
-<div>
-% while (my $reminder = $reminder_collection->Next) {
-% if ($reminder->Status eq 'resolved' && !$ShowCompleted) {
-<input type="hidden" class="hidden" name="Complete-Reminder-<% $reminder->id %>" value="1" />
-% } elsif ($Edit) {
-<& SELF:EditEntry, Reminder => $reminder, Ticket => $Ticket &>
-% } else {
-<& SELF:ShowEntry, Reminder => $reminder, Ticket => $Ticket &>
-% }
+<table border="0" cellpadding="1" cellspacing="0" class="collection-as-table"<% $Edit ? ' style="width: auto;"' : '' |n %>>
+<tr>
+% if ( $Edit ) {
+<th class="collection-as-table" colspan="5"><&|/l&>Reminders</&></th>
+% } else {
+<th class="collection-as-table"></th>
+<th class="collection-as-table"><&|/l&>Reminder</&></th>
+<th class="collection-as-table"><&|/l&>Due</&></th>
+<th class="collection-as-table"><&|/l&>Owner</&></th>
+% }
+</tr>
+% my ( $i, $visible ) = 0;
+% while ( my $reminder = $reminder_collection->Next ) {
+% $i++;
+% if ( $reminder->Status eq 'resolved' && !$ShowCompleted ) {
+<tr class="hidden"><td><input type="hidden" class="hidden" name="Complete-Reminder-<% $reminder->id %>" value="1" /></td></tr>
+% $i++;
+% } elsif ($Edit) {
+<& SELF:EditEntry, Reminder => $reminder, Ticket => $Ticket, Index => $i &>
+% $visible++;
+% } else {
+<& SELF:ShowEntry, Reminder => $reminder, Ticket => $Ticket, Index => $i &>
+% $visible++;
% }
-% if ($reminder_collection->Count) {
-<i><&|/l&>(Check box to delete)</&></i><br /><br />
% }
-</div>
-<div>
+</table>
+% if ( $visible > 0 ) {
+<i><&|/l&>(Check box to complete)</&></i><br /><br />
+% }
<&|/l&>New reminder:</&>
<& SELF:NewReminder, Ticket => $Ticket &>
-</div>
<%method NewReminder>
<%args>
$Ticket
</%args>
<table>
-<tr class="input-row">
-<td class="label"><label class="horizontal" for="NewReminder-Subject" ><&|/l&>Subject</&>:</label></td>
-<td class="value"><input type="text" size="15" name="NewReminder-Subject" id="NewReminder-Subject" /></td>
+<tr>
+<td class="label"><&|/l&>Subject</&>:</td>
+<td class="entry" colspan="3"><input type="text" size="50" name="NewReminder-Subject" id="NewReminder-Subject" /></td>
</tr>
-<tr class="input-row">
-<td class="label">
-<label class="horizontal" for="NewReminder-Owner" ><&|/l&>Owner</&>:</label></td><td class="value">
-<& /Elements/SelectOwner, Name => 'NewReminder-Owner', QueueObj => $Ticket->QueueObj, Default=>$session{'CurrentUser'}->id, DefaultValue => 0 &>
-</td>
-</tr>
-<tr class="input-row">
-<td class="label"><label class="horizontal" for="NewReminder-Due" ><&|/l&>Due</&>:</label></td>
-<td class="value"><& /Elements/SelectDate, Name => "NewReminder-Due", Default => "" &></td>
+<tr>
+<td class="label"><&|/l&>Owner</&>:</td>
+<td class="entry"><& /Elements/SelectOwner, Name => 'NewReminder-Owner', QueueObj => $Ticket->QueueObj, Default=>$session{'CurrentUser'}->id, DefaultValue => 0 &></td>
+<td class="label"><&|/l&>Due</&>:</td>
+<td class="entry"><& /Elements/SelectDate, Name => "NewReminder-Due", Default => "" &></td>
</tr>
</table>
</%method>
@@ -148,22 +160,33 @@ $Ticket
<%args>
$Reminder
$Ticket
+$Index
</%args>
-<input type="checkbox" name="Complete-Reminder-<%$Reminder->id%>" \
- <% $Reminder->Status eq 'resolved' ? 'checked="checked"' : '' %> />
- <input type="text" size="15" name="Reminder-Subject-<% $Reminder->id %>" value="<%$Reminder->Subject%>" /> •
- <& /Elements/SelectOwner, Name => 'Reminder-Owner-'.$Reminder->id, Queue => $Ticket->QueueObj, Default => $Reminder->Owner, DefaultValue => 0 &>
- <& /Elements/SelectDate, Name => 'Reminder-Due-'.$Reminder->id, Default => $Reminder->DueObj->Date &>
- (<%$Reminder->DueObj->Unix>0 ? $Reminder->DueObj->AgeAsString : '' %>)<br />
+<tr class="<% $Index%2 ? 'oddline' : 'evenline' %>">
+<td class="entry"><input type="checkbox" name="Complete-Reminder-<% $Reminder->id %>" <% $Reminder->Status eq 'resolved' ? 'checked="checked"' : '' |n %> /></td>
+<td class="label"><&|/l&>Subject</&>:</td>
+<td class="entry" colspan="3"><input type="text" size="50" name="Reminder-Subject-<% $Reminder->id %>" value="<% $Reminder->Subject %>" /></td>
+</tr>
+<tr class="<% $Index%2 ? 'oddline' : 'evenline' %>">
+<td class="entry"> </td>
+<td class="label"><&|/l&>Owner</&>:</td>
+<td class="entry"><& /Elements/SelectOwner, Name => 'Reminder-Owner-'.$Reminder->id, QueueObj => $Ticket->QueueObj, Default => $Reminder->Owner, DefaultValue => 0 &></td>
+<td class="label"><&|/l&>Due</&>:</td>
+<td class="entry"><& /Elements/SelectDate, Name => 'Reminder-Due-'.$Reminder->id &> (<% $Reminder->DueObj->AsString %>)</td>
+</tr>
</%method>
<%method ShowEntry>
<%args>
$Reminder
$Ticket
+$Index
</%args>
-<input type="checkbox" name="Complete-Reminder-<%$Reminder->id%>" \
- <% $Reminder->Status eq 'resolved' ? 'checked="checked"' : '' %> />
- <%$Reminder->Subject%> • \
- <& /Elements/ShowUser, User => $Reminder->OwnerObj &> \
- <%$Reminder->DueObj->Unix>0 ? "• ". $Reminder->DueObj->AgeAsString : '' |n%><br />
+% my $dueobj = $Reminder->DueObj;
+% my $overdue = $dueobj->Unix > 0 && $dueobj->Diff < 0 ? 1 : 0;
+<tr class="<% $Index%2 ? 'oddline' : 'evenline' %>">
+<td class="collection-as-table"><input type="checkbox" name="Complete-Reminder-<% $Reminder->id %>" <% $Reminder->Status eq 'resolved' ? 'checked="checked"' : '' |n %> /></td>
+<td class="collection-as-table"><% $Reminder->Subject %></td>
+<td class="collection-as-table"><% $overdue ? '<span class="overdue">' : '' |n %><% $dueobj->AgeAsString || loc('Not set') %><% $overdue ? '</span>' : '' |n %></td>
+<td class="collection-as-table"><& /Elements/ShowUser, User => $Reminder->OwnerObj &></td>
+</tr>
</%method>
commit fdbe6f9d481b5b18140d0f794c3f1f43e054847d
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Fri Dec 17 13:15:28 2010 -0500
Fix a warning
diff --git a/share/html/Ticket/Elements/Reminders b/share/html/Ticket/Elements/Reminders
index 33aa480..5d47f5f 100644
--- a/share/html/Ticket/Elements/Reminders
+++ b/share/html/Ticket/Elements/Reminders
@@ -119,7 +119,8 @@ $reminder_collection = $Ticket->Reminders->Collection;
<th class="collection-as-table"><&|/l&>Owner</&></th>
% }
</tr>
-% my ( $i, $visible ) = 0;
+% my $i = 0;
+% my $visible = 0;
% while ( my $reminder = $reminder_collection->Next ) {
% $i++;
% if ( $reminder->Status eq 'resolved' && !$ShowCompleted ) {
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list