Reduce alarm settings UI to the capabilities of the Kolab 2 format
This commit is contained in:
parent
c822a713f1
commit
32d64e419e
7 changed files with 18 additions and 4 deletions
|
@ -87,6 +87,7 @@ abstract class calendar_driver
|
||||||
public $undelete = false; // event undelete action
|
public $undelete = false; // event undelete action
|
||||||
public $categoriesimmutable = false;
|
public $categoriesimmutable = false;
|
||||||
public $alarm_types = array('DISPLAY');
|
public $alarm_types = array('DISPLAY');
|
||||||
|
public $alarm_absolute = true;
|
||||||
public $last_error;
|
public $last_error;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -55,6 +55,11 @@ class kolab_driver extends calendar_driver
|
||||||
$this->cal->register_action('calendar-acl', array($this, 'calendar_acl'));
|
$this->cal->register_action('calendar-acl', array($this, 'calendar_acl'));
|
||||||
|
|
||||||
$this->freebusy_trigger = $this->rc->config->get('calendar_freebusy_trigger', false);
|
$this->freebusy_trigger = $this->rc->config->get('calendar_freebusy_trigger', false);
|
||||||
|
|
||||||
|
if (kolab_storage::$version == 2.0) {
|
||||||
|
$this->alarm_types = array('DISPLAY');
|
||||||
|
$this->alarm_absolute = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -327,7 +327,7 @@ class calendar_ui
|
||||||
*/
|
*/
|
||||||
function alarm_select($attrib = array())
|
function alarm_select($attrib = array())
|
||||||
{
|
{
|
||||||
return $this->cal->lib->alarm_select($attrib, $this->cal->driver->alarm_types);
|
return $this->cal->lib->alarm_select($attrib, $this->cal->driver->alarm_types, $this->cal->driver->alarm_absolute);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -239,7 +239,7 @@ class libcalendaring extends rcube_plugin
|
||||||
/**
|
/**
|
||||||
* Render HTML form for alarm configuration
|
* Render HTML form for alarm configuration
|
||||||
*/
|
*/
|
||||||
public function alarm_select($attrib, $alarm_types)
|
public function alarm_select($attrib, $alarm_types, $absolute_time = true)
|
||||||
{
|
{
|
||||||
unset($attrib['name']);
|
unset($attrib['name']);
|
||||||
$select_type = new html_select(array('name' => 'alarmtype[]', 'class' => 'edit-alarm-type'));
|
$select_type = new html_select(array('name' => 'alarmtype[]', 'class' => 'edit-alarm-type'));
|
||||||
|
@ -252,9 +252,12 @@ class libcalendaring extends rcube_plugin
|
||||||
$input_time = new html_inputfield(array('name' => 'alarmtime[]', 'class' => 'edit-alarm-time', 'size' => 6));
|
$input_time = new html_inputfield(array('name' => 'alarmtime[]', 'class' => 'edit-alarm-time', 'size' => 6));
|
||||||
|
|
||||||
$select_offset = new html_select(array('name' => 'alarmoffset[]', 'class' => 'edit-alarm-offset'));
|
$select_offset = new html_select(array('name' => 'alarmoffset[]', 'class' => 'edit-alarm-offset'));
|
||||||
foreach (array('-M','-H','-D','+M','+H','+D','@') as $trigger)
|
foreach (array('-M','-H','-D','+M','+H','+D') as $trigger)
|
||||||
$select_offset->add($this->gettext('trigger' . $trigger), $trigger);
|
$select_offset->add($this->gettext('trigger' . $trigger), $trigger);
|
||||||
|
|
||||||
|
if ($absolute_time)
|
||||||
|
$select_offset->add($this->gettext('trigger@'), '@');
|
||||||
|
|
||||||
// pre-set with default values from user settings
|
// pre-set with default values from user settings
|
||||||
$preset = self::parse_alaram_value($this->rc->config->get('calendar_default_alarm_offset', '-15M'));
|
$preset = self::parse_alaram_value($this->rc->config->get('calendar_default_alarm_offset', '-15M'));
|
||||||
$hidden = array('style' => 'display:none');
|
$hidden = array('style' => 'display:none');
|
||||||
|
|
|
@ -46,6 +46,10 @@ class tasklist_kolab_driver extends tasklist_driver
|
||||||
$this->plugin = $plugin;
|
$this->plugin = $plugin;
|
||||||
|
|
||||||
$this->_read_lists();
|
$this->_read_lists();
|
||||||
|
|
||||||
|
if (kolab_storage::$version == 2.0) {
|
||||||
|
$this->alarm_absolute = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -58,6 +58,7 @@ abstract class tasklist_driver
|
||||||
public $undelete = false; // task undelete action
|
public $undelete = false; // task undelete action
|
||||||
public $sortable = false;
|
public $sortable = false;
|
||||||
public $alarm_types = array('DISPLAY');
|
public $alarm_types = array('DISPLAY');
|
||||||
|
public $alarm_absolute = true;
|
||||||
public $last_error;
|
public $last_error;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -173,7 +173,7 @@ class tasklist_ui
|
||||||
*/
|
*/
|
||||||
function alarm_select($attrib = array())
|
function alarm_select($attrib = array())
|
||||||
{
|
{
|
||||||
return $this->plugin->lib->alarm_select($attrib, $this->plugin->driver->alarm_types);
|
return $this->plugin->lib->alarm_select($attrib, $this->plugin->driver->alarm_types, $this->plugin->driver->alarm_absolute);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue