From 8b1a2a17e695c54bc5ab67fc516c2d34a20aac89 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 30 Aug 2020 20:13:11 +0200 Subject: [PATCH] autofixes --- Models/DutyType.php | 1 + Models/PermissionState.php | 2 + Models/TaskPriority.php | 5 ++ Models/TaskStatus.php | 4 + Models/TaskType.php | 2 + Models/TaskVisibility.php | 2 + Theme/Backend/Components/Tasks/list.tpl.php | 8 +- Theme/Backend/Components/Tasks/status.tpl.php | 10 +-- Theme/Backend/dashboard-task.tpl.php | 2 +- Theme/Backend/task-analysis.tpl.php | 24 +++--- Theme/Backend/task-create.tpl.php | 36 ++++----- Theme/Backend/task-dashboard.tpl.php | 24 +++--- Theme/Backend/task-single.tpl.php | 74 +++++++++---------- tests/Admin/AdminTest.php | 1 + tests/BackendControllerTest.php | 1 + tests/ControllerTest.php | 1 + 16 files changed, 108 insertions(+), 89 deletions(-) diff --git a/Models/DutyType.php b/Models/DutyType.php index aebf2bb..b2ee0d6 100755 --- a/Models/DutyType.php +++ b/Models/DutyType.php @@ -27,5 +27,6 @@ use phpOMS\Stdlib\Base\Enum; abstract class DutyType extends Enum { public const TO = 1; + public const CC = 2; } diff --git a/Models/PermissionState.php b/Models/PermissionState.php index 4c3e2de..a66ba79 100755 --- a/Models/PermissionState.php +++ b/Models/PermissionState.php @@ -27,6 +27,8 @@ use phpOMS\Stdlib\Base\Enum; abstract class PermissionState extends Enum { public const TASK = 1; + public const ELEMENT = 2; + public const ANALYSIS = 3; } diff --git a/Models/TaskPriority.php b/Models/TaskPriority.php index 1c342a2..29d7683 100755 --- a/Models/TaskPriority.php +++ b/Models/TaskPriority.php @@ -27,9 +27,14 @@ use phpOMS\Stdlib\Base\Enum; abstract class TaskPriority extends Enum { public const NONE = 0; + public const VLOW = 1; + public const LOW = 2; + public const MEDIUM = 3; + public const HIGH = 4; + public const VHIGH = 5; } diff --git a/Models/TaskStatus.php b/Models/TaskStatus.php index 2d0e774..6e311ea 100755 --- a/Models/TaskStatus.php +++ b/Models/TaskStatus.php @@ -27,8 +27,12 @@ use phpOMS\Stdlib\Base\Enum; abstract class TaskStatus extends Enum { public const OPEN = 1; + public const WORKING = 2; + public const SUSPENDED = 3; + public const CANCELED = 4; + public const DONE = 5; } diff --git a/Models/TaskType.php b/Models/TaskType.php index 3d15bf0..8b58144 100755 --- a/Models/TaskType.php +++ b/Models/TaskType.php @@ -27,6 +27,8 @@ use phpOMS\Stdlib\Base\Enum; abstract class TaskType extends Enum { public const TEMPLATE = 1; + public const SINGLE = 2; + public const HIDDEN = 3; } diff --git a/Models/TaskVisibility.php b/Models/TaskVisibility.php index 76929f9..b37b37c 100755 --- a/Models/TaskVisibility.php +++ b/Models/TaskVisibility.php @@ -27,6 +27,8 @@ use phpOMS\Stdlib\Base\Enum; abstract class TaskVisibility extends Enum { public const TO = 1; + public const CC = 2; + public const BCC = 3; } diff --git a/Theme/Backend/Components/Tasks/list.tpl.php b/Theme/Backend/Components/Tasks/list.tpl.php index 1a540ca..cd57e0b 100755 --- a/Theme/Backend/Components/Tasks/list.tpl.php +++ b/Theme/Backend/Components/Tasks/list.tpl.php @@ -5,9 +5,9 @@ use Modules\Tasks\Models\TaskStatus; ?> - tasks as $key => $task) : ++$c; @@ -19,7 +19,7 @@ use Modules\Tasks\Models\TaskStatus; elseif ($task->getStatus() === TaskStatus::CANCELED) { $color = 'red'; } elseif ($task->getStatus() === TaskStatus::SUSPENDED) { $color = 'yellow'; } ?> -
getHtml('Status', 'Tasks') ?> - getHtml('Due/Priority', 'Tasks') ?> - getHtml('Title', 'Tasks') ?> + getHtml('Status', 'Tasks'); ?> + getHtml('Due/Priority', 'Tasks'); ?> + getHtml('Title', 'Tasks'); ?>
getHtml('S' . $task->getStatus(), 'Tasks') ?> + getHtml('S' . $task->getStatus(), 'Tasks'); ?> getPriority() === TaskPriority::NONE) : ?> printHtml($task->getDue()->format('Y-m-d H:i')); ?> diff --git a/Theme/Backend/Components/Tasks/status.tpl.php b/Theme/Backend/Components/Tasks/status.tpl.php index c26485a..27af5e1 100755 --- a/Theme/Backend/Components/Tasks/status.tpl.php +++ b/Theme/Backend/Components/Tasks/status.tpl.php @@ -9,11 +9,11 @@
getHtml('S1') ?> -
getHtml('S2') ?> -
getHtml('S3') ?> -
getHtml('S4') ?> -
getHtml('S5') ?> +
getHtml('S1'); ?> +
getHtml('S2'); ?> +
getHtml('S3'); ?> +
getHtml('S4'); ?> +
getHtml('S5'); ?> diff --git a/Theme/Backend/dashboard-task.tpl.php b/Theme/Backend/dashboard-task.tpl.php index d10e514..08b09ae 100755 --- a/Theme/Backend/dashboard-task.tpl.php +++ b/Theme/Backend/dashboard-task.tpl.php @@ -15,7 +15,7 @@ declare(strict_types=1); ?>
-
getHtml('Tasks', 'Tasks') ?>
+
getHtml('Tasks', 'Tasks'); ?>
getData('tasklist')->render($this->getData('tasks')); ?>
\ No newline at end of file diff --git a/Theme/Backend/task-analysis.tpl.php b/Theme/Backend/task-analysis.tpl.php index 39b86ad..35be2b5 100755 --- a/Theme/Backend/task-analysis.tpl.php +++ b/Theme/Backend/task-analysis.tpl.php @@ -18,15 +18,15 @@ echo $this->getData('nav')->render(); ?>
-

getHtml('Account') ?>

+

getHtml('Account'); ?>

-
+
-
+
-
+
@@ -37,15 +37,15 @@ echo $this->getData('nav')->render(); ?>
-

getHtml('Statistics') ?>

+

getHtml('Statistics'); ?>

-
getHtml('Received') ?>0 -
getHtml('Created') ?>0 -
getHtml('Forwarded') ?>0 -
getHtml('AverageAmount') ?>0 -
getHtml('AverageProcessTime') ?>0 -
getHtml('InTime') ?>0 +
getHtml('Received'); ?>0 +
getHtml('Created'); ?>0 +
getHtml('Forwarded'); ?>0 +
getHtml('AverageAmount'); ?>0 +
getHtml('AverageProcessTime'); ?>0 +
getHtml('InTime'); ?>0
@@ -55,7 +55,7 @@ echo $this->getData('nav')->render(); ?>
-

getHtml('History') ?>

+

getHtml('History'); ?>

diff --git a/Theme/Backend/task-create.tpl.php b/Theme/Backend/task-create.tpl.php index e098e4d..1ab8414 100755 --- a/Theme/Backend/task-create.tpl.php +++ b/Theme/Backend/task-create.tpl.php @@ -22,29 +22,29 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Task') ?>
+
getHtml('Task'); ?>
-
+
getData('accGrpSelector')->render('iReceiver', 'forward', true); ?> -
+
getData('accGrpSelector')->render('iCC', 'cc', false); ?> -
+
-
+
-
-
-
+
+
+
getData('editor')->render('task-editor'); ?>
getData('editor')->getData('text')->render('task-editor', 'plain', 'fTask'); ?>
@@ -59,18 +59,18 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Media') ?>
+
getHtml('Media'); ?>
-
+
-
+
-
+
diff --git a/Theme/Backend/task-dashboard.tpl.php b/Theme/Backend/task-dashboard.tpl.php index f946303..0a8d93e 100755 --- a/Theme/Backend/task-dashboard.tpl.php +++ b/Theme/Backend/task-dashboard.tpl.php @@ -35,14 +35,14 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Tasks') ?>
+
getHtml('Tasks'); ?>
- getData('nav')->render(); ?> $url = UriFactory::build('{/prefix}task/single?{?}&id=' . $task->getId()); ?> -
getHtml('Status') ?> - getHtml('Due/Priority') ?> - getHtml('Title') ?> - getHtml('Creator') ?> - getHtml('Created') ?> + getHtml('Status'); ?> + getHtml('Due/Priority'); ?> + getHtml('Title'); ?> + getHtml('Creator'); ?> + getHtml('Created'); ?>
+ - getHtml('S' . $task->getStatus()) ?> + getHtml('S' . $task->getStatus()); ?> - + getPriority() === TaskPriority::NONE) : ?> printHtml($task->getDue()->format('Y-m-d H:i')); ?> @@ -64,11 +64,11 @@ echo $this->getData('nav')->render(); ?> getHtml('P' . $task->getPriority()); ?> - + printHtml($task->getTitle()); ?> - + printHtml($task->getCreatedBy()->getName1()); ?> - + printHtml($task->getCreatedAt()->format('Y-m-d H:i')); ?>
getHtml('Empty', '0', '0'); ?> diff --git a/Theme/Backend/task-single.tpl.php b/Theme/Backend/task-single.tpl.php index c28ebdb..8017a19 100755 --- a/Theme/Backend/task-single.tpl.php +++ b/Theme/Backend/task-single.tpl.php @@ -65,7 +65,7 @@ echo $this->getData('nav')->render(); ?> - getHtml('S' . $task->getStatus()) ?> + getHtml('S' . $task->getStatus()); ?> @@ -92,18 +92,18 @@ echo $this->getData('nav')->render(); ?>
getPriority() === TaskPriority::NONE) : ?> - getHtml('Due') ?>: printHtml($task->getDue()->format('Y/m/d H:i')); ?> + getHtml('Due'); ?>: printHtml($task->getDue()->format('Y/m/d H:i')); ?> - getHtml('Priority') ?>: getHtml('P' . $task->getPriority()) ?> + getHtml('Priority'); ?>: getHtml('P' . $task->getPriority()); ?>
isEditable() && $this->request->getHeader()->getAccount() === $task->getCreatedBy()->getId()) : ?>
- - - + + +
@@ -143,9 +143,9 @@ echo $this->getData('nav')->render(); ?>
- - - + + +
@@ -177,7 +177,7 @@ echo $this->getData('nav')->render(); ?> $element->getCreatedAt()->format('Y-m-d H:i') )); ?> - getHtml('S' . $element->getStatus()) ?> + getHtml('S' . $element->getStatus()); ?> @@ -193,7 +193,7 @@ echo $this->getData('nav')->render(); ?> $element->getCreatedAt()->format('Y-m-d H:i') )); ?> - getHtml('P' . $element->getPriority()) ?> + getHtml('P' . $element->getPriority()); ?> @@ -256,9 +256,9 @@ echo $this->getData('nav')->render(); ?> && $previous->getDue()->format('Y/m/d H:i') !== $element->getDue()->format('Y/m/d H:i') ) ) : ?> - getHtml('Due') ?>: printHtml($element->getDue()->format('Y/m/d H:i')); ?> + getHtml('Due'); ?>: printHtml($element->getDue()->format('Y/m/d H:i')); ?> getPriority() !== $element->getPriority()) : ?> - getHtml('Priority') ?>: getHtml('P' . $element->getPriority()) ?> + getHtml('Priority'); ?>: getHtml('P' . $element->getPriority()); ?> @@ -268,9 +268,9 @@ echo $this->getData('nav')->render(); ?> ) : ?>
- - - + + +
@@ -285,10 +285,10 @@ echo $this->getData('nav')->render(); ?> ) : ?>
- printHtml($element->getCreatedBy()->getName1()); ?> getHtml('forwarded_to') ?> + printHtml($element->getCreatedBy()->getName1()); ?> getHtml('forwarded_to'); ?> - printHtml($to->getRelation()->getName1()); ?> + printHtml($to->getRelation()->getName1()); ?> printHtml($to->getRelation()->getName()); ?> @@ -309,7 +309,7 @@ echo $this->getData('nav')->render(); ?> data-add-element=".taskElement-content" data-add-tpl="#elementTpl" > -
getHtml('Message') ?>
+
getHtml('Message'); ?>
getData('editor')->render('task-editor'); ?> @@ -320,36 +320,36 @@ echo $this->getData('nav')->render(); ?> '', '', '/content', '{/api}task?id={?id}' ); ?> -
+
-
+
-
+
-
+
getData('accGrpSelector')->render('iReceiver', 'to', true); ?> -
+
-
+
-
+
diff --git a/tests/Admin/AdminTest.php b/tests/Admin/AdminTest.php index 989a685..380b947 100755 --- a/tests/Admin/AdminTest.php +++ b/tests/Admin/AdminTest.php @@ -20,6 +20,7 @@ namespace Modules\Tasks\tests\Admin; class AdminTest extends \PHPUnit\Framework\TestCase { protected const MODULE_NAME = 'Tasks'; + protected const URI_LOAD = 'http://127.0.0.1/en/backend/task'; use \Modules\tests\ModuleTestTrait; diff --git a/tests/BackendControllerTest.php b/tests/BackendControllerTest.php index a364fe7..d12d547 100755 --- a/tests/BackendControllerTest.php +++ b/tests/BackendControllerTest.php @@ -34,6 +34,7 @@ use phpOMS\Utils\TestUtils; class BackendControllerTest extends \PHPUnit\Framework\TestCase { protected $app = null; + protected $module = null; protected function setUp() : void diff --git a/tests/ControllerTest.php b/tests/ControllerTest.php index 3abcf0a..5b89561 100755 --- a/tests/ControllerTest.php +++ b/tests/ControllerTest.php @@ -37,6 +37,7 @@ use phpOMS\Utils\TestUtils; class ControllerTest extends \PHPUnit\Framework\TestCase { protected $app = null; + protected $module = null; protected function setUp() : void