add RTx::Calendar 0.07
[freeside.git] / rt / share / html / Prefs / Elements / CalendarFeed
1 <%args>
2 $Search => undef
3 $Object => undef
4 $HiddenField => undef
5 </%args>
6
7 <&| /Widgets/TitleBox, title => $title &>
8
9 % if ($FeedText) {
10 <p><%$FeedText%></p>
11 % } else {
12 This feed will show tickets with due date find with query:<br />
13 "<%$Search->SubValue('Query')%>".
14 % }
15
16 % if ($ICalURL) {
17 <p>Your can paste this url in your calendar  : <b><a href="<%$link%>"><%$link%></a></b><p>
18 <table>
19 <tr>
20 <td>
21 <form action="<%$RT::WebPath%>/Prefs/Calendar.html" method="post">
22 <input type="hidden" name="HiddenField" value="<%$HiddenField%>" />
23 <input type="submit" class="button" name="ResetURL" value="<%loc('Disable Feed')%>" />
24 </form>
25 </td>
26 <td>
27 <form action="<%$RT::WebPath%>/Prefs/Calendar.html" method="post">
28 <input type="hidden" name="HiddenField" value="<%$HiddenField%>" />
29 <input type="submit" class="button" name="ChangeURL" value="<%loc('Change Feed URL')%>" />
30 </form>
31 </td>
32 </tr>
33 </table>
34 % } else {
35
36 <form action="<%$RT::WebPath%>/Prefs/Calendar.html" method="post">
37 <input type="hidden" name="HiddenField" value="<%$HiddenField%>" />
38 <input type="submit" class="button" name="ChangeURL" value="<%loc('Enable Feed')%>" />
39 </form>
40 % }
41
42 </&>
43
44 <%init>
45 my $title;
46 my $ICalURL;
47 my $Id;
48 my $FeedText;
49 my $link;
50
51 if ($Object) {
52   $title = loc('Feed for "') . ($Search->Description || loc('Unnamed search')) . '" search';
53   $HiddenField = "SavedSearch-" . $Search->Id;
54   $ICalURL = $Search->FirstAttribute('ICalURL');
55   $Id = $session{CurrentUser}->Id . "@" . $Search->Id;
56   $title .= " (disabled)" unless $ICalURL;
57 } else {
58   $title = loc('Feed for default calendar');
59   $HiddenField = "Private";
60   $ICalURL = $session{CurrentUser}->UserObj->FirstAttribute('ICalURL');
61   $Id = $session{CurrentUser}->Id;
62   $FeedText = "This feed will show yours and Nobody's tasks with due date.";
63 }
64
65 $link = $RT::WebURL . "NoAuth/Calendar/" . $Id . "/" . $ICalURL->Content
66   if $ICalURL;
67
68 </%init>