summaryrefslogtreecommitdiff
path: root/app/Subscriber/SubtaskTimesheetSubscriber.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-06-24 20:39:06 -0400
committerFrederic Guillot <fred@kanboard.net>2015-06-24 20:39:06 -0400
commit6efac784fcc1a2e83bb7b43fc7841448b5975cba (patch)
treea083b3c8b86deca9c4f23bcb15cfafeec86924e8 /app/Subscriber/SubtaskTimesheetSubscriber.php
parent58c96b8c4ec3f326b25e6b55f133fc067345cd57 (diff)
Add timer for subtasks and remove settings for subtask time tracking
Diffstat (limited to 'app/Subscriber/SubtaskTimesheetSubscriber.php')
-rw-r--r--app/Subscriber/SubtaskTimesheetSubscriber.php47
1 files changed, 0 insertions, 47 deletions
diff --git a/app/Subscriber/SubtaskTimesheetSubscriber.php b/app/Subscriber/SubtaskTimesheetSubscriber.php
deleted file mode 100644
index fdaf442f..00000000
--- a/app/Subscriber/SubtaskTimesheetSubscriber.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-
-namespace Subscriber;
-
-use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-use Model\Subtask;
-use Event\SubtaskEvent;
-
-class SubtaskTimesheetSubscriber extends \Core\Base implements EventSubscriberInterface
-{
- public static function getSubscribedEvents()
- {
- return array(
- Subtask::EVENT_CREATE => array('updateTaskTime', 0),
- Subtask::EVENT_UPDATE => array(
- array('logStartEnd', 10),
- array('updateTaskTime', 0),
- )
- );
- }
-
- public function updateTaskTime(SubtaskEvent $event)
- {
- if (isset($event['task_id'])) {
- $this->subtaskTimeTracking->updateTaskTimeTracking($event['task_id']);
- }
- }
-
- public function logStartEnd(SubtaskEvent $event)
- {
- if ($this->config->get('subtask_time_tracking') == 1 && isset($event['status'])) {
-
- $subtask = $this->subtask->getById($event['id']);
-
- if (empty($subtask['user_id'])) {
- return false;
- }
-
- if ($subtask['status'] == Subtask::STATUS_INPROGRESS) {
- return $this->subtaskTimeTracking->logStartTime($subtask['id'], $subtask['user_id']);
- }
- else {
- return $this->subtaskTimeTracking->logEndTime($subtask['id'], $subtask['user_id']);
- }
- }
- }
-}