Changeset View
Changeset View
Standalone View
Standalone View
plugins/tasklist/tasklist_ui.php
Show First 20 Lines • Show All 155 Lines • ▼ Show 20 Lines | public function init_templates() | ||||
$this->plugin->register_handler('plugin.attachments_list', array($this, 'attachments_list')); | $this->plugin->register_handler('plugin.attachments_list', array($this, 'attachments_list')); | ||||
$this->plugin->register_handler('plugin.filedroparea', array($this, 'file_drop_area')); | $this->plugin->register_handler('plugin.filedroparea', array($this, 'file_drop_area')); | ||||
$this->plugin->register_handler('plugin.attendees_list', array($this, 'attendees_list')); | $this->plugin->register_handler('plugin.attendees_list', array($this, 'attendees_list')); | ||||
$this->plugin->register_handler('plugin.attendees_form', array($this, 'attendees_form')); | $this->plugin->register_handler('plugin.attendees_form', array($this, 'attendees_form')); | ||||
$this->plugin->register_handler('plugin.identity_select', array($this, 'identity_select')); | $this->plugin->register_handler('plugin.identity_select', array($this, 'identity_select')); | ||||
$this->plugin->register_handler('plugin.edit_attendees_notify', array($this, 'edit_attendees_notify')); | $this->plugin->register_handler('plugin.edit_attendees_notify', array($this, 'edit_attendees_notify')); | ||||
$this->plugin->register_handler('plugin.task_rsvp_buttons', array($this->plugin->itip, 'itip_rsvp_buttons')); | $this->plugin->register_handler('plugin.task_rsvp_buttons', array($this->plugin->itip, 'itip_rsvp_buttons')); | ||||
$this->plugin->register_handler('plugin.object_changelog_table', array('libkolab', 'object_changelog_table')); | $this->plugin->register_handler('plugin.object_changelog_table', array('libkolab', 'object_changelog_table')); | ||||
$this->plugin->register_handler('plugin.tasks_export_form', array($this, 'tasks_export_form')); | |||||
jqueryui::tagedit(); | jqueryui::tagedit(); | ||||
$this->plugin->include_script('tasklist.js'); | $this->plugin->include_script('tasklist.js'); | ||||
$this->rc->output->include_script('treelist.js'); | $this->rc->output->include_script('treelist.js'); | ||||
// include kolab folderlist widget if available | // include kolab folderlist widget if available | ||||
if (in_array('libkolab', $this->plugin->api->loaded_plugins())) { | if (in_array('libkolab', $this->plugin->api->loaded_plugins())) { | ||||
▲ Show 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | function status_select($attrib = array()) | ||||
return $select->show(null); | return $select->show(null); | ||||
} | } | ||||
/** | /** | ||||
* Render a HTML select box for list selection | * Render a HTML select box for list selection | ||||
*/ | */ | ||||
function tasklist_select($attrib = array()) | function tasklist_select($attrib = array()) | ||||
{ | { | ||||
if (empty($attrib['name'])) { | |||||
$attrib['name'] = 'list'; | $attrib['name'] = 'list'; | ||||
} | |||||
$attrib['is_escaped'] = true; | $attrib['is_escaped'] = true; | ||||
$select = new html_select($attrib); | $select = new html_select($attrib); | ||||
$default = null; | $default = null; | ||||
foreach ((array) $attrib['extra'] as $id => $name) { | |||||
$select->add($name, $id); | |||||
} | |||||
foreach ((array)$this->plugin->driver->get_lists() as $id => $prop) { | foreach ((array)$this->plugin->driver->get_lists() as $id => $prop) { | ||||
if ($prop['editable'] || strpos($prop['rights'], 'i') !== false) { | if ($prop['editable'] || strpos($prop['rights'], 'i') !== false) { | ||||
$select->add($prop['name'], $id); | $select->add($prop['name'], $id); | ||||
if (!$default || $prop['default']) | if (!$default || $prop['default']) | ||||
$default = $id; | $default = $id; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 195 Lines • ▼ Show 20 Lines | // $table->add_header('role', $this->plugin->gettext('role')); | ||||
*/ | */ | ||||
function edit_attendees_notify($attrib = array()) | function edit_attendees_notify($attrib = array()) | ||||
{ | { | ||||
$checkbox = new html_checkbox(array('name' => '_notify', 'id' => 'edit-attendees-donotify', 'value' => 1)); | $checkbox = new html_checkbox(array('name' => '_notify', 'id' => 'edit-attendees-donotify', 'value' => 1)); | ||||
return html::div($attrib, html::label(null, $checkbox->show(1) . ' ' . $this->plugin->gettext('sendnotifications'))); | return html::div($attrib, html::label(null, $checkbox->show(1) . ' ' . $this->plugin->gettext('sendnotifications'))); | ||||
} | } | ||||
/** | /** | ||||
* Form to select options for exporting tasks | |||||
*/ | |||||
function tasks_export_form($attrib = array()) | |||||
{ | |||||
if (!$attrib['id']) { | |||||
$attrib['id'] = 'rcmTaskExportForm'; | |||||
} | |||||
$html .= html::div('form-section', | |||||
html::label('task-export-list', $this->plugin->gettext('list')) . | |||||
$this->tasklist_select(array( | |||||
'name' => 'source', | |||||
'id' => 'task-export-list', | |||||
'extra' => array('' => '- ' . $this->plugin->gettext('currentview') . ' -'), | |||||
)) | |||||
); | |||||
$checkbox = new html_checkbox(array('name' => 'attachments', 'id' => 'task-export-attachments', 'value' => 1)); | |||||
$html .= html::div('form-section', | |||||
html::label('task-export-attachments', $this->plugin->gettext('exportattachments')) . | |||||
$checkbox->show(1) | |||||
); | |||||
$this->register_gui_object('exportform', $attrib['id']); | |||||
return html::tag('form', array('action' => $this->rc->url(array('task' => 'tasklist', 'action' => 'export')), | |||||
'method' => "post", 'id' => $attrib['id']), | |||||
$html | |||||
); | |||||
} | |||||
/** | |||||
* Wrapper for rcube_output_html::add_gui_object() | * Wrapper for rcube_output_html::add_gui_object() | ||||
*/ | */ | ||||
function register_gui_object($name, $id) | function register_gui_object($name, $id) | ||||
{ | { | ||||
$this->gui_objects[$name] = $id; | $this->gui_objects[$name] = $id; | ||||
$this->rc->output->add_gui_object($name, $id); | $this->rc->output->add_gui_object($name, $id); | ||||
} | } | ||||
Show All 9 Lines |