bug fixes

This commit is contained in:
Dennis Eichhorn 2024-05-12 00:03:34 +00:00
parent a0fc4b1f3b
commit c413733ac0
6 changed files with 11 additions and 26 deletions

View File

@ -9,5 +9,5 @@ jobs:
- uses: actions/first-interaction@v1 - uses: actions/first-interaction@v1
with: with:
repo-token: ${{ secrets.GITHUB_TOKEN }} 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.' pr-message: 'Thank you for your pull request. We will check it as soon as possible.'

View File

@ -1,18 +1,4 @@
[ [
{
"type": "type",
"name": "equipment_profile_image",
"l11n": [
{
"title": "Profile image",
"lang": "en"
},
{
"title": "Profilbild",
"lang": "de"
}
]
},
{ {
"type": "collection", "type": "collection",
"create_directory": true, "create_directory": true,

View File

@ -193,7 +193,7 @@ final class ApiController extends Controller
pathSettings: PathSettings::FILE_PATH, pathSettings: PathSettings::FILE_PATH,
hasAccountRelation: false, hasAccountRelation: false,
readContent: $request->getDataBool('parse_content') ?? false, readContent: $request->getDataBool('parse_content') ?? false,
type: $request->getDataInt('type'), tag: $request->getDataInt('tag'),
rel: $equipment->id, rel: $equipment->id,
mapper: EquipmentMapper::class, mapper: EquipmentMapper::class,
field: 'files' field: 'files'

View File

@ -66,7 +66,7 @@ final class ApiEquipmentAttributeController extends Controller
->where('id', (int) $request->getData('type')) ->where('id', (int) $request->getData('type'))
->execute(); ->execute();
if (!$type->repeatable) { if (!$type->isRepeatable) {
$attr = EquipmentAttributeMapper::count() $attr = EquipmentAttributeMapper::count()
->with('type') ->with('type')
->where('type/id', $type->id) ->where('type/id', $type->id)

View File

@ -26,8 +26,8 @@ use Modules\EquipmentManagement\Models\Inspection;
use Modules\EquipmentManagement\Models\InspectionMapper; use Modules\EquipmentManagement\Models\InspectionMapper;
use Modules\EquipmentManagement\Models\InspectionTypeMapper; use Modules\EquipmentManagement\Models\InspectionTypeMapper;
use Modules\Media\Models\MediaMapper; use Modules\Media\Models\MediaMapper;
use Modules\Media\Models\MediaTypeMapper;
use Modules\Organization\Models\UnitMapper; use Modules\Organization\Models\UnitMapper;
use Modules\Tag\Models\TagMapper;
use phpOMS\Contract\RenderableInterface; use phpOMS\Contract\RenderableInterface;
use phpOMS\DataStorage\Database\Query\Builder; use phpOMS\DataStorage\Database\Query\Builder;
use phpOMS\Message\RequestAbstract; use phpOMS\Message\RequestAbstract;
@ -225,7 +225,7 @@ final class BackendController extends Controller
->with('attributes/type/l11n') ->with('attributes/type/l11n')
->with('attributes/value/l11n') ->with('attributes/value/l11n')
->with('files') ->with('files')
->with('files/types') ->with('files/tags')
->with('type') ->with('type')
->with('type/l11n') ->with('type/l11n')
->with('fuelType') ->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) ->on(EquipmentMapper::HAS_MANY['files']['table'] . '.' . EquipmentMapper::HAS_MANY['files']['self'], '=', EquipmentMapper::TABLE . '.' . EquipmentMapper::PRIMARYFIELD)
->leftJoin(MediaMapper::TABLE) ->leftJoin(MediaMapper::TABLE)
->on(EquipmentMapper::HAS_MANY['files']['table'] . '.' . EquipmentMapper::HAS_MANY['files']['external'], '=', MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD) ->on(EquipmentMapper::HAS_MANY['files']['table'] . '.' . EquipmentMapper::HAS_MANY['files']['external'], '=', MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD)
->leftJoin(MediaMapper::HAS_MANY['types']['table']) ->leftJoin(MediaMapper::HAS_MANY['tags']['table'])
->on(MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD, '=', MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['self']) ->on(MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD, '=', MediaMapper::HAS_MANY['tags']['table'] . '.' . MediaMapper::HAS_MANY['tags']['self'])
->leftJoin(MediaTypeMapper::TABLE) ->leftJoin(TagMapper::TABLE)
->on(MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['external'], '=', MediaTypeMapper::TABLE . '.' . MediaTypeMapper::PRIMARYFIELD) ->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(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() $view->data['equipmentImage'] = MediaMapper::get()
->with('types')
->where('id', $results) ->where('id', $results)
->limit(1) ->limit(1)
->execute(); ->execute();

View File

@ -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_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_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_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_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_pattern' => ['name' => 'equipmgmt_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'],
'equipmgmt_attr_type_required' => ['name' => 'equipmgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'], 'equipmgmt_attr_type_required' => ['name' => 'equipmgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'],