From 857f183ba7d9c07fd0fbc92b041a304a435db2c4 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sun, 30 Aug 2020 20:13:11 +0200 Subject: [PATCH] autofixes --- Models/Department.php | 2 +- Models/PermissionState.php | 3 +++ Models/Position.php | 2 +- Models/SettingsEnum.php | 2 ++ Models/Status.php | 2 ++ Models/Unit.php | 2 +- .../department-selector-popup.tpl.php | 4 ++-- .../position-selector-popup.tpl.php | 4 ++-- .../UnitTagSelector/unit-selector-popup.tpl.php | 4 ++-- Theme/Backend/department-create.tpl.php | 10 +++++----- Theme/Backend/department-list.tpl.php | 16 ++++++++-------- Theme/Backend/department-profile.tpl.php | 16 ++++++++-------- Theme/Backend/position-create.tpl.php | 14 +++++++------- Theme/Backend/position-list.tpl.php | 16 ++++++++-------- Theme/Backend/position-profile.tpl.php | 16 ++++++++-------- Theme/Backend/unit-create.tpl.php | 16 ++++++++-------- Theme/Backend/unit-list.tpl.php | 12 ++++++------ Theme/Backend/unit-profile.tpl.php | 14 +++++++------- tests/Admin/AdminTest.php | 1 + tests/ControllerTest.php | 1 + 20 files changed, 83 insertions(+), 74 deletions(-) diff --git a/Models/Department.php b/Models/Department.php index 5039ae2..de23f5b 100755 --- a/Models/Department.php +++ b/Models/Department.php @@ -24,7 +24,7 @@ use phpOMS\Contract\ArrayableInterface; * @link https://orange-management.org * @since 1.0.0 */ -class Department implements ArrayableInterface, \JsonSerializable +class Department implements \JsonSerializable, ArrayableInterface { /** * Article ID. diff --git a/Models/PermissionState.php b/Models/PermissionState.php index a2fbc06..c6988b2 100755 --- a/Models/PermissionState.php +++ b/Models/PermissionState.php @@ -27,7 +27,10 @@ use phpOMS\Stdlib\Base\Enum; abstract class PermissionState extends Enum { public const UNIT = 1; + public const DEPARTMENT = 2; + public const POSITION = 3; + public const ORGANIGRAM = 4; } diff --git a/Models/Position.php b/Models/Position.php index e04c71c..d21cead 100755 --- a/Models/Position.php +++ b/Models/Position.php @@ -24,7 +24,7 @@ use phpOMS\Contract\ArrayableInterface; * @link https://orange-management.org * @since 1.0.0 */ -class Position implements ArrayableInterface, \JsonSerializable +class Position implements \JsonSerializable, ArrayableInterface { /** * Article ID. diff --git a/Models/SettingsEnum.php b/Models/SettingsEnum.php index 2b59b51..6fe35b0 100755 --- a/Models/SettingsEnum.php +++ b/Models/SettingsEnum.php @@ -27,6 +27,8 @@ use phpOMS\Stdlib\Base\Enum; abstract class SettingsEnum extends Enum { public const GROUP_GENERATE_AUTOMATICALLY_UNIT = '1004700001'; + public const GROUP_GENERATE_AUTOMATICALLY_DEPARTMENT = '1004700002'; + public const GROUP_GENERATE_AUTOMATICALLY_POSITION = '1004700003'; } diff --git a/Models/Status.php b/Models/Status.php index 1113b02..ca36145 100755 --- a/Models/Status.php +++ b/Models/Status.php @@ -27,6 +27,8 @@ use phpOMS\Stdlib\Base\Enum; abstract class Status extends Enum { public const ACTIVE = 1; + public const INACTIVE = 2; + public const HIDDEN = 4; } diff --git a/Models/Unit.php b/Models/Unit.php index 6ef5e19..fb0681f 100755 --- a/Models/Unit.php +++ b/Models/Unit.php @@ -26,7 +26,7 @@ use phpOMS\Contract\ArrayableInterface; * @link https://orange-management.org * @since 1.0.0 */ -class Unit implements ArrayableInterface, \JsonSerializable +class Unit implements \JsonSerializable, ArrayableInterface { /** * Article ID. diff --git a/Theme/Backend/Components/DepartmentTagSelector/department-selector-popup.tpl.php b/Theme/Backend/Components/DepartmentTagSelector/department-selector-popup.tpl.php index bd9747d..b826a04 100755 --- a/Theme/Backend/Components/DepartmentTagSelector/department-selector-popup.tpl.php +++ b/Theme/Backend/Components/DepartmentTagSelector/department-selector-popup.tpl.php @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/Theme/Backend/Components/PositionTagSelector/position-selector-popup.tpl.php b/Theme/Backend/Components/PositionTagSelector/position-selector-popup.tpl.php index e70363b..2f210bd 100755 --- a/Theme/Backend/Components/PositionTagSelector/position-selector-popup.tpl.php +++ b/Theme/Backend/Components/PositionTagSelector/position-selector-popup.tpl.php @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/Theme/Backend/Components/UnitTagSelector/unit-selector-popup.tpl.php b/Theme/Backend/Components/UnitTagSelector/unit-selector-popup.tpl.php index 015940f..900f7df 100755 --- a/Theme/Backend/Components/UnitTagSelector/unit-selector-popup.tpl.php +++ b/Theme/Backend/Components/UnitTagSelector/unit-selector-popup.tpl.php @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/Theme/Backend/department-create.tpl.php b/Theme/Backend/department-create.tpl.php index 9534851..df65109 100755 --- a/Theme/Backend/department-create.tpl.php +++ b/Theme/Backend/department-create.tpl.php @@ -21,16 +21,16 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Department') ?>
+
getHtml('Department'); ?>
-
+
-
+
getData('department-selector')->render('iParent', 'parent', false); ?> -
+
getData('unit-selector')->render('iUnit', 'unit', false); ?> -
+
getData('editor')->render('department-editor'); ?>
getData('editor')->getData('text')->render('department-editor', 'description', 'fDepartmentCreate'); ?>
diff --git a/Theme/Backend/department-list.tpl.php b/Theme/Backend/department-list.tpl.php index b9deee9..7c0dfc4 100755 --- a/Theme/Backend/department-list.tpl.php +++ b/Theme/Backend/department-list.tpl.php @@ -28,22 +28,22 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Departments') ?>
+
getHtml('Departments'); ?>
$value) : ++$c; $url = \phpOMS\Uri\UriFactory::build('{/prefix}organization/department/profile?{?}&id=' . $value->getId()); ?> - diff --git a/Theme/Backend/department-profile.tpl.php b/Theme/Backend/department-profile.tpl.php index 1f5c67b..2441ce9 100755 --- a/Theme/Backend/department-profile.tpl.php +++ b/Theme/Backend/department-profile.tpl.php @@ -25,20 +25,20 @@ echo $this->getData('nav')->render(); ?>
- -
getHtml('Department') ?>
+ +
getHtml('Department'); ?>
getHtml('ID', '0', '0'); ?> - getHtml('Name') ?> - getHtml('Parent') ?> - getHtml('Unit') ?> + getHtml('Name'); ?> + getHtml('Parent'); ?> + getHtml('Unit'); ?>
printHtml($value->getId()); ?> - printHtml($value->getName()); ?> - printHtml($value->getParent()->getName()); ?> - printHtml($value->getUnit()->getName()); ?> + printHtml($value->getId()); ?> + printHtml($value->getName()); ?> + printHtml($value->getParent()->getName()); ?> + printHtml($value->getUnit()->getName()); ?>
-
+
-
+
getData('department-selector')->render('iParent', 'parent', false); ?> -
+
getData('unit-selector')->render('iUnit', 'unit', false); ?> -
+
getData('editor')->render('department-editor'); ?>
getData('editor')->getData('text')->render( diff --git a/Theme/Backend/position-create.tpl.php b/Theme/Backend/position-create.tpl.php index 2b66565..2c3a2be 100755 --- a/Theme/Backend/position-create.tpl.php +++ b/Theme/Backend/position-create.tpl.php @@ -21,19 +21,19 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Position') ?>
+
getHtml('Position'); ?>
-
+
-
+
getData('position-selector')->render('iParent', 'parent', false); ?> -
+
getData('department-selector')->render('iDepartment', 'department', false); ?> -
+
getData('editor')->render('position-editor'); ?>
getData('editor')->getData('text')->render('position-editor', 'description', 'fPositionCreate'); ?> diff --git a/Theme/Backend/position-list.tpl.php b/Theme/Backend/position-list.tpl.php index c64449a..eb1425f 100755 --- a/Theme/Backend/position-list.tpl.php +++ b/Theme/Backend/position-list.tpl.php @@ -29,22 +29,22 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Positions') ?>
+
getHtml('Positions'); ?>
$value) : ++$count; $url = \phpOMS\Uri\UriFactory::build('{/prefix}organization/position/profile?{?}&id=' . $value->getId()); ?> -
getHtml('ID', '0', '0'); ?> - getHtml('Name') ?> - getHtml('Parent') ?> - getHtml('Department') ?> + getHtml('Name'); ?> + getHtml('Parent'); ?> + getHtml('Department'); ?>
printHtml($value->getId()); ?> - printHtml($value->getName()); ?> - printHtml($value->getParent()->getName()); ?> - printHtml($value->getDepartment()->getName()); ?> + printHtml($value->getId()); ?> + printHtml($value->getName()); ?> + printHtml($value->getParent()->getName()); ?> + printHtml($value->getDepartment()->getName()); ?>
getHtml('Empty', '0', '0'); ?> diff --git a/Theme/Backend/position-profile.tpl.php b/Theme/Backend/position-profile.tpl.php index 886b003..34491fb 100755 --- a/Theme/Backend/position-profile.tpl.php +++ b/Theme/Backend/position-profile.tpl.php @@ -25,20 +25,20 @@ echo $this->getData('nav')->render(); ?>
- -
getHtml('Position') ?>
+ +
getHtml('Position'); ?>
-
+
-
+
getData('position-selector')->render('iParent', 'parent', false); ?> -
+
getData('department-selector')->render('iDepartment', 'department', false); ?> -
+
getData('editor')->render('position-editor'); ?>
getData('editor')->getData('text')->render( diff --git a/Theme/Backend/unit-create.tpl.php b/Theme/Backend/unit-create.tpl.php index 9d72321..3e0da2f 100755 --- a/Theme/Backend/unit-create.tpl.php +++ b/Theme/Backend/unit-create.tpl.php @@ -22,20 +22,20 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Unit') ?>
+
getHtml('Unit'); ?>
-
+
-
-
+
+
getData('media-preview-upload')->render('fUnitCreate', 'logo', '/Modules/Organization'); ?> -
+
getData('unit-selector')->render('iParent', 'parent', false); ?> -
+
getData('editor')->render('unit-editor'); ?>
getData('editor')->getData('text')->render('unit-editor', 'description', 'fUnitCreate'); ?> diff --git a/Theme/Backend/unit-list.tpl.php b/Theme/Backend/unit-list.tpl.php index 6a1f03a..ee8ebca 100755 --- a/Theme/Backend/unit-list.tpl.php +++ b/Theme/Backend/unit-list.tpl.php @@ -29,14 +29,14 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Units') ?>
+
getHtml('Units'); ?>
$value) : $url = UriFactory::build('{/prefix}organization/unit/profile?{?}&id=' . $value->getId()); ?> @@ -45,8 +45,8 @@ echo $this->getData('nav')->render(); ?>
getHtml('ID', '0', '0'); ?> - getHtml('Logo') ?> - getHtml('Name') ?> - getHtml('Parent') ?> + getHtml('Logo'); ?> + getHtml('Name'); ?> + getHtml('Parent'); ?>
- printHtml($value->getName()); ?> - printHtml($value->getParent()->getName()); ?> + printHtml($value->getName()); ?> + printHtml($value->getParent()->getName()); ?>
diff --git a/Theme/Backend/unit-profile.tpl.php b/Theme/Backend/unit-profile.tpl.php index fb80cb0..a6f841a 100755 --- a/Theme/Backend/unit-profile.tpl.php +++ b/Theme/Backend/unit-profile.tpl.php @@ -28,7 +28,7 @@ echo $this->getData('nav')->render(); ?>
- +
-
+
-
+
getData('unit-selector')->render('iParent', 'parent', false); ?> -
+
getData('editor')->render('unit-editor'); ?>
getData('editor')->getData('text')->render( diff --git a/tests/Admin/AdminTest.php b/tests/Admin/AdminTest.php index db72652..9e1c351 100755 --- a/tests/Admin/AdminTest.php +++ b/tests/Admin/AdminTest.php @@ -20,6 +20,7 @@ namespace Modules\Organization\tests\Admin; class AdminTest extends \PHPUnit\Framework\TestCase { protected const MODULE_NAME = 'Organization'; + protected const URI_LOAD = 'http://127.0.0.1/en/backend/organization'; use \Modules\tests\ModuleTestTrait; diff --git a/tests/ControllerTest.php b/tests/ControllerTest.php index d4d7670..0e938d3 100755 --- a/tests/ControllerTest.php +++ b/tests/ControllerTest.php @@ -40,6 +40,7 @@ use phpOMS\Utils\TestUtils; class ControllerTest extends \PHPUnit\Framework\TestCase { protected $app = null; + protected $module = null; protected function setUp() : void