Store ajax location in a separate field.
authorJan Schneider <jan@horde.org>
Mon, 30 Nov 2009 17:02:51 +0000 (18:02 +0100)
committerJan Schneider <jan@horde.org>
Mon, 30 Nov 2009 17:02:51 +0000 (18:02 +0100)
kronolith/js/kronolith.js
nag/lib/Task.php

index bde32be..3080d2a 100644 (file)
@@ -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);
                 }
index 65f7dc4..fd067ca 100644 (file)
@@ -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;