forked from extern/egroupware
Add ability to set an alarm for after the appointment [starts]
This commit is contained in:
parent
c30e35bdd8
commit
e1505758b7
@ -835,6 +835,7 @@ class calendar_uiforms extends calendar_ui
|
||||
case 'add_alarm':
|
||||
$time = ($content['actual_date'] ? $content['actual_date'] : $content['start']);
|
||||
$offset = DAY_s * $content['new_alarm']['days'] + HOUR_s * $content['new_alarm']['hours'] + 60 * $content['new_alarm']['mins'];
|
||||
if($content['before_after']) $offset *= -1;
|
||||
if ($event['recur_type'] != MCAL_RECUR_NONE &&
|
||||
($next_occurrence = $this->bo->read($event['id'], $this->bo->now_su + $offset, true)) &&
|
||||
$time < $next_occurrence['start'])
|
||||
@ -1033,6 +1034,7 @@ class calendar_uiforms extends calendar_ui
|
||||
'status' => $this->bo->verbose_status,
|
||||
'duration' => $this->durations,
|
||||
'role' => $this->bo->roles,
|
||||
'before_after'=>array(0 => lang('Before'), 1 => lang('After')),
|
||||
'action' => array(
|
||||
'copy' => array('label' => 'Copy', 'title' => 'Copy this event'),
|
||||
'ical' => array('label' => 'Export', 'title' => 'Download this event as iCal'),
|
||||
@ -1304,6 +1306,12 @@ function replace_eTemplate_onsubmit()
|
||||
continue; // no read rights to the calendar of the alarm-owner, dont show the alarm
|
||||
}
|
||||
$alarm['all'] = (int) $alarm['all'];
|
||||
$after = false;
|
||||
if($alarm['offset'] < 0)
|
||||
{
|
||||
$after = true;
|
||||
$alarm['offset'] = -1 * $alarm['offset'];
|
||||
}
|
||||
$days = (int) ($alarm['offset'] / DAY_s);
|
||||
$hours = (int) (($alarm['offset'] % DAY_s) / HOUR_s);
|
||||
$minutes = (int) (($alarm['offset'] % HOUR_s) / 60);
|
||||
@ -1311,7 +1319,7 @@ function replace_eTemplate_onsubmit()
|
||||
if ($days) $label[] = $days.' '.lang('days');
|
||||
if ($hours) $label[] = $hours.' '.lang('hours');
|
||||
if ($minutes) $label[] = $minutes.' '.lang('Minutes');
|
||||
$alarm['offset'] = implode(', ',$label);
|
||||
$alarm['offset'] = implode(', ',$label) . ' ' . ($after ? lang('after') : lang('before'));
|
||||
$content['alarm'][] = $alarm;
|
||||
|
||||
$readonlys['delete_alarm['.$id.']'] = !$this->bo->check_perms(EGW_ACL_EDIT,$alarm['all'] ? $event : 0,$alarm['owner']);
|
||||
|
@ -2,7 +2,7 @@
|
||||
/**
|
||||
* eGroupWare - eTemplates for Application calendar
|
||||
* http://www.egroupware.org
|
||||
* generated by soetemplate::dump4setup() 2010-09-27 10:42
|
||||
* generated by soetemplate::dump4setup() 2010-10-06 11:37
|
||||
*
|
||||
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||
* @package calendar
|
||||
@ -23,7 +23,7 @@ $templ_data[] = array('name' => 'calendar.delete_series','template' => '','lang'
|
||||
$templ_data[] = array('name' => 'calendar.edit','template' => '','lang' => '','group' => '0','version' => '1.7.003','data' => 'a:1:{i:0;a:5:{s:4:"type";s:4:"grid";s:4:"data";a:7:{i:0;a:7:{s:1:"A";s:3:"100";s:1:"B";s:3:"300";s:2:"h1";s:6:",!@msg";s:2:"c2";s:2:"th";s:2:"h2";s:2:"28";s:2:"h4";s:8:",!@owner";s:2:"h6";s:13:",!@recur_type";}i:1;a:4:{s:1:"A";a:5:{s:4:"span";s:13:"all,redItalic";s:7:"no_lang";s:1:"1";s:5:"align";s:6:"center";s:4:"name";s:3:"msg";s:4:"type";s:4:"html";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}}i:2;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"Title";}s:1:"B";a:5:{s:4:"size";s:6:"80,255";s:4:"span";s:3:"all";s:6:"needed";s:1:"1";s:4:"name";s:5:"title";s:4:"type";s:4:"text";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}}i:3;a:4:{s:1:"A";a:5:{s:4:"span";s:3:"all";s:4:"name";s:76:"tabs=general|description|participants|recurrence|custom|links|alarms|history";s:4:"type";s:3:"tab";s:5:"label";s:71:"General|Description|Participants|Recurrence|Custom|Links|Alarms|History";s:4:"help";s:173:"Location, Start- and Endtimes, ...|Full description|Participants, Resources, ...|Repeating Event Information|Custom fields|Links, Attachments|Alarm management|Change history";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}}i:4;a:4:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"Owner";}s:1:"B";a:3:{s:4:"type";s:14:"select-account";s:8:"readonly";s:4:"true";s:4:"name";s:5:"owner";}s:1:"C";a:7:{s:5:"label";s:7:"Updated";s:8:"readonly";s:4:"true";s:7:"no_lang";s:1:"1";s:5:"align";s:5:"right";s:4:"name";s:8:"modified";s:4:"type";s:9:"date-time";s:4:"span";s:8:",noBreak";}s:1:"D";a:6:{s:5:"class";s:7:"noBreak";s:4:"type";s:14:"select-account";s:5:"label";s:2:"by";s:8:"readonly";s:4:"true";s:5:"align";s:5:"right";s:4:"name";s:8:"modifier";}}i:5;a:4:{s:1:"A";a:7:{s:4:"span";s:1:"3";s:4:"type";s:4:"hbox";s:4:"size";s:1:"4";i:1;a:4:{s:5:"label";s:4:"Save";s:4:"name";s:12:"button[save]";s:4:"type";s:6:"button";s:4:"help";s:22:"saves the changes made";}i:2;a:4:{s:5:"label";s:5:"Apply";s:4:"name";s:13:"button[apply]";s:4:"type";s:6:"button";s:4:"help";s:17:"apply the changes";}i:3;a:5:{s:5:"label";s:6:"Cancel";s:7:"onclick";s:15:"window.close();";s:4:"name";s:14:"button[cancel]";s:4:"type";s:6:"button";s:4:"help";s:16:"Close the window";}i:4;a:5:{s:8:"onchange";s:34:"this.form.submit(); this.value=\'\';";s:4:"name";s:6:"action";s:4:"size";s:10:"Actions...";s:4:"type";s:6:"select";s:4:"help";s:39:"Execute a further action for this entry";}}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:6:{s:5:"label";s:6:"Delete";s:7:"onclick";s:137:"if ($cont[recur_type]) { getElementById(\'delete_series\').style.display=\'block\'; return false; } else return confirm(\'Delete this event\');";s:5:"align";s:5:"right";s:4:"name";s:14:"button[delete]";s:4:"type";s:6:"button";s:4:"help";s:17:"Delete this event";}}i:6;a:4:{s:1:"A";a:3:{s:4:"type";s:8:"template";s:4:"span";s:3:"all";s:4:"name";s:22:"calendar.delete_series";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}}}s:4:"cols";i:4;s:4:"rows";i:6;s:4:"size";s:4:"100%";}}','size' => '100%','style' => '.end_hide { display: block; white-space: nowrap; margin-left: 10px; }
|
||||
.noBreak { white-space: nowrap; }','modified' => '1274342574',);
|
||||
|
||||
$templ_data[] = array('name' => 'calendar.edit.alarms','template' => '','lang' => '','group' => '0','version' => '1.0.1.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:5:{s:2:"c1";s:3:"row";s:1:"A";s:2:"95";s:2:"h1";s:16:"20,@no_add_alarm";s:2:"c2";s:4:",top";s:2:"h2";s:8:",!@alarm";}i:1;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:16:"before the event";}s:1:"B";a:10:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"8";i:1;a:4:{s:4:"type";s:13:"select-number";s:4:"size";s:4:",0,7";s:4:"name";s:15:"new_alarm[days]";s:4:"help";s:4:"days";}i:2;a:3:{s:4:"type";s:5:"label";s:4:"size";s:18:",,,new_alarm[days]";s:5:"label";s:4:"days";}i:3;a:4:{s:4:"type";s:13:"select-number";s:4:"name";s:16:"new_alarm[hours]";s:4:"size";s:5:",0,23";s:4:"help";s:5:"hours";}i:4;a:3:{s:4:"type";s:5:"label";s:4:"size";s:19:",,,new_alarm[hours]";s:5:"label";s:5:"hours";}i:5;a:4:{s:4:"type";s:13:"select-number";s:4:"name";s:15:"new_alarm[mins]";s:4:"size";s:7:",0,55,5";s:4:"help";s:7:"Minutes";}i:6;a:3:{s:4:"type";s:5:"label";s:4:"size";s:18:",,,new_alarm[mins]";s:5:"label";s:7:"Minutes";}i:7;a:5:{s:4:"type";s:6:"select";s:4:"name";s:16:"new_alarm[owner]";s:7:"no_lang";s:1:"1";s:5:"label";s:3:"for";s:4:"help";s:31:"Select who should get the alarm";}i:8;a:3:{s:4:"type";s:6:"button";s:4:"name";s:17:"button[add_alarm]";s:5:"label";s:9:"Add alarm";}}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:6:"Alarms";}s:1:"B";a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:2:{s:2:"c1";s:2:"th";s:2:"c2";s:3:"row";}i:1;a:5:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:4:"Time";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:16:"before the event";}s:1:"C";a:2:{s:4:"type";s:5:"label";s:5:"label";s:16:"All participants";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"Owner";}s:1:"E";a:2:{s:4:"type";s:5:"label";s:5:"label";s:6:"Action";}}i:2;a:5:{s:1:"A";a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:12:"${row}[time]";s:8:"readonly";s:1:"1";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:4:"name";s:14:"${row}[offset]";s:7:"no_lang";s:1:"1";}s:1:"C";a:4:{s:4:"type";s:8:"checkbox";s:5:"align";s:6:"center";s:4:"name";s:11:"${row}[all]";s:8:"readonly";s:1:"1";}s:1:"D";a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:13:"${row}[owner]";s:8:"readonly";s:1:"1";}s:1:"E";a:7:{s:4:"type";s:6:"button";s:4:"size";s:6:"delete";s:5:"label";s:6:"Delete";s:5:"align";s:6:"center";s:4:"name";s:27:"delete_alarm[$row_cont[id]]";s:4:"help";s:17:"Delete this alarm";s:7:"onclick";s:36:"return confirm(\'Delete this alarm\');";}}}s:4:"rows";i:2;s:4:"cols";i:5;s:4:"name";s:5:"alarm";s:7:"options";a:0:{}}}}s:4:"rows";i:2;s:4:"cols";i:2;s:4:"size";s:17:"100%,210,,,,,auto";s:7:"options";a:3:{i:0;s:4:"100%";i:1;s:3:"210";i:6;s:4:"auto";}}}','size' => '100%,210,,,,,auto','style' => '','modified' => '1118780740',);
|
||||
$templ_data[] = array('name' => 'calendar.edit.alarms','template' => '','lang' => '','group' => '0','version' => '1.9.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:5:{s:2:"c1";s:3:"row";s:1:"A";s:4:"95px";s:2:"h1";s:16:"20,@no_add_alarm";s:2:"c2";s:4:",top";s:2:"h2";s:8:",!@alarm";}i:1;a:2:{s:1:"A";a:3:{s:4:"type";s:6:"select";s:4:"name";s:12:"before_after";s:5:"label";s:12:"%s the event";}s:1:"B";a:10:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"8";i:1;a:4:{s:4:"type";s:13:"select-number";s:4:"size";s:4:",0,7";s:4:"name";s:15:"new_alarm[days]";s:4:"help";s:4:"days";}i:2;a:3:{s:4:"type";s:5:"label";s:4:"size";s:18:",,,new_alarm[days]";s:5:"label";s:4:"days";}i:3;a:4:{s:4:"type";s:13:"select-number";s:4:"name";s:16:"new_alarm[hours]";s:4:"size";s:5:",0,23";s:4:"help";s:5:"hours";}i:4;a:3:{s:4:"type";s:5:"label";s:4:"size";s:19:",,,new_alarm[hours]";s:5:"label";s:5:"hours";}i:5;a:4:{s:4:"type";s:13:"select-number";s:4:"name";s:15:"new_alarm[mins]";s:4:"size";s:7:",0,55,5";s:4:"help";s:7:"Minutes";}i:6;a:3:{s:4:"type";s:5:"label";s:4:"size";s:18:",,,new_alarm[mins]";s:5:"label";s:7:"Minutes";}i:7;a:5:{s:4:"type";s:6:"select";s:4:"name";s:16:"new_alarm[owner]";s:7:"no_lang";s:1:"1";s:5:"label";s:3:"for";s:4:"help";s:31:"Select who should get the alarm";}i:8;a:3:{s:4:"type";s:6:"button";s:4:"name";s:17:"button[add_alarm]";s:5:"label";s:9:"Add alarm";}}}i:2;a:2:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:6:"Alarms";}s:1:"B";a:6:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:2:{s:2:"c1";s:2:"th";s:2:"c2";s:3:"row";}i:1;a:5:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:4:"Time";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:16:"before the event";}s:1:"C";a:2:{s:4:"type";s:5:"label";s:5:"label";s:16:"All participants";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"Owner";}s:1:"E";a:2:{s:4:"type";s:5:"label";s:5:"label";s:6:"Action";}}i:2;a:5:{s:1:"A";a:3:{s:4:"type";s:9:"date-time";s:4:"name";s:12:"${row}[time]";s:8:"readonly";s:1:"1";}s:1:"B";a:3:{s:4:"type";s:5:"label";s:4:"name";s:14:"${row}[offset]";s:7:"no_lang";s:1:"1";}s:1:"C";a:4:{s:4:"type";s:8:"checkbox";s:5:"align";s:6:"center";s:4:"name";s:11:"${row}[all]";s:8:"readonly";s:1:"1";}s:1:"D";a:3:{s:4:"type";s:14:"select-account";s:4:"name";s:13:"${row}[owner]";s:8:"readonly";s:1:"1";}s:1:"E";a:7:{s:4:"type";s:6:"button";s:4:"size";s:6:"delete";s:5:"label";s:6:"Delete";s:5:"align";s:6:"center";s:4:"name";s:27:"delete_alarm[$row_cont[id]]";s:4:"help";s:17:"Delete this alarm";s:7:"onclick";s:36:"return confirm(\'Delete this alarm\');";}}}s:4:"rows";i:2;s:4:"cols";i:5;s:4:"name";s:5:"alarm";s:7:"options";a:0:{}}}}s:4:"rows";i:2;s:4:"cols";i:2;s:4:"size";s:17:"100%,210,,,,,auto";s:7:"options";a:3:{i:0;s:4:"100%";i:1;s:3:"210";i:6;s:4:"auto";}}}','size' => '100%,210,,,,,auto','style' => '','modified' => '1286382659',);
|
||||
|
||||
$templ_data[] = array('name' => 'calendar.edit.custom','template' => '','lang' => '','group' => '0','version' => '1.4.001','data' => 'a:1:{i:0;a:6:{s:4:"type";s:4:"grid";s:4:"data";a:2:{i:0;a:1:{s:2:"c1";s:4:",top";}i:1;a:1:{s:1:"A";a:1:{s:4:"type";s:12:"customfields";}}}s:4:"rows";i:1;s:4:"cols";i:1;s:4:"size";s:17:"100%,210,,,,,auto";s:7:"options";a:3:{i:0;s:4:"100%";i:1;s:3:"210";i:6;s:4:"auto";}}}','size' => '100%,210,,,,,auto','style' => '','modified' => '1184167751',);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user