mirror of
https://github.com/Karaka-Management/oms-Support.git
synced 2026-01-11 17:18:40 +00:00
l11n, unit/app and simplification fixes
This commit is contained in:
parent
c140c89935
commit
94f065a383
|
|
@ -13,6 +13,14 @@
|
|||
"name": "support_app_name",
|
||||
"type": "VARCHAR(255)",
|
||||
"default": null
|
||||
},
|
||||
"support_app_unit": {
|
||||
"name": "support_app_unit",
|
||||
"type": "INT",
|
||||
"default": null,
|
||||
"null": true,
|
||||
"foreignTable": "organization_unit",
|
||||
"foreignKey": "organization_unit_id"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -374,6 +374,7 @@ final class ApiController extends Controller
|
|||
{
|
||||
$app = new SupportApp();
|
||||
$app->name = (string) ($request->getData('name') ?? '');
|
||||
$app->unit = $request->getData('unit', 'int');
|
||||
|
||||
return $app;
|
||||
}
|
||||
|
|
@ -662,13 +663,13 @@ final class ApiController extends Controller
|
|||
|
||||
$type = (int) ($request->getData('type') ?? 0);
|
||||
if ($type === AttributeValueType::_INT) {
|
||||
$attrValue->valueInt = $request->hasData('value') ? (int) $request->getData('value') : null;
|
||||
$attrValue->valueInt = $request->getData('value', 'int');
|
||||
} elseif ($type === AttributeValueType::_STRING) {
|
||||
$attrValue->valueStr = $request->hasData('value') ? (string) $request->getData('value') : null;
|
||||
$attrValue->valueStr = $request->getData('value', 'string');
|
||||
} elseif ($type === AttributeValueType::_FLOAT) {
|
||||
$attrValue->valueDec = $request->hasData('value') ? (float) $request->getData('value') : null;
|
||||
$attrValue->valueDec = $request->getData('value', 'float');
|
||||
} elseif ($type === AttributeValueType::_DATETIME) {
|
||||
$attrValue->valueDat = $request->hasData('value') ? new \DateTime((string) ($request->getData('value') ?? '')) : null;
|
||||
$attrValue->valueDat = $request->getData('value', 'DateTime');
|
||||
}
|
||||
|
||||
$attrValue->type = $type;
|
||||
|
|
|
|||
|
|
@ -40,6 +40,14 @@ class SupportApp implements \JsonSerializable
|
|||
*/
|
||||
public string $name = '';
|
||||
|
||||
/**
|
||||
* Unit
|
||||
*
|
||||
* @var null|int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public ?int $unit = null;
|
||||
|
||||
/**
|
||||
* Get id.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ final class SupportAppMapper extends DataMapperFactory
|
|||
public const COLUMNS = [
|
||||
'support_app_id' => ['name' => 'support_app_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'support_app_name' => ['name' => 'support_app_name', 'type' => 'string', 'internal' => 'name'],
|
||||
'support_app_unit' => ['name' => 'support_app_unit', 'type' => 'int', 'internal' => 'unit'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user