diff --git a/Models/HelperStatus.php b/Models/HelperStatus.php index d44840c..3afb6b5 100755 --- a/Models/HelperStatus.php +++ b/Models/HelperStatus.php @@ -27,5 +27,6 @@ use phpOMS\Stdlib\Base\Enum; abstract class HelperStatus extends Enum { public const INACTIVE = 0; + public const ACTIVE = 1; } diff --git a/Models/PermissionState.php b/Models/PermissionState.php index 95ed7b1..7cb22d8 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 TEMPLATE = 1; + public const REPORT = 2; + public const EXPORT = 3; } diff --git a/Theme/Backend/helper-edit.tpl.php b/Theme/Backend/helper-edit.tpl.php index 8c8143a..19b1db4 100755 --- a/Theme/Backend/helper-edit.tpl.php +++ b/Theme/Backend/helper-edit.tpl.php @@ -26,7 +26,7 @@ echo $this->getData('nav')->render(); ?> diff --git a/Theme/Backend/helper-list.tpl.php b/Theme/Backend/helper-list.tpl.php index bd93f47..e4e40b5 100755 --- a/Theme/Backend/helper-list.tpl.php +++ b/Theme/Backend/helper-list.tpl.php @@ -28,14 +28,14 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Helpers') ?>
+
getHtml('Helpers'); ?>
- @@ -44,13 +44,13 @@ echo $this->getData('nav')->render(); ?> $template) : $url = UriFactory::build('{/prefix}helper/report/view?{?}&id=' . $template->getId()); ?> -
getHtml('Name') ?> + getHtml('Name'); ?> getHtml('Tag'); ?> - getHtml('Creator') ?> - getHtml('Updated') ?> + getHtml('Creator'); ?> + getHtml('Updated'); ?>
printHtml($template->getName()); ?> - + printHtml($template->getName()); ?> + getTags(); foreach ($tags as $tag) : ?> printHtml($tag->getTitle()); ?> - printHtml($template->getCreatedBy()->getName1()); ?> - printHtml($template->getCreatedAt()->format('Y-m-d')); ?> + printHtml($template->getCreatedBy()->getName1()); ?> + printHtml($template->getCreatedAt()->format('Y-m-d')); ?>
diff --git a/Theme/Backend/helper-single.tpl.php b/Theme/Backend/helper-single.tpl.php index 778dff6..34b15a1 100755 --- a/Theme/Backend/helper-single.tpl.php +++ b/Theme/Backend/helper-single.tpl.php @@ -36,7 +36,7 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Reports') ?>
+
getHtml('Reports'); ?>
@@ -61,7 +61,7 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Export') ?>
+
getHtml('Export'); ?>
@@ -90,7 +90,7 @@ echo $this->getData('nav')->render(); ?>
-
getHtml('Settings') ?>
+
getHtml('Settings'); ?>
@@ -100,19 +100,19 @@ echo $this->getData('nav')->render(); ?>
- +
-
getHtml('Info') ?>
+
getHtml('Info'); ?>
isStandalone() && !($report instanceof \Modules\Helper\Models\NullReport)) : ?> - - -
getHtml('Report') ?> + getHtml('Report'); ?>
getHtml('Name'); ?> printHtml($report->getTitle()); ?> @@ -124,7 +124,7 @@ echo $this->getData('nav')->render(); ?> getCreatedAt()->format('Y-m-d'); ?>
getHtml('Template') ?> + getHtml('Template'); ?>
getHtml('Name'); ?> printHtml($template->getName()); ?> diff --git a/tests/Admin/AdminTest.php b/tests/Admin/AdminTest.php index 1a061f0..4e8c513 100755 --- a/tests/Admin/AdminTest.php +++ b/tests/Admin/AdminTest.php @@ -20,6 +20,7 @@ namespace Modules\Helper\tests\Admin; class AdminTest extends \PHPUnit\Framework\TestCase { protected const MODULE_NAME = 'Helper'; + protected const URI_LOAD = 'http://127.0.0.1/en/backend/helper'; use \Modules\tests\ModuleTestTrait; diff --git a/tests/ControllerTestTemp.php b/tests/ControllerTestTemp.php index 7696d4e..aae8db9 100755 --- a/tests/ControllerTestTemp.php +++ b/tests/ControllerTestTemp.php @@ -32,6 +32,7 @@ use phpOMS\Utils\TestUtils; class ControllerTest extends \PHPUnit\Framework\TestCase { protected $app = null; + protected $module = null; protected function setUp() : void diff --git a/tests/EventCourse/EventCourse.tpl.php b/tests/EventCourse/EventCourse.tpl.php index 839be4f..3f1ab5f 100755 --- a/tests/EventCourse/EventCourse.tpl.php +++ b/tests/EventCourse/EventCourse.tpl.php @@ -18,15 +18,15 @@ require 'Worker.php';
- request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : '' ?>> + request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : ''; ?>>
@@ -41,40 +41,40 @@ require 'Worker.php'; - - - - -
- - format('Y')]['value'] ?? 0, 2, ',', '.') ?> - - - + + + format('Y')]['value'] ?? 0, 2, ',', '.'); ?> + + +
- - format('Y')]['value'] ?? 0) + ($type['R'][$fiscal_end->format('Y')]['value'] ?? 0) + ($type['V'][$fiscal_end->format('Y')]['value'] ?? 0), 2, ',', '.') ?> - - - + + + format('Y')]['value'] ?? 0) + ($type['R'][$fiscal_end->format('Y')]['value'] ?? 0) + ($type['V'][$fiscal_end->format('Y')]['value'] ?? 0), 2, ',', '.'); ?> + + +
- - format('Y')]['value'] ?? 0, 2, ',', '.') ?> - - - + + + format('Y')]['value'] ?? 0, 2, ',', '.'); ?> + + +
- - format('Y')]['value'] ?? 0, 2, ',', '.') ?> - - - + + + format('Y')]['value'] ?? 0, 2, ',', '.'); ?> + + +
- - format('Y')]['value'] ?? 0, 2, ',', '.') ?> - - - + + + format('Y')]['value'] ?? 0, 2, ',', '.'); ?> + + +
@@ -96,12 +96,12 @@ require 'Worker.php'; $sum_forecast = 0.0; foreach ($types as $key => $stype) : ?>
- - format('Y')]['value'] ?? 0.0, 2, ',', '.')) ?> - format('Y')]['value'] ?? 0.0, 2, ',', '.')) ?> - format('Y')]['value'] ?? 0.0) / \abs(((int) $fiscal_current->format('m') - ((int) $fiscal_end->format('m') + 1)) % 12 + 1) * 12, 2, ',', '.')) ?> - + + + format('Y')]['value'] ?? 0.0, 2, ',', '.')); ?> + format('Y')]['value'] ?? 0.0, 2, ',', '.')); ?> + format('Y')]['value'] ?? 0.0) / \abs(((int) $fiscal_current->format('m') - ((int) $fiscal_end->format('m') + 1)) % 12 + 1) * 12, 2, ',', '.')); ?> +
- - - - - + + + + +
@@ -135,12 +135,12 @@ require 'Worker.php'; $sum_forecast = 0.0; foreach ($costcenter as $key => $stype) : ?> - - - format('Y')]['value'] ?? 0.0, 2, ',', '.')) ?> - format('Y')]['value'] ?? 0.0, 2, ',', '.')) ?> - format('Y')]['value'] ?? 0.0) / \abs(((int) $fiscal_current->format('m') - ((int) $fiscal_end->format('m') + 1)) % 12 + 1) * 12, 2, ',', '.')) ?> - + + + format('Y')]['value'] ?? 0.0, 2, ',', '.')); ?> + format('Y')]['value'] ?? 0.0, 2, ',', '.')); ?> + format('Y')]['value'] ?? 0.0) / \abs(((int) $fiscal_current->format('m') - ((int) $fiscal_end->format('m') + 1)) % 12 + 1) * 12, 2, ',', '.')); ?> + - - - - - + + + + +
@@ -174,12 +174,12 @@ require 'Worker.php'; $sum_forecast = 0.0; foreach ($account as $key => $stype) : ?> - - - format('Y')]['value'] ?? 0.0, 2, ',', '.')) ?> - format('Y')]['value'] ?? 0.0, 2, ',', '.')) ?> - format('Y')]['value'] ?? 0.0) / \abs(((int) $fiscal_current->format('m') - ((int) $fiscal_end->format('m') + 1)) % 12 + 1) * 12, 2, ',', '.')) ?> - + + + format('Y')]['value'] ?? 0.0, 2, ',', '.')); ?> + format('Y')]['value'] ?? 0.0, 2, ',', '.')); ?> + format('Y')]['value'] ?? 0.0) / \abs(((int) $fiscal_current->format('m') - ((int) $fiscal_end->format('m') + 1)) % 12 + 1) * 12, 2, ',', '.')); ?> + - - - - - + + + + +
- request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : '' ?>> + request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : ''; ?>>
@@ -211,16 +211,16 @@ require 'Worker.php'; foreach ($costobject as $key => $co) : if (\strrpos($key, 'K', -\strlen($key)) !== false && isset($co[$fiscal_end->format('Y')]['value'])) : ?> -
+ - - format('Y')]['value'] ?? 0, 2, ',', '.') ?> + + format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
- - format('Y')]['value'] ?? 0, 2, ',', '.') ?> + + format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
@@ -236,14 +236,14 @@ require 'Worker.php'; format('Y')]['cc'] ?? []; foreach ($loop as $key => $stype) : ?> - - - + + + - - format('Y')]['value'] ?? 0, 2, ',', '.') ?> + + format('Y')]['value'] ?? 0, 2, ',', '.'); ?> @@ -259,18 +259,18 @@ require 'Worker.php'; format('Y')]['ac'] ?? []; foreach ($loop as $key => $stype) : ?> - - - + + + - - format('Y')]['value'] ?? 0, 2, ',', '.') ?> + + format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
- request->getUri()->getFragment() === 'c-tab-3' ? ' checked' : '' ?>> + request->getUri()->getFragment() === 'c-tab-3' ? ' checked' : ''; ?>>
@@ -284,14 +284,14 @@ require 'Worker.php'; format('Y')]['ac'] ?? []; foreach ($loop as $key => $co) : ?> -
- - + + +
- - format('Y')]['value'] ?? 0, 2, ',', '.') ?> + + format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
@@ -307,18 +307,18 @@ require 'Worker.php'; format('Y')]['cc'] ?? []; foreach ($loop as $key => $co) : ?> - - - + + + - - format('Y')]['value'] ?? 0, 2, ',', '.') ?> + + format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
- request->getUri()->getFragment() === 'c-tab-4' ? ' checked' : '' ?>> + request->getUri()->getFragment() === 'c-tab-4' ? ' checked' : ''; ?>>
@@ -332,14 +332,14 @@ require 'Worker.php'; format('Y')]['ac'] ?? []; foreach ($loop as $key => $ac) : ?> -
- - + + +
- - format('Y')]['value'] ?? 0, 2, ',', '.') ?> + + format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
@@ -355,14 +355,14 @@ require 'Worker.php'; format('Y')]['type'] ?? []; foreach ($loop as $key => $co) : ?> - - - + + + - - format('Y')]['value'] ?? 0, 2, ',', '.') ?> + + format('Y')]['value'] ?? 0, 2, ',', '.'); ?> @@ -378,18 +378,18 @@ require 'Worker.php'; format('Y')]['co'] ?? []; foreach ($loop as $key => $co) : ?> - - - + + + - - format('Y')]['value'] ?? 0, 2, ',', '.') ?> + + format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
- request->getUri()->getFragment() === 'c-tab-5' ? ' checked' : '' ?>> + request->getUri()->getFragment() === 'c-tab-5' ? ' checked' : ''; ?>>
@@ -403,14 +403,14 @@ require 'Worker.php'; format('Y')]['type'] ?? []; foreach ($loop as $key => $stype) : ?> -
- - + + +
- - format('Y')]['value'] ?? 0, 2, ',', '.') ?> + + format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
@@ -426,14 +426,14 @@ require 'Worker.php'; format('Y')]['cc'] ?? []; foreach ($loop as $key => $cc) : ?> - - - + + + - - format('Y')]['value'] ?? 0, 2, ',', '.') ?> + + format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
diff --git a/tests/Models/TemplateTest.php b/tests/Models/TemplateTest.php index fb599ad..6d9a708 100755 --- a/tests/Models/TemplateTest.php +++ b/tests/Models/TemplateTest.php @@ -68,6 +68,7 @@ class TemplateTest extends \PHPUnit\Framework\TestCase $this->template->setUnit(new NullUnit(1)); self::assertEquals(1, $this->template->getUnit()->getId()); } + /** * @testdox The creator can be set and returned correctly * @covers Modules\Helper\Models\Template