diff --git a/Controller/ApiController.php b/Controller/ApiController.php
index b204b6b..14a3e09 100644
--- a/Controller/ApiController.php
+++ b/Controller/ApiController.php
@@ -639,8 +639,13 @@ class ApiController extends Controller
*/
public function apiUnitFind(RequestAbstract $request, ResponseAbstract $response, $data = null) : void
{
- $response->getHeader()->set('Content-Type', MimeType::M_JSON . '; charset=utf-8', true);
- $response->set($request->getUri()->__toString(), array_values(UnitMapper::find((string) ($request->getData('search') ?? ''))));
+ $response->getHeader()->set('Content-Type', MimeType::M_JSON, true);
+ $response->set(
+ $request->getUri()->__toString(),
+ \array_values(
+ UnitMapper::find((string) ($request->getData('search') ?? ''))
+ )
+ );
}
/**
@@ -658,8 +663,13 @@ class ApiController extends Controller
*/
public function apiDepartmentFind(RequestAbstract $request, ResponseAbstract $response, $data = null) : void
{
- $response->getHeader()->set('Content-Type', MimeType::M_JSON . '; charset=utf-8', true);
- $response->set($request->getUri()->__toString(), array_values(DepartmentMapper::find((string) ($request->getData('search') ?? ''))));
+ $response->getHeader()->set('Content-Type', MimeType::M_JSON, true);
+ $response->set(
+ $request->getUri()->__toString(),
+ \array_values(
+ DepartmentMapper::find((string) ($request->getData('search') ?? ''))
+ )
+ );
}
/**
@@ -677,7 +687,12 @@ class ApiController extends Controller
*/
public function apiPositionFind(RequestAbstract $request, ResponseAbstract $response, $data = null) : void
{
- $response->getHeader()->set('Content-Type', MimeType::M_JSON . '; charset=utf-8', true);
- $response->set($request->getUri()->__toString(), array_values(PositionMapper::find((string) ($request->getData('search') ?? ''))));
+ $response->getHeader()->set('Content-Type', MimeType::M_JSON, true);
+ $response->set(
+ $request->getUri()->__toString(),
+ \array_values(
+ PositionMapper::find((string) ($request->getData('search') ?? ''))
+ )
+ );
}
}
diff --git a/Theme/Backend/Components/UnitTagSelector/unit-selector.tpl.php b/Theme/Backend/Components/UnitTagSelector/unit-selector.tpl.php
index 43e16e5..d0a36a0 100644
--- a/Theme/Backend/Components/UnitTagSelector/unit-selector.tpl.php
+++ b/Theme/Backend/Components/UnitTagSelector/unit-selector.tpl.php
@@ -6,9 +6,9 @@
"key": 1, "listener": "click", "action": [
{"key": 1, "type": "dom.popup", "selector": "#org-unit-selector-tpl", "aniIn": "fadeIn", "id": "= $this->printHtml($this->getId()); ?>"},
{"key": 2, "type": "message.request", "uri": "= \phpOMS\Uri\UriFactory::build('/{/lang}/api/organization/unit?filter=some&limit=10'); ?>", "method": "GET", "request_type": "json"},
- {"key": 3, "type": "dom.table.append", "id": "acc-table", "aniIn": "fadeIn", "data": [], "bindings": {"id": "id", "name": "name/0"}, "position": -1},
+ {"key": 3, "type": "dom.table.append", "id": "acc-table", "aniIn": "fadeIn", "data": [], "bindings": {"id": "id", "name": "name"}, "position": -1},
{"key": 4, "type": "message.request", "uri": "= \phpOMS\Uri\UriFactory::build('/{/lang}/api/organization/unit?filter=some&limit=10'); ?>", "method": "GET", "request_type": "json"},
- {"key": 5, "type": "dom.table.append", "id": "grp-table", "aniIn": "fadeIn", "data": [], "bindings": {"id": "id", "name": "name/0"}, "position": -1}
+ {"key": 5, "type": "dom.table.append", "id": "grp-table", "aniIn": "fadeIn", "data": [], "bindings": {"id": "id", "name": "name"}, "position": -1}
]
}
]' formaction="">
@@ -27,7 +27,7 @@
{"key": 1, "type": "validate.keypress", "pressed": "13|9"},
{"key": 2, "type": "message.request", "uri": "{/base}/{/lang}/api/organization/find/unit?search={#= $this->printHtml($this->getId()); ?>}", "method": "GET", "request_type": "json"},
{"key": 3, "type": "dom.setvalue", "overwrite": true, "selector": "#= $this->printHtml($this->getId()); ?>-idlist", "value": "{0/id}", "data": ""},
- {"key": 4, "type": "dom.setvalue", "overwrite": true, "selector": "#= $this->printHtml($this->getId()); ?>-taglist", "value": "printHtml($this->getId()); ?>-taglist-{0/id}\" class=\"tag red\" data-id=\"{0/id}\"> {0/name/0}, {0/name/1}", "data": ""},
+ {"key": 4, "type": "dom.setvalue", "overwrite": true, "selector": "#= $this->printHtml($this->getId()); ?>-taglist", "value": "printHtml($this->getId()); ?>-taglist-{0/id}\" class=\"tag red\" data-id=\"{0/id}\"> {0/name}", "data": ""},
{"key": 5, "type": "dom.setvalue", "overwrite": true, "selector": "#= $this->printHtml($this->getId()); ?>", "value": "", "data": ""}
]
}