diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 7826dbb..e59853c 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -84,7 +84,7 @@ final class ApiController extends Controller $l11n = ItemL11nMapper::getAll() ->with('type') ->where('type/title', ['name1', 'name2', 'name3'], 'IN') - ->where('language', $request->getLanguage()) + ->where('language', $request->header->l11n->language) ->where('description', '%' . ($request->getDataString('search') ?? '') . '%', 'LIKE') ->execute(); @@ -99,7 +99,7 @@ final class ApiController extends Controller ->with('l11n/type') ->where('id', $items, 'IN') ->where('l11n/type/title', ['name1', 'name2', 'name3'], 'IN') - ->where('l11n/language', $request->getLanguage()) + ->where('l11n/language', $request->header->l11n->language) ->execute(); $response->header->set('Content-Type', MimeType::M_JSON, true); @@ -186,7 +186,7 @@ final class ApiController extends Controller $path = $this->createItemDir($item); - $uploadedFiles = $request->getFile('item_profile_image'); + $uploadedFiles = $request->files['item_profile_image'] ?? []; if (!empty($uploadedFiles)) { // upload image $uploaded = $this->app->moduleManager->get('Media')->uploadFiles( @@ -588,7 +588,7 @@ final class ApiController extends Controller $attrL11n = new BaseStringL11n(); $attrL11n->ref = $request->getDataInt('type') ?? 0; $attrL11n->setLanguage( - $request->getDataString('language') ?? $request->getLanguage() + $request->getDataString('language') ?? $request->header->l11n->language ); $attrL11n->content = $request->getDataString('title') ?? ''; @@ -812,7 +812,7 @@ final class ApiController extends Controller $attrL11n = new BaseStringL11n(); $attrL11n->ref = $request->getDataInt('value') ?? 0; $attrL11n->setLanguage( - $request->getDataString('language') ?? $request->getLanguage() + $request->getDataString('language') ?? $request->header->l11n->language ); $attrL11n->content = $request->getDataString('title') ?? ''; @@ -1036,7 +1036,7 @@ final class ApiController extends Controller $itemL11n->ref = $request->getDataInt('item') ?? 0; $itemL11n->type = new NullBaseStringL11nType($request->getDataInt('type') ?? 0); $itemL11n->setLanguage( - $request->getDataString('language') ?? $request->getLanguage() + $request->getDataString('language') ?? $request->header->l11n->language ); $itemL11n->content = $request->getDataString('description') ?? ''; diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 63cf176..9f20655 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -75,7 +75,7 @@ final class BackendController extends Controller /** @var \Modules\Attribute\Models\AttributeType[] $attributes */ $attributes = ItemAttributeTypeMapper::getAll() ->with('l11n') - ->where('l11n/language', $response->getLanguage()) + ->where('l11n/language', $response->header->l11n->language) ->execute(); $view->addData('attributes', $attributes); @@ -104,7 +104,7 @@ final class BackendController extends Controller /** @var \Modules\Attribute\Models\AttributeValue[] $attributes */ $attributes = ItemAttributeValueMapper::getAll() ->with('l11n') - ->where('l11n/language', $response->getLanguage()) + ->where('l11n/language', $response->header->l11n->language) ->execute(); $view->addData('attributes', $attributes); @@ -134,7 +134,7 @@ final class BackendController extends Controller $attribute = ItemAttributeTypeMapper::get() ->with('l11n') ->where('id', (int) $request->getData('id')) - ->where('l11n/language', $response->getLanguage()) + ->where('l11n/language', $response->header->l11n->language) ->execute(); $l11ns = ItemAttributeTypeL11nMapper::getAll() @@ -169,7 +169,7 @@ final class BackendController extends Controller $attribute = ItemAttributeValueMapper::get() ->with('l11n') ->where('id', (int) $request->getData('id')) - ->where('l11n/language', $response->getLanguage()) + ->where('l11n/language', $response->header->l11n->language) ->execute(); $view->addData('attribute', $attribute); @@ -201,7 +201,7 @@ final class BackendController extends Controller ->with('l11n/type') ->with('files') ->with('files/types') - ->where('l11n/language', $response->getLanguage()) + ->where('l11n/language', $response->header->l11n->language) ->where('l11n/type/title', ['name1', 'name2', 'name3'], 'IN') ->where('files/types/name', 'item_profile_image') ->limit(50) @@ -361,9 +361,9 @@ final class BackendController extends Controller ->with('attributes/value') ->with('notes') ->where('id', (int) $request->getData('id')) - ->where('l11n/language', $response->getLanguage()) + ->where('l11n/language', $response->header->l11n->language) ->where('l11n/type/title', ['name1', 'name2', 'name3'], 'IN') - ->where('attributes/type/l11n/language', $response->getLanguage()) + ->where('attributes/type/l11n/language', $response->header->l11n->language) ->limit(5, 'files')->sort('files/id', OrderType::DESC) ->limit(5, 'notes')->sort('notes/id', OrderType::DESC) ->execute(); @@ -416,7 +416,7 @@ final class BackendController extends Controller $attributeTypes = ItemAttributeTypeMapper::getAll() ->with('l11n') - ->where('l11n/language', $response->getLanguage()) + ->where('l11n/language', $response->header->l11n->language) ->execute(); $view->setData('attributeTypes', $attributeTypes); @@ -461,7 +461,7 @@ final class BackendController extends Controller ->with('type') ->with('type/l11n') ->where('type/transferType', BillTransferType::SALES) - ->where('type/l11n/language', $response->getLanguage()) + ->where('type/l11n/language', $response->header->l11n->language) ->sort('id', OrderType::DESC) ->limit(5) ->execute(); diff --git a/Theme/Backend/item-profile.tpl.php b/Theme/Backend/item-profile.tpl.php index d88da6b..ce391a4 100755 --- a/Theme/Backend/item-profile.tpl.php +++ b/Theme/Backend/item-profile.tpl.php @@ -475,7 +475,7 @@ echo $this->getData('nav')->render(); @@ -590,7 +590,7 @@ echo $this->getData('nav')->render(); @@ -1078,7 +1078,7 @@ echo $this->getData('nav')->render(); @@ -1087,7 +1087,7 @@ echo $this->getData('nav')->render(); @@ -1096,7 +1096,7 @@ echo $this->getData('nav')->render(); @@ -1105,7 +1105,7 @@ echo $this->getData('nav')->render(); diff --git a/Theme/Backend/sales-item-profile.tpl.php b/Theme/Backend/sales-item-profile.tpl.php index 372e7e7..9edfad4 100755 --- a/Theme/Backend/sales-item-profile.tpl.php +++ b/Theme/Backend/sales-item-profile.tpl.php @@ -433,7 +433,7 @@ echo $this->getData('nav')->render(); @@ -442,7 +442,7 @@ echo $this->getData('nav')->render(); @@ -501,7 +501,7 @@ echo $this->getData('nav')->render(); @@ -510,7 +510,7 @@ echo $this->getData('nav')->render(); @@ -519,7 +519,7 @@ echo $this->getData('nav')->render(); @@ -857,7 +857,7 @@ echo $this->getData('nav')->render(); @@ -866,7 +866,7 @@ echo $this->getData('nav')->render(); @@ -875,7 +875,7 @@ echo $this->getData('nav')->render(); @@ -884,7 +884,7 @@ echo $this->getData('nav')->render();