[Rt-commit] r3277 - in rt/branches/CHALDEA-EXPERIMENTAL: . bin html
html/Elements html/Ticket html/Ticket/Elements lib/RT
alexmv at bestpractical.com
alexmv at bestpractical.com
Fri Jul 1 16:12:56 EDT 2005
Author: alexmv
Date: Fri Jul 1 16:12:56 2005
New Revision: 3277
Added:
rt/branches/CHALDEA-EXPERIMENTAL/html/CalPopup.html
rt/branches/CHALDEA-EXPERIMENTAL/html/rt.js
Modified:
rt/branches/CHALDEA-EXPERIMENTAL/ (props changed)
rt/branches/CHALDEA-EXPERIMENTAL/bin/webmux.pl.in
rt/branches/CHALDEA-EXPERIMENTAL/html/Elements/Header
rt/branches/CHALDEA-EXPERIMENTAL/html/Elements/SelectDate
rt/branches/CHALDEA-EXPERIMENTAL/html/Ticket/Create.html
rt/branches/CHALDEA-EXPERIMENTAL/html/Ticket/Elements/Reminders
rt/branches/CHALDEA-EXPERIMENTAL/lib/RT/Reminders.pm
Log:
r4602 at zoq-fot-pik: chmrr | 2005-07-01 16:17:13 -0400
* Fix syntax error in html/Ticket/Elements/Reminders
* Fix missing 'Obj' on TicketObj in lib/RT/Reminders.pm
* Move JS into separate file
* Calendar popups
Modified: rt/branches/CHALDEA-EXPERIMENTAL/bin/webmux.pl.in
==============================================================================
--- rt/branches/CHALDEA-EXPERIMENTAL/bin/webmux.pl.in (original)
+++ rt/branches/CHALDEA-EXPERIMENTAL/bin/webmux.pl.in Fri Jul 1 16:12:56 2005
@@ -115,7 +115,7 @@
$r->filename( File::Spec::Unix->catfile( $r->filename, 'index.html' ) );
}
elsif (defined( $r->content_type )) {
- $r->content_type =~ m!(^text/|\bxml\b)!i or return -1;
+ $r->content_type =~ m!(^text/|\bxml\b|\bjavascript\b)!i or return -1;
}
Module::Refresh->refresh if $RT::DevelMode;
Added: rt/branches/CHALDEA-EXPERIMENTAL/html/CalPopup.html
==============================================================================
--- (empty file)
+++ rt/branches/CHALDEA-EXPERIMENTAL/html/CalPopup.html Fri Jul 1 16:12:56 2005
@@ -0,0 +1,83 @@
+<& /Elements/Header &>
+<script>
+function updateParent(strItem) {
+ window.opener.document.getElementById('<%$field%>').value = strItem;
+ window.close();
+}
+</script>
+<a href="javascript: window.close();">close window</a>
+<br><br>
+<div align="center">
+<div class="table-wrapper">
+<table>
+ <caption><%$months[$DisplayedMonth]%> <%$DisplayedYear%></caption>
+ <tr>
+% foreach my $wday (@weekdays) {
+ <th><%$wday%></th>
+% }
+ </tr>
+% foreach my $week (@cal) {
+ <tr>
+% foreach my $day (@{$week}) {
+ <td>
+% if ($day) {
+% my $datestr = join('-', $DisplayedYear, $DisplayedMonth+1, $day);
+ <dt><a href="javascript: updateParent('<%$datestr%>')"><%$day%></a></dt>
+% }
+ </td>
+% } #foreach $day
+ </tr>
+% } # foreach $week
+ <tr>
+ <td colspan="2"><a href="CalPopup.html?DisplayedMonth=<%$prev_month%>&DisplayedYear=<%$prev_year%>&field=<%$field%>">Previous</a></td>
+ <td colspan="3"> </td>
+ <td colspan="2"><a href="CalPopup.html?DisplayedMonth=<%$next_month%>&DisplayedYear=<%$next_year%>&field=<%$field%>">Next</a></td>
+</table>
+</div>
+</div>
+
+<%init>
+use Calendar::Simple;
+my @today = localtime(time());
+
+my @weekdays = (loc('Sun'), loc('Mon'), loc('Tue'), loc('Wed'), loc('Thu'),
+ loc('Fri'), loc('Sat'));
+my @months = (loc('January'), loc('February'), loc('March'), loc('April'),
+ loc('May'), loc('June'), loc('July'), loc('August'),
+ loc('September'), loc('October'), loc('November'),
+ loc('December'));
+
+unless ($DisplayedYear) {
+ $DisplayedMonth = $today[4];
+ $DisplayedYear = ($today[5] + 1900);
+}
+
+my ($prev_year, $next_year, $prev_month, $next_month);
+$prev_month = $next_month = $DisplayedMonth;
+$prev_year = $next_year = $DisplayedYear;
+
+$next_month++;
+$prev_month--;
+
+if ($DisplayedMonth == 11) {
+ $next_year++;
+ $next_month = 0;
+ }
+elsif ($DisplayedMonth == 0) {
+ $prev_month = 11;
+ $prev_year--;
+
+
+ }
+
+
+
+
+my @cal = calendar($DisplayedMonth, $DisplayedYear);
+
+</%init>
+<%args>
+$field => 'none'
+$DisplayedMonth => undef
+$DisplayedYear => undef
+</%args>
Modified: rt/branches/CHALDEA-EXPERIMENTAL/html/Elements/Header
==============================================================================
--- rt/branches/CHALDEA-EXPERIMENTAL/html/Elements/Header (original)
+++ rt/branches/CHALDEA-EXPERIMENTAL/html/Elements/Header Fri Jul 1 16:12:56 2005
@@ -53,18 +53,7 @@
<link rel="shortcut icon" href="<%$RT::WebImagesURL%>/favicon.png" type="image/png">
<link rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/webrt.css" type="text/css">
-<script>
-function hideshow(num) {
- idstring = "element-" + num;
- chunk = document.getElementById(idstring);
- if ( chunk.style.display == "none") {
- chunk.style.display = chunk.style.tag;
- } else {
- chunk.style.tag = chunk.style.display;
- chunk.style.display = "none";
- }
-}
-</script>
+<script type="text/javascript" src="<%$RT::WebPath%>/rt.js"></script>
<& /Elements/Callback, _CallbackName => 'Head', %ARGS &>
</HEAD>
<BODY BGCOLOR="<%$BgColor%>"
Modified: rt/branches/CHALDEA-EXPERIMENTAL/html/Elements/SelectDate
==============================================================================
--- rt/branches/CHALDEA-EXPERIMENTAL/html/Elements/SelectDate (original)
+++ rt/branches/CHALDEA-EXPERIMENTAL/html/Elements/SelectDate Fri Jul 1 16:12:56 2005
@@ -43,7 +43,14 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<INPUT NAME="<%$Name%>" VALUE="<%$Default%>" size=<%$Size%>>
+<input type="text" id="<% $Name %>" name="<% $Name %>" value="<% $Default %>" size="<% $Size %>">
+<script language="javascript" type="text/javascript">
+<!--
+document.write('<a href="javascript:');
+document.write("openCalWindow('<% $Name %>');");
+document.write('">pick</a>');
+// -->
+</script>
<%init>
unless ((defined $Default) or
Modified: rt/branches/CHALDEA-EXPERIMENTAL/html/Ticket/Create.html
==============================================================================
--- rt/branches/CHALDEA-EXPERIMENTAL/html/Ticket/Create.html (original)
+++ rt/branches/CHALDEA-EXPERIMENTAL/html/Ticket/Create.html Fri Jul 1 16:12:56 2005
@@ -208,9 +208,8 @@
color => "#663366" &>
<TABLE BORDER=0>
-<TR><TD ALIGN=RIGHT><&|/l&>Starts</&>:</TD><TD><input size=10 name="Starts" value="<% $ARGS{Starts} %>"></TD></TR>
-<TR><TD ALIGN=RIGHT><&|/l&>Due</&>:</TD><TD><input size=10 name="Due" value="<%
-$ARGS{Due}%>"></TD></TR>
+<TR><TD ALIGN=RIGHT><&|/l&>Starts</&>:</TD><TD><& /Elements/SelectDate, Name => "Starts", Value => $ARGS{Starts}, Default => '' &></TD></TR>
+<TR><TD ALIGN=RIGHT><&|/l&>Due</&>:</TD><TD><& /Elements/SelectDate, Name => "Due", Value => $ARGS{Due}, Default => '' &></TD></TR>
</TABLE>
<& /Elements/TitleBoxEnd &>
<BR>
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 16:12:56 2005
@@ -14,7 +14,7 @@
if ( $request_args->{'update-reminders'} ) {
while ( my $reminder = $reminder_collection->Next ) {
if ( $reminder->Status ne 'resolved' && $request_args->{ 'Complete-Reminder-' . $reminder->id } ) {
-
+
$Ticket->Reminders->Resolve($reminder);
}
elsif ( $reminder->Status eq 'resolved' && !$request_args->{ 'Complete-Reminder-' . $reminder->id } ) {
@@ -53,7 +53,6 @@
<& SELF:ShowEntry, Reminder => $reminder, Ticket => $Ticket &>
% }
% }
-% }
<br />
<br />
<&|/l&>New reminder:</&><br />
@@ -72,7 +71,7 @@
</div>
<div class="horizontal">
<label class="horizontal" for="NewReminder-Due" ><&|/l&>Due</&> <&|/l&>(yyyy/mm/dd)</&>:</label>
-<input type="text" size="10" name="NewReminder-Due">
+<& /Elements/SelectDate, Name => "NewReminder-Due", Default => "" &>
</div>
</%method>
<%method ShowEntry>
Added: rt/branches/CHALDEA-EXPERIMENTAL/html/rt.js
==============================================================================
--- (empty file)
+++ rt/branches/CHALDEA-EXPERIMENTAL/html/rt.js Fri Jul 1 16:12:56 2005
@@ -0,0 +1,19 @@
+% $r->content_type('application/x-javascript');
+
+function hideshow(num) {
+ idstring = "element-" + num;
+ chunk = document.getElementById(idstring);
+ if ( chunk.style.display == "none") {
+ chunk.style.display = chunk.style.tag;
+ } else {
+ chunk.style.tag = chunk.style.display;
+ chunk.style.display = "none";
+ }
+}
+
+function openCalWindow(field) {
+ var objWindow = window.open('<%$RT::WebPath%>/CalPopup.html?field='+field, 'Pick', 'height=400,width=400,scrollbars=1');
+ objWindow.focus();
+}
+
+% $m->abort;
\ No newline at end of file
Modified: rt/branches/CHALDEA-EXPERIMENTAL/lib/RT/Reminders.pm
==============================================================================
--- rt/branches/CHALDEA-EXPERIMENTAL/lib/RT/Reminders.pm (original)
+++ rt/branches/CHALDEA-EXPERIMENTAL/lib/RT/Reminders.pm Fri Jul 1 16:12:56 2005
@@ -78,7 +78,7 @@
Queue => $self->TicketObj->Queue,
);
- $self->Ticket->_NewTransaction(Type => 'AddReminder',
+ $self->TicketObj->_NewTransaction(Type => 'AddReminder',
Field => 'RT::Ticket',
NewValue => $reminder->id);
@@ -91,7 +91,7 @@
my $reminder = shift;
$reminder->SetStatus('open');
- $self->Ticket->_NewTransaction(Type => 'OpenReminder',
+ $self->TicketObj->_NewTransaction(Type => 'OpenReminder',
Field => 'RT::Ticket',
NewValue => $reminder->id);
}
@@ -101,7 +101,7 @@
my $self = shift;
my $reminder = shift;
$reminder->SetStatus('resolved');
- $self->Ticket->_NewTransaction(Type => 'ResolveReminder',
+ $self->TicketObj->_NewTransaction(Type => 'ResolveReminder',
Field => 'RT::Ticket',
NewValue => $reminder->id);
}
More information about the Rt-commit
mailing list