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)",
|
||||
"null": false
|
||||
},
|
||||
"assetmgmt_attr_type_repeatable": {
|
||||
"name": "assetmgmt_attr_type_repeatable",
|
||||
"type": "TINYINT(1)",
|
||||
"null": false
|
||||
},
|
||||
"assetmgmt_attr_type_required": {
|
||||
"description": "Every asset must have this attribute type if set to true.",
|
||||
"name": "assetmgmt_attr_type_required",
|
||||
|
|
|
|||
|
|
@ -61,7 +61,23 @@ final class ApiAssetAttributeController extends Controller
|
|||
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);
|
||||
$this->createModel($request->header->account, $attribute, AssetAttributeMapper::class, 'attribute', $request->getOrigin());
|
||||
$this->createStandardCreateResponse($request, $response, $attribute);
|
||||
|
|
|
|||
|
|
@ -175,12 +175,10 @@ final class BackendController extends Controller
|
|||
$view->data['units'] = $units;
|
||||
|
||||
/** @var \Model\Setting $settings */
|
||||
$settings = $this->app->appSettings->get(null, [
|
||||
SettingsEnum::DEFAULT_LOCALIZATION,
|
||||
]);
|
||||
$settings = $this->app->appSettings->get(null, SettingsEnum::DEFAULT_LOCALIZATION);
|
||||
|
||||
$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['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_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_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_required' => ['name' => 'assetmgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ final class AssetAttributeValueMapper extends DataMapperFactory
|
|||
'mapper' => AssetAttributeValueL11nMapper::class,
|
||||
'table' => 'assetmgmt_attr_value_l11n',
|
||||
'self' => 'assetmgmt_attr_value_l11n_value',
|
||||
'column' => 'content',
|
||||
'external' => null,
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ return ['AssetManagement' => [
|
|||
'Assets' => 'Assets',
|
||||
'Status' => 'Status',
|
||||
'Name' => 'Name',
|
||||
'Number' => 'Number',
|
||||
'Type' => 'Type',
|
||||
':status1' => 'Active',
|
||||
':status2' => 'Inactive',
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user