From 24d96270dd0045b75a4cc49c3d7e4e00bbb9aaa6 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 9 Jun 2020 22:01:09 +0200 Subject: [PATCH] fixes #1 --- .github/dev_bug_report.md | 0 .github/dev_feature_request.md | 0 .github/user_bug_report.md | 0 .github/user_feature_request.md | 0 .github/workflows/greetings.yml | 0 .github/workflows/image.yml | 0 .github/workflows/main.yml | 0 Admin/Install/Media.install.json | 7 +++ Admin/Install/Media.php | 43 +++++++++++++++++ Admin/Install/Navigation.install.json | 0 Admin/Install/Navigation.php | 0 Admin/Install/Settings.install.php | 0 Admin/Install/db.json | 8 ++++ Admin/Installer.php | 0 Admin/Routes/Web/Api.php | 14 +++++- Admin/Routes/Web/Backend.php | 0 Admin/Status.php | 0 Admin/Uninstaller.php | 0 Admin/Updater.php | 0 CODE_OF_CONDUCT.md | 0 CONTRIBUTING.md | 0 Controller/ApiController.php | 39 ++++++++++++++++ Controller/BackendController.php | 0 Controller/Controller.php | 0 LICENSE.txt | 0 Models/Department.php | 0 Models/DepartmentMapper.php | 0 Models/NullDepartment.php | 0 Models/NullPosition.php | 0 Models/NullUnit.php | 1 + Models/PermissionState.php | 0 Models/Position.php | 0 Models/PositionMapper.php | 0 Models/SettingsEnum.php | 0 Models/Status.php | 0 Models/Unit.php | 46 +++++++++++++++++++ Models/UnitMapper.php | 15 ++++++ README.md | 0 .../DepartmentTagSelectorPopupView.php | 0 .../DepartmentTagSelectorView.php | 0 .../department-selector-popup.tpl.php | 0 .../department-selector.tpl.php | 0 .../PositionTagSelectorPopupView.php | 0 .../PositionTagSelectorView.php | 0 .../position-selector-popup.tpl.php | 0 .../position-selector.tpl.php | 0 .../UnitTagSelectorPopupView.php | 0 .../UnitTagSelector/UnitTagSelectorView.php | 0 .../unit-selector-popup.tpl.php | 0 .../UnitTagSelector/unit-selector.tpl.php | 0 Theme/Backend/Lang/Navigation.en.lang.php | 0 Theme/Backend/Lang/en.lang.php | 1 + Theme/Backend/css/styles.css | 0 Theme/Backend/css/styles.scss | 0 Theme/Backend/department-create.tpl.php | 0 Theme/Backend/department-list.tpl.php | 0 Theme/Backend/department-profile.tpl.php | 0 Theme/Backend/organigram.tpl.php | 0 Theme/Backend/position-create.tpl.php | 0 Theme/Backend/position-list.tpl.php | 0 Theme/Backend/position-profile.tpl.php | 0 Theme/Backend/unit-create.tpl.php | 0 Theme/Backend/unit-list.tpl.php | 5 ++ Theme/Backend/unit-profile.tpl.php | 19 +++++++- composer.json | 0 composer.lock | 0 info.json | 6 ++- tests/Admin/AdminTest.php | 0 tests/ControllerTest.php | 0 tests/Models/DepartmentMapperTest.php | 0 tests/Models/DepartmentTest.php | 0 tests/Models/PositionMapperTest.php | 0 tests/Models/PositionTest.php | 0 tests/Models/UnitMapperTest.php | 0 tests/Models/UnitTest.php | 0 75 files changed, 200 insertions(+), 4 deletions(-) mode change 100644 => 100755 .github/dev_bug_report.md mode change 100644 => 100755 .github/dev_feature_request.md mode change 100644 => 100755 .github/user_bug_report.md mode change 100644 => 100755 .github/user_feature_request.md mode change 100644 => 100755 .github/workflows/greetings.yml mode change 100644 => 100755 .github/workflows/image.yml mode change 100644 => 100755 .github/workflows/main.yml create mode 100644 Admin/Install/Media.install.json create mode 100755 Admin/Install/Media.php mode change 100644 => 100755 Admin/Install/Navigation.install.json mode change 100644 => 100755 Admin/Install/Navigation.php mode change 100644 => 100755 Admin/Install/Settings.install.php mode change 100644 => 100755 Admin/Install/db.json mode change 100644 => 100755 Admin/Installer.php mode change 100644 => 100755 Admin/Routes/Web/Api.php mode change 100644 => 100755 Admin/Routes/Web/Backend.php mode change 100644 => 100755 Admin/Status.php mode change 100644 => 100755 Admin/Uninstaller.php mode change 100644 => 100755 Admin/Updater.php mode change 100644 => 100755 CODE_OF_CONDUCT.md mode change 100644 => 100755 CONTRIBUTING.md mode change 100644 => 100755 Controller/ApiController.php mode change 100644 => 100755 Controller/BackendController.php mode change 100644 => 100755 Controller/Controller.php mode change 100644 => 100755 LICENSE.txt mode change 100644 => 100755 Models/Department.php mode change 100644 => 100755 Models/DepartmentMapper.php mode change 100644 => 100755 Models/NullDepartment.php mode change 100644 => 100755 Models/NullPosition.php mode change 100644 => 100755 Models/NullUnit.php mode change 100644 => 100755 Models/PermissionState.php mode change 100644 => 100755 Models/Position.php mode change 100644 => 100755 Models/PositionMapper.php mode change 100644 => 100755 Models/SettingsEnum.php mode change 100644 => 100755 Models/Status.php mode change 100644 => 100755 Models/Unit.php mode change 100644 => 100755 Models/UnitMapper.php mode change 100644 => 100755 README.md mode change 100644 => 100755 Theme/Backend/Components/DepartmentTagSelector/DepartmentTagSelectorPopupView.php mode change 100644 => 100755 Theme/Backend/Components/DepartmentTagSelector/DepartmentTagSelectorView.php mode change 100644 => 100755 Theme/Backend/Components/DepartmentTagSelector/department-selector-popup.tpl.php mode change 100644 => 100755 Theme/Backend/Components/DepartmentTagSelector/department-selector.tpl.php mode change 100644 => 100755 Theme/Backend/Components/PositionTagSelector/PositionTagSelectorPopupView.php mode change 100644 => 100755 Theme/Backend/Components/PositionTagSelector/PositionTagSelectorView.php mode change 100644 => 100755 Theme/Backend/Components/PositionTagSelector/position-selector-popup.tpl.php mode change 100644 => 100755 Theme/Backend/Components/PositionTagSelector/position-selector.tpl.php mode change 100644 => 100755 Theme/Backend/Components/UnitTagSelector/UnitTagSelectorPopupView.php mode change 100644 => 100755 Theme/Backend/Components/UnitTagSelector/UnitTagSelectorView.php mode change 100644 => 100755 Theme/Backend/Components/UnitTagSelector/unit-selector-popup.tpl.php mode change 100644 => 100755 Theme/Backend/Components/UnitTagSelector/unit-selector.tpl.php mode change 100644 => 100755 Theme/Backend/Lang/Navigation.en.lang.php mode change 100644 => 100755 Theme/Backend/Lang/en.lang.php mode change 100644 => 100755 Theme/Backend/css/styles.css mode change 100644 => 100755 Theme/Backend/css/styles.scss mode change 100644 => 100755 Theme/Backend/department-create.tpl.php mode change 100644 => 100755 Theme/Backend/department-list.tpl.php mode change 100644 => 100755 Theme/Backend/department-profile.tpl.php mode change 100644 => 100755 Theme/Backend/organigram.tpl.php mode change 100644 => 100755 Theme/Backend/position-create.tpl.php mode change 100644 => 100755 Theme/Backend/position-list.tpl.php mode change 100644 => 100755 Theme/Backend/position-profile.tpl.php mode change 100644 => 100755 Theme/Backend/unit-create.tpl.php mode change 100644 => 100755 Theme/Backend/unit-list.tpl.php mode change 100644 => 100755 Theme/Backend/unit-profile.tpl.php mode change 100644 => 100755 composer.json mode change 100644 => 100755 composer.lock mode change 100644 => 100755 info.json mode change 100644 => 100755 tests/Admin/AdminTest.php mode change 100644 => 100755 tests/ControllerTest.php mode change 100644 => 100755 tests/Models/DepartmentMapperTest.php mode change 100644 => 100755 tests/Models/DepartmentTest.php mode change 100644 => 100755 tests/Models/PositionMapperTest.php mode change 100644 => 100755 tests/Models/PositionTest.php mode change 100644 => 100755 tests/Models/UnitMapperTest.php mode change 100644 => 100755 tests/Models/UnitTest.php diff --git a/.github/dev_bug_report.md b/.github/dev_bug_report.md old mode 100644 new mode 100755 diff --git a/.github/dev_feature_request.md b/.github/dev_feature_request.md old mode 100644 new mode 100755 diff --git a/.github/user_bug_report.md b/.github/user_bug_report.md old mode 100644 new mode 100755 diff --git a/.github/user_feature_request.md b/.github/user_feature_request.md old mode 100644 new mode 100755 diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml old mode 100644 new mode 100755 diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml old mode 100644 new mode 100755 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml old mode 100644 new mode 100755 diff --git a/Admin/Install/Media.install.json b/Admin/Install/Media.install.json new file mode 100644 index 0000000..427e3d2 --- /dev/null +++ b/Admin/Install/Media.install.json @@ -0,0 +1,7 @@ +[ + { + "name": "Organization", + "virtualPath": "/Modules", + "user": 1 + } +] \ No newline at end of file diff --git a/Admin/Install/Media.php b/Admin/Install/Media.php new file mode 100755 index 0000000..da2ece7 --- /dev/null +++ b/Admin/Install/Media.php @@ -0,0 +1,43 @@ + __DIR__ . '/Media.install.json']); + } +} diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json old mode 100644 new mode 100755 diff --git a/Admin/Install/Navigation.php b/Admin/Install/Navigation.php old mode 100644 new mode 100755 diff --git a/Admin/Install/Settings.install.php b/Admin/Install/Settings.install.php old mode 100644 new mode 100755 diff --git a/Admin/Install/db.json b/Admin/Install/db.json old mode 100644 new mode 100755 index 9b4e2f8..710b826 --- a/Admin/Install/db.json +++ b/Admin/Install/db.json @@ -15,6 +15,14 @@ "default": null, "null": true }, + "organization_unit_image": { + "name": "organization_unit_image", + "type": "INT", + "default": null, + "null": true, + "foreignTable": "media", + "foreignKey": "media_id" + }, "organization_unit_description": { "name": "organization_unit_description", "type": "TEXT", diff --git a/Admin/Installer.php b/Admin/Installer.php old mode 100644 new mode 100755 diff --git a/Admin/Routes/Web/Api.php b/Admin/Routes/Web/Api.php old mode 100644 new mode 100755 index 9613135..a628490 --- a/Admin/Routes/Web/Api.php +++ b/Admin/Routes/Web/Api.php @@ -82,7 +82,7 @@ return [ ], ], ], - '^.*/organization/unit.*$' => [ + '^.*/organization/unit(\?.*|$)' => [ [ 'dest' => '\Modules\Organization\Controller\ApiController:apiUnitCreate', 'verb' => RouteVerb::PUT, @@ -121,6 +121,18 @@ return [ ], ], + '^.*/organization/unit/image(\?.*|$)' => [ + [ + 'dest' => '\Modules\Organization\Controller\ApiController:apiUnitImageSet', + 'verb' => RouteVerb::SET, + 'permission' => [ + 'module' => ApiController::MODULE_NAME, + 'type' => PermissionType::MODIFY, + 'state' => PermissionState::UNIT, + ], + ], + ], + '^.*/organization/find/unit.*$' => [ [ 'dest' => '\Modules\Organization\Controller\ApiController:apiUnitFind', diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php old mode 100644 new mode 100755 diff --git a/Admin/Status.php b/Admin/Status.php old mode 100644 new mode 100755 diff --git a/Admin/Uninstaller.php b/Admin/Uninstaller.php old mode 100644 new mode 100755 diff --git a/Admin/Updater.php b/Admin/Updater.php old mode 100644 new mode 100755 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md old mode 100644 new mode 100755 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md old mode 100644 new mode 100755 diff --git a/Controller/ApiController.php b/Controller/ApiController.php old mode 100644 new mode 100755 index 8adca06..1159947 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -220,6 +220,45 @@ final class ApiController extends Controller return $unit; } + /** + * Routing end-point for application behaviour. + * + * @param RequestAbstract $request Request + * @param ResponseAbstract $response Response + * @param mixed $data Generic data + * + * @return void + * + * @api + * + * @since 1.0.0 + */ + public function apiUnitImageSet(RequestAbstract $request, ResponseAbstract $response, $data = null) : void + { + $uploadedFiles = $request->getFiles() ?? []; + + if (empty($uploadedFiles)) { + return; + } + + /** @var Unit $unit */ + $unit = UnitMapper::get((int) ($request->getData('id') ?? 0)); + $old = clone $unit; + + $uploaded = $this->app->moduleManager->get('Media')->uploadFiles( + $request->getData('name') ?? '', + $uploadedFiles, + $request->getHeader()->getAccount(), + __DIR__ . '/../../../Modules/Media/Files', + '/Modules/Organization' + ); + + $unit->setImage(\reset($uploaded)); + + $this->updateModel($request->getHeader()->getAccount(), $old, $unit, UnitMapper::class, 'unit', $request->getOrigin()); + $this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Unit', 'Unit successfully updated', $unit); + } + /** * Validate position create request * diff --git a/Controller/BackendController.php b/Controller/BackendController.php old mode 100644 new mode 100755 diff --git a/Controller/Controller.php b/Controller/Controller.php old mode 100644 new mode 100755 diff --git a/LICENSE.txt b/LICENSE.txt old mode 100644 new mode 100755 diff --git a/Models/Department.php b/Models/Department.php old mode 100644 new mode 100755 diff --git a/Models/DepartmentMapper.php b/Models/DepartmentMapper.php old mode 100644 new mode 100755 diff --git a/Models/NullDepartment.php b/Models/NullDepartment.php old mode 100644 new mode 100755 diff --git a/Models/NullPosition.php b/Models/NullPosition.php old mode 100644 new mode 100755 diff --git a/Models/NullUnit.php b/Models/NullUnit.php old mode 100644 new mode 100755 index cc09f5f..1aaa9a4 --- a/Models/NullUnit.php +++ b/Models/NullUnit.php @@ -34,5 +34,6 @@ final class NullUnit extends Unit public function __construct(int $id = 0) { $this->id = $id; + parent::__construct(); } } diff --git a/Models/PermissionState.php b/Models/PermissionState.php old mode 100644 new mode 100755 diff --git a/Models/Position.php b/Models/Position.php old mode 100644 new mode 100755 diff --git a/Models/PositionMapper.php b/Models/PositionMapper.php old mode 100644 new mode 100755 diff --git a/Models/SettingsEnum.php b/Models/SettingsEnum.php old mode 100644 new mode 100755 diff --git a/Models/Status.php b/Models/Status.php old mode 100644 new mode 100755 diff --git a/Models/Unit.php b/Models/Unit.php old mode 100644 new mode 100755 index f5c6697..5560f96 --- a/Models/Unit.php +++ b/Models/Unit.php @@ -15,6 +15,8 @@ declare(strict_types=1); namespace Modules\Organization\Models; use phpOMS\Contract\ArrayableInterface; +use Modules\Media\Models\Media; +use Modules\Media\Models\NullMedia; /** * Organization unit class. @@ -42,6 +44,14 @@ class Unit implements ArrayableInterface, \JsonSerializable */ private string $name = ''; + /** + * Unit image. + * + * @var Media + * @since 1.0.0 + */ + protected Media $image; + /** * Parent * @@ -74,6 +84,16 @@ class Unit implements ArrayableInterface, \JsonSerializable */ protected int $status = Status::INACTIVE; + /** + * Constructor. + * + * @since 1.0.0 + */ + public function __construct() + { + $this->image = new NullMedia(); + } + /** * Get id * @@ -112,6 +132,32 @@ class Unit implements ArrayableInterface, \JsonSerializable $this->name = $name; } + /** + * Get unit image. + * + * @return Media + * + * @since 1.0.0 + */ + public function getImage() : Media + { + return $this->image ?? new NullMedia(); + } + + /** + * Set unit image. + * + * @param Media $image Profile image + * + * @return void + * + * @since 1.0.0 + */ + public function setImage(Media $image) : void + { + $this->image = $image; + } + /** * Get parent * diff --git a/Models/UnitMapper.php b/Models/UnitMapper.php old mode 100644 new mode 100755 index 611f8d2..a53fcdd --- a/Models/UnitMapper.php +++ b/Models/UnitMapper.php @@ -15,6 +15,7 @@ declare(strict_types=1); namespace Modules\Organization\Models; use phpOMS\DataStorage\Database\DataMapperAbstract; +use Modules\Media\Models\MediaMapper; /** * Organization unit mapper class. @@ -35,12 +36,26 @@ final class UnitMapper extends DataMapperAbstract protected static array $columns = [ 'organization_unit_id' => ['name' => 'organization_unit_id', 'type' => 'int', 'internal' => 'id'], 'organization_unit_name' => ['name' => 'organization_unit_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true], + 'organization_unit_image' => ['name' => 'organization_unit_image', 'type' => 'string', 'internal' => 'image'], 'organization_unit_description' => ['name' => 'organization_unit_description', 'type' => 'string', 'internal' => 'description'], 'organization_unit_descriptionraw' => ['name' => 'organization_unit_descriptionraw', 'type' => 'string', 'internal' => 'descriptionRaw'], 'organization_unit_parent' => ['name' => 'organization_unit_parent', 'type' => 'int', 'internal' => 'parent'], 'organization_unit_status' => ['name' => 'organization_unit_status', 'type' => 'int', 'internal' => 'status'], ]; + /** + * Has one relation. + * + * @var array + * @since 1.0.0 + */ + protected static array $ownsOne = [ + 'image' => [ + 'mapper' => MediaMapper::class, + 'self' => 'organization_unit_image', + ], + ]; + /** * Belongs to. * diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/Theme/Backend/Components/DepartmentTagSelector/DepartmentTagSelectorPopupView.php b/Theme/Backend/Components/DepartmentTagSelector/DepartmentTagSelectorPopupView.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/Components/DepartmentTagSelector/DepartmentTagSelectorView.php b/Theme/Backend/Components/DepartmentTagSelector/DepartmentTagSelectorView.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/Components/DepartmentTagSelector/department-selector-popup.tpl.php b/Theme/Backend/Components/DepartmentTagSelector/department-selector-popup.tpl.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/Components/DepartmentTagSelector/department-selector.tpl.php b/Theme/Backend/Components/DepartmentTagSelector/department-selector.tpl.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/Components/PositionTagSelector/PositionTagSelectorPopupView.php b/Theme/Backend/Components/PositionTagSelector/PositionTagSelectorPopupView.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/Components/PositionTagSelector/PositionTagSelectorView.php b/Theme/Backend/Components/PositionTagSelector/PositionTagSelectorView.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/Components/PositionTagSelector/position-selector-popup.tpl.php b/Theme/Backend/Components/PositionTagSelector/position-selector-popup.tpl.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/Components/PositionTagSelector/position-selector.tpl.php b/Theme/Backend/Components/PositionTagSelector/position-selector.tpl.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/Components/UnitTagSelector/UnitTagSelectorPopupView.php b/Theme/Backend/Components/UnitTagSelector/UnitTagSelectorPopupView.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/Components/UnitTagSelector/UnitTagSelectorView.php b/Theme/Backend/Components/UnitTagSelector/UnitTagSelectorView.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/Components/UnitTagSelector/unit-selector-popup.tpl.php b/Theme/Backend/Components/UnitTagSelector/unit-selector-popup.tpl.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/Components/UnitTagSelector/unit-selector.tpl.php b/Theme/Backend/Components/UnitTagSelector/unit-selector.tpl.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/Lang/Navigation.en.lang.php b/Theme/Backend/Lang/Navigation.en.lang.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php old mode 100644 new mode 100755 index f60a608..72fb61b --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -18,6 +18,7 @@ return ['Organization' => [ 'Departments' => 'Departments', 'Description' => 'Description', 'Inactive' => 'Inactive', + 'Logo' => 'Logo', 'Name' => 'Name', 'Parent' => 'Parent', 'Position' => 'Position', diff --git a/Theme/Backend/css/styles.css b/Theme/Backend/css/styles.css old mode 100644 new mode 100755 diff --git a/Theme/Backend/css/styles.scss b/Theme/Backend/css/styles.scss old mode 100644 new mode 100755 diff --git a/Theme/Backend/department-create.tpl.php b/Theme/Backend/department-create.tpl.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/department-list.tpl.php b/Theme/Backend/department-list.tpl.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/department-profile.tpl.php b/Theme/Backend/department-profile.tpl.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/organigram.tpl.php b/Theme/Backend/organigram.tpl.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/position-create.tpl.php b/Theme/Backend/position-create.tpl.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/position-list.tpl.php b/Theme/Backend/position-list.tpl.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/position-profile.tpl.php b/Theme/Backend/position-profile.tpl.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/unit-create.tpl.php b/Theme/Backend/unit-create.tpl.php old mode 100644 new mode 100755 diff --git a/Theme/Backend/unit-list.tpl.php b/Theme/Backend/unit-list.tpl.php old mode 100644 new mode 100755 index 119f0cc..bae173b --- a/Theme/Backend/unit-list.tpl.php +++ b/Theme/Backend/unit-list.tpl.php @@ -13,6 +13,7 @@ declare(strict_types=1); use phpOMS\Uri\UriFactory; +use Modules\Media\Models\NullMedia; /** * @var \phpOMS\Views\View $this @@ -33,6 +34,7 @@ echo $this->getData('nav')->render(); ?> getHtml('ID', '0', '0'); ?> + getHtml('Logo') ?> getHtml('Name') ?> getHtml('Parent') ?> @@ -40,6 +42,9 @@ echo $this->getData('nav')->render(); ?> $url = \phpOMS\Uri\UriFactory::build('{/prefix}organization/unit/profile?{?}&id=' . $value->getId()); ?> printHtml($value->getId()); ?> + printHtml($value->getName()); ?> printHtml($value->getParent()->getName()); ?> diff --git a/Theme/Backend/unit-profile.tpl.php b/Theme/Backend/unit-profile.tpl.php old mode 100644 new mode 100755 index 04610d6..987379a --- a/Theme/Backend/unit-profile.tpl.php +++ b/Theme/Backend/unit-profile.tpl.php @@ -13,6 +13,7 @@ declare(strict_types=1); use phpOMS\Uri\UriFactory; +use Modules\Media\Models\NullMedia; /** * @var \phpOMS\Views\View $this @@ -22,11 +23,27 @@ $unit = $this->getData('unit'); echo $this->getData('nav')->render(); ?> +
+
-
getHtml('Unit') ?>
+
+
+ + <?= $this->getHtml('Logo'); ?> + +
+
getHtml('Unit') ?>
+
diff --git a/composer.json b/composer.json old mode 100644 new mode 100755 diff --git a/composer.lock b/composer.lock old mode 100644 new mode 100755 diff --git a/info.json b/info.json old mode 100644 new mode 100755 index 411c0cd..83c9b22 --- a/info.json +++ b/info.json @@ -18,10 +18,12 @@ "directory": "Organization", "dependencies": { "Admin": "1.0.0", - "Editor": "1.0.0" + "Editor": "1.0.0", + "Media": "1.0.0" }, "providing": { - "Navigation": "*" + "Navigation": "*", + "Media": "*" }, "load": [ { diff --git a/tests/Admin/AdminTest.php b/tests/Admin/AdminTest.php old mode 100644 new mode 100755 diff --git a/tests/ControllerTest.php b/tests/ControllerTest.php old mode 100644 new mode 100755 diff --git a/tests/Models/DepartmentMapperTest.php b/tests/Models/DepartmentMapperTest.php old mode 100644 new mode 100755 diff --git a/tests/Models/DepartmentTest.php b/tests/Models/DepartmentTest.php old mode 100644 new mode 100755 diff --git a/tests/Models/PositionMapperTest.php b/tests/Models/PositionMapperTest.php old mode 100644 new mode 100755 diff --git a/tests/Models/PositionTest.php b/tests/Models/PositionTest.php old mode 100644 new mode 100755 diff --git a/tests/Models/UnitMapperTest.php b/tests/Models/UnitMapperTest.php old mode 100644 new mode 100755 diff --git a/tests/Models/UnitTest.php b/tests/Models/UnitTest.php old mode 100644 new mode 100755