this.alarms.push(alarm.id);
message = alarm.title.escapeHTML();
- if (!Object.isUndefined(alarm.params) &&
- !Object.isUndefined(alarm.params.notify)) {
- if (!Object.isUndefined(alarm.params.notify.ajax)) {
+ if (alarm.params && alarm.params.notify) {
+ if (alarm.params.notify.ajax) {
message = new Element('a')
.insert(message)
.observe('click', function() {
this.Growler.ungrowl(growl);
this.go(alarm.params.notify.ajax);
}.bind(this));
- } else if (!Object.isUndefined(alarm.params.notify.url)) {
+ } else if (alarm.params.notify.url) {
message = new Element('a', { href: alarm.params.notify.url })
.insert(message);
}
}
message = new Element('div')
.insert(message);
+ if (alarm.params && alarm.params.notify &&
+ alarm.params.notify.subtitle) {
+ message.insert(new Element('br')).insert(alarm.params.notify.subtitle);
+ }
if (alarm.user) {
var select = '<select>';
$H(Kronolith.conf.snooze).each(function(snooze) {
$methods['notify']['sound'] = $GLOBALS['registry']->get('themesuri', 'horde') . '/sounds/' . $methods['notify']['sound'];
}
}
+ if ($this->isAllDay()) {
+ if ($this->start->compareDate($this->end) == 0) {
+ $methods['notify']['subtitle'] = sprintf(_("On %s"), '<strong>' . $this->start->strftime($prefs->getValue('date_format')) . '</strong>');
+ } else {
+ $methods['notify']['subtitle'] = sprintf(_("From %s to %s"), '<strong>' . $this->start->strftime($prefs->getValue('date_format')) . '</strong>', '<strong>' . $this->end->strftime($prefs->getValue('date_format')) . '</strong>');
+ }
+ } else {
+ $methods['notify']['subtitle'] = sprintf(_("From %s at %s to %s at %s"), '<strong>' . $this->start->strftime($prefs->getValue('date_format')), $this->start->format($prefs->getValue('twentyFour') ? 'H:i' : 'h:ia') . '</strong>', '<strong>' . $this->end->strftime($prefs->getValue('date_format')), $this->end->format($prefs->getValue('twentyFour') ? 'H:i' : 'h:ia') . '</strong>');
+ }
}
if (isset($methods['mail'])) {
$methods['mail']['body'] = sprintf(