Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Dennis Eichhorn 2023-01-26 22:05:55 +01:00
commit bb52554a61
7 changed files with 20 additions and 21 deletions

View File

@ -20,7 +20,6 @@ use Modules\ClientManagement\Models\Client;
use Modules\ClientManagement\Models\ClientAttribute;
use Modules\ClientManagement\Models\ClientAttributeMapper;
use Modules\ClientManagement\Models\ClientAttributeType;
use phpOMS\Localization\BaseStringL11n;
use Modules\ClientManagement\Models\ClientAttributeTypeL11nMapper;
use Modules\ClientManagement\Models\ClientAttributeTypeMapper;
use Modules\ClientManagement\Models\ClientAttributeValue;
@ -31,6 +30,7 @@ use Modules\ClientManagement\Models\NullClientAttributeValue;
use Modules\Media\Models\PathSettings;
use Modules\Profile\Models\ContactElementMapper;
use Modules\Profile\Models\Profile;
use phpOMS\Localization\BaseStringL11n;
use phpOMS\Localization\ISO639x1Enum;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Message\NotificationLevel;
@ -273,7 +273,7 @@ final class ApiController extends Controller
private function createClientAttributeTypeL11nFromRequest(RequestAbstract $request) : BaseStringL11n
{
$attrL11n = new BaseStringL11n();
$attrL11n->ref = (int) ($request->getData('type') ?? 0);
$attrL11n->ref = (int) ($request->getData('type') ?? 0);
$attrL11n->setLanguage((string) (
$request->getData('language') ?? $request->getLanguage()
));
@ -426,7 +426,7 @@ final class ApiController extends Controller
->where('id', (int) ($request->getData('type') ?? 0))
->execute();
$attrValue = new ClientAttributeValue();
$attrValue = new ClientAttributeValue();
$attrValue->isDefault = (bool) ($request->getData('default') ?? false);
$attrValue->setValue($request->getData('value'), $type->datatype);
@ -497,7 +497,7 @@ final class ApiController extends Controller
private function createClientAttributeValueL11nFromRequest(RequestAbstract $request) : BaseStringL11n
{
$attrL11n = new BaseStringL11n();
$attrL11n->ref = (int) ($request->getData('value') ?? 0);
$attrL11n->ref = (int) ($request->getData('value') ?? 0);
$attrL11n->setLanguage((string) (
$request->getData('language') ?? $request->getLanguage()
));

View File

@ -14,8 +14,8 @@ declare(strict_types=1);
namespace Modules\ClientManagement\Models;
use phpOMS\Localization\ISO639x1Enum;
use phpOMS\Localization\BaseStringL11n;
use phpOMS\Localization\ISO639x1Enum;
/**
* Client Attribute Type class.
@ -114,7 +114,7 @@ class ClientAttributeType implements \JsonSerializable
* Set l11n
*
* @param string|BaseStringL11n $l11n Tag article l11n
* @param string $lang Language
* @param string $lang Language
*
* @return void
*
@ -127,7 +127,7 @@ class ClientAttributeType implements \JsonSerializable
} elseif (isset($this->l11n) && $this->l11n instanceof BaseStringL11n) {
$this->l11n->content = $l11n;
} else {
$this->l11n = new BaseStringL11n();
$this->l11n = new BaseStringL11n();
$this->l11n->content = $l11n;
$this->l11n->setLanguage($lang);
}

View File

@ -33,13 +33,13 @@ final class ClientAttributeTypeMapper extends DataMapperFactory
* @since 1.0.0
*/
public const COLUMNS = [
'clientmgmt_attr_type_id' => ['name' => 'clientmgmt_attr_type_id', 'type' => 'int', 'internal' => 'id'],
'clientmgmt_attr_type_name' => ['name' => 'clientmgmt_attr_type_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true],
'clientmgmt_attr_type_id' => ['name' => 'clientmgmt_attr_type_id', 'type' => 'int', 'internal' => 'id'],
'clientmgmt_attr_type_name' => ['name' => 'clientmgmt_attr_type_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true],
'clientmgmt_attr_type_datatype' => ['name' => 'clientmgmt_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'],
'clientmgmt_attr_type_fields' => ['name' => 'clientmgmt_attr_type_fields', 'type' => 'int', 'internal' => 'fields'],
'clientmgmt_attr_type_custom' => ['name' => 'clientmgmt_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'],
'clientmgmt_attr_type_pattern' => ['name' => 'clientmgmt_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'],
'clientmgmt_attr_type_required' => ['name' => 'clientmgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'],
'clientmgmt_attr_type_fields' => ['name' => 'clientmgmt_attr_type_fields', 'type' => 'int', 'internal' => 'fields'],
'clientmgmt_attr_type_custom' => ['name' => 'clientmgmt_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'],
'clientmgmt_attr_type_pattern' => ['name' => 'clientmgmt_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'],
'clientmgmt_attr_type_required' => ['name' => 'clientmgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'],
];
/**

View File

@ -14,8 +14,8 @@ declare(strict_types=1);
namespace Modules\ClientManagement\Models;
use phpOMS\Localization\ISO639x1Enum;
use phpOMS\Localization\BaseStringL11n;
use phpOMS\Localization\ISO639x1Enum;
/**
* Client attribute value class.
@ -124,7 +124,7 @@ class ClientAttributeValue implements \JsonSerializable
* Set l11n
*
* @param string|BaseStringL11n $l11n Tag article l11n
* @param string $lang Language
* @param string $lang Language
*
* @return void
*
@ -137,9 +137,9 @@ class ClientAttributeValue implements \JsonSerializable
} elseif (isset($this->l11n) && $this->l11n instanceof BaseStringL11n) {
$this->l11n->content = $l11n;
} else {
$this->l11n = new BaseStringL11n();
$this->l11n = new BaseStringL11n();
$this->l11n->content = $l11n;
$this->l11n->ref = $this->id;
$this->l11n->ref = $this->id;
$this->l11n->setLanguage($lang);
}
}
@ -160,7 +160,7 @@ class ClientAttributeValue implements \JsonSerializable
* Set value
*
* @param int|string|float|\DateTimeInterface $value Value
* @param int $type Datatype
* @param int $type Datatype
*
* @return void
*

View File

@ -47,7 +47,7 @@ final class ClientMapper extends DataMapperFactory
'clientmgmt_client_created_at' => ['name' => 'clientmgmt_client_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
'clientmgmt_client_profile' => ['name' => 'clientmgmt_client_profile', 'type' => 'int', 'internal' => 'profile'],
'clientmgmt_client_address' => ['name' => 'clientmgmt_client_address', 'type' => 'int', 'internal' => 'mainAddress'],
'clientmgmt_client_unit' => ['name' => 'clientmgmt_client_unit', 'type' => 'int', 'internal' => 'unit'],
'clientmgmt_client_unit' => ['name' => 'clientmgmt_client_unit', 'type' => 'int', 'internal' => 'unit'],
];
/**

View File

@ -14,7 +14,6 @@ declare(strict_types=1);
namespace Modules\ClientManagement\tests\Controller\Api;
use Modules\ClientManagement\Models\AttributeValueType;
use phpOMS\Localization\ISO3166TwoEnum;
use phpOMS\Localization\ISO639x1Enum;
use phpOMS\Message\Http\HttpRequest;

View File

@ -14,8 +14,8 @@ declare(strict_types=1);
namespace Modules\ClientManagement\tests\Models;
use Modules\ClientManagement\Models\ClientAttributeValue;
use Modules\ClientManagement\Models\AttributeValueType;
use Modules\ClientManagement\Models\ClientAttributeValue;
/**
* @internal