diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml index adb8716..75cb759 100755 --- a/.github/workflows/greetings.yml +++ b/.github/workflows/greetings.yml @@ -9,5 +9,5 @@ jobs: - uses: actions/first-interaction@v1 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - issue-message: 'Thank you for createing this issue. We will check it as soon as possible.' + issue-message: 'Thank you for creating this issue. We will check it as soon as possible.' pr-message: 'Thank you for your pull request. We will check it as soon as possible.' diff --git a/Admin/Install/Media.install.json b/Admin/Install/Media.install.json index dc66b0f..b587547 100755 --- a/Admin/Install/Media.install.json +++ b/Admin/Install/Media.install.json @@ -1,18 +1,4 @@ [ - { - "type": "type", - "name": "equipment_profile_image", - "l11n": [ - { - "title": "Profile image", - "lang": "en" - }, - { - "title": "Profilbild", - "lang": "de" - } - ] - }, { "type": "collection", "create_directory": true, diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 6bf043b..42ba494 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -193,7 +193,7 @@ final class ApiController extends Controller pathSettings: PathSettings::FILE_PATH, hasAccountRelation: false, readContent: $request->getDataBool('parse_content') ?? false, - type: $request->getDataInt('type'), + tag: $request->getDataInt('tag'), rel: $equipment->id, mapper: EquipmentMapper::class, field: 'files' diff --git a/Controller/ApiEquipmentAttributeController.php b/Controller/ApiEquipmentAttributeController.php index 6479273..e693b8a 100755 --- a/Controller/ApiEquipmentAttributeController.php +++ b/Controller/ApiEquipmentAttributeController.php @@ -66,7 +66,7 @@ final class ApiEquipmentAttributeController extends Controller ->where('id', (int) $request->getData('type')) ->execute(); - if (!$type->repeatable) { + if (!$type->isRepeatable) { $attr = EquipmentAttributeMapper::count() ->with('type') ->where('type/id', $type->id) diff --git a/Controller/BackendController.php b/Controller/BackendController.php index b591b3b..3a3f430 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -26,8 +26,8 @@ use Modules\EquipmentManagement\Models\Inspection; use Modules\EquipmentManagement\Models\InspectionMapper; use Modules\EquipmentManagement\Models\InspectionTypeMapper; use Modules\Media\Models\MediaMapper; -use Modules\Media\Models\MediaTypeMapper; use Modules\Organization\Models\UnitMapper; +use Modules\Tag\Models\TagMapper; use phpOMS\Contract\RenderableInterface; use phpOMS\DataStorage\Database\Query\Builder; use phpOMS\Message\RequestAbstract; @@ -225,7 +225,7 @@ final class BackendController extends Controller ->with('attributes/type/l11n') ->with('attributes/value/l11n') ->with('files') - ->with('files/types') + ->with('files/tags') ->with('type') ->with('type/l11n') ->with('fuelType') @@ -253,15 +253,14 @@ final class BackendController extends Controller ->on(EquipmentMapper::HAS_MANY['files']['table'] . '.' . EquipmentMapper::HAS_MANY['files']['self'], '=', EquipmentMapper::TABLE . '.' . EquipmentMapper::PRIMARYFIELD) ->leftJoin(MediaMapper::TABLE) ->on(EquipmentMapper::HAS_MANY['files']['table'] . '.' . EquipmentMapper::HAS_MANY['files']['external'], '=', MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD) - ->leftJoin(MediaMapper::HAS_MANY['types']['table']) - ->on(MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD, '=', MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['self']) - ->leftJoin(MediaTypeMapper::TABLE) - ->on(MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['external'], '=', MediaTypeMapper::TABLE . '.' . MediaTypeMapper::PRIMARYFIELD) + ->leftJoin(MediaMapper::HAS_MANY['tags']['table']) + ->on(MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD, '=', MediaMapper::HAS_MANY['tags']['table'] . '.' . MediaMapper::HAS_MANY['tags']['self']) + ->leftJoin(TagMapper::TABLE) + ->on(MediaMapper::HAS_MANY['tags']['table'] . '.' . MediaMapper::HAS_MANY['tags']['external'], '=', TagMapper::TABLE . '.' . TagMapper::PRIMARYFIELD) ->where(EquipmentMapper::HAS_MANY['files']['self'], '=', $view->data['equipment']->id) - ->where(MediaTypeMapper::TABLE . '.' . MediaTypeMapper::getColumnByMember('name'), '=', 'equipment_profile_image'); + ->where(TagMapper::TABLE . '.' . TagMapper::getColumnByMember('name'), '=', 'profile_image'); $view->data['equipmentImage'] = MediaMapper::get() - ->with('types') ->where('id', $results) ->limit(1) ->execute(); diff --git a/Models/Attribute/EquipmentAttributeTypeMapper.php b/Models/Attribute/EquipmentAttributeTypeMapper.php index 4468725..8c624d0 100755 --- a/Models/Attribute/EquipmentAttributeTypeMapper.php +++ b/Models/Attribute/EquipmentAttributeTypeMapper.php @@ -42,7 +42,7 @@ final class EquipmentAttributeTypeMapper extends DataMapperFactory 'equipmgmt_attr_type_datatype' => ['name' => 'equipmgmt_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'], 'equipmgmt_attr_type_fields' => ['name' => 'equipmgmt_attr_type_fields', 'type' => 'int', 'internal' => 'fields'], 'equipmgmt_attr_type_custom' => ['name' => 'equipmgmt_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'], - 'equipmgmt_attr_type_repeatable' => ['name' => 'equipmgmt_attr_type_repeatable', 'type' => 'bool', 'internal' => 'repeatable'], + 'equipmgmt_attr_type_repeatable' => ['name' => 'equipmgmt_attr_type_repeatable', 'type' => 'bool', 'internal' => 'isRepeatable'], 'equipmgmt_attr_type_internal' => ['name' => 'equipmgmt_attr_type_internal', 'type' => 'bool', 'internal' => 'isInternal'], 'equipmgmt_attr_type_pattern' => ['name' => 'equipmgmt_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'], 'equipmgmt_attr_type_required' => ['name' => 'equipmgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'],