summaryrefslogtreecommitdiff
path: root/rt/share/html
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-06-07 17:20:16 -0700
committerIvan Kohler <ivan@freeside.biz>2012-06-07 17:20:16 -0700
commitfec244eb00508517cd3313f6cf55973c2d2e99cf (patch)
tree0931b07101ac4b7fdecba13f2ff1b2555109e287 /rt/share/html
parent21a232b78413718d8a68867ba7eb4f52a287f9b6 (diff)
merge RTx-Calendar 0.14
Diffstat (limited to 'rt/share/html')
-rw-r--r--rt/share/html/Callbacks/RTx-Calendar/Elements/Header/Head3
-rw-r--r--rt/share/html/Callbacks/RTx-Calendar/Elements/Tabs/Privileged73
-rw-r--r--rt/share/html/Callbacks/RTx-Calendar/Ticket/Elements/Tabs/Default2
-rw-r--r--rt/share/html/Elements/CalendarEvent8
-rw-r--r--rt/share/html/NoAuth/Calendar/dhandler6
-rw-r--r--rt/share/html/NoAuth/css/calendar.css10
-rw-r--r--rt/share/html/Prefs/Calendar.html11
-rw-r--r--rt/share/html/Search/Calendar.html9
8 files changed, 97 insertions, 25 deletions
diff --git a/rt/share/html/Callbacks/RTx-Calendar/Elements/Header/Head b/rt/share/html/Callbacks/RTx-Calendar/Elements/Header/Head
index c1f24c2b4..dcaaa1279 100644
--- a/rt/share/html/Callbacks/RTx-Calendar/Elements/Header/Head
+++ b/rt/share/html/Callbacks/RTx-Calendar/Elements/Header/Head
@@ -1,2 +1,5 @@
+<%init>
+return if RT->can('AddStyleSheets');
+</%init>
<link rel="stylesheet" href="<%$RT::WebPath%>/NoAuth/css/calendar.css" type="text/css" media="all" />
diff --git a/rt/share/html/Callbacks/RTx-Calendar/Elements/Tabs/Privileged b/rt/share/html/Callbacks/RTx-Calendar/Elements/Tabs/Privileged
new file mode 100644
index 000000000..31ed90aea
--- /dev/null
+++ b/rt/share/html/Callbacks/RTx-Calendar/Elements/Tabs/Privileged
@@ -0,0 +1,73 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# <jesse@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 }}}
+<%INIT>
+my $request_path = $HTML::Mason::Commands::r->path_info;
+
+my $query_string = sub {
+ my %args = @_;
+ my $u = URI->new();
+ $u->query_form(%args);
+ return $u->query;
+};
+
+if ( $request_path =~ qr{^/Search/} && $m->request_args->{Query} ) {
+ my $tabs = PageMenu;
+ my $chart = $tabs->child('chart');
+ $chart->add_after( 'calendar' => title => loc('Calendar'),
+ path => '/Search/Calendar.html?' . $query_string->( %{$m->request_args} ) );
+}
+
+my $about_me = Menu->child( 'preferences' );
+my $settings = $about_me ? $about_me->child('settings') : undef;
+
+if ( $settings ) {
+ $settings->child( 'calendar' => title => loc('Calendar'),
+ path => '/Prefs/Calendar.html' );
+}
+
+</%INIT>
diff --git a/rt/share/html/Callbacks/RTx-Calendar/Ticket/Elements/Tabs/Default b/rt/share/html/Callbacks/RTx-Calendar/Ticket/Elements/Tabs/Default
index cb46fdaf6..b6d390598 100644
--- a/rt/share/html/Callbacks/RTx-Calendar/Ticket/Elements/Tabs/Default
+++ b/rt/share/html/Callbacks/RTx-Calendar/Ticket/Elements/Tabs/Default
@@ -1,4 +1,4 @@
-<%init>
+<%init>
my $args;
$args= "?" . $m->comp(
'/Elements/QueryString',
diff --git a/rt/share/html/Elements/CalendarEvent b/rt/share/html/Elements/CalendarEvent
index 3a6b00bb8..65dd58c9f 100644
--- a/rt/share/html/Elements/CalendarEvent
+++ b/rt/share/html/Elements/CalendarEvent
@@ -13,11 +13,11 @@ $DateTypes => undef
% and RTx::Calendar::LocalDate($Object->ResolvedObj->Unix) eq $today) {
<img src="<%$RT::WebImagesURL%>/resolved.png" />
-% } elsif ($DateTypes->{Starts} and $DateTypes->{Due}
+% } elsif ($DateTypes->{Starts} and $DateTypes->{Due}
% and RTx::Calendar::LocalDate($Object->StartsObj->Unix) eq $today and RTx::Calendar::LocalDate($Object->DueObj->Unix) eq $today ) {
<img src="<%$RT::WebImagesURL%>/starts_due.png" />
-% } elsif ($DateTypes->{Due} and $DateTypes->{Created}
+% } elsif ($DateTypes->{Due} and $DateTypes->{Created}
% and RTx::Calendar::LocalDate($Object->DueObj->Unix) eq $today and RTx::Calendar::LocalDate($Object->CreatedObj->Unix) eq $today ) {
<img src="<%$RT::WebImagesURL%>/created_due.png" />
@@ -25,7 +25,7 @@ $DateTypes => undef
% and RTx::Calendar::LocalDate($Object->StartsObj->Unix) eq $today) {
<img src="<%$RT::WebImagesURL%>/starts.png" />
-% } elsif ($DateTypes->{Due}
+% } elsif ($DateTypes->{Due}
% and RTx::Calendar::LocalDate($Object->DueObj->Unix) eq $today) {
<img src="<%$RT::WebImagesURL%>/due.png" />
@@ -64,7 +64,7 @@ $DateTypes => undef
% my $method = '$Object->'.$attr.'()';
% $method =~ s/->ISO\(\)$/->ISO( Timezone => 'user' )/;
% $value = eval $method;
-% if ($@) {die "<b>Check your CalendarPopupFields config in etc/RT_SiteConfig.pm</b>.<br /><br />Failed to find \"$attr\" - ". $@};
+% if ($@) {die "<b>Check your CalendarPopupFields config in etc/RT_SiteConfig.pm</b>.<br /><br />Failed to find \"$attr\" - ". $@};
% }
<strong><&|/l&><% $label_of{$attr} %></&>:</strong> <% $value %><br />
% }
diff --git a/rt/share/html/NoAuth/Calendar/dhandler b/rt/share/html/NoAuth/Calendar/dhandler
index 4b4aa631e..ea08c9a76 100644
--- a/rt/share/html/NoAuth/Calendar/dhandler
+++ b/rt/share/html/NoAuth/Calendar/dhandler
@@ -101,14 +101,14 @@ my $cal = $calendar->as_string;
$r->content_type('text/calendar;charset=utf-8');
$m->clear_buffer();
$m->out($cal);
-$m->abort;
+$m->abort;
sub add_event {
my ($Reminder, $uid) = @_;
return unless defined $Reminder->RefersTo->First;
my $Ticket = $Reminder->RefersTo->First->TargetObj;
-
+
my %event = (
summary => $Reminder->Subject ? $Reminder->Subject : '',
url => "${RT::WebURL}/Ticket/Display.html?id=" . $Ticket->id,
@@ -142,7 +142,7 @@ sub add_todo {
$vtodo{attendee} = "MAILTO:" . $Ticket->OwnerObj->EmailAddress;
} elsif ($Ticket->QueueObj->CommentAddress) {
$vtodo{organizer} = "MAILTO:" . $Ticket->QueueObj->CommentAddress;
- $vtodo{attendee} = "MAILTO:" . $Ticket->QueueObj->CommentAddress;
+ $vtodo{attendee} = "MAILTO:" . $Ticket->QueueObj->CommentAddress;
}
$vtodo{priority} = $Ticket->Priority
diff --git a/rt/share/html/NoAuth/css/calendar.css b/rt/share/html/NoAuth/css/calendar.css
index c6b584e96..93edccf4c 100644
--- a/rt/share/html/NoAuth/css/calendar.css
+++ b/rt/share/html/NoAuth/css/calendar.css
@@ -1,8 +1,8 @@
-.tooltip{position:relative;z-index:1;}
-.tooltip:hover{z-index:5;color:#000;}
-.tooltip span.tip{display: none; text-align:left;}
+.rtxcalendar .tooltip{position:relative;z-index:1;}
+.rtxcalendar .tooltip:hover{z-index:5;color:#000;}
+.rtxcalendar .tooltip span.tip{display: none; text-align:left;}
-div.tooltip:hover span.tip{
+.rtxcalendar div.tooltip:hover span.tip{
display:block;
position:absolute;
top:12px; left:24px; width:350px;
@@ -13,7 +13,7 @@ font-size: 0.8em;
color:#505050;
}
-.calendardate {
+.rtxcalendar .date {
text-align: right;
background-color: #f8f8ff;
width:100%;
diff --git a/rt/share/html/Prefs/Calendar.html b/rt/share/html/Prefs/Calendar.html
index 5fbdd2717..b508d103b 100644
--- a/rt/share/html/Prefs/Calendar.html
+++ b/rt/share/html/Prefs/Calendar.html
@@ -6,10 +6,7 @@ $HiddenField => undef
</%args>
<& /Elements/Header, Title => $title &>
-<& /User/Elements/Tabs,
- current_tab => 'Prefs/Calendar.html',
- Title => $title
-&>
+<& /Elements/Tabs &>
<&| /Widgets/TitleBox, title => loc('ICal Feeds (ics)') &>
@@ -50,7 +47,7 @@ Builder")%></a>.</p>
<& /Prefs/Elements/CalendarFeed &>
-% # only allow this part if
+% # only allow this part if
% if ($AllowSearch) {
% my $search_count;
@@ -107,9 +104,9 @@ $AllowSearch = 1
my $object;
-if ($HiddenField eq 'Private') {
+if ($HiddenField && $HiddenField eq 'Private') {
$object = $session{CurrentUser}->UserObj;
-} elsif ($AllowSearch and my ($SearchId) = $HiddenField =~ m/SavedSearch\-(\d+)/) {
+} elsif ($AllowSearch and $HiddenField my ($SearchId) = $HiddenField =~ m/SavedSearch\-(\d+)/) {
$object = $session{CurrentUser}->Attributes->WithId($SearchId);
}
diff --git a/rt/share/html/Search/Calendar.html b/rt/share/html/Search/Calendar.html
index 9d2b6f546..8a1b79609 100644
--- a/rt/share/html/Search/Calendar.html
+++ b/rt/share/html/Search/Calendar.html
@@ -10,9 +10,8 @@ $NewQuery => 0
</%args>
<& /Elements/Header, Title => $title &>
-<& /Ticket/Elements/Tabs,
- current_tab => "Search/Calendar.html?$QueryString",
- Title => $title &>
+<& /Elements/Tabs &>
+
<&| /Widgets/TitleBox,
title => loc('Calendar for ') . $rtdate->GetMonth($Month) . " $Year" ,
title_class=> 'inverse',
@@ -195,7 +194,7 @@ my $set = DateTime::Set->from_recurrence(
next => sub { $_[0]->truncate( to => 'day' )->add( days => 1 ) }
);
-my $QueryString =
+my $QueryString =
$m->comp(
'/Elements/QueryString',
Query => $Query,
@@ -212,7 +211,7 @@ $QueryString ||= 'NewQuery=1';
my $TempFormat = "__Starts__ __Due__";
my $TempQuery = "( Status = 'new' OR Status = 'open' OR Status = 'stalled')
AND ( Owner = '" . $session{CurrentUser}->Id ."' OR Owner = 'Nobody' )
- AND ( Type = 'reminder' OR 'Type' = 'ticket' )";
+ AND ( Type = 'reminder' OR 'Type' = 'ticket' )";
if ( my $Search = RTx::Calendar::SearchDefaultCalendar($session{CurrentUser}) ) {
$TempFormat = $Search->SubValue('Format');