summaryrefslogtreecommitdiff
path: root/events
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-05-17 17:35:39 -0400
committerFrédéric Guillot <fred@kanboard.net>2014-05-17 17:35:39 -0400
commit5e4b40665fa11ce0fd0fe957a19e2b7e63f47446 (patch)
treeb0e458788f84c03608154866ec3e964ec89ccb14 /events
parent09da5720e8dccaa2437a7b25d992eaa104753684 (diff)
Rewrite board drag and drop with jquery (touch devices, IE, auto-update)
Diffstat (limited to 'events')
-rw-r--r--events/task_modification.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/events/task_modification.php b/events/task_modification.php
new file mode 100644
index 00000000..97ee73fd
--- /dev/null
+++ b/events/task_modification.php
@@ -0,0 +1,51 @@
+<?php
+
+namespace Event;
+
+use \Core\Listener;
+use \Model\Project;
+
+/**
+ * Task modification listener
+ *
+ * @package events
+ * @author Frederic Guillot
+ */
+class TaskModification implements Listener
+{
+ /**
+ * Project model
+ *
+ * @accesss private
+ * @var \Model\Project
+ */
+ private $project;
+
+ /**
+ * Constructor
+ *
+ * @access public
+ * @param \Model\Project $project Project model instance
+ */
+ public function __construct(Project $project)
+ {
+ $this->project = $project;
+ }
+
+ /**
+ * Execute the action
+ *
+ * @access public
+ * @param array $data Event data dictionary
+ * @return bool True if the action was executed or false when not executed
+ */
+ public function execute(array $data)
+ {
+ if (isset($data['project_id'])) {
+ $this->project->updateModificationDate($data['project_id']);
+ return true;
+ }
+
+ return false;
+ }
+}