From 3b687f9a0ea84e7c0ef8e41e1b969816b064f46b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carlos=20Tim=C3=B3teo?= <ctimoteo@sapo.pt>
Date: Wed, 12 Feb 2014 18:11:46 +0000
Subject: [PATCH] Added alarm icon to tasks (dynamic view only)

---
 kronolith/js/kronolith.js |    7 +++++++
 nag/lib/Task.php          |    5 +++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js
index 54de49c..b768b88 100644
--- a/kronolith/js/kronolith.js
+++ b/kronolith/js/kronolith.js
@@ -2434,6 +2434,13 @@ KronolithCore = {
             });
             col.insert(tagc);
         }
+
+        //Check if task has alarm set, add icon if has
+        if ( task.value.a ) {
+            col.insert(' ')
+            .insert(new Element('img', { src: Kronolith.conf.images.alarm.replace(/fff/, Kronolith.conf.calendars.tasklists['tasks/' + task.value.l].fg.substr(1)), title: Kronolith.text.alerts })); 
+        }
+
         row.insert(col.show());
         this.insertTaskPosition(row, task);
     },
diff --git a/nag/lib/Task.php b/nag/lib/Task.php
index 1912fae..90df984 100644
--- a/nag/lib/Task.php
+++ b/nag/lib/Task.php
@@ -969,6 +969,9 @@ class Nag_Task
         }
         $json->t = array_values($this->tags);
 
+        $json->a = (int)$this->alarm;
+        $json->m = $this->methods;
+
         if ($full) {
             // @todo: do we really need all this?
             $json->id = $this->id;
@@ -992,8 +995,6 @@ class Nag_Task
                 $json->cd = $date->toJson();
             }
             */
-            $json->a = (int)$this->alarm;
-            $json->m = $this->methods;
             //$json->pv = (boolean)$this->private;
             if ($this->recurs()) {
                 $json->r = $this->recurrence->toJson();
-- 
1.7.1