1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
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>
|