[Rt-commit] r3278 - in rt/branches/CHALDEA-EXPERIMENTAL: . html
html/Ticket html/Ticket/Elements lib/RT
alexmv at bestpractical.com
alexmv at bestpractical.com
Fri Jul 1 18:53:15 EDT 2005
Author: alexmv
Date: Fri Jul 1 18:53:15 2005
New Revision: 3278
Modified:
rt/branches/CHALDEA-EXPERIMENTAL/ (props changed)
rt/branches/CHALDEA-EXPERIMENTAL/html/CalPopup.html
rt/branches/CHALDEA-EXPERIMENTAL/html/Ticket/Elements/Reminders
rt/branches/CHALDEA-EXPERIMENTAL/html/Ticket/Reminders.html
rt/branches/CHALDEA-EXPERIMENTAL/lib/RT/Date.pm
Log:
r4606 at zoq-fot-pik: chmrr | 2005-07-01 18:57:33 -0400
* Editing of Reminders
* RT::Date has ->Date and ->Time methods now
* Calendar popup is always yyyy-mm-dd
Modified: rt/branches/CHALDEA-EXPERIMENTAL/html/CalPopup.html
==============================================================================
--- rt/branches/CHALDEA-EXPERIMENTAL/html/CalPopup.html (original)
+++ rt/branches/CHALDEA-EXPERIMENTAL/html/CalPopup.html Fri Jul 1 18:53:15 2005
@@ -21,7 +21,7 @@
% foreach my $day (@{$week}) {
<td>
% if ($day) {
-% my $datestr = join('-', $DisplayedYear, $DisplayedMonth+1, $day);
+% my $datestr = sprintf('%04d-%02d-%02d', $DisplayedYear, $DisplayedMonth+1, $day);
<dt><a href="javascript: updateParent('<%$datestr%>')"><%$day%></a></dt>
% }
</td>
Modified: rt/branches/CHALDEA-EXPERIMENTAL/html/Ticket/Elements/Reminders
==============================================================================
--- rt/branches/CHALDEA-EXPERIMENTAL/html/Ticket/Elements/Reminders (original)
+++ rt/branches/CHALDEA-EXPERIMENTAL/html/Ticket/Elements/Reminders Fri Jul 1 18:53:15 2005
@@ -2,6 +2,7 @@
$Ticket => undef
$id => undef
$ShowCompleted => 0
+$Edit => 0
</%args>
<%init>
@@ -20,6 +21,15 @@
elsif ( $reminder->Status eq 'resolved' && !$request_args->{ 'Complete-Reminder-' . $reminder->id } ) {
$Ticket->Reminders->Open($reminder);
}
+ elsif ( $reminder->Subject ne $request_args->{ 'Reminder-Subject-' . $reminder->id } ) {
+ $reminder->SetSubject( $request_args->{ 'Reminder-Subject-' . $reminder->id } ) ;
+ }
+ elsif ( $reminder->Owner != $request_args->{ 'Reminder-Owner-' . $reminder->id } ) {
+ $reminder->SetOwner( $request_args->{ 'Reminder-Owner-' . $reminder->id } , "Force" ) ;
+ }
+ elsif ( $reminder->DueObj->Date ne $request_args->{ 'Reminder-Due-' . $reminder->id } ) {
+ $reminder->SetDue( $request_args->{ 'Reminder-Due-' . $reminder->id } ) ;
+ }
}
}
@@ -49,6 +59,8 @@
% while (my $reminder = $reminder_collection->Next) {
% if ($reminder->Status eq 'resolved' && !$ShowCompleted) {
<input type="hidden" name="Complete-Reminder-<% $reminder->id %>" value="1" />
+% } elsif ($Edit) {
+<& SELF:EditEntry, Reminder => $reminder, Ticket => $Ticket &>
% } else {
<& SELF:ShowEntry, Reminder => $reminder, Ticket => $Ticket &>
% }
@@ -67,16 +79,32 @@
</div>
<div class="horizontal">
<label class="horizontal" for="NewReminder-Owner" ><&|/l&>Owner</&>:</label>
-<& /Elements/SelectOwner, Name => 'NewReminder-Owner', Queue => $Ticket->QueueObj &>
+<& /Elements/SelectOwner, Name => 'NewReminder-Owner', Queue => $Ticket->QueueObj, DefaultValue => 0 &>
</div>
<div class="horizontal">
<label class="horizontal" for="NewReminder-Due" ><&|/l&>Due</&> <&|/l&>(yyyy/mm/dd)</&>:</label>
<& /Elements/SelectDate, Name => "NewReminder-Due", Default => "" &>
</div>
</%method>
+<%method EditEntry>
+<%args>
+$Reminder
+$Ticket
+</%args>
+<input
+ type="checkbox"
+ name="Complete-Reminder-<%$Reminder->id%>"
+ <% $Reminder->Status eq 'resolved' ? '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/>
+</%method>
<%method ShowEntry>
<%args>
$Reminder
+$Ticket
</%args>
<input
type="checkbox"
Modified: rt/branches/CHALDEA-EXPERIMENTAL/html/Ticket/Reminders.html
==============================================================================
--- rt/branches/CHALDEA-EXPERIMENTAL/html/Ticket/Reminders.html (original)
+++ rt/branches/CHALDEA-EXPERIMENTAL/html/Ticket/Reminders.html Fri Jul 1 18:53:15 2005
@@ -53,7 +53,7 @@
title_class=> 'inverse',
color => "#666699" &>
-<& /Ticket/Elements/Reminders, Ticket => $Ticket, ShowCompleted => 1 &>
+<& /Ticket/Elements/Reminders, Ticket => $Ticket, ShowCompleted => 1, Edit => 1 &>
</&>
<& /Elements/Submit, Label => 'Save'&>
</form>
Modified: rt/branches/CHALDEA-EXPERIMENTAL/lib/RT/Date.pm
==============================================================================
--- rt/branches/CHALDEA-EXPERIMENTAL/lib/RT/Date.pm (original)
+++ rt/branches/CHALDEA-EXPERIMENTAL/lib/RT/Date.pm Fri Jul 1 18:53:15 2005
@@ -555,6 +555,44 @@
# }}}
+# {{{ sub Date
+
+=head2 Date
+
+Takes nothing
+
+Returns the object's date in yyyy-mm-dd format; this is the same as
+the ISO format without the time
+
+=cut
+
+sub Date {
+ my $self = shift;
+ my ($date, $time) = split ' ', $self->ISO;
+ return $date;
+}
+
+# }}}}
+
+# {{{ sub Time
+
+=head2 Time
+
+Takes nothing
+
+Returns the object's time in hh:mm:ss format; this is the same as
+the ISO format without the date
+
+=cut
+
+sub Time {
+ my $self = shift;
+ my ($date, $time) = split ' ', $self->ISO;
+ return $time;
+}
+
+# }}}}
+
# {{{ sub W3CDTF
=head2 W3CDTF
More information about the Rt-commit
mailing list