mirror of
https://github.com/Karaka-Management/oms-Attribute.git
synced 2026-02-05 04:18:39 +00:00
bug fixes
This commit is contained in:
parent
fd0e6b470e
commit
e89c03cb59
2
.github/workflows/greetings.yml
vendored
2
.github/workflows/greetings.yml
vendored
|
|
@ -9,5 +9,5 @@ jobs:
|
|||
- uses: actions/first-interaction@v1
|
||||
with:
|
||||
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.'
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ trait ApiAttributeTraitController
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private function createAttributeFromRequest(RequestAbstract $request, AttributeType $type) : Attribute
|
||||
public function createAttributeFromRequest(RequestAbstract $request, AttributeType $type) : Attribute
|
||||
{
|
||||
$new = new Attribute();
|
||||
$new->ref = (int) $request->getData('ref');
|
||||
|
|
@ -153,7 +153,7 @@ trait ApiAttributeTraitController
|
|||
$attrType = new AttributeType($request->getDataString('name') ?? '');
|
||||
$attrType->datatype = AttributeValueType::tryFromValue($request->getDataInt('datatype')) ?? AttributeValueType::_STRING;
|
||||
$attrType->custom = $request->getDataBool('custom') ?? false;
|
||||
$attrType->repeatable = $request->getDataBool('repeatable') ?? false;
|
||||
$attrType->isRepeatable = $request->getDataBool('is_repeatable') ?? false;
|
||||
$attrType->isInternal = $request->getDataBool('internal') ?? false;
|
||||
$attrType->isRequired = $request->getDataBool('is_required') ?? false;
|
||||
$attrType->validationPattern = $request->getDataString('validation_pattern') ?? '';
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ final class ApiController extends Controller
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
private function createAttributeFromRequest(RequestAbstract $request, AttributeType $type) : Attribute
|
||||
public function createAttributeFromRequest(RequestAbstract $request, AttributeType $type) : Attribute
|
||||
{
|
||||
$new = new Attribute();
|
||||
$new->ref = (int) $request->getData('ref');
|
||||
|
|
@ -246,6 +246,7 @@ final class ApiController extends Controller
|
|||
$attrType->datatype = AttributeValueType::tryFromValue($request->getDataInt('datatype')) ?? AttributeValueType::_STRING;
|
||||
$attrType->custom = $request->getDataBool('custom') ?? false;
|
||||
$attrType->isRequired = $request->getDataBool('is_required') ?? false;
|
||||
$attrType->isRepeatable = $request->getDataBool('is_repeatable') ?? false;
|
||||
$attrType->validationPattern = $request->getDataString('validation_pattern') ?? '';
|
||||
$attrType->setL11n(
|
||||
$request->getDataString('title') ?? '',
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class AttributeType implements \JsonSerializable
|
|||
|
||||
public bool $isRequired = false;
|
||||
|
||||
public bool $repeatable = false;
|
||||
public bool $isRepeatable = false;
|
||||
|
||||
public bool $isInternal = false;
|
||||
|
||||
|
|
@ -240,7 +240,7 @@ class AttributeType implements \JsonSerializable
|
|||
'custom' => $this->custom,
|
||||
'isRequired' => $this->isRequired,
|
||||
'isInternal' => $this->isInternal,
|
||||
'repeatable' => $this->repeatable,
|
||||
'isRepeatable' => $this->isRepeatable,
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ final class AttributeTypeMapper extends DataMapperFactory
|
|||
'attribute_attr_type_custom' => ['name' => 'attribute_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'],
|
||||
'attribute_attr_type_pattern' => ['name' => 'attribute_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'],
|
||||
'attribute_attr_type_required' => ['name' => 'attribute_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'],
|
||||
'attribute_attr_type_repeatable' => ['name' => 'attribute_attr_type_repeatable', 'type' => 'bool', 'internal' => 'isRepeatable'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -66,12 +66,20 @@ echo $this->data['nav']->render(); ?>
|
|||
|
||||
<div class="form-group">
|
||||
<label class="checkbox" for="iRequired">
|
||||
<input id="iRequired" type="checkbox" name="required" value="1"<?= $this->attribute->isRequired ? ' checked' : ''; ?>>
|
||||
<input id="iRequired" type="checkbox" name="is_required" value="1"<?= $this->attribute->isRequired ? ' checked' : ''; ?>>
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('IsRequired', 'Attribute', 'Backend'); ?>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="checkbox" for="iRepeatable">
|
||||
<input id="iRepeatable" type="checkbox" name="is_repeatable" value="1"<?= $this->attribute->isRepeatable ? ' checked' : ''; ?>>
|
||||
<span class="checkmark"></span>
|
||||
<?= $this->getHtml('IsRepeatable', 'Attribute', 'Backend'); ?>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="checkbox" for="iCustom">
|
||||
<input id="iCustom" type="checkbox" name="custom" value="1" <?= $this->attribute->custom ? ' checked' : ''; ?>>
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ return ['Attribute' => [
|
|||
'Datatype' => 'Datatype',
|
||||
'DefaultValues' => 'Default Values',
|
||||
'IsRequired' => 'Is required?',
|
||||
'IsRepeatable' => 'Is repeatable?',
|
||||
'Name' => 'Name',
|
||||
'Pattern' => 'Pattern',
|
||||
'Status' => 'Status',
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ return ['Attribute' => [
|
|||
'Datatype' => 'Datatype',
|
||||
'DefaultValues' => 'Default Values',
|
||||
'IsRequired' => 'Is required?',
|
||||
'IsRepeatable' => 'Is repeatable?',
|
||||
'Name' => 'Name',
|
||||
'Pattern' => 'Pattern',
|
||||
'Status' => 'Status',
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user