mirror of
https://github.com/Karaka-Management/oms-AssetManagement.git
synced 2026-01-11 14:48:40 +00:00
continue implementations
This commit is contained in:
parent
74541d765d
commit
f8afe183e1
|
|
@ -147,6 +147,11 @@
|
||||||
"type": "TINYINT(1)",
|
"type": "TINYINT(1)",
|
||||||
"null": false
|
"null": false
|
||||||
},
|
},
|
||||||
|
"assetmgmt_attr_type_repeatable": {
|
||||||
|
"name": "assetmgmt_attr_type_repeatable",
|
||||||
|
"type": "TINYINT(1)",
|
||||||
|
"null": false
|
||||||
|
},
|
||||||
"assetmgmt_attr_type_required": {
|
"assetmgmt_attr_type_required": {
|
||||||
"description": "Every asset must have this attribute type if set to true.",
|
"description": "Every asset must have this attribute type if set to true.",
|
||||||
"name": "assetmgmt_attr_type_required",
|
"name": "assetmgmt_attr_type_required",
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,23 @@ final class ApiAssetAttributeController extends Controller
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$type = AssetAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('type'))->execute();
|
$type = AssetAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('type'))->execute();
|
||||||
|
|
||||||
|
if (!$type->repeatable) {
|
||||||
|
$attr = AssetAttributeMapper::count()
|
||||||
|
->with('type')
|
||||||
|
->where('type/id', (int) $request->getData('type'))
|
||||||
|
->where('ref', (int) $request->getData('ref'))
|
||||||
|
->execute();
|
||||||
|
|
||||||
|
if ($attr > 0) {
|
||||||
|
$response->header->status = RequestStatusCode::R_409;
|
||||||
|
$this->createInvalidCreateResponse($request, $response, $val);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$attribute = $this->createAttributeFromRequest($request, $type);
|
$attribute = $this->createAttributeFromRequest($request, $type);
|
||||||
$this->createModel($request->header->account, $attribute, AssetAttributeMapper::class, 'attribute', $request->getOrigin());
|
$this->createModel($request->header->account, $attribute, AssetAttributeMapper::class, 'attribute', $request->getOrigin());
|
||||||
$this->createStandardCreateResponse($request, $response, $attribute);
|
$this->createStandardCreateResponse($request, $response, $attribute);
|
||||||
|
|
|
||||||
|
|
@ -175,12 +175,10 @@ final class BackendController extends Controller
|
||||||
$view->data['units'] = $units;
|
$view->data['units'] = $units;
|
||||||
|
|
||||||
/** @var \Model\Setting $settings */
|
/** @var \Model\Setting $settings */
|
||||||
$settings = $this->app->appSettings->get(null, [
|
$settings = $this->app->appSettings->get(null, SettingsEnum::DEFAULT_LOCALIZATION);
|
||||||
SettingsEnum::DEFAULT_LOCALIZATION,
|
|
||||||
]);
|
|
||||||
|
|
||||||
$view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response);
|
$view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response);
|
||||||
$view->data['attributeView']->data['defaultlocalization'] = LocalizationMapper::get()->where('id', (int) $settings->id)->execute();
|
$view->data['attributeView']->data['default_localization'] = LocalizationMapper::get()->where('id', (int) $settings->id)->execute();
|
||||||
|
|
||||||
$view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
|
$view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
|
||||||
$view->data['asset-notes'] = new \Modules\Editor\Theme\Backend\Components\Compound\BaseView($this->app->l11nManager, $request, $response);
|
$view->data['asset-notes'] = new \Modules\Editor\Theme\Backend\Components\Compound\BaseView($this->app->l11nManager, $request, $response);
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ final class AssetAttributeTypeMapper extends DataMapperFactory
|
||||||
'assetmgmt_attr_type_datatype' => ['name' => 'assetmgmt_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'],
|
'assetmgmt_attr_type_datatype' => ['name' => 'assetmgmt_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'],
|
||||||
'assetmgmt_attr_type_fields' => ['name' => 'assetmgmt_attr_type_fields', 'type' => 'int', 'internal' => 'fields'],
|
'assetmgmt_attr_type_fields' => ['name' => 'assetmgmt_attr_type_fields', 'type' => 'int', 'internal' => 'fields'],
|
||||||
'assetmgmt_attr_type_custom' => ['name' => 'assetmgmt_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'],
|
'assetmgmt_attr_type_custom' => ['name' => 'assetmgmt_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'],
|
||||||
|
'assetmgmt_attr_type_repeatable' => ['name' => 'assetmgmt_attr_type_repeatable', 'type' => 'bool', 'internal' => 'repeatable'],
|
||||||
'assetmgmt_attr_type_pattern' => ['name' => 'assetmgmt_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'],
|
'assetmgmt_attr_type_pattern' => ['name' => 'assetmgmt_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'],
|
||||||
'assetmgmt_attr_type_required' => ['name' => 'assetmgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'],
|
'assetmgmt_attr_type_required' => ['name' => 'assetmgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'],
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,7 @@ final class AssetAttributeValueMapper extends DataMapperFactory
|
||||||
'mapper' => AssetAttributeValueL11nMapper::class,
|
'mapper' => AssetAttributeValueL11nMapper::class,
|
||||||
'table' => 'assetmgmt_attr_value_l11n',
|
'table' => 'assetmgmt_attr_value_l11n',
|
||||||
'self' => 'assetmgmt_attr_value_l11n_value',
|
'self' => 'assetmgmt_attr_value_l11n_value',
|
||||||
|
'column' => 'content',
|
||||||
'external' => null,
|
'external' => null,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ return ['AssetManagement' => [
|
||||||
'Assets' => 'Assets',
|
'Assets' => 'Assets',
|
||||||
'Status' => 'Status',
|
'Status' => 'Status',
|
||||||
'Name' => 'Name',
|
'Name' => 'Name',
|
||||||
'Number' => 'Number',
|
|
||||||
'Type' => 'Type',
|
'Type' => 'Type',
|
||||||
':status1' => 'Active',
|
':status1' => 'Active',
|
||||||
':status2' => 'Inactive',
|
':status2' => 'Inactive',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user