diff options
Diffstat (limited to 'rt/share/html/Prefs')
-rw-r--r-- | rt/share/html/Prefs/Calendar.html | 123 | ||||
-rw-r--r-- | rt/share/html/Prefs/Elements/CalendarFeed | 68 | ||||
-rw-r--r-- | rt/share/html/Prefs/SavedSearches.html | 10 | ||||
-rw-r--r-- | rt/share/html/Prefs/SearchOptions.html | 32 |
4 files changed, 217 insertions, 16 deletions
diff --git a/rt/share/html/Prefs/Calendar.html b/rt/share/html/Prefs/Calendar.html new file mode 100644 index 000000000..5fbdd2717 --- /dev/null +++ b/rt/share/html/Prefs/Calendar.html @@ -0,0 +1,123 @@ +<%args> +$ChangeURL => undef +$ResetURL => undef +$SearchType => 'Ticket' +$HiddenField => undef +</%args> + +<& /Elements/Header, Title => $title &> +<& /User/Elements/Tabs, + current_tab => 'Prefs/Calendar.html', + Title => $title +&> + +<&| /Widgets/TitleBox, title => loc('ICal Feeds (ics)') &> + +<&| /Widgets/TitleBox, title => 'Help' &> + +<h3>displaying reminders :</h3> +<p>If you want to have reminders in a search you need to go in the <a +href="<%$RT::WebPath%>/Search/Edit.html"><%loc("Edit Query")%></a> tab +of the <%loc("query builder")%> and add something like that : + + <pre> + AND ( Type = 'ticket' OR Type = 'reminder' ) +</pre> +</p> + +<h3>displaying other kind of dates :</h3> +<p>By default RTx::Calendar display Due and Starts dates. You can +select other kind of events you want with the <%loc("Display +Columns")%> section in the <a +href="<%$RT::WebPath%>/Search/Build.html"><%loc("Query +Builder")%></a>. The following one will display the two latter and +LastUpdated dates : + +<pre> + '<small>__Due__</small>', + '<small>__Starts__</small>', + '<small>__LastUpdated__</small>' +</pre> +</p> + +<h3>changing the default query :</h3> +<p>You can change the default Query of Calendar.html and MyCalendar +portlet by saving a query with the name <code>calendar</code> in the +<a href="<%$RT::WebPath%>/Search/Build.html"><%loc("Query +Builder")%></a>.</p> + +</&> + +<& /Prefs/Elements/CalendarFeed &> + +% # only allow this part if +% if ($AllowSearch) { + +% my $search_count; + +% # I'm quite sure the loop isn't usefull but... +% my @Objects = $session{CurrentUser}->UserObj; +% for my $object (@Objects) { +% next unless ref($object) eq 'RT::User' && $object->id == $session{'CurrentUser'}->Id; +% my @searches = $object->Attributes->Named('SavedSearch'); +% for my $search (@searches) { +% next if ($search->SubValue('SearchType') +% && $search->SubValue('SearchType') ne $SearchType); +% $search_count++; +<& /Prefs/Elements/CalendarFeed, Object => $object, Search => $search &> + +% } +% } +% unless ($search_count) { + +<&| /Widgets/TitleBox, title => loc('Private Search ICal feeds') + , title_class=> 'inverse' + , color => "#993333" &> + +You can add private ICal feeds by saving new queries in <a +href="<%$RT::WebPath . '/Search/Build.html'%>">the Query Builder</a> + +</&> + +% } +% } else { +%#<&| /Widgets/TitleBox, title => loc('Private Search ICal feeds') +%# , title_class=> 'inverse' +%# , color => "#993333" &> +%# +%#<%loc('Private search ICal feeds disabled. To enable them, ask your admin for "[_1]" and "[_2]" rights', +%# loc('CreateSavedSearch'), +%# loc('LoadSavedSearch') )%> +%# +%#</&> +% } + +</&> + +<%INIT> +use Digest::SHA1; +use RT::SavedSearches; + +my $title = loc("Calendar Prefs"); +my $AllowSearch; + +$AllowSearch = 1 + if $session{'CurrentUser'}->HasRight( Right => 'LoadSavedSearch', + Object=> $RT::System ); + +my $object; + +if ($HiddenField eq 'Private') { + $object = $session{CurrentUser}->UserObj; +} elsif ($AllowSearch and my ($SearchId) = $HiddenField =~ m/SavedSearch\-(\d+)/) { + $object = $session{CurrentUser}->Attributes->WithId($SearchId); +} + +if (defined $ChangeURL) { + my @args = $object->SetAttribute(Name => 'ICalURL', Content => Digest::SHA1::sha1_base64(time)); +} elsif (defined $ResetURL) { + my @args = $object->DeleteAttribute('ICalURL'); +} + + +</%INIT> diff --git a/rt/share/html/Prefs/Elements/CalendarFeed b/rt/share/html/Prefs/Elements/CalendarFeed new file mode 100644 index 000000000..46893435e --- /dev/null +++ b/rt/share/html/Prefs/Elements/CalendarFeed @@ -0,0 +1,68 @@ +<%args> +$Search => undef +$Object => undef +$HiddenField => undef +</%args> + +<&| /Widgets/TitleBox, title => $title &> + +% if ($FeedText) { +<p><%$FeedText%></p> +% } else { +This feed will show tickets with due date find with query:<br /> +"<%$Search->SubValue('Query')%>". +% } + +% if ($ICalURL) { +<p>Your can paste this url in your calendar : <b><a href="<%$link%>"><%$link%></a></b><p> +<table> +<tr> +<td> +<form action="<%$RT::WebPath%>/Prefs/Calendar.html" method="post"> +<input type="hidden" name="HiddenField" value="<%$HiddenField%>" /> +<input type="submit" class="button" name="ResetURL" value="<%loc('Disable Feed')%>" /> +</form> +</td> +<td> +<form action="<%$RT::WebPath%>/Prefs/Calendar.html" method="post"> +<input type="hidden" name="HiddenField" value="<%$HiddenField%>" /> +<input type="submit" class="button" name="ChangeURL" value="<%loc('Change Feed URL')%>" /> +</form> +</td> +</tr> +</table> +% } else { + +<form action="<%$RT::WebPath%>/Prefs/Calendar.html" method="post"> +<input type="hidden" name="HiddenField" value="<%$HiddenField%>" /> +<input type="submit" class="button" name="ChangeURL" value="<%loc('Enable Feed')%>" /> +</form> +% } + +</&> + +<%init> +my $title; +my $ICalURL; +my $Id; +my $FeedText; +my $link; + +if ($Object) { + $title = loc('Feed for "') . ($Search->Description || loc('Unnamed search')) . '" search'; + $HiddenField = "SavedSearch-" . $Search->Id; + $ICalURL = $Search->FirstAttribute('ICalURL'); + $Id = $session{CurrentUser}->Id . "@" . $Search->Id; + $title .= " (disabled)" unless $ICalURL; +} else { + $title = loc('Feed for default calendar'); + $HiddenField = "Private"; + $ICalURL = $session{CurrentUser}->UserObj->FirstAttribute('ICalURL'); + $Id = $session{CurrentUser}->Id; + $FeedText = "This feed will show yours and Nobody's tasks with due date."; +} + +$link = $RT::WebURL . "NoAuth/Calendar/" . $Id . "/" . $ICalURL->Content + if $ICalURL; + +</%init>
\ No newline at end of file diff --git a/rt/share/html/Prefs/SavedSearches.html b/rt/share/html/Prefs/SavedSearches.html new file mode 100644 index 000000000..fe9859ca4 --- /dev/null +++ b/rt/share/html/Prefs/SavedSearches.html @@ -0,0 +1,10 @@ +<& /Elements/Header, Title => $title, &> +<& /Ticket/Elements/Tabs, + current_tab => "Prefs/SavedSearches.html", + Title => $title, +&> +<& /Elements/SavedSearches, %ARGS &> + +<%INIT> +my $title = "Saved Searches"; +</%INIT> diff --git a/rt/share/html/Prefs/SearchOptions.html b/rt/share/html/Prefs/SearchOptions.html index 613a0f351..5e5ed46f1 100644 --- a/rt/share/html/Prefs/SearchOptions.html +++ b/rt/share/html/Prefs/SearchOptions.html @@ -1,40 +1,40 @@ %# BEGIN BPS TAGGED BLOCK {{{ -%# +%# %# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC -%# <sales@bestpractical.com> -%# +%# +%# This software is Copyright (c) 1996-2009 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 @@ -43,9 +43,9 @@ %# 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 }}} -<& /Elements/Header, Title => loc("Search Preferences") &> +<& /Elements/Header, Title => loc("Ticketing Search Preferences") &> <& /User/Elements/Tabs, current_tab => "Prefs/SearchOptions.html", Title => loc("Search Preferences") |