annotate plugins/calendar/lib/calendar_ui.php @ 12:ff1f27bd05ad

partial success in getting back_link to message when making event from mail
author Charlie Root
date Sat, 13 Jan 2018 09:39:32 -0500
parents f6fe4b6ae66a
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
1 <?php
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
2 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
3 * User Interface class for the Calendar plugin
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
4 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
5 * @author Lazlo Westerhof <hello@lazlo.me>
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
6 * @author Thomas Bruederli <bruederli@kolabsys.com>
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
7 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
8 * Copyright (C) 2010, Lazlo Westerhof <hello@lazlo.me>
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
9 * Copyright (C) 2014, Kolab Systems AG <contact@kolabsys.com>
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
10 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
11 * This program is free software: you can redistribute it and/or modify
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
12 * it under the terms of the GNU Affero General Public License as
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
13 * published by the Free Software Foundation, either version 3 of the
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
14 * License, or (at your option) any later version.
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
15 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
16 * This program is distributed in the hope that it will be useful,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
19 * GNU Affero General Public License for more details.
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
20 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
21 * You should have received a copy of the GNU Affero General Public License
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
22 * along with this program. If not, see <http://www.gnu.org/licenses/>.
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
23 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
24
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
25
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
26 class calendar_ui
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
27 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
28 private $rc;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
29 private $cal;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
30 private $ready = false;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
31 public $screen;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
32
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
33 function __construct($cal)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
34 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
35 $this->cal = $cal;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
36 $this->rc = $cal->rc;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
37 $this->screen = $this->rc->task == 'calendar' ? ($this->rc->action ? $this->rc->action: 'calendar') : 'other';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
38 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
39
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
40 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
41 * Calendar UI initialization and requests handlers
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
42 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
43 public function init()
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
44 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
45 if ($this->ready) // already done
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
46 return;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
47
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
48 // add taskbar button
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
49 $this->cal->add_button(array(
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
50 'command' => 'calendar',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
51 'class' => 'button-calendar',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
52 'classsel' => 'button-calendar button-selected',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
53 'innerclass' => 'button-inner',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
54 'label' => 'calendar.calendar',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
55 'type' => 'link'
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
56 ), 'taskbar');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
57
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
58 // load basic client script
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
59 $this->cal->include_script('calendar_base.js');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
60
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
61 $skin_path = $this->cal->local_skin_path();
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
62 $this->cal->include_stylesheet($skin_path . '/calendar.css');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
63
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
64 $this->ready = true;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
65 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
66
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
67 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
68 * Register handler methods for the template engine
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
69 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
70 public function init_templates()
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
71 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
72 $this->cal->register_handler('plugin.calendar_css', array($this, 'calendar_css'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
73 $this->cal->register_handler('plugin.calendar_list', array($this, 'calendar_list'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
74 $this->cal->register_handler('plugin.calendar_select', array($this, 'calendar_select'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
75 $this->cal->register_handler('plugin.identity_select', array($this, 'identity_select'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
76 $this->cal->register_handler('plugin.category_select', array($this, 'category_select'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
77 $this->cal->register_handler('plugin.status_select', array($this, 'status_select'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
78 $this->cal->register_handler('plugin.freebusy_select', array($this, 'freebusy_select'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
79 $this->cal->register_handler('plugin.priority_select', array($this, 'priority_select'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
80 $this->cal->register_handler('plugin.sensitivity_select', array($this, 'sensitivity_select'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
81 $this->cal->register_handler('plugin.alarm_select', array($this, 'alarm_select'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
82 $this->cal->register_handler('plugin.recurrence_form', array($this->cal->lib, 'recurrence_form'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
83 $this->cal->register_handler('plugin.attachments_form', array($this, 'attachments_form'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
84 $this->cal->register_handler('plugin.attachments_list', array($this, 'attachments_list'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
85 $this->cal->register_handler('plugin.filedroparea', array($this, 'file_drop_area'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
86 $this->cal->register_handler('plugin.attendees_list', array($this, 'attendees_list'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
87 $this->cal->register_handler('plugin.attendees_form', array($this, 'attendees_form'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
88 $this->cal->register_handler('plugin.resources_form', array($this, 'resources_form'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
89 $this->cal->register_handler('plugin.resources_list', array($this, 'resources_list'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
90 $this->cal->register_handler('plugin.resources_searchform', array($this, 'resources_search_form'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
91 $this->cal->register_handler('plugin.resource_info', array($this, 'resource_info'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
92 $this->cal->register_handler('plugin.resource_calendar', array($this, 'resource_calendar'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
93 $this->cal->register_handler('plugin.attendees_freebusy_table', array($this, 'attendees_freebusy_table'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
94 $this->cal->register_handler('plugin.edit_attendees_notify', array($this, 'edit_attendees_notify'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
95 $this->cal->register_handler('plugin.edit_recurring_warning', array($this, 'recurring_event_warning'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
96 $this->cal->register_handler('plugin.event_rsvp_buttons', array($this, 'event_rsvp_buttons'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
97 $this->cal->register_handler('plugin.angenda_options', array($this, 'angenda_options'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
98 $this->cal->register_handler('plugin.events_import_form', array($this, 'events_import_form'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
99 $this->cal->register_handler('plugin.events_export_form', array($this, 'events_export_form'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
100 $this->cal->register_handler('plugin.object_changelog_table', array('libkolab', 'object_changelog_table'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
101 $this->cal->register_handler('plugin.searchform', array($this->rc->output, 'search_form')); // use generic method from rcube_template
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
102 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
103
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
104 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
105 * Adds CSS stylesheets to the page header
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
106 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
107 public function addCSS()
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
108 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
109 $skin_path = $this->cal->local_skin_path();
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
110 $this->cal->include_stylesheet($skin_path . '/fullcalendar.css');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
111 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
112
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
113 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
114 * Adds JS files to the page header
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
115 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
116 public function addJS()
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
117 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
118 $this->cal->include_script('calendar_ui.js');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
119 $this->cal->include_script('lib/js/fullcalendar.js');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
120 $this->rc->output->include_script('treelist.js');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
121
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
122 // include kolab folderlist widget if available
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
123 if (in_array('libkolab', $this->cal->api->loaded_plugins())) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
124 $this->cal->api->include_script('libkolab/js/folderlist.js');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
125 $this->cal->api->include_script('libkolab/js/audittrail.js');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
126 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
127
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
128 jqueryui::miniColors();
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
129 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
130
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
131 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
132 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
133 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
134 function calendar_css($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
135 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
136 $mode = $this->rc->config->get('calendar_event_coloring', $this->cal->defaults['calendar_event_coloring']);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
137 $categories = $this->cal->driver->list_categories();
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
138 $css = "\n";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
139
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
140 foreach ((array)$categories as $class => $color) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
141 if (empty($color))
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
142 continue;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
143
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
144 $class = 'cat-' . asciiwords(strtolower($class), true);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
145 $css .= ".$class { color: #$color }\n";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
146 if ($mode > 0) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
147 if ($mode == 2) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
148 $css .= ".fc-event-$class .fc-event-bg {";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
149 $css .= " opacity: 0.9;";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
150 $css .= " filter: alpha(opacity=90);";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
151 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
152 else {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
153 $css .= ".fc-event-$class.fc-event-skin, ";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
154 $css .= ".fc-event-$class .fc-event-skin, ";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
155 $css .= ".fc-event-$class .fc-event-inner {";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
156 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
157 $css .= " background-color: #" . $color . ";";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
158 if ($mode % 2)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
159 $css .= " border-color: #$color;";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
160 $css .= "}\n";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
161 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
162 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
163
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
164 $calendars = $this->cal->driver->list_calendars();
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
165 foreach ((array)$calendars as $id => $prop) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
166 if (!$prop['color'])
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
167 continue;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
168 $css .= $this->calendar_css_classes($id, $prop, $mode);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
169 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
170
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
171 return html::tag('style', array('type' => 'text/css'), $css);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
172 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
173
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
174 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
175 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
176 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
177 public function calendar_css_classes($id, $prop, $mode)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
178 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
179 $color = $prop['color'];
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
180 $class = 'cal-' . asciiwords($id, true);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
181 $css .= "li .$class, #eventshow .$class { color: #$color; }\n";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
182
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
183 if ($mode != 1) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
184 if ($mode == 3) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
185 $css .= ".fc-event-$class .fc-event-bg {";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
186 $css .= " opacity: 0.9;";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
187 $css .= " filter: alpha(opacity=90);";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
188 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
189 else {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
190 $css .= ".fc-event-$class, ";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
191 $css .= ".fc-event-$class .fc-event-inner {";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
192 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
193 if (!$prop['printmode'])
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
194 $css .= " background-color: #$color;";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
195 if ($mode % 2 == 0)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
196 $css .= " border-color: #$color;";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
197 $css .= "}\n";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
198 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
199
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
200 return $css . ".$class .handle { background-color: #$color; }\n";
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
201 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
202
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
203 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
204 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
205 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
206 function calendar_list($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
207 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
208 $html = '';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
209 $jsenv = array();
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
210 $tree = true;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
211 $calendars = $this->cal->driver->list_calendars(0, $tree);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
212
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
213 // walk folder tree
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
214 if (is_object($tree)) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
215 $html = $this->list_tree_html($tree, $calendars, $jsenv, $attrib);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
216
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
217 // append birthdays calendar which isn't part of $tree
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
218 if ($bdaycal = $calendars[calendar_driver::BIRTHDAY_CALENDAR_ID]) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
219 $calendars = array(calendar_driver::BIRTHDAY_CALENDAR_ID => $bdaycal);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
220 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
221 else {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
222 $calendars = array(); // clear array for flat listing
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
223 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
224 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
225 else {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
226 // fall-back to flat folder listing
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
227 $attrib['class'] .= ' flat';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
228 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
229
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
230 foreach ((array)$calendars as $id => $prop) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
231 if ($attrib['activeonly'] && !$prop['active'])
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
232 continue;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
233
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
234 $html .= html::tag('li', array('id' => 'rcmlical' . $id, 'class' => $prop['group']),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
235 $content = $this->calendar_list_item($id, $prop, $jsenv, $attrib['activeonly'])
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
236 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
237 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
238
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
239 $this->rc->output->set_env('source', rcube_utils::get_input_value('source', rcube_utils::INPUT_GET));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
240 $this->rc->output->set_env('calendars', $jsenv);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
241 $this->rc->output->add_gui_object('calendarslist', $attrib['id']);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
242
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
243 return html::tag('ul', $attrib, $html, html::$common_attrib);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
244 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
245
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
246 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
247 * Return html for a structured list <ul> for the folder tree
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
248 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
249 public function list_tree_html($node, $data, &$jsenv, $attrib)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
250 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
251 $out = '';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
252 foreach ($node->children as $folder) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
253 $id = $folder->id;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
254 $prop = $data[$id];
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
255 $is_collapsed = false; // TODO: determine this somehow?
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
256
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
257 $content = $this->calendar_list_item($id, $prop, $jsenv, $attrib['activeonly']);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
258
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
259 if (!empty($folder->children)) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
260 $content .= html::tag('ul', array('style' => ($is_collapsed ? "display:none;" : null)),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
261 $this->list_tree_html($folder, $data, $jsenv, $attrib));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
262 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
263
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
264 if (strlen($content)) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
265 $out .= html::tag('li', array(
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
266 'id' => 'rcmlical' . rcube_utils::html_identifier($id),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
267 'class' => $prop['group'] . ($prop['virtual'] ? ' virtual' : ''),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
268 ),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
269 $content);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
270 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
271 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
272
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
273 return $out;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
274 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
275
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
276 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
277 * Helper method to build a calendar list item (HTML content and js data)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
278 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
279 public function calendar_list_item($id, $prop, &$jsenv, $activeonly = false)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
280 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
281 // enrich calendar properties with settings from the driver
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
282 if (!$prop['virtual']) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
283 unset($prop['user_id']);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
284 $prop['alarms'] = $this->cal->driver->alarms;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
285 $prop['attendees'] = $this->cal->driver->attendees;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
286 $prop['freebusy'] = $this->cal->driver->freebusy;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
287 $prop['attachments'] = $this->cal->driver->attachments;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
288 $prop['undelete'] = $this->cal->driver->undelete;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
289 $prop['feedurl'] = $this->cal->get_url(array('_cal' => $this->cal->ical_feed_hash($id) . '.ics', 'action' => 'feed'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
290
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
291 $jsenv[$id] = $prop;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
292 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
293
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
294 $classes = array('calendar', 'cal-' . asciiwords($id, true));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
295 $title = $prop['title'] ?: ($prop['name'] != $prop['listname'] || strlen($prop['name']) > 25 ?
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
296 html_entity_decode($prop['name'], ENT_COMPAT, RCUBE_CHARSET) : '');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
297
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
298 if ($prop['virtual'])
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
299 $classes[] = 'virtual';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
300 else if (!$prop['editable'])
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
301 $classes[] = 'readonly';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
302 if ($prop['subscribed'])
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
303 $classes[] = 'subscribed';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
304 if ($prop['subscribed'] === 2)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
305 $classes[] = 'partial';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
306 if ($prop['class'])
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
307 $classes[] = $prop['class'];
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
308
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
309 $content = '';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
310 if (!$activeonly || $prop['active']) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
311 $label_id = 'cl:' . $id;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
312 $content = html::div(join(' ', $classes),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
313 html::span(array('class' => 'calname', 'id' => $label_id, 'title' => $title), $prop['editname'] ? rcube::Q($prop['editname']) : $prop['listname']) .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
314 ($prop['virtual'] ? '' :
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
315 html::tag('input', array('type' => 'checkbox', 'name' => '_cal[]', 'value' => $id, 'checked' => $prop['active'], 'aria-labelledby' => $label_id), '') .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
316 html::span('actions',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
317 ($prop['removable'] ? html::a(array('href' => '#', 'class' => 'remove', 'title' => $this->cal->gettext('removelist')), ' ') : '') .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
318 html::a(array('href' => '#', 'class' => 'quickview', 'title' => $this->cal->gettext('quickview'), 'role' => 'checkbox', 'aria-checked' => 'false'), '') .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
319 (isset($prop['subscribed']) ? html::a(array('href' => '#', 'class' => 'subscribed', 'title' => $this->cal->gettext('calendarsubscribe'), 'role' => 'checkbox', 'aria-checked' => $prop['subscribed'] ? 'true' : 'false'), ' ') : '')
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
320 ) .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
321 html::span(array('class' => 'handle', 'style' => "background-color: #" . ($prop['color'] ?: 'f00')), '&nbsp;')
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
322 )
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
323 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
324 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
325
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
326 return $content;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
327 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
328
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
329 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
330 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
331 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
332 function angenda_options($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
333 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
334 $attrib += array('id' => 'agendaoptions');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
335 $attrib['style'] .= 'display:none';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
336
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
337 $select_range = new html_select(array('name' => 'listrange', 'id' => 'agenda-listrange'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
338 $select_range->add(1 . ' ' . preg_replace('/\(.+\)/', '', $this->cal->lib->gettext('days')), $days);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
339 foreach (array(2,5,7,14,30,60,90,180,365) as $days)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
340 $select_range->add($days . ' ' . preg_replace('/\(|\)/', '', $this->cal->lib->gettext('days')), $days);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
341
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
342 $html .= html::label('agenda-listrange', $this->cal->gettext('listrange'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
343 $html .= $select_range->show($this->rc->config->get('calendar_agenda_range', $this->cal->defaults['calendar_agenda_range']));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
344
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
345 $select_sections = new html_select(array('name' => 'listsections', 'id' => 'agenda-listsections'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
346 $select_sections->add('---', '');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
347 foreach (array('day' => 'libcalendaring.days', 'week' => 'libcalendaring.weeks', 'month' => 'libcalendaring.months', 'smart' => 'calendar.smartsections') as $val => $label)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
348 $select_sections->add(preg_replace('/\(|\)/', '', ucfirst($this->rc->gettext($label))), $val);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
349
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
350 $html .= html::span('spacer', '&nbsp;');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
351 $html .= html::label('agenda-listsections', $this->cal->gettext('listsections'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
352 $html .= $select_sections->show($this->rc->config->get('calendar_agenda_sections', $this->cal->defaults['calendar_agenda_sections']));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
353
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
354 return html::div($attrib, $html);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
355 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
356
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
357 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
358 * Render a HTML select box for calendar selection
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
359 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
360 function calendar_select($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
361 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
362 $attrib['name'] = 'calendar';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
363 $attrib['is_escaped'] = true;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
364 $select = new html_select($attrib);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
365
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
366 foreach ((array)$this->cal->driver->list_calendars() as $id => $prop) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
367 if ($prop['editable'] || strpos($prop['rights'], 'i') !== false)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
368 $select->add($prop['name'], $id);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
369 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
370
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
371 return $select->show(null);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
372 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
373
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
374 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
375 * Render a HTML select box for user identity selection
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
376 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
377 function identity_select($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
378 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
379 $attrib['name'] = 'identity';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
380 $select = new html_select($attrib);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
381 $identities = $this->rc->user->list_emails();
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
382
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
383 foreach ($identities as $ident) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
384 $select->add(format_email_recipient($ident['email'], $ident['name']), $ident['identity_id']);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
385 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
386
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
387 return $select->show(null);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
388 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
389
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
390 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
391 * Render a HTML select box to select an event category
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
392 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
393 function category_select($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
394 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
395 $attrib['name'] = 'categories';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
396 $select = new html_select($attrib);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
397 $select->add('---', '');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
398 foreach (array_keys((array)$this->cal->driver->list_categories()) as $cat) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
399 $select->add($cat, $cat);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
400 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
401
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
402 return $select->show(null);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
403 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
404
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
405 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
406 * Render a HTML select box for status property
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
407 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
408 function status_select($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
409 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
410 $attrib['name'] = 'status';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
411 $select = new html_select($attrib);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
412 $select->add('---', '');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
413 $select->add($this->cal->gettext('status-confirmed'), 'CONFIRMED');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
414 $select->add($this->cal->gettext('status-cancelled'), 'CANCELLED');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
415 $select->add($this->cal->gettext('status-tentative'), 'TENTATIVE');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
416 return $select->show(null);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
417 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
418
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
419 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
420 * Render a HTML select box for free/busy/out-of-office property
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
421 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
422 function freebusy_select($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
423 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
424 $attrib['name'] = 'freebusy';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
425 $select = new html_select($attrib);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
426 $select->add($this->cal->gettext('free'), 'free');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
427 $select->add($this->cal->gettext('busy'), 'busy');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
428 // out-of-office is not supported by libkolabxml (#3220)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
429 // $select->add($this->cal->gettext('outofoffice'), 'outofoffice');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
430 $select->add($this->cal->gettext('tentative'), 'tentative');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
431 return $select->show(null);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
432 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
433
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
434 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
435 * Render a HTML select for event priorities
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
436 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
437 function priority_select($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
438 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
439 $attrib['name'] = 'priority';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
440 $select = new html_select($attrib);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
441 $select->add('---', '0');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
442 $select->add('1 '.$this->cal->gettext('highest'), '1');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
443 $select->add('2 '.$this->cal->gettext('high'), '2');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
444 $select->add('3 ', '3');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
445 $select->add('4 ', '4');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
446 $select->add('5 '.$this->cal->gettext('normal'), '5');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
447 $select->add('6 ', '6');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
448 $select->add('7 ', '7');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
449 $select->add('8 '.$this->cal->gettext('low'), '8');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
450 $select->add('9 '.$this->cal->gettext('lowest'), '9');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
451 return $select->show(null);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
452 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
453
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
454 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
455 * Render HTML input for sensitivity selection
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
456 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
457 function sensitivity_select($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
458 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
459 $attrib['name'] = 'sensitivity';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
460 $select = new html_select($attrib);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
461 $select->add($this->cal->gettext('public'), 'public');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
462 $select->add($this->cal->gettext('private'), 'private');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
463 $select->add($this->cal->gettext('confidential'), 'confidential');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
464 return $select->show(null);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
465 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
466
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
467 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
468 * Render HTML form for alarm configuration
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
469 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
470 function alarm_select($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
471 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
472 return $this->cal->lib->alarm_select($attrib, $this->cal->driver->alarm_types, $this->cal->driver->alarm_absolute);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
473 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
474
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
475 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
476 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
477 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
478 function edit_attendees_notify($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
479 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
480 $checkbox = new html_checkbox(array('name' => '_notify', 'id' => 'edit-attendees-donotify', 'value' => 1));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
481 return html::div($attrib, html::label(null, $checkbox->show(1) . ' ' . $this->cal->gettext('sendnotifications')));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
482 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
483
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
484 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
485 * Generate the form for recurrence settings
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
486 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
487 function recurring_event_warning($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
488 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
489 $attrib['id'] = 'edit-recurring-warning';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
490
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
491 $radio = new html_radiobutton(array('name' => '_savemode', 'class' => 'edit-recurring-savemode'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
492 $form = html::label(null, $radio->show('', array('value' => 'current')) . $this->cal->gettext('currentevent')) . ' ' .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
493 html::label(null, $radio->show('', array('value' => 'future')) . $this->cal->gettext('futurevents')) . ' ' .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
494 html::label(null, $radio->show('all', array('value' => 'all')) . $this->cal->gettext('allevents')) . ' ' .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
495 html::label(null, $radio->show('', array('value' => 'new')) . $this->cal->gettext('saveasnew'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
496
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
497 return html::div($attrib, html::div('message', html::span('ui-icon ui-icon-alert', '') . $this->cal->gettext('changerecurringeventwarning')) . html::div('savemode', $form));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
498 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
499
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
500 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
501 * Form for uploading and importing events
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
502 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
503 function events_import_form($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
504 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
505 if (!$attrib['id'])
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
506 $attrib['id'] = 'rcmImportForm';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
507
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
508 // Get max filesize, enable upload progress bar
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
509 $max_filesize = $this->rc->upload_init();
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
510
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
511 $accept = '.ics, text/calendar, text/x-vcalendar, application/ics';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
512 if (class_exists('ZipArchive', false)) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
513 $accept .= ', .zip, application/zip';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
514 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
515
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
516 $input = new html_inputfield(array(
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
517 'type' => 'file', 'name' => '_data', 'size' => $attrib['uploadfieldsize'],
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
518 'accept' => $accept));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
519
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
520 $select = new html_select(array('name' => '_range', 'id' => 'event-import-range'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
521 $select->add(array(
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
522 $this->cal->gettext('onemonthback'),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
523 $this->cal->gettext(array('name' => 'nmonthsback', 'vars' => array('nr'=>2))),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
524 $this->cal->gettext(array('name' => 'nmonthsback', 'vars' => array('nr'=>3))),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
525 $this->cal->gettext(array('name' => 'nmonthsback', 'vars' => array('nr'=>6))),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
526 $this->cal->gettext(array('name' => 'nmonthsback', 'vars' => array('nr'=>12))),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
527 $this->cal->gettext('all'),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
528 ),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
529 array('1','2','3','6','12',0));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
530
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
531 $html .= html::div('form-section',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
532 html::div(null, $input->show()) .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
533 html::div('hint', $this->rc->gettext(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize))))
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
534 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
535
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
536 $html .= html::div('form-section',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
537 html::label('event-import-calendar', $this->cal->gettext('calendar')) .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
538 $this->calendar_select(array('name' => 'calendar', 'id' => 'event-import-calendar'))
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
539 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
540
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
541 $html .= html::div('form-section',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
542 html::label('event-import-range', $this->cal->gettext('importrange')) .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
543 $select->show(1)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
544 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
545
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
546 $this->rc->output->add_gui_object('importform', $attrib['id']);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
547 $this->rc->output->add_label('import');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
548
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
549 return html::tag('form', array('action' => $this->rc->url(array('task' => 'calendar', 'action' => 'import_events')),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
550 'method' => "post", 'enctype' => 'multipart/form-data', 'id' => $attrib['id']),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
551 $html
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
552 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
553 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
554
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
555 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
556 * Form to select options for exporting events
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
557 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
558 function events_export_form($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
559 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
560 if (!$attrib['id'])
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
561 $attrib['id'] = 'rcmExportForm';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
562
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
563 $html .= html::div('form-section',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
564 html::label('event-export-calendar', $this->cal->gettext('calendar')) .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
565 $this->calendar_select(array('name' => 'calendar', 'id' => 'event-export-calendar'))
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
566 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
567
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
568 $select = new html_select(array('name' => 'range', 'id' => 'event-export-range'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
569 $select->add(array(
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
570 $this->cal->gettext('all'),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
571 $this->cal->gettext('onemonthback'),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
572 $this->cal->gettext(array('name' => 'nmonthsback', 'vars' => array('nr'=>2))),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
573 $this->cal->gettext(array('name' => 'nmonthsback', 'vars' => array('nr'=>3))),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
574 $this->cal->gettext(array('name' => 'nmonthsback', 'vars' => array('nr'=>6))),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
575 $this->cal->gettext(array('name' => 'nmonthsback', 'vars' => array('nr'=>12))),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
576 $this->cal->gettext('customdate'),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
577 ),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
578 array(0,'1','2','3','6','12','custom'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
579
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
580 $startdate = new html_inputfield(array('name' => 'start', 'size' => 11, 'id' => 'event-export-startdate'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
581
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
582 $html .= html::div('form-section',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
583 html::label('event-export-range', $this->cal->gettext('exportrange')) .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
584 $select->show(0) .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
585 html::span(array('style'=>'display:none'), $startdate->show())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
586 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
587
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
588 $checkbox = new html_checkbox(array('name' => 'attachments', 'id' => 'event-export-attachments', 'value' => 1));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
589 $html .= html::div('form-section',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
590 html::label('event-export-attachments', $this->cal->gettext('exportattachments')) .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
591 $checkbox->show(1)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
592 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
593
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
594 $this->rc->output->add_gui_object('exportform', $attrib['id']);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
595
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
596 return html::tag('form', array('action' => $this->rc->url(array('task' => 'calendar', 'action' => 'export_events')),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
597 'method' => "post", 'id' => $attrib['id']),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
598 $html
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
599 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
600 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
601
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
602 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
603 * Generate the form for event attachments upload
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
604 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
605 function attachments_form($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
606 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
607 // add ID if not given
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
608 if (!$attrib['id'])
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
609 $attrib['id'] = 'rcmUploadForm';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
610
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
611 // Get max filesize, enable upload progress bar
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
612 $max_filesize = $this->rc->upload_init();
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
613
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
614 $button = new html_inputfield(array('type' => 'button'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
615 $input = new html_inputfield(array(
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
616 'type' => 'file', 'name' => '_attachments[]',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
617 'multiple' => 'multiple', 'size' => $attrib['attachmentfieldsize']));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
618
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
619 return html::div($attrib,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
620 html::div(null, $input->show()) .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
621 html::div('buttons', $button->show($this->rc->gettext('upload'), array('class' => 'button mainaction',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
622 'onclick' => rcmail_output::JS_OBJECT_NAME . ".upload_file(this.form)"))) .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
623 html::div('hint', $this->rc->gettext(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize))))
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
624 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
625 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
626
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
627 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
628 * Register UI object for HTML5 drag & drop file upload
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
629 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
630 function file_drop_area($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
631 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
632 if ($attrib['id']) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
633 $this->rc->output->add_gui_object('filedrop', $attrib['id']);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
634 $this->rc->output->set_env('filedrop', array('action' => 'upload', 'fieldname' => '_attachments'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
635 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
636 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
637
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
638 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
639 * Generate HTML element for attachments list
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
640 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
641 function attachments_list($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
642 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
643 if (!$attrib['id'])
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
644 $attrib['id'] = 'rcmAttachmentList';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
645
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
646 $skin_path = $this->cal->local_skin_path();
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
647 if ($attrib['deleteicon']) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
648 $_SESSION[calendar::SESSION_KEY . '_deleteicon'] = $skin_path . $attrib['deleteicon'];
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
649 $this->rc->output->set_env('deleteicon', $skin_path . $attrib['deleteicon']);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
650 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
651 if ($attrib['cancelicon'])
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
652 $this->rc->output->set_env('cancelicon', $skin_path . $attrib['cancelicon']);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
653 if ($attrib['loadingicon'])
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
654 $this->rc->output->set_env('loadingicon', $skin_path . $attrib['loadingicon']);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
655
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
656 $this->rc->output->add_gui_object('attachmentlist', $attrib['id']);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
657 $this->attachmentlist_id = $attrib['id'];
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
658
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
659 return html::tag('ul', $attrib, '', html::$common_attrib);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
660 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
661
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
662 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
663 * Handler for calendar form template.
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
664 * The form content could be overriden by the driver
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
665 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
666 function calendar_editform($action, $calendar = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
667 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
668 // compose default calendar form fields
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
669 $input_name = new html_inputfield(array('name' => 'name', 'id' => 'calendar-name', 'size' => 20));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
670 $input_color = new html_inputfield(array('name' => 'color', 'id' => 'calendar-color', 'size' => 6));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
671
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
672 $formfields = array(
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
673 'name' => array(
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
674 'label' => $this->cal->gettext('name'),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
675 'value' => $input_name->show($calendar['name']),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
676 'id' => 'calendar-name',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
677 ),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
678 'color' => array(
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
679 'label' => $this->cal->gettext('color'),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
680 'value' => $input_color->show($calendar['color']),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
681 'id' => 'calendar-color',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
682 ),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
683 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
684
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
685 if ($this->cal->driver->alarms) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
686 $checkbox = new html_checkbox(array('name' => 'showalarms', 'id' => 'calendar-showalarms', 'value' => 1));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
687 $formfields['showalarms'] = array(
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
688 'label' => $this->cal->gettext('showalarms'),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
689 'value' => $checkbox->show($calendar['showalarms']?1:0),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
690 'id' => 'calendar-showalarms',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
691 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
692 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
693
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
694 // allow driver to extend or replace the form content
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
695 return html::tag('form', array('action' => "#", 'method' => "get", 'id' => 'calendarpropform'),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
696 $this->cal->driver->calendar_form($action, $calendar, $formfields)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
697 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
698 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
699
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
700 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
701 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
702 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
703 function attendees_list($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
704 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
705 // add "noreply" checkbox to attendees table only
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
706 $invitations = strpos($attrib['id'], 'attend') !== false;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
707
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
708 $invite = new html_checkbox(array('value' => 1, 'id' => 'edit-attendees-invite'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
709 $table = new html_table(array('cols' => 5 + intval($invitations), 'border' => 0, 'cellpadding' => 0, 'class' => 'rectable'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
710
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
711 $table->add_header('role', $this->cal->gettext('role'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
712 $table->add_header('name', $this->cal->gettext($attrib['coltitle'] ?: 'attendee'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
713 $table->add_header('availability', $this->cal->gettext('availability'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
714 $table->add_header('confirmstate', $this->cal->gettext('confirmstate'));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
715 if ($invitations) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
716 $table->add_header(array('class' => 'invite', 'title' => $this->cal->gettext('sendinvitations')),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
717 $invite->show(1) . html::label('edit-attendees-invite', $this->cal->gettext('sendinvitations')));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
718 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
719 $table->add_header('options', '');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
720
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
721 // hide invite column if disabled by config
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
722 $itip_notify = (int)$this->rc->config->get('calendar_itip_send_option', $this->cal->defaults['calendar_itip_send_option']);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
723 if ($invitations && !($itip_notify & 2)) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
724 $css = sprintf('#%s td.invite, #%s th.invite { display:none !important }', $attrib['id'], $attrib['id']);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
725 $this->rc->output->add_footer(html::tag('style', array('type' => 'text/css'), $css));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
726 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
727
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
728 return $table->show($attrib);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
729 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
730
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
731 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
732 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
733 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
734 function attendees_form($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
735 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
736 $input = new html_inputfield(array('name' => 'participant', 'id' => 'edit-attendee-name', 'size' => 30));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
737 $textarea = new html_textarea(array('name' => 'comment', 'id' => 'edit-attendees-comment',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
738 'rows' => 4, 'cols' => 55, 'title' => $this->cal->gettext('itipcommenttitle')));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
739
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
740 return html::div($attrib,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
741 html::div(null, $input->show() . " " .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
742 html::tag('input', array('type' => 'button', 'class' => 'button', 'id' => 'edit-attendee-add', 'value' => $this->cal->gettext('addattendee'))) . " " .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
743 html::tag('input', array('type' => 'button', 'class' => 'button', 'id' => 'edit-attendee-schedule', 'value' => $this->cal->gettext('scheduletime').'...'))) .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
744 html::p('attendees-commentbox', html::label(null, $this->cal->gettext('itipcomment') . $textarea->show()))
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
745 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
746 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
747
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
748 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
749 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
750 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
751 function resources_form($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
752 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
753 $input = new html_inputfield(array('name' => 'resource', 'id' => 'edit-resource-name', 'size' => 30));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
754
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
755 return html::div($attrib,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
756 html::div(null, $input->show() . " " .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
757 html::tag('input', array('type' => 'button', 'class' => 'button', 'id' => 'edit-resource-add', 'value' => $this->cal->gettext('addresource'))) . " " .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
758 html::tag('input', array('type' => 'button', 'class' => 'button', 'id' => 'edit-resource-find', 'value' => $this->cal->gettext('findresources').'...')))
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
759 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
760 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
761
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
762 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
763 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
764 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
765 function resources_list($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
766 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
767 $attrib += array('id' => 'calendar-resources-list');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
768
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
769 $this->rc->output->add_gui_object('resourceslist', $attrib['id']);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
770
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
771 return html::tag('ul', $attrib, '', html::$common_attrib);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
772 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
773
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
774 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
775 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
776 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
777 public function resource_info($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
778 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
779 $attrib += array('id' => 'calendar-resources-info');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
780
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
781 $this->rc->output->add_gui_object('resourceinfo', $attrib['id']);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
782 $this->rc->output->add_gui_object('resourceownerinfo', $attrib['id'] . '-owner');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
783
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
784 // copy address book labels for owner details to client
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
785 $this->rc->output->add_label('name','firstname','surname','department','jobtitle','email','phone','address');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
786
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
787 $table_attrib = array('id','class','style','width','summary','cellpadding','cellspacing','border');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
788
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
789 return html::tag('table', $attrib,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
790 html::tag('tbody', null, ''), $table_attrib) .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
791
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
792 html::tag('table', array('id' => $attrib['id'] . '-owner', 'style' => 'display:none') + $attrib,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
793 html::tag('thead', null,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
794 html::tag('tr', null,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
795 html::tag('td', array('colspan' => 2), rcube::Q($this->cal->gettext('resourceowner')))
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
796 )
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
797 ) .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
798 html::tag('tbody', null, ''),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
799 $table_attrib);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
800 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
801
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
802 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
803 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
804 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
805 public function resource_calendar($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
806 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
807 $attrib += array('id' => 'calendar-resources-calendar');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
808
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
809 $this->rc->output->add_gui_object('resourceinfocalendar', $attrib['id']);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
810
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
811 return html::div($attrib, '');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
812 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
813
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
814 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
815 * GUI object 'searchform' for the resource finder dialog
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
816 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
817 * @param array Named parameters
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
818 * @return string HTML code for the gui object
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
819 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
820 function resources_search_form($attrib)
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
821 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
822 $attrib += array('command' => 'search-resource', 'id' => 'rcmcalresqsearchbox', 'autocomplete' => 'off');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
823 $attrib['name'] = '_q';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
824
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
825 $input_q = new html_inputfield($attrib);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
826 $out = $input_q->show();
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
827
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
828 // add form tag around text field
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
829 $out = $this->rc->output->form_tag(array(
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
830 'name' => "rcmcalresoursqsearchform",
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
831 'onsubmit' => rcmail_output::JS_OBJECT_NAME . ".command('" . $attrib['command'] . "'); return false",
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
832 'style' => "display:inline"),
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
833 $out);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
834
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
835 return $out;
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
836 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
837
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
838 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
839 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
840 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
841 function attendees_freebusy_table($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
842 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
843 $table = new html_table(array('cols' => 2, 'border' => 0, 'cellspacing' => 0));
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
844 $table->add('attendees',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
845 html::tag('h3', 'boxtitle', $this->cal->gettext('tabattendees')) .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
846 html::div('timesheader', '&nbsp;') .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
847 html::div(array('id' => 'schedule-attendees-list', 'class' => 'attendees-list'), '')
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
848 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
849 $table->add('times',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
850 html::div('scroll',
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
851 html::tag('table', array('id' => 'schedule-freebusy-times', 'border' => 0, 'cellspacing' => 0), html::tag('thead') . html::tag('tbody')) .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
852 html::div(array('id' => 'schedule-event-time', 'style' => 'display:none'), '&nbsp;')
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
853 )
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
854 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
855
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
856 return $table->show($attrib);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
857 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
858
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
859 /**
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
860 *
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
861 */
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
862 function event_invitebox($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
863 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
864 if ($this->cal->event) {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
865 return html::div($attrib,
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
866 $this->cal->itip->itip_object_details_table($this->cal->event, $this->cal->itip->gettext('itipinvitation')) .
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
867 $this->cal->invitestatus
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
868 );
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
869 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
870
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
871 return '';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
872 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
873
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
874 function event_rsvp_buttons($attrib = array())
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
875 {
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
876 $actions = array('accepted','tentative','declined');
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
877 if ($attrib['delegate'] !== 'false')
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
878 $actions[] = 'delegated';
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
879
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
880 return $this->cal->itip->itip_rsvp_buttons($attrib, $actions);
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
881 }
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
882
f6fe4b6ae66a calendar plugin nearly as distributed
Charlie Root
parents:
diff changeset
883 }