From 38c31e47804757bf2e25b655d5081c0dfa3c82f5 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 28 Sep 2016 22:07:54 +0200 Subject: [PATCH 01/17] Preparing for query extension implementing media for task/task elements and preparing for unit parent display. --- Admin/Installer.php | 34 ++++++++++++++++++++++++++++++++++ Admin/Routes/Web/Api.php | 18 ++++++++++++++++++ Admin/Routes/Web/Backend.php | 13 ------------- Models/Task.php | 2 ++ Models/TaskElementMapper.php | 15 +++++++++++++++ Models/TaskMapper.php | 7 ++++++- 6 files changed, 75 insertions(+), 14 deletions(-) create mode 100644 Admin/Routes/Web/Api.php diff --git a/Admin/Installer.php b/Admin/Installer.php index 5355af8..191d8a3 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -69,6 +69,23 @@ class Installer extends InstallerAbstract ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'task_ibfk_2` FOREIGN KEY (`task_created_by`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`);' )->execute(); + $dbPool->get('core')->con->prepare( + 'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'task_media` ( + `task_media_id` int(11) NOT NULL AUTO_INCREMENT, + `task_media_src` int(11) NULL, + `task_media_dst` int(11) NULL, + PRIMARY KEY (`task_media_id`), + KEY `task_media_src` (`task_media_src`), + KEY `task_media_dst` (`task_media_dst`) + )ENGINE=InnoDB DEFAULT CHARSET=utf8;' + )->execute(); + + $dbPool->get('core')->con->prepare( + 'ALTER TABLE `' . $dbPool->get('core')->prefix . 'task_media` + ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'task_media_ibfk_1` FOREIGN KEY (`task_media_src`) REFERENCES `' . $dbPool->get('core')->prefix . 'task` (`task_id`), + ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'task_media_ibfk_2` FOREIGN KEY (`task_media_dst`) REFERENCES `' . $dbPool->get('core')->prefix . 'media` (`media_id`);' + )->execute(); + $dbPool->get('core')->con->prepare( 'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'task_account` ( `task_account_id` int(11) NOT NULL AUTO_INCREMENT, @@ -112,6 +129,23 @@ class Installer extends InstallerAbstract ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'task_element_ibfk_3` FOREIGN KEY (`task_element_forwarded`) REFERENCES `' . $dbPool->get('core')->prefix . 'account` (`account_id`);' )->execute(); + $dbPool->get('core')->con->prepare( + 'CREATE TABLE if NOT EXISTS `' . $dbPool->get('core')->prefix . 'task_element_media` ( + `task_element_media_id` int(11) NOT NULL AUTO_INCREMENT, + `task_element_media_src` int(11) NULL, + `task_element_media_dst` int(11) NULL, + PRIMARY KEY (`task_element_media_id`), + KEY `task_element_media_src` (`task_element_media_src`), + KEY `task_element_media_dst` (`task_element_media_dst`) + )ENGINE=InnoDB DEFAULT CHARSET=utf8;' + )->execute(); + + $dbPool->get('core')->con->prepare( + 'ALTER TABLE `' . $dbPool->get('core')->prefix . 'task_element_media` + ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'task_element_media_ibfk_1` FOREIGN KEY (`task_element_media_src`) REFERENCES `' . $dbPool->get('core')->prefix . 'task_element` (`task_element_id`), + ADD CONSTRAINT `' . $dbPool->get('core')->prefix . 'task_element_media_ibfk_2` FOREIGN KEY (`task_element_media_dst`) REFERENCES `' . $dbPool->get('core')->prefix . 'media` (`media_id`);' + )->execute(); + $dbPool->get('core')->con->commit(); break; } diff --git a/Admin/Routes/Web/Api.php b/Admin/Routes/Web/Api.php new file mode 100644 index 0000000..85d0dc1 --- /dev/null +++ b/Admin/Routes/Web/Api.php @@ -0,0 +1,18 @@ + [ + [ + 'dest' => '\Modules\Tasks\Controller:apiTaskCreate', + 'verb' => RouteVerb::SET, + ], + ], + '^.*/api/task/element.*$' => [ + [ + 'dest' => '\Modules\Tasks\Controller:apiTaskElementCreate', + 'verb' => RouteVerb::SET, + ], + ], +]; diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index bf85247..a407d12 100644 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -27,17 +27,4 @@ return [ 'verb' => RouteVerb::GET, ], ], - - '^.*/api/task$' => [ - [ - 'dest' => '\Modules\Tasks\Controller:apiTaskCreate', - 'verb' => RouteVerb::SET, - ], - ], - '^.*/api/task/element.*$' => [ - [ - 'dest' => '\Modules\Tasks\Controller:apiTaskElementCreate', - 'verb' => RouteVerb::SET, - ], - ], ]; diff --git a/Models/Task.php b/Models/Task.php index 6eb94a2..b50e2f2 100644 --- a/Models/Task.php +++ b/Models/Task.php @@ -119,6 +119,8 @@ class Task */ protected $schedule = null; + protected $media = null; + /** * Constructor. * diff --git a/Models/TaskElementMapper.php b/Models/TaskElementMapper.php index 5b15db1..176c5a4 100644 --- a/Models/TaskElementMapper.php +++ b/Models/TaskElementMapper.php @@ -49,6 +49,21 @@ class TaskElementMapper extends DataMapperAbstract 'task_element_created_at' => ['name' => 'task_element_created_at', 'type' => 'DateTime', 'internal' => 'createdAt'], ]; + /** + * Has many relation. + * + * @var array + * @since 1.0.0 + */ + protected static $hasMany = [ + 'media' => [ + 'mapper' => MediaMapper::class, + 'table' => 'task_element_media', + 'dst' => 'task_element_media_dst', + 'src' => 'task_element_media_src', + ], + ]; + /** * Primary table. * diff --git a/Models/TaskMapper.php b/Models/TaskMapper.php index c377045..3e9de1b 100644 --- a/Models/TaskMapper.php +++ b/Models/TaskMapper.php @@ -64,11 +64,16 @@ class TaskMapper extends DataMapperAbstract protected static $hasMany = [ 'taskElements' => [ 'mapper' => TaskElementMapper::class, - 'relationmapper' => TaskElementMapper::class, 'table' => 'task_element', 'dst' => 'task_element_task', 'src' => null, ], + 'media' => [ + 'mapper' => MediaMapper::class, + 'table' => 'task_media', + 'dst' => 'task_media_dst', + 'src' => 'task_media_src', + ], ]; /** From 2f379c222d54995dc004f74ac6fcaef2d9724b14 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 2 Oct 2016 12:07:05 +0200 Subject: [PATCH 02/17] Core adjustments for pending issues --- Admin/Routes/Web/Api.php | 20 +++++++++++++++++ Admin/Routes/Web/Backend.php | 13 ----------- Controller.php | 29 +++++++++++++++++++++++- Models/NullTask.php | 34 +++++++++++++++++++++++++++++ Models/TaskMapper.php | 3 +-- Theme/Backend/Lang/en.lang.php | 2 ++ Theme/Backend/task-analysis.tpl.php | 8 +++++++ Theme/Backend/task-create.tpl.php | 10 ++++----- Theme/Backend/task-single.tpl.php | 14 ++++++------ Theme/backend/Lang/en.lang.php | 2 ++ Theme/backend/task-analysis.tpl.php | 8 +++++++ Theme/backend/task-create.tpl.php | 10 ++++----- Theme/backend/task-single.tpl.php | 14 ++++++------ 13 files changed, 127 insertions(+), 40 deletions(-) create mode 100644 Admin/Routes/Web/Api.php create mode 100644 Models/NullTask.php diff --git a/Admin/Routes/Web/Api.php b/Admin/Routes/Web/Api.php new file mode 100644 index 0000000..a19df99 --- /dev/null +++ b/Admin/Routes/Web/Api.php @@ -0,0 +1,20 @@ + [ + [ + 'dest' => '\Modules\Tasks\Controller:apiTaskCreate', + 'verb' => RouteVerb::SET, + ], + ], + '^.*/api/task/element.*$' => [ + [ + 'dest' => '\Modules\Tasks\Controller:apiTaskElementCreate', + 'verb' => RouteVerb::SET, + ], + ], +]; + + diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index bf85247..a407d12 100644 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -27,17 +27,4 @@ return [ 'verb' => RouteVerb::GET, ], ], - - '^.*/api/task$' => [ - [ - 'dest' => '\Modules\Tasks\Controller:apiTaskCreate', - 'verb' => RouteVerb::SET, - ], - ], - '^.*/api/task/element.*$' => [ - [ - 'dest' => '\Modules\Tasks\Controller:apiTaskElementCreate', - 'verb' => RouteVerb::SET, - ], - ], ]; diff --git a/Controller.php b/Controller.php index 082a5f6..0cd81b9 100644 --- a/Controller.php +++ b/Controller.php @@ -16,8 +16,10 @@ namespace Modules\Tasks; use Model\Message\Redirect; +use Model\Message\Reload; use Modules\Tasks\Models\Task; use Modules\Tasks\Models\TaskElement; +use Modules\Tasks\Models\TaskElementMapper; use Modules\Tasks\Models\TaskMapper; use Modules\Tasks\Models\TaskStatus; use Modules\Tasks\Models\TaskType; @@ -196,7 +198,32 @@ class Controller extends ModuleAbstract implements WebInterface $task->addElement($element); TaskMapper::create($task); - $response->set($request->__toString(), new Redirect(UriFactory::build('http://127.0.0.1/{/lang}/backend/task/single?id=' . $task->getId()))); + $response->set($request->__toString(), new Redirect(UriFactory::build('{/base}/{/lang}/{/app}/task/single?id=' . $task->getId()))); + } + + /** + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param mixed $data Generic data + * + * @return \Serializable + * + * @since 1.0.0 + * @author Dennis Eichhorn + */ + public function apiTaskElementCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) + { + $element = new TaskElement(); + $element->setForwarded($request->getData('forward') ?? $request->getAccount()); + $element->setCreatedAt(new \DateTime('now')); + $element->setCreatedBy($request->getAccount()); + $element->setDue(new \DateTime($request->getData('due') ?? 'now')); + $element->setStatus($request->getData('status')); + $element->setTask($request->getData('task')); + $element->setDescription($request->getData('desc')); + + TaskElementMapper::create($element); + $response->set($request->__toString(), new Reload()); } } diff --git a/Models/NullTask.php b/Models/NullTask.php new file mode 100644 index 0000000..666d071 --- /dev/null +++ b/Models/NullTask.php @@ -0,0 +1,34 @@ + + * @author Dennis Eichhorn + * @copyright 2013 Dennis Eichhorn + * @license OMS License 1.0 + * @version 1.0.0 + * @link http://orange-management.com + */ +namespace Modules\Tasks\Models; + + + +/** + * Task class. + * + * @category Modules + * @package Framework + * @author OMS Development Team + * @author Dennis Eichhorn + * @license OMS License 1.0 + * @link http://orange-management.com + * @since 1.0.0 + */ +class NullTask extends Task +{ + +} diff --git a/Models/TaskMapper.php b/Models/TaskMapper.php index c377045..e180a0d 100644 --- a/Models/TaskMapper.php +++ b/Models/TaskMapper.php @@ -64,7 +64,6 @@ class TaskMapper extends DataMapperAbstract protected static $hasMany = [ 'taskElements' => [ 'mapper' => TaskElementMapper::class, - 'relationmapper' => TaskElementMapper::class, 'table' => 'task_element', 'dst' => 'task_element_task', 'src' => null, @@ -77,7 +76,7 @@ class TaskMapper extends DataMapperAbstract * @var array * @since 1.0.0 */ - protected static $hasOne = [ + protected static $ownsOne = [ 'schedule' => [ 'mapper' => ScheduleMapper::class, 'src' => 'task_schedule', diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index 4b4fdb0..8e8a592 100644 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -28,6 +28,7 @@ return ['Tasks' => [ 'Forwarded' => 'Forwarded', 'From' => 'From', 'Group' => 'Group', + 'History' => 'History', 'Interval' => 'Interval', 'InTime' => 'In Time', 'Message' => 'Message', @@ -49,6 +50,7 @@ return ['Tasks' => [ 'Task' => 'Task', 'Tasks' => 'Tasks', 'Template' => 'Template', + 'Time' => 'Time', 'Title' => 'Title', 'To' => 'To', 'Today' => 'Today', diff --git a/Theme/Backend/task-analysis.tpl.php b/Theme/Backend/task-analysis.tpl.php index 6d8e67a..65986c5 100644 --- a/Theme/Backend/task-analysis.tpl.php +++ b/Theme/Backend/task-analysis.tpl.php @@ -48,3 +48,11 @@ echo $this->getData('nav')->render(); ?> + +
+ +
+

getText('History'); ?>

+
+
+
diff --git a/Theme/Backend/task-create.tpl.php b/Theme/Backend/task-create.tpl.php index a5e92de..929c2d2 100644 --- a/Theme/Backend/task-create.tpl.php +++ b/Theme/Backend/task-create.tpl.php @@ -22,19 +22,19 @@ echo $this->getData('nav')->render(); ?>

getText('Task'); ?>

-
+
-
+
-
+
-
+
-
+
diff --git a/Theme/Backend/task-single.tpl.php b/Theme/Backend/task-single.tpl.php index 806e750..99ffeaf 100644 --- a/Theme/Backend/task-single.tpl.php +++ b/Theme/Backend/task-single.tpl.php @@ -71,19 +71,19 @@ foreach ($elements as $key => $element) : $c++;
-
+
-
+
-
-
-
+
+
-
-
+
+
diff --git a/Theme/backend/Lang/en.lang.php b/Theme/backend/Lang/en.lang.php index 4b4fdb0..8e8a592 100644 --- a/Theme/backend/Lang/en.lang.php +++ b/Theme/backend/Lang/en.lang.php @@ -28,6 +28,7 @@ return ['Tasks' => [ 'Forwarded' => 'Forwarded', 'From' => 'From', 'Group' => 'Group', + 'History' => 'History', 'Interval' => 'Interval', 'InTime' => 'In Time', 'Message' => 'Message', @@ -49,6 +50,7 @@ return ['Tasks' => [ 'Task' => 'Task', 'Tasks' => 'Tasks', 'Template' => 'Template', + 'Time' => 'Time', 'Title' => 'Title', 'To' => 'To', 'Today' => 'Today', diff --git a/Theme/backend/task-analysis.tpl.php b/Theme/backend/task-analysis.tpl.php index 6d8e67a..65986c5 100644 --- a/Theme/backend/task-analysis.tpl.php +++ b/Theme/backend/task-analysis.tpl.php @@ -48,3 +48,11 @@ echo $this->getData('nav')->render(); ?>
+ +
+ +
+

getText('History'); ?>

+
+
+
diff --git a/Theme/backend/task-create.tpl.php b/Theme/backend/task-create.tpl.php index a5e92de..929c2d2 100644 --- a/Theme/backend/task-create.tpl.php +++ b/Theme/backend/task-create.tpl.php @@ -22,19 +22,19 @@ echo $this->getData('nav')->render(); ?>

getText('Task'); ?>

-
+
-
+
-
+
-
+
-
+
diff --git a/Theme/backend/task-single.tpl.php b/Theme/backend/task-single.tpl.php index 806e750..99ffeaf 100644 --- a/Theme/backend/task-single.tpl.php +++ b/Theme/backend/task-single.tpl.php @@ -71,19 +71,19 @@ foreach ($elements as $key => $element) : $c++;
-
+
-
+
-
-
-
+
+
-
-
+
+
From 224c43f782f92c13e81b65f4184fad8852809b90 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 2 Oct 2016 19:39:58 +0200 Subject: [PATCH 03/17] Fixed dependency bug --- info.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/info.json b/info.json index 8ad6dee..63d9639 100644 --- a/info.json +++ b/info.json @@ -17,7 +17,8 @@ "directory": "Tasks", "dependencies": { "Admin" : "1.0.0", - "Calendar" : "1.0.0" + "Calendar" : "1.0.0", + "Media" : "1.0.0" }, "providing": { "Navigation": "*" From 0ad430d4976718c3f540971433d2f136ccf03826 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 9 Oct 2016 20:07:30 +0200 Subject: [PATCH 04/17] Fix install --- Admin/Install/Navigation.php | 2 +- Admin/Installer.php | 4 ++-- Models/TaskElement.php | 2 ++ Models/TaskElementMapper.php | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php index 1fb0051..9f8104a 100644 --- a/Admin/Install/Navigation.php +++ b/Admin/Install/Navigation.php @@ -29,7 +29,7 @@ use phpOMS\DataStorage\Database\Pool; */ class Navigation { - public static function install(Pool $dbPool) + public static function install(string $path, Pool $dbPool) { $navData = json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true); diff --git a/Admin/Installer.php b/Admin/Installer.php index 191d8a3..ed24217 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -37,9 +37,9 @@ class Installer extends InstallerAbstract /** * {@inheritdoc} */ - public static function install(Pool $dbPool, InfoManager $info) + public static function install(string $path, Pool $dbPool, InfoManager $info) { - parent::install($dbPool, $info); + parent::install($path, $dbPool, $info); switch ($dbPool->get('core')->getType()) { case DatabaseType::MYSQL: diff --git a/Models/TaskElement.php b/Models/TaskElement.php index 78634a5..55f5d90 100644 --- a/Models/TaskElement.php +++ b/Models/TaskElement.php @@ -94,6 +94,8 @@ class TaskElement */ private $forwarded = 0; + private $media = []; + /** * Constructor. * diff --git a/Models/TaskElementMapper.php b/Models/TaskElementMapper.php index 176c5a4..359e912 100644 --- a/Models/TaskElementMapper.php +++ b/Models/TaskElementMapper.php @@ -15,6 +15,7 @@ */ namespace Modules\Tasks\Models; +use Modules\Media\Models\MediaMapper; use phpOMS\DataStorage\Database\DataMapperAbstract; use phpOMS\DataStorage\Database\RelationType; From 26afb1aae207b1dc3b6e9a5090074d8f4cbe1cc4 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 29 Oct 2016 20:44:52 +0200 Subject: [PATCH 05/17] Adjust database pool name --- Admin/Activate.php | 4 ++-- Admin/Deactivate.php | 4 ++-- Admin/Install/Navigation.php | 4 ++-- Admin/Installer.php | 4 ++-- Admin/Uninstall.php | 4 ++-- Admin/Update.php | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Admin/Activate.php b/Admin/Activate.php index fca858c..b200213 100644 --- a/Admin/Activate.php +++ b/Admin/Activate.php @@ -16,7 +16,7 @@ namespace Modules\Tasks\Admin; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Module\ActivateAbstract; use phpOMS\Module\InfoManager; @@ -37,7 +37,7 @@ class Activate extends ActivateAbstract /** * {@inheritdoc} */ - public static function activate(Pool $dbPool, InfoManager $info) + public static function activate(DatabasePool $dbPool, InfoManager $info) { parent::activate($dbPool, $info); } diff --git a/Admin/Deactivate.php b/Admin/Deactivate.php index 666ed58..b7f5b57 100644 --- a/Admin/Deactivate.php +++ b/Admin/Deactivate.php @@ -16,7 +16,7 @@ namespace Modules\Tasks\Admin; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Module\DeactivateAbstract; use phpOMS\Module\InfoManager; @@ -37,7 +37,7 @@ class Deactivate extends DeactivateAbstract /** * {@inheritdoc} */ - public static function deactivate(Pool $dbPool, InfoManager $info) + public static function deactivate(DatabasePool $dbPool, InfoManager $info) { parent::deactivate($dbPool, $info); } diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php index 9f8104a..7151977 100644 --- a/Admin/Install/Navigation.php +++ b/Admin/Install/Navigation.php @@ -14,7 +14,7 @@ * @link http://orange-management.com */ namespace Modules\Tasks\Admin\Install; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; /** * Navigation class. @@ -29,7 +29,7 @@ use phpOMS\DataStorage\Database\Pool; */ class Navigation { - public static function install(string $path, Pool $dbPool) + public static function install(string $path, DatabasePool $dbPool) { $navData = json_decode(file_get_contents(__DIR__ . '/Navigation.install.json'), true); diff --git a/Admin/Installer.php b/Admin/Installer.php index ed24217..50afc25 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -16,7 +16,7 @@ namespace Modules\Tasks\Admin; use phpOMS\DataStorage\Database\DatabaseType; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Module\InfoManager; use phpOMS\Module\InstallerAbstract; @@ -37,7 +37,7 @@ class Installer extends InstallerAbstract /** * {@inheritdoc} */ - public static function install(string $path, Pool $dbPool, InfoManager $info) + public static function install(string $path, DatabasePool $dbPool, InfoManager $info) { parent::install($path, $dbPool, $info); diff --git a/Admin/Uninstall.php b/Admin/Uninstall.php index 2050856..86029b4 100644 --- a/Admin/Uninstall.php +++ b/Admin/Uninstall.php @@ -16,7 +16,7 @@ namespace Modules\Tasks\Admin; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\DataStorage\Database\Schema\Builder; use phpOMS\Module\InfoManager; use phpOMS\Module\UninstallAbstract; @@ -38,7 +38,7 @@ class Uninstall extends UninstallAbstract /** * {@inheritdoc} */ - public static function uninstall(Pool $dbPool, InfoManager $info) + public static function uninstall(DatabasePool $dbPool, InfoManager $info) { parent::uninstall($dbPool, $info); diff --git a/Admin/Update.php b/Admin/Update.php index 5763dba..bc690ad 100644 --- a/Admin/Update.php +++ b/Admin/Update.php @@ -16,7 +16,7 @@ namespace Modules\Tasks\Admin; -use phpOMS\DataStorage\Database\Pool; +use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Module\InfoManager; use phpOMS\Module\UpdateAbstract; use phpOMS\System\File\Directory; @@ -38,7 +38,7 @@ class Update extends UpdateAbstract /** * {@inheritdoc} */ - public static function update(Pool $dbPool, InfoManager $info) + public static function update(DatabasePool $dbPool, InfoManager $info) { Directory::deletePath(__DIR__ . '/Update'); mkdir('Update'); From 2d08306678f2bd29bd7b2ad51d75387c7b6aba03 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 5 Nov 2016 21:47:42 +0100 Subject: [PATCH 06/17] Fix routing --- Admin/Routes/Web/Api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Admin/Routes/Web/Api.php b/Admin/Routes/Web/Api.php index 557c833..1e24e36 100644 --- a/Admin/Routes/Web/Api.php +++ b/Admin/Routes/Web/Api.php @@ -3,7 +3,7 @@ use phpOMS\Router\RouteVerb; return [ - '^.*/api/task$' => [ + '^.*/api/task(\?.*|$)' => [ [ 'dest' => '\Modules\Tasks\Controller:apiTaskCreate', 'verb' => RouteVerb::SET, From 473dafdbcf90020be462eb58c1931f9ed90e6e06 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 5 Nov 2016 21:48:14 +0100 Subject: [PATCH 07/17] Implement create and get --- Controller.php | 24 +++++++++++++++++++++++- Models/Task.php | 29 +++++++++++++++++++++++++++-- Models/TaskMapper.php | 3 ++- Theme/backend/task-create.tpl.php | 2 +- 4 files changed, 53 insertions(+), 5 deletions(-) diff --git a/Controller.php b/Controller.php index 0cd81b9..7c077b7 100644 --- a/Controller.php +++ b/Controller.php @@ -15,6 +15,7 @@ */ namespace Modules\Tasks; +use Model\Message\FormValidation; use Model\Message\Redirect; use Model\Message\Reload; use Modules\Tasks\Models\Task; @@ -167,6 +168,21 @@ class Controller extends ModuleAbstract implements WebInterface return $view; } + private function validateTaskCreate(RequestAbstract $request) : array + { + $val = []; + if ( + ($val['title'] = empty($request->getData('title'))) + || ($val['description'] = empty($request->getData('description'))) + || ($val['due'] = !((bool)strtotime($request->getData('due')))) + || ($val['forward'] = !(is_numeric($request->getData('forward') ?? 0))) + ) { + return $val; + } + + return []; + } + /** * @param RequestAbstract $request Request * @param ResponseAbstract $response Response @@ -179,6 +195,12 @@ class Controller extends ModuleAbstract implements WebInterface */ public function apiTaskCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) { + if (!empty($val = $this->validateTaskCreate($request))) { + $response->set('task_create', new FormValidation($val)); + + return; + } + $task = new Task(); $task->setTitle($request->getData('title') ?? ''); $task->setDescription($request->getData('description') ?? ''); @@ -198,7 +220,7 @@ class Controller extends ModuleAbstract implements WebInterface $task->addElement($element); TaskMapper::create($task); - $response->set($request->__toString(), new Redirect(UriFactory::build('{/base}/{/lang}/{/app}/task/single?id=' . $task->getId()))); + $response->set($request->__toString(), $task->jsonSerialize()); } /** diff --git a/Models/Task.php b/Models/Task.php index b50e2f2..25930a7 100644 --- a/Models/Task.php +++ b/Models/Task.php @@ -28,7 +28,7 @@ use phpOMS\Datatypes\Exception\InvalidEnumValue; * @link http://orange-management.com * @since 1.0.0 */ -class Task +class Task implements \JsonSerializable { /** @@ -119,7 +119,7 @@ class Task */ protected $schedule = null; - protected $media = null; + protected $media = []; /** * Constructor. @@ -197,6 +197,7 @@ class Task public function setCreatedBy(int $id) { $this->createdBy = $id; + $this->schedule->setCreatedBy($id); } /** @@ -415,4 +416,28 @@ class Task return $this->schedule; } + private function toArray() : array + { + return [ + 'id' => $this->id, + 'title' => $this->title, + 'description' => $this->description, + 'status' => $this->status, + 'type' => $this->type, + 'due' => $this->due->format('Y-m-d H:i:s'), + 'done' => (!isset($this->done) ? null : $this->done->format('Y-m-d H:i:s')), + ]; + } + + /** + * Specify data which should be serialized to JSON + * @link http://php.net/manual/en/jsonserializable.jsonserialize.php + * @return mixed data which can be serialized by json_encode, + * which is a value of any type other than a resource. + * @since 5.4.0 + */ + public function jsonSerialize() + { + return json_encode($this->toArray()); + } } diff --git a/Models/TaskMapper.php b/Models/TaskMapper.php index 3c0da81..5528aac 100644 --- a/Models/TaskMapper.php +++ b/Models/TaskMapper.php @@ -16,6 +16,7 @@ namespace Modules\Tasks\Models; use Modules\Calendar\Models\ScheduleMapper; +use Modules\Media\Models\MediaMapper; use Modules\Tasks\Models\TaskElementMapper; use phpOMS\DataStorage\Database\DataMapperAbstract; use phpOMS\DataStorage\Database\Query\Builder; @@ -68,7 +69,7 @@ class TaskMapper extends DataMapperAbstract 'dst' => 'task_element_task', 'src' => null, ], - 'media' => [ + 'media' => [ // todo: maybe make this a has one and then link to collection instead of single media files! 'mapper' => MediaMapper::class, 'table' => 'task_media', 'dst' => 'task_media_dst', diff --git a/Theme/backend/task-create.tpl.php b/Theme/backend/task-create.tpl.php index 929c2d2..28ccd86 100644 --- a/Theme/backend/task-create.tpl.php +++ b/Theme/backend/task-create.tpl.php @@ -22,7 +22,7 @@ echo $this->getData('nav')->render(); ?>

getText('Task'); ?>

-
+
From 0292870691733df214c369dbf71e0dea993a8e76 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 5 Nov 2016 21:48:22 +0100 Subject: [PATCH 08/17] Path fix --- Theme/Backend/task-create.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Theme/Backend/task-create.tpl.php b/Theme/Backend/task-create.tpl.php index 929c2d2..28ccd86 100644 --- a/Theme/Backend/task-create.tpl.php +++ b/Theme/Backend/task-create.tpl.php @@ -22,7 +22,7 @@ echo $this->getData('nav')->render(); ?>

getText('Task'); ?>

- +
From a9b2812323b0f9b48b0fe431f032306b7631f3d2 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 6 Nov 2016 22:22:07 +0100 Subject: [PATCH 09/17] Fixing doc blocks --- Models/Task.php | 2 +- Models/TaskElementMapper.php | 4 ++-- Models/TaskMapper.php | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Models/Task.php b/Models/Task.php index 25930a7..e87e128 100644 --- a/Models/Task.php +++ b/Models/Task.php @@ -291,7 +291,7 @@ class Task implements \JsonSerializable /** * @param int $status * - * @throws + * @throws InvalidEnumValue * * @since 1.0.0 * @author Dennis Eichhorn diff --git a/Models/TaskElementMapper.php b/Models/TaskElementMapper.php index 359e912..d93a3c3 100644 --- a/Models/TaskElementMapper.php +++ b/Models/TaskElementMapper.php @@ -36,7 +36,7 @@ class TaskElementMapper extends DataMapperAbstract /** * Columns. * - * @var array + * @var array * @since 1.0.0 */ protected static $columns = [ @@ -53,7 +53,7 @@ class TaskElementMapper extends DataMapperAbstract /** * Has many relation. * - * @var array + * @var array * @since 1.0.0 */ protected static $hasMany = [ diff --git a/Models/TaskMapper.php b/Models/TaskMapper.php index 5528aac..5f58862 100644 --- a/Models/TaskMapper.php +++ b/Models/TaskMapper.php @@ -40,7 +40,7 @@ class TaskMapper extends DataMapperAbstract /** * Columns. * - * @var array + * @var array * @since 1.0.0 */ protected static $columns = [ @@ -59,7 +59,7 @@ class TaskMapper extends DataMapperAbstract /** * Has many relation. * - * @var array + * @var array * @since 1.0.0 */ protected static $hasMany = [ @@ -80,7 +80,7 @@ class TaskMapper extends DataMapperAbstract /** * Has one relation. * - * @var array + * @var array * @since 1.0.0 */ protected static $ownsOne = [ From 814f8f493df8228b4d9e77e4260938ee49a4321d Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 7 Nov 2016 20:14:30 +0100 Subject: [PATCH 10/17] Fix comments --- Models/TaskElement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Models/TaskElement.php b/Models/TaskElement.php index 55f5d90..f4dccba 100644 --- a/Models/TaskElement.php +++ b/Models/TaskElement.php @@ -259,7 +259,7 @@ class TaskElement * * @return void * - * @throws + * @throws InvalidEnumValue * * @since 1.0.0 * @author Dennis Eichhorn From 0f769089cbb584039db712030325f013b4860e85 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 8 Nov 2016 13:06:43 +0100 Subject: [PATCH 11/17] Create task elements --- Controller.php | 25 +++++++++++++++++++++++-- Models/Task.php | 3 +++ Models/TaskElement.php | 19 ++++++++++++++++++- Theme/Backend/task-single.tpl.php | 12 ++++++++---- Theme/backend/task-single.tpl.php | 12 ++++++++---- 5 files changed, 60 insertions(+), 11 deletions(-) diff --git a/Controller.php b/Controller.php index 7c077b7..ea674e4 100644 --- a/Controller.php +++ b/Controller.php @@ -223,6 +223,21 @@ class Controller extends ModuleAbstract implements WebInterface $response->set($request->__toString(), $task->jsonSerialize()); } + private function validateTaskElementCreate(RequestAbstract $request) : array + { + $val = []; + if ( + ($val['status'] = !TaskStatus::isValidValue((int) $request->getData('status'))) + || ($val['due'] = !((bool)strtotime($request->getData('due')))) + || ($val['task'] = !(is_numeric($request->getData('task')))) + || ($val['forward'] = !(is_numeric(empty($request->getData('forward')) ? $request->getAccount() : $request->getData('forward')))) + ) { // todo: validate correct task + return $val; + } + + return []; + } + /** * @param RequestAbstract $request Request * @param ResponseAbstract $response Response @@ -235,6 +250,12 @@ class Controller extends ModuleAbstract implements WebInterface */ public function apiTaskElementCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) { + if (!empty($val = $this->validateTaskElementCreate($request))) { + $response->set('task_element_create', new FormValidation($val)); + + return; + } + $element = new TaskElement(); $element->setForwarded($request->getData('forward') ?? $request->getAccount()); $element->setCreatedAt(new \DateTime('now')); @@ -242,10 +263,10 @@ class Controller extends ModuleAbstract implements WebInterface $element->setDue(new \DateTime($request->getData('due') ?? 'now')); $element->setStatus($request->getData('status')); $element->setTask($request->getData('task')); - $element->setDescription($request->getData('desc')); + $element->setDescription($request->getData('description')); TaskElementMapper::create($element); - $response->set($request->__toString(), new Reload()); + $response->set($request->__toString(), $element->jsonSerialize()); } } diff --git a/Models/Task.php b/Models/Task.php index e87e128..1d81398 100644 --- a/Models/Task.php +++ b/Models/Task.php @@ -420,10 +420,13 @@ class Task implements \JsonSerializable { return [ 'id' => $this->id, + 'createdBy' => $this->createdBy, + 'createdAt' => $this->createdAt, 'title' => $this->title, 'description' => $this->description, 'status' => $this->status, 'type' => $this->type, + 'type' => $this->type, 'due' => $this->due->format('Y-m-d H:i:s'), 'done' => (!isset($this->done) ? null : $this->done->format('Y-m-d H:i:s')), ]; diff --git a/Models/TaskElement.php b/Models/TaskElement.php index f4dccba..c98becb 100644 --- a/Models/TaskElement.php +++ b/Models/TaskElement.php @@ -27,7 +27,7 @@ use phpOMS\Datatypes\Exception\InvalidEnumValue; * @link http://orange-management.com * @since 1.0.0 */ -class TaskElement +class TaskElement implements \JsonSerializable { /** @@ -296,4 +296,21 @@ class TaskElement { $this->task = $task; } + + public function toArray() : array { + return [ + 'id' => $this->id, + 'task' => $this->task, + 'createdBy' => $this->createdBy, + 'createdAt' => $this->createdAt, + 'description' => $this->description, + 'status' => $this->status, + 'forward' => $this->forwarded, + 'due' => isset($this->due) ? $this->due->format('Y-m-d H:i:s') : null, + ]; + } + + public function jsonSerialize() { + return json_encode($this->toArray()); + } } diff --git a/Theme/Backend/task-single.tpl.php b/Theme/Backend/task-single.tpl.php index 99ffeaf..dcfc05b 100644 --- a/Theme/Backend/task-single.tpl.php +++ b/Theme/Backend/task-single.tpl.php @@ -74,15 +74,19 @@ foreach ($elements as $key => $element) : $c++;
-
+
-
+
-
+
diff --git a/Theme/backend/task-single.tpl.php b/Theme/backend/task-single.tpl.php index 99ffeaf..dcfc05b 100644 --- a/Theme/backend/task-single.tpl.php +++ b/Theme/backend/task-single.tpl.php @@ -74,15 +74,19 @@ foreach ($elements as $key => $element) : $c++;
-
+
-
+
-
+
From 73a6b192ccd6c886a47860e0ed9cb363888c7b7c Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 23 Nov 2016 23:51:14 +0100 Subject: [PATCH 12/17] [Task] Path fixes --- Theme/backend/task-create.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Theme/backend/task-create.tpl.php b/Theme/backend/task-create.tpl.php index 28ccd86..ea5c642 100644 --- a/Theme/backend/task-create.tpl.php +++ b/Theme/backend/task-create.tpl.php @@ -22,7 +22,7 @@ echo $this->getData('nav')->render(); ?>

getText('Task'); ?>

-
+
From d30eca5d0be3b8481e7b9b47fb9677cbf2e6b91c Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 23 Nov 2016 23:51:35 +0100 Subject: [PATCH 13/17] [Tasks] Remove whitespace --- Theme/Backend/task-create.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Theme/Backend/task-create.tpl.php b/Theme/Backend/task-create.tpl.php index 28ccd86..ea5c642 100644 --- a/Theme/Backend/task-create.tpl.php +++ b/Theme/Backend/task-create.tpl.php @@ -22,7 +22,7 @@ echo $this->getData('nav')->render(); ?>

getText('Task'); ?>

- +
From 5e2fb47236d6477d5b5c645c09f7addd0478c502 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 7 Dec 2016 20:23:04 +0100 Subject: [PATCH 14/17] Prepare const visibility --- Controller.php | 6 +++--- Models/TaskPriority.php | 10 +++++----- Models/TaskStatus.php | 12 ++++++------ Models/TaskType.php | 6 +++--- Models/TaskVisibility.php | 6 +++--- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Controller.php b/Controller.php index ea674e4..b573a4f 100644 --- a/Controller.php +++ b/Controller.php @@ -51,7 +51,7 @@ class Controller extends ModuleAbstract implements WebInterface * @var string * @since 1.0.0 */ - const MODULE_PATH = __DIR__; + /* public */ const MODULE_PATH = __DIR__; /** * Module version. @@ -59,7 +59,7 @@ class Controller extends ModuleAbstract implements WebInterface * @var string * @since 1.0.0 */ - const MODULE_VERSION = '1.0.0'; + /* public */ const MODULE_VERSION = '1.0.0'; /** * Module name. @@ -67,7 +67,7 @@ class Controller extends ModuleAbstract implements WebInterface * @var string * @since 1.0.0 */ - const MODULE_NAME = 'Tasks'; + /* public */ const MODULE_NAME = 'Tasks'; /** * Providing. diff --git a/Models/TaskPriority.php b/Models/TaskPriority.php index 0a83962..6705708 100644 --- a/Models/TaskPriority.php +++ b/Models/TaskPriority.php @@ -30,13 +30,13 @@ use phpOMS\Datatypes\Enum; */ abstract class TaskPriority extends Enum { - const VLOW = 1; + /* public */ const VLOW = 1; - const LOW = 2; + /* public */ const LOW = 2; - const MEDIUM = 3; + /* public */ const MEDIUM = 3; - const HIGH = 4; + /* public */ const HIGH = 4; - const VHIGH = 5; + /* public */ const VHIGH = 5; } diff --git a/Models/TaskStatus.php b/Models/TaskStatus.php index c4a068a..96ae99b 100644 --- a/Models/TaskStatus.php +++ b/Models/TaskStatus.php @@ -30,15 +30,15 @@ use phpOMS\Datatypes\Enum; */ abstract class TaskStatus extends Enum { - const OPEN = 1; + /* public */ const OPEN = 1; - const WORKING = 2; + /* public */ const WORKING = 2; - const SUSPENDED = 3; + /* public */ const SUSPENDED = 3; - const CANCELED = 4; + /* public */ const CANCELED = 4; - const DONE = 5; + /* public */ const DONE = 5; - const CLOSED = 6; + /* public */ const CLOSED = 6; } diff --git a/Models/TaskType.php b/Models/TaskType.php index ff45271..f8bc34a 100644 --- a/Models/TaskType.php +++ b/Models/TaskType.php @@ -30,7 +30,7 @@ use phpOMS\Datatypes\Enum; */ abstract class TaskType extends Enum { - const TEMPLATE = 1; - const SINGLE = 2; - const HIDDEN = 3; + /* public */ const TEMPLATE = 1; + /* public */ const SINGLE = 2; + /* public */ const HIDDEN = 3; } diff --git a/Models/TaskVisibility.php b/Models/TaskVisibility.php index 0f651a7..e9b8ae5 100644 --- a/Models/TaskVisibility.php +++ b/Models/TaskVisibility.php @@ -30,7 +30,7 @@ use phpOMS\Datatypes\Enum; */ abstract class TaskVisibility extends Enum { - const TO = 1; - const CC = 2; - const BCC = 3; + /* public */ const TO = 1; + /* public */ const CC = 2; + /* public */ const BCC = 3; } From 49f480f59a186feeda89c5ec05702ec047afd19b Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 7 Dec 2016 20:56:15 +0100 Subject: [PATCH 15/17] Increase php version requirement --- Admin/Activate.php | 2 +- Admin/Deactivate.php | 2 +- Admin/Install/Navigation.php | 2 +- Admin/Installer.php | 2 +- Admin/Uninstall.php | 2 +- Admin/Update.php | 2 +- Controller.php | 2 +- Models/NullTask.php | 2 +- Models/NullTaskElement.php | 2 +- Models/Task.php | 2 +- Models/TaskElement.php | 2 +- Models/TaskElementMapper.php | 2 +- Models/TaskMapper.php | 2 +- Models/TaskPriority.php | 2 +- Models/TaskStatus.php | 2 +- Models/TaskTemplate.php | 2 +- Models/TaskType.php | 2 +- Models/TaskVisibility.php | 2 +- Theme/Backend/Lang/Navigation.en.lang.php | 2 +- Theme/Backend/Lang/en.lang.php | 2 +- Theme/Backend/task-analysis.tpl.php | 2 +- Theme/Backend/task-create.tpl.php | 2 +- Theme/Backend/task-dashboard.tpl.php | 2 +- Theme/Backend/task-single.tpl.php | 2 +- Theme/backend/Lang/Navigation.en.lang.php | 2 +- Theme/backend/Lang/en.lang.php | 2 +- Theme/backend/task-analysis.tpl.php | 2 +- Theme/backend/task-create.tpl.php | 2 +- Theme/backend/task-dashboard.tpl.php | 2 +- Theme/backend/task-single.tpl.php | 2 +- 30 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Admin/Activate.php b/Admin/Activate.php index b200213..4098220 100644 --- a/Admin/Activate.php +++ b/Admin/Activate.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Admin/Deactivate.php b/Admin/Deactivate.php index b7f5b57..8c76a69 100644 --- a/Admin/Deactivate.php +++ b/Admin/Deactivate.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php index 7151977..3a4737e 100644 --- a/Admin/Install/Navigation.php +++ b/Admin/Install/Navigation.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Admin/Installer.php b/Admin/Installer.php index 50afc25..7782485 100644 --- a/Admin/Installer.php +++ b/Admin/Installer.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Admin/Uninstall.php b/Admin/Uninstall.php index 86029b4..3cadbe4 100644 --- a/Admin/Uninstall.php +++ b/Admin/Uninstall.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Admin/Update.php b/Admin/Update.php index bc690ad..f8a9598 100644 --- a/Admin/Update.php +++ b/Admin/Update.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Controller.php b/Controller.php index b573a4f..9da25c8 100644 --- a/Controller.php +++ b/Controller.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/NullTask.php b/Models/NullTask.php index 666d071..6af2107 100644 --- a/Models/NullTask.php +++ b/Models/NullTask.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/NullTaskElement.php b/Models/NullTaskElement.php index e98798e..0003214 100644 --- a/Models/NullTaskElement.php +++ b/Models/NullTaskElement.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/Task.php b/Models/Task.php index 1d81398..a89df05 100644 --- a/Models/Task.php +++ b/Models/Task.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/TaskElement.php b/Models/TaskElement.php index c98becb..e0cfcb2 100644 --- a/Models/TaskElement.php +++ b/Models/TaskElement.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/TaskElementMapper.php b/Models/TaskElementMapper.php index d93a3c3..edf8f61 100644 --- a/Models/TaskElementMapper.php +++ b/Models/TaskElementMapper.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/TaskMapper.php b/Models/TaskMapper.php index 5f58862..68d25eb 100644 --- a/Models/TaskMapper.php +++ b/Models/TaskMapper.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/TaskPriority.php b/Models/TaskPriority.php index 6705708..3c07446 100644 --- a/Models/TaskPriority.php +++ b/Models/TaskPriority.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/TaskStatus.php b/Models/TaskStatus.php index 96ae99b..2c9af43 100644 --- a/Models/TaskStatus.php +++ b/Models/TaskStatus.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/TaskTemplate.php b/Models/TaskTemplate.php index 8f77708..b8ae732 100644 --- a/Models/TaskTemplate.php +++ b/Models/TaskTemplate.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/TaskType.php b/Models/TaskType.php index f8bc34a..b1ba2af 100644 --- a/Models/TaskType.php +++ b/Models/TaskType.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Models/TaskVisibility.php b/Models/TaskVisibility.php index e9b8ae5..7776f4e 100644 --- a/Models/TaskVisibility.php +++ b/Models/TaskVisibility.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/Lang/Navigation.en.lang.php b/Theme/Backend/Lang/Navigation.en.lang.php index 86bf658..8a2625d 100644 --- a/Theme/Backend/Lang/Navigation.en.lang.php +++ b/Theme/Backend/Lang/Navigation.en.lang.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index 8e8a592..c4479f6 100644 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/task-analysis.tpl.php b/Theme/Backend/task-analysis.tpl.php index 65986c5..3d2cf85 100644 --- a/Theme/Backend/task-analysis.tpl.php +++ b/Theme/Backend/task-analysis.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/task-create.tpl.php b/Theme/Backend/task-create.tpl.php index ea5c642..810549f 100644 --- a/Theme/Backend/task-create.tpl.php +++ b/Theme/Backend/task-create.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/task-dashboard.tpl.php b/Theme/Backend/task-dashboard.tpl.php index 703d7ef..f5c6f26 100644 --- a/Theme/Backend/task-dashboard.tpl.php +++ b/Theme/Backend/task-dashboard.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/Backend/task-single.tpl.php b/Theme/Backend/task-single.tpl.php index dcfc05b..9828d92 100644 --- a/Theme/Backend/task-single.tpl.php +++ b/Theme/Backend/task-single.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/Lang/Navigation.en.lang.php b/Theme/backend/Lang/Navigation.en.lang.php index 86bf658..8a2625d 100644 --- a/Theme/backend/Lang/Navigation.en.lang.php +++ b/Theme/backend/Lang/Navigation.en.lang.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/Lang/en.lang.php b/Theme/backend/Lang/en.lang.php index 8e8a592..c4479f6 100644 --- a/Theme/backend/Lang/en.lang.php +++ b/Theme/backend/Lang/en.lang.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/task-analysis.tpl.php b/Theme/backend/task-analysis.tpl.php index 65986c5..3d2cf85 100644 --- a/Theme/backend/task-analysis.tpl.php +++ b/Theme/backend/task-analysis.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/task-create.tpl.php b/Theme/backend/task-create.tpl.php index ea5c642..810549f 100644 --- a/Theme/backend/task-create.tpl.php +++ b/Theme/backend/task-create.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/task-dashboard.tpl.php b/Theme/backend/task-dashboard.tpl.php index 703d7ef..f5c6f26 100644 --- a/Theme/backend/task-dashboard.tpl.php +++ b/Theme/backend/task-dashboard.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD diff --git a/Theme/backend/task-single.tpl.php b/Theme/backend/task-single.tpl.php index dcfc05b..9828d92 100644 --- a/Theme/backend/task-single.tpl.php +++ b/Theme/backend/task-single.tpl.php @@ -2,7 +2,7 @@ /** * Orange Management * - * PHP Version 7.0 + * PHP Version 7.1 * * @category TBD * @package TBD From 4a2cc303d3a940692aefffa508accdce5388015d Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 30 Dec 2016 19:59:24 +0100 Subject: [PATCH 16/17] Template, comment and path fixes --- Theme/Backend/dashboard-task.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Theme/Backend/dashboard-task.tpl.php b/Theme/Backend/dashboard-task.tpl.php index 87584b3..f01d870 100644 --- a/Theme/Backend/dashboard-task.tpl.php +++ b/Theme/Backend/dashboard-task.tpl.php @@ -1,3 +1,3 @@ -
+
Task
\ No newline at end of file From 3f621643f6cfe2eae9c4d2f6faf328e00d44fb11 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 22 Jan 2017 21:08:46 +0100 Subject: [PATCH 17/17] Fixing json serialization and reporter --- Models/Task.php | 2 +- Models/TaskElement.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Models/Task.php b/Models/Task.php index a89df05..dacf1e0 100644 --- a/Models/Task.php +++ b/Models/Task.php @@ -441,6 +441,6 @@ class Task implements \JsonSerializable */ public function jsonSerialize() { - return json_encode($this->toArray()); + return $this->toArray(); } } diff --git a/Models/TaskElement.php b/Models/TaskElement.php index e0cfcb2..cb7a607 100644 --- a/Models/TaskElement.php +++ b/Models/TaskElement.php @@ -311,6 +311,6 @@ class TaskElement implements \JsonSerializable } public function jsonSerialize() { - return json_encode($this->toArray()); + return $this->toArray(); } }