From d69409438fde86840c8af11681df9b06f8913b3d Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Mon, 30 Nov 2009 18:02:51 +0100 Subject: [PATCH] Store ajax location in a separate field. --- kronolith/js/kronolith.js | 6 +++++- nag/lib/Task.php | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index bde32bee9..3080d2a53 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -127,7 +127,11 @@ KronolithCore = { break; } message = m.alarm.title.escapeHTML(); - if (!Object.isUndefined(m.alarm.url)) { + if (!Object.isUndefined(m.alarm.ajax)) { + message = new Element('a') + .insert(message) + .observe('click', function() { this.go(m.alarm.ajax); }.bind(this)); + } else if (!Object.isUndefined(m.alarm.url)) { message = new Element('a', { 'href': m.alarm.url }) .insert(message); } diff --git a/nag/lib/Task.php b/nag/lib/Task.php index 65f7dc40e..fd067ca92 100644 --- a/nag/lib/Task.php +++ b/nag/lib/Task.php @@ -746,8 +746,8 @@ class Nag_Task { $methods['notify']['show'] = array( '__app' => $GLOBALS['registry']->getApp(), 'task' => $this->id, - 'tasklist' => $this->tasklist, - 'ajax' => 'task:' . $this->tasklist . ':' . $this->id); + 'tasklist' => $this->tasklist); + $methods['notify']['ajax'] = 'task:' . $this->tasklist . ':' . $this->id; if (!empty($methods['notify']['sound'])) { if ($methods['notify']['sound'] == 'on') { // Handle boolean sound preferences; -- 2.11.0