mirror of
https://github.com/Karaka-Management/oms-ItemManagement.git
synced 2026-01-31 04:38:42 +00:00
Merge branch 'develop' of https://github.com/Karaka-Management/oms-ItemManagement into develop
This commit is contained in:
commit
3b0ce77d13
|
|
@ -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);
|
||||
|
|
@ -156,7 +156,7 @@ final class ApiController extends Controller
|
|||
public function apiItemCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateItemCreate($request))) {
|
||||
$response->set('item_create', new FormValidation($val));
|
||||
$response->data['item_create'] = new FormValidation($val);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
return;
|
||||
|
|
@ -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(
|
||||
|
|
@ -311,7 +311,7 @@ final class ApiController extends Controller
|
|||
public function apiItemPriceCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateItemPriceCreate($request))) {
|
||||
$response->set('item_create', new FormValidation($val));
|
||||
$response->data['item_create'] = new FormValidation($val);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
return;
|
||||
|
|
@ -386,7 +386,7 @@ final class ApiController extends Controller
|
|||
public function apiItemAttributeCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateItemAttributeCreate($request))) {
|
||||
$response->set('attribute_create', new FormValidation($val));
|
||||
$response->data['attribute_create'] = new FormValidation($val);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
return;
|
||||
|
|
@ -464,7 +464,7 @@ final class ApiController extends Controller
|
|||
public function apiItemAttributeUpdate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateItemAttributeUpdate($request))) {
|
||||
$response->set('attribute_update', new FormValidation($val));
|
||||
$response->data['attribute_update'] = new FormValidation($val);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
return;
|
||||
|
|
@ -563,7 +563,7 @@ final class ApiController extends Controller
|
|||
public function apiItemAttributeTypeL11nCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateItemAttributeTypeL11nCreate($request))) {
|
||||
$response->set('attr_type_l11n_create', new FormValidation($val));
|
||||
$response->data['attr_type_l11n_create'] = new FormValidation($val);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
return;
|
||||
|
|
@ -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') ?? '';
|
||||
|
||||
|
|
@ -632,7 +632,7 @@ final class ApiController extends Controller
|
|||
public function apiItemAttributeTypeCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateItemAttributeTypeCreate($request))) {
|
||||
$response->set('attr_type_create', new FormValidation($val));
|
||||
$response->data['attr_type_create'] = new FormValidation($val);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
return;
|
||||
|
|
@ -702,7 +702,7 @@ final class ApiController extends Controller
|
|||
public function apiItemAttributeValueCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateItemAttributeValueCreate($request))) {
|
||||
$response->set('attr_value_create', new FormValidation($val));
|
||||
$response->data['attr_value_create'] = new FormValidation($val);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
return;
|
||||
|
|
@ -787,7 +787,7 @@ final class ApiController extends Controller
|
|||
public function apiItemAttributeValueL11nCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateItemAttributeValueL11nCreate($request))) {
|
||||
$response->set('attr_value_l11n_create', new FormValidation($val));
|
||||
$response->data['attr_value_l11n_create'] = new FormValidation($val);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
return;
|
||||
|
|
@ -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') ?? '';
|
||||
|
||||
|
|
@ -856,7 +856,7 @@ final class ApiController extends Controller
|
|||
public function apiItemAttribute(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateItemAttributeValueL11nCreate($request))) {
|
||||
$response->set('attr_value_l11n_create', new FormValidation($val));
|
||||
$response->data['attr_value_l11n_create'] = new FormValidation($val);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
return;
|
||||
|
|
@ -883,7 +883,7 @@ final class ApiController extends Controller
|
|||
public function apiItemL11nTypeCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateItemL11nTypeCreate($request))) {
|
||||
$response->set('item_l11n_type_create', new FormValidation($val));
|
||||
$response->data['item_l11n_type_create'] = new FormValidation($val);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
return;
|
||||
|
|
@ -947,7 +947,7 @@ final class ApiController extends Controller
|
|||
public function apiItemRelationTypeCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateItemRelationTypeCreate($request))) {
|
||||
$response->set('item_relation_type_create', new FormValidation($val));
|
||||
$response->data['item_relation_type_create'] = new FormValidation($val);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
return;
|
||||
|
|
@ -1010,7 +1010,7 @@ final class ApiController extends Controller
|
|||
public function apiItemL11nCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateItemL11nCreate($request))) {
|
||||
$response->set('item_l11n_create', new FormValidation($val));
|
||||
$response->data['item_l11n_create'] = new FormValidation($val);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
return;
|
||||
|
|
@ -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') ?? '';
|
||||
|
||||
|
|
@ -1081,13 +1081,13 @@ final class ApiController extends Controller
|
|||
public function apiFileCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateFileCreate($request))) {
|
||||
$response->set('item_file_create', new FormValidation($val));
|
||||
$response->data['item_file_create'] = new FormValidation($val);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$uploadedFiles = $request->getFiles();
|
||||
$uploadedFiles = $request->files;
|
||||
|
||||
if (empty($uploadedFiles)) {
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
|
@ -1173,7 +1173,7 @@ final class ApiController extends Controller
|
|||
public function apiNoteCreate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : void
|
||||
{
|
||||
if (!empty($val = $this->validateNoteCreate($request))) {
|
||||
$response->set('item_note_create', new FormValidation($val));
|
||||
$response->data['item_note_create'] = new FormValidation($val);
|
||||
$response->header->status = RequestStatusCode::R_400;
|
||||
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -70,15 +70,15 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/ItemManagement/Theme/Backend/attribute-type-list');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response);
|
||||
|
||||
/** @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);
|
||||
$view->data['attributes'] = $attributes;
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -99,15 +99,15 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/ItemManagement/Theme/Backend/attribute-value-list');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response);
|
||||
|
||||
/** @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);
|
||||
$view->data['attributes'] = $attributes;
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -128,21 +128,21 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/ItemManagement/Theme/Backend/attribute-type');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response);
|
||||
|
||||
/** @var \Modules\Attribute\Models\AttributeType $attribute */
|
||||
$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()
|
||||
->where('ref', $attribute->id)
|
||||
->execute();
|
||||
|
||||
$view->addData('attribute', $attribute);
|
||||
$view->addData('l11ns', $l11ns);
|
||||
$view->data['attribute'] = $attribute;
|
||||
$view->data['l11ns'] = $l11ns;
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -163,16 +163,16 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/ItemManagement/Theme/Backend/attribute-value');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response);
|
||||
|
||||
/** @var \Modules\Attribute\Models\AttributeValue $attribute */
|
||||
$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);
|
||||
$view->data['attribute'] = $attribute;
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -193,7 +193,7 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/ItemManagement/Theme/Backend/item-list');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004801001, $request, $response);
|
||||
|
||||
/** @var \Modules\ItemManagement\Models\Item[] $items */
|
||||
$items = ItemMapper::getAll()
|
||||
|
|
@ -201,13 +201,13 @@ 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)
|
||||
->execute();
|
||||
|
||||
$view->addData('items', $items);
|
||||
$view->data['items'] = $items;
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -279,7 +279,7 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/ItemManagement/Theme/Backend/item-create');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004805001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004805001, $request, $response);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -300,7 +300,7 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/ItemManagement/Theme/Backend/item-create');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004806001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004806001, $request, $response);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -321,7 +321,7 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/ItemManagement/Theme/Backend/item-create');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004807001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004807001, $request, $response);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -340,14 +340,14 @@ final class BackendController extends Controller
|
|||
*/
|
||||
public function viewItemManagementItem(RequestAbstract $request, ResponseAbstract $response, $data = null) : View
|
||||
{
|
||||
$head = $response->get('Content')->getData('head');
|
||||
$head = $response->get('Content')->head;
|
||||
$head->addAsset(AssetType::CSS, 'Resources/chartjs/Chartjs/chart.css');
|
||||
$head->addAsset(AssetType::JSLATE, 'Resources/chartjs/Chartjs/chart.js');
|
||||
$head->addAsset(AssetType::JSLATE, 'Modules/ItemManagement/Controller.js', ['type' => 'module']);
|
||||
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/ItemManagement/Theme/Backend/item-profile');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1004803001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1004803001, $request, $response);
|
||||
|
||||
/** @var \Modules\ItemManagement\Models\Item $item */
|
||||
$item = ItemMapper::get()
|
||||
|
|
@ -361,14 +361,14 @@ 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();
|
||||
|
||||
$view->addData('item', $item);
|
||||
$view->data['item'] = $item;
|
||||
|
||||
// Get item profile image
|
||||
// It might not be part of the 5 newest item files from above
|
||||
|
|
@ -395,59 +395,59 @@ final class BackendController extends Controller
|
|||
->limit(1)
|
||||
->execute();
|
||||
|
||||
$view->addData('itemImage', $itemImage);
|
||||
$view->data['itemImage'] = $itemImage;
|
||||
|
||||
/** @var \Model\Setting $settings */
|
||||
$settings = $this->app->appSettings->get(null, [
|
||||
SettingsEnum::DEFAULT_LOCALIZATION,
|
||||
]);
|
||||
|
||||
$view->setData('defaultlocalization', LocalizationMapper::get()->where('id', (int) $settings->id)->execute());
|
||||
$view->data['defaultlocalization'] = LocalizationMapper::get()->where('id', (int) $settings->id)->execute();
|
||||
|
||||
$l11nTypes = ItemL11nTypeMapper::getAll()
|
||||
->execute();
|
||||
$view->setData('l11nTypes', $l11nTypes);
|
||||
$view->data['l11nTypes'] = $l11nTypes;
|
||||
|
||||
$l11nValues = ItemL11nMapper::getAll()
|
||||
->with('type')
|
||||
->where('ref', $item->id)
|
||||
->execute();
|
||||
$view->setData('l11nValues', $l11nValues);
|
||||
$view->data['l11nValues'] = $l11nValues;
|
||||
|
||||
$attributeTypes = ItemAttributeTypeMapper::getAll()
|
||||
->with('l11n')
|
||||
->where('l11n/language', $response->getLanguage())
|
||||
->where('l11n/language', $response->header->l11n->language)
|
||||
->execute();
|
||||
$view->setData('attributeTypes', $attributeTypes);
|
||||
$view->data['attributeTypes'] = $attributeTypes;
|
||||
|
||||
$units = UnitMapper::getAll()
|
||||
->execute();
|
||||
$view->setData('units', $units);
|
||||
$view->data['units'] = $units;
|
||||
|
||||
$prices = PriceMapper::getAll()
|
||||
->where('item', $item->id)
|
||||
->where('type', PriceType::SALES)
|
||||
->where('client', null)
|
||||
->execute();
|
||||
$view->setData('prices', $prices);
|
||||
$view->data['prices'] = $prices;
|
||||
|
||||
$audits = AuditMapper::getAll()
|
||||
->where('type', StringUtils::intHash(ItemMapper::class))
|
||||
->where('module', 'ItemManagement')
|
||||
->where('ref', $item->id)
|
||||
->execute();
|
||||
$view->setData('audits', $audits);
|
||||
$view->data['audits'] = $audits;
|
||||
|
||||
$files = MediaMapper::getAll()
|
||||
->with('types')
|
||||
->join('id', ItemMapper::class, 'files') // id = media id, files = item relations
|
||||
->on('id', $item->id, relation: 'files') // id = item id
|
||||
->execute();
|
||||
$view->setData('files', $files);
|
||||
$view->data['files'] = $files;
|
||||
|
||||
$mediaListView = new \Modules\Media\Theme\Backend\Components\Media\ListView($this->app->l11nManager, $request, $response);
|
||||
$mediaListView->setTemplate('/Modules/Media/Theme/Backend/Components/Media/list');
|
||||
$view->addData('medialist', $mediaListView);
|
||||
$view->data['medialist'] = $mediaListView;
|
||||
|
||||
// stats
|
||||
if ($this->app->moduleManager->isActive('Billing')) {
|
||||
|
|
@ -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();
|
||||
|
|
@ -484,16 +484,16 @@ final class BackendController extends Controller
|
|||
$monthlySalesCosts = [];
|
||||
}
|
||||
|
||||
$view->addData('ytd', $ytd);
|
||||
$view->addData('mtd', $mtd);
|
||||
$view->addData('avg', $avg);
|
||||
$view->addData('lastOrder', $lastOrder);
|
||||
$view->addData('newestInvoices', $newestInvoices);
|
||||
$view->addData('allInvoices', $allInvoices);
|
||||
$view->addData('topCustomers', $topCustomers);
|
||||
$view->addData('regionSales', $regionSales);
|
||||
$view->addData('countrySales', $countrySales);
|
||||
$view->addData('monthlySalesCosts', $monthlySalesCosts);
|
||||
$view->data['ytd'] = $ytd;
|
||||
$view->data['mtd'] = $mtd;
|
||||
$view->data['avg'] = $avg;
|
||||
$view->data['lastOrder'] = $lastOrder;
|
||||
$view->data['newestInvoices'] = $newestInvoices;
|
||||
$view->data['allInvoices'] = $allInvoices;
|
||||
$view->data['topCustomers'] = $topCustomers;
|
||||
$view->data['regionSales'] = $regionSales;
|
||||
$view->data['countrySales'] = $countrySales;
|
||||
$view->data['monthlySalesCosts'] = $monthlySalesCosts;
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -563,14 +563,14 @@ final class BackendController extends Controller
|
|||
*/
|
||||
public function viewItemSalesAnalysis(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
$head = $response->get('Content')->getData('head');
|
||||
$head = $response->get('Content')->head;
|
||||
$head->addAsset(AssetType::CSS, 'Resources/chartjs/Chartjs/chart.css');
|
||||
$head->addAsset(AssetType::JSLATE, 'Resources/chartjs/Chartjs/chart.js');
|
||||
$head->addAsset(AssetType::JSLATE, 'Modules/ClientManagement/Controller.js', ['type' => 'module']);
|
||||
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/ItemManagement/Theme/Backend/item-analysis');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1001602001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001602001, $request, $response);
|
||||
|
||||
$monthlySalesCosts = [];
|
||||
for ($i = 1; $i < 13; ++$i) {
|
||||
|
|
@ -582,7 +582,7 @@ final class BackendController extends Controller
|
|||
];
|
||||
}
|
||||
|
||||
$view->addData('monthlySalesCosts', $monthlySalesCosts);
|
||||
$view->data['monthlySalesCosts'] = $monthlySalesCosts;
|
||||
|
||||
/////
|
||||
$monthlySalesCustomer = [];
|
||||
|
|
@ -595,7 +595,7 @@ final class BackendController extends Controller
|
|||
];
|
||||
}
|
||||
|
||||
$view->addData('monthlySalesCustomer', $monthlySalesCustomer);
|
||||
$view->data['monthlySalesCustomer'] = $monthlySalesCustomer;
|
||||
|
||||
$annualSalesCustomer = [];
|
||||
for ($i = 1; $i < 11; ++$i) {
|
||||
|
|
@ -606,7 +606,7 @@ final class BackendController extends Controller
|
|||
];
|
||||
}
|
||||
|
||||
$view->addData('annualSalesCustomer', $annualSalesCustomer);
|
||||
$view->data['annualSalesCustomer'] = $annualSalesCustomer;
|
||||
|
||||
/////
|
||||
$monthlyCustomerRetention = [];
|
||||
|
|
@ -617,7 +617,7 @@ final class BackendController extends Controller
|
|||
];
|
||||
}
|
||||
|
||||
$view->addData('monthlyCustomerRetention', $monthlyCustomerRetention);
|
||||
$view->data['monthlyCustomerRetention'] = $monthlyCustomerRetention;
|
||||
|
||||
/////
|
||||
$currentCustomerRegion = [
|
||||
|
|
@ -629,7 +629,7 @@ final class BackendController extends Controller
|
|||
'Other' => (int) (\mt_rand(200, 400) / 4),
|
||||
];
|
||||
|
||||
$view->addData('currentCustomerRegion', $currentCustomerRegion);
|
||||
$view->data['currentCustomerRegion'] = $currentCustomerRegion;
|
||||
|
||||
$annualCustomerRegion = [];
|
||||
for ($i = 1; $i < 11; ++$i) {
|
||||
|
|
@ -645,7 +645,7 @@ final class BackendController extends Controller
|
|||
];
|
||||
}
|
||||
|
||||
$view->addData('annualCustomerRegion', $annualCustomerRegion);
|
||||
$view->data['annualCustomerRegion'] = $annualCustomerRegion;
|
||||
|
||||
/////
|
||||
$currentCustomersRep = [];
|
||||
|
|
@ -659,7 +659,7 @@ final class BackendController extends Controller
|
|||
return $b['customers'] <=> $a['customers'];
|
||||
});
|
||||
|
||||
$view->addData('currentCustomersRep', $currentCustomersRep);
|
||||
$view->data['currentCustomersRep'] = $currentCustomersRep;
|
||||
|
||||
$annualCustomersRep = [];
|
||||
for ($i = 1; $i < 13; ++$i) {
|
||||
|
|
@ -673,7 +673,7 @@ final class BackendController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
$view->addData('annualCustomersRep', $annualCustomersRep);
|
||||
$view->data['annualCustomersRep'] = $annualCustomersRep;
|
||||
|
||||
/////
|
||||
$currentCustomersCountry = [];
|
||||
|
|
@ -688,7 +688,7 @@ final class BackendController extends Controller
|
|||
return $b['customers'] <=> $a['customers'];
|
||||
});
|
||||
|
||||
$view->addData('currentCustomersCountry', $currentCustomersCountry);
|
||||
$view->data['currentCustomersCountry'] = $currentCustomersCountry;
|
||||
|
||||
$annualCustomersCountry = [];
|
||||
for ($i = 1; $i < 51; ++$i) {
|
||||
|
|
@ -706,7 +706,7 @@ final class BackendController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
$view->addData('annualCustomersCountry', $annualCustomersCountry);
|
||||
$view->data['annualCustomersCountry'] = $annualCustomersCountry;
|
||||
|
||||
/////
|
||||
$customerGroups = [];
|
||||
|
|
@ -716,7 +716,7 @@ final class BackendController extends Controller
|
|||
];
|
||||
}
|
||||
|
||||
$view->addData('customerGroups', $customerGroups);
|
||||
$view->data['customerGroups'] = $customerGroups;
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -735,14 +735,14 @@ final class BackendController extends Controller
|
|||
*/
|
||||
public function viewItemPurchaseAnalysis(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||
{
|
||||
$head = $response->get('Content')->getData('head');
|
||||
$head = $response->get('Content')->head;
|
||||
$head->addAsset(AssetType::CSS, 'Resources/chartjs/Chartjs/chart.css');
|
||||
$head->addAsset(AssetType::JSLATE, 'Resources/chartjs/Chartjs/chart.js');
|
||||
$head->addAsset(AssetType::JSLATE, 'Modules/ClientManagement/Controller.js', ['type' => 'module']);
|
||||
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/ItemManagement/Theme/Backend/item-analysis');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1001602001, $request, $response));
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001602001, $request, $response);
|
||||
|
||||
$monthlySalesCosts = [];
|
||||
for ($i = 1; $i < 13; ++$i) {
|
||||
|
|
@ -754,7 +754,7 @@ final class BackendController extends Controller
|
|||
];
|
||||
}
|
||||
|
||||
$view->addData('monthlySalesCosts', $monthlySalesCosts);
|
||||
$view->data['monthlySalesCosts'] = $monthlySalesCosts;
|
||||
|
||||
/////
|
||||
$monthlySalesCustomer = [];
|
||||
|
|
@ -767,7 +767,7 @@ final class BackendController extends Controller
|
|||
];
|
||||
}
|
||||
|
||||
$view->addData('monthlySalesCustomer', $monthlySalesCustomer);
|
||||
$view->data['monthlySalesCustomer'] = $monthlySalesCustomer;
|
||||
|
||||
$annualSalesCustomer = [];
|
||||
for ($i = 1; $i < 11; ++$i) {
|
||||
|
|
@ -778,7 +778,7 @@ final class BackendController extends Controller
|
|||
];
|
||||
}
|
||||
|
||||
$view->addData('annualSalesCustomer', $annualSalesCustomer);
|
||||
$view->data['annualSalesCustomer'] = $annualSalesCustomer;
|
||||
|
||||
/////
|
||||
$monthlyCustomerRetention = [];
|
||||
|
|
@ -789,7 +789,7 @@ final class BackendController extends Controller
|
|||
];
|
||||
}
|
||||
|
||||
$view->addData('monthlyCustomerRetention', $monthlyCustomerRetention);
|
||||
$view->data['monthlyCustomerRetention'] = $monthlyCustomerRetention;
|
||||
|
||||
/////
|
||||
$currentCustomerRegion = [
|
||||
|
|
@ -801,7 +801,7 @@ final class BackendController extends Controller
|
|||
'Other' => (int) (\mt_rand(200, 400) / 4),
|
||||
];
|
||||
|
||||
$view->addData('currentCustomerRegion', $currentCustomerRegion);
|
||||
$view->data['currentCustomerRegion'] = $currentCustomerRegion;
|
||||
|
||||
$annualCustomerRegion = [];
|
||||
for ($i = 1; $i < 11; ++$i) {
|
||||
|
|
@ -817,7 +817,7 @@ final class BackendController extends Controller
|
|||
];
|
||||
}
|
||||
|
||||
$view->addData('annualCustomerRegion', $annualCustomerRegion);
|
||||
$view->data['annualCustomerRegion'] = $annualCustomerRegion;
|
||||
|
||||
/////
|
||||
$currentCustomersRep = [];
|
||||
|
|
@ -831,7 +831,7 @@ final class BackendController extends Controller
|
|||
return $b['customers'] <=> $a['customers'];
|
||||
});
|
||||
|
||||
$view->addData('currentCustomersRep', $currentCustomersRep);
|
||||
$view->data['currentCustomersRep'] = $currentCustomersRep;
|
||||
|
||||
$annualCustomersRep = [];
|
||||
for ($i = 1; $i < 13; ++$i) {
|
||||
|
|
@ -845,7 +845,7 @@ final class BackendController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
$view->addData('annualCustomersRep', $annualCustomersRep);
|
||||
$view->data['annualCustomersRep'] = $annualCustomersRep;
|
||||
|
||||
/////
|
||||
$currentCustomersCountry = [];
|
||||
|
|
@ -860,7 +860,7 @@ final class BackendController extends Controller
|
|||
return $b['customers'] <=> $a['customers'];
|
||||
});
|
||||
|
||||
$view->addData('currentCustomersCountry', $currentCustomersCountry);
|
||||
$view->data['currentCustomersCountry'] = $currentCustomersCountry;
|
||||
|
||||
$annualCustomersCountry = [];
|
||||
for ($i = 1; $i < 51; ++$i) {
|
||||
|
|
@ -878,7 +878,7 @@ final class BackendController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
$view->addData('annualCustomersCountry', $annualCustomersCountry);
|
||||
$view->data['annualCustomersCountry'] = $annualCustomersCountry;
|
||||
|
||||
/////
|
||||
$customerGroups = [];
|
||||
|
|
@ -888,7 +888,7 @@ final class BackendController extends Controller
|
|||
];
|
||||
}
|
||||
|
||||
$view->addData('customerGroups', $customerGroups);
|
||||
$view->data['customerGroups'] = $customerGroups;
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,18 +68,6 @@ class ItemPrice implements \JsonSerializable
|
|||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getId() : int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get status
|
||||
*
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@ declare(strict_types=1);
|
|||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
$attributes = $this->getData('attributes');
|
||||
$attributes = $this->data['attributes'];
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
|
|
|
|||
|
|
@ -17,10 +17,10 @@ use phpOMS\Localization\ISO639Enum;
|
|||
|
||||
$types = AttributeValueType::getConstants();
|
||||
|
||||
$attribute = $this->getData('attribute');
|
||||
$l11ns = $this->getData('l11ns');
|
||||
$attribute = $this->data['attribute'];
|
||||
$l11ns = $this->data['l11ns'];
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-xs-12">
|
||||
|
|
|
|||
|
|
@ -16,4 +16,4 @@ declare(strict_types=1);
|
|||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
|
||||
echo $this->getData('nav')->render();
|
||||
echo $this->data['nav']->render();
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ declare(strict_types=1);
|
|||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
|
||||
<div class="tabview tab-2">
|
||||
<div class="box">
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ use phpOMS\Uri\UriFactory;
|
|||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
/** @var \Modules\ItemManagement\Models\Item[] $items */
|
||||
$items = $this->getData('items') ?? [];
|
||||
$items = $this->data['items'] ?? [];
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
|
|
|
|||
|
|
@ -21,27 +21,27 @@ use phpOMS\Message\Http\HttpHeader;
|
|||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
/** @var \Modules\ItemManagement\Models\Item $item */
|
||||
$item = $this->getData('item');
|
||||
$item = $this->data['item'];
|
||||
|
||||
$attribute = $item->getAttributes();
|
||||
|
||||
$notes = $item->getNotes();
|
||||
$files = $item->getFiles();
|
||||
$files = $item->files;
|
||||
$itemImage = $this->getData('itemImage') ?? new NullMedia();
|
||||
|
||||
$newestInvoices = $this->getData('newestInvoices') ?? [];
|
||||
$allInvoices = $this->getData('allInvoices') ?? [];
|
||||
$newestInvoices = $this->data['newestInvoices'] ?? [];
|
||||
$allInvoices = $this->data['allInvoices'] ?? [];
|
||||
$topCustomers = $this->getData('topCustomers') ?? [[], []];
|
||||
$regionSales = $this->getData('regionSales') ?? [];
|
||||
$countrySales = $this->getData('countrySales') ?? [];
|
||||
$monthlySalesCosts = $this->getData('monthlySalesCosts') ?? [];
|
||||
$regionSales = $this->data['regionSales'] ?? [];
|
||||
$countrySales = $this->data['countrySales'] ?? [];
|
||||
$monthlySalesCosts = $this->data['monthlySalesCosts'] ?? [];
|
||||
|
||||
$languages = ISO639Enum::getConstants();
|
||||
|
||||
/** @var \phpOMS\Localization\Localization $l11n */
|
||||
$l11n = $this->getData('defaultlocalization') ?? new NullLocalization();
|
||||
|
||||
echo $this->getData('nav')->render();
|
||||
echo $this->data['nav']->render();
|
||||
?>
|
||||
|
||||
<div class="tabview tab-2">
|
||||
|
|
@ -475,7 +475,7 @@ echo $this->getData('nav')->render();
|
|||
<label for="iLocalizationLanguage"><?= $this->getHtml('Language'); ?></label>
|
||||
<select id="iLocalizationLanguage" name="language" data-tpl-text="/language" data-tpl-value="/language">
|
||||
<?php foreach ($languages as $code => $language) : $code = ISO639x1Enum::getByName($code); ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->getLanguage() ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->language ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -484,7 +484,7 @@ echo $this->getData('nav')->render();
|
|||
<label for="iLocalizationType"><?= $this->getHtml('Type'); ?></label>
|
||||
<select id="iLocalizationType" name="type" data-tpl-text="/type" data-tpl-value="/type">
|
||||
<?php
|
||||
$types = $this->getData('l11nTypes') ?? [];
|
||||
$types = $this->data['l11nTypes'] ?? [];
|
||||
foreach ($types as $type) : ?>
|
||||
<option value="<?= $type->id; ?>"><?= $this->printHtml($type->title); ?>
|
||||
<?php endforeach; ?>
|
||||
|
|
@ -540,7 +540,7 @@ echo $this->getData('nav')->render();
|
|||
</template>
|
||||
<?php
|
||||
$c = 0;
|
||||
$itemL11n = $this->getData('l11nValues');
|
||||
$itemL11n = $this->data['l11nValues'];
|
||||
foreach ($itemL11n as $value) : ++$c; ?>
|
||||
<tr data-id="<?= $value->id; ?>">
|
||||
<td>
|
||||
|
|
@ -590,7 +590,7 @@ echo $this->getData('nav')->render();
|
|||
<select id="iAttributesLanguage" name="language" data-tpl-text="/language" data-tpl-value="/language">
|
||||
<option value="">
|
||||
<?php foreach ($languages as $code => $language) : ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->getLanguage() ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->language ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
|
@ -600,7 +600,7 @@ echo $this->getData('nav')->render();
|
|||
<label for="iAttributesType"><?= $this->getHtml('Type'); ?></label>
|
||||
<select id="iAttributesType" name="type" data-tpl-text="/type" data-tpl-value="/type">
|
||||
<?php
|
||||
$types = $this->getData('attributeTypes') ?? [];
|
||||
$types = $this->data['attributeTypes'] ?? [];
|
||||
foreach ($types as $type) : ?>
|
||||
<option value="<?= $type->id; ?>"><?= $this->printHtml($type->getL11n()); ?>
|
||||
<?php endforeach; ?>
|
||||
|
|
@ -612,7 +612,7 @@ echo $this->getData('nav')->render();
|
|||
<select id="iAttributesUnit" name="unit" data-tpl-text="/unit" data-tpl-value="/unit">
|
||||
<option value="">
|
||||
<?php
|
||||
$units = $this->getData('units') ?? [];
|
||||
$units = $this->data['units'] ?? [];
|
||||
foreach ($units as $unit) : ?>
|
||||
<option value="<?= $unit->id; ?>"><?= $this->printHtml($unit->name); ?>
|
||||
<?php endforeach; ?>
|
||||
|
|
@ -783,7 +783,7 @@ echo $this->getData('nav')->render();
|
|||
<tbody>
|
||||
<?php
|
||||
$c = 0;
|
||||
$prices = $this->getData('prices');
|
||||
$prices = $this->data['prices'];
|
||||
foreach ($prices as $key => $value) : ++$c;
|
||||
$url = UriFactory::build('{/base}/admin/group/settings?{?}&id=' . $value->id); ?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
|
|
@ -1078,7 +1078,7 @@ echo $this->getData('nav')->render();
|
|||
<td>
|
||||
<select id="iEarningIndicator" name="settings_1000000020">
|
||||
<?php foreach ($languages as $code => $language) : ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->getLanguage() ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->language ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<tr>
|
||||
|
|
@ -1087,7 +1087,7 @@ echo $this->getData('nav')->render();
|
|||
<td>
|
||||
<select id="iCostIndicator" name="settings_1000000020">
|
||||
<?php foreach ($languages as $code => $language) : ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->getLanguage() ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->language ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<tr>
|
||||
|
|
@ -1096,7 +1096,7 @@ echo $this->getData('nav')->render();
|
|||
<td>
|
||||
<select id="iCostCenter" name="settings_1000000020">
|
||||
<?php foreach ($languages as $code => $language) : ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->getLanguage() ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->language ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<tr>
|
||||
|
|
@ -1105,7 +1105,7 @@ echo $this->getData('nav')->render();
|
|||
<td>
|
||||
<select id="iCostObject" name="settings_1000000020">
|
||||
<?php foreach ($languages as $code => $language) : ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->getLanguage() ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->language ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</table>
|
||||
|
|
@ -1207,7 +1207,7 @@ echo $this->getData('nav')->render();
|
|||
<tbody>
|
||||
<?php
|
||||
$count = 0;
|
||||
$audits = $this->getData('audits') ?? [];
|
||||
$audits = $this->data['audits'] ?? [];
|
||||
$previous = empty($audits) ? HttpHeader::getAllHeaders()['Referer'] ?? 'admin/module/settings?id={?id}#{\#}' : 'admin/module/settings?{?}&audit=' . \reset($audits)->id . '&ptype=p#{\#}';
|
||||
$next = empty($audits) ? HttpHeader::getAllHeaders()['Referer'] ?? 'admin/module/settings?id={?id}#{\#}' : 'admin/module/settings?{?}&audit=' . \end($audits)->id . '&ptype=n#{\#}';
|
||||
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@ declare(strict_types=1);
|
|||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
$items = $this->getData('items');
|
||||
$items = $this->data['items'];
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ use phpOMS\Uri\UriFactory;
|
|||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
/** @var \Modules\ItemManagement\Models\Item[] $items */
|
||||
$items = $this->getData('items');
|
||||
$items = $this->data['items'];
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
|
|
|
|||
|
|
@ -18,27 +18,27 @@ use phpOMS\Localization\NullLocalization;
|
|||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
/** @var \Modules\ItemManagement\Models\Item $item */
|
||||
$item = $this->getData('item');
|
||||
$item = $this->data['item'];
|
||||
|
||||
$itemL11n = $item->getL11ns();
|
||||
$Attribute = $item->getAttributes();
|
||||
|
||||
$notes = $item->getNotes();
|
||||
$files = $item->getFiles();
|
||||
$files = $item->files;
|
||||
|
||||
$newestInvoices = $this->getData('newestInvoices') ?? [];
|
||||
$allInvoices = $this->getData('allInvoices') ?? [];
|
||||
$topCustomers = $this->getData('topCustomers') ?? [];
|
||||
$regionSales = $this->getData('regionSales') ?? [];
|
||||
$countrySales = $this->getData('countrySales') ?? [];
|
||||
$monthlySalesCosts = $this->getData('monthlySalesCosts') ?? [];
|
||||
$newestInvoices = $this->data['newestInvoices'] ?? [];
|
||||
$allInvoices = $this->data['allInvoices'] ?? [];
|
||||
$topCustomers = $this->data['topCustomers'] ?? [];
|
||||
$regionSales = $this->data['regionSales'] ?? [];
|
||||
$countrySales = $this->data['countrySales'] ?? [];
|
||||
$monthlySalesCosts = $this->data['monthlySalesCosts'] ?? [];
|
||||
|
||||
$languages = ISO639Enum::getConstants();
|
||||
|
||||
/** @var \phpOMS\Localization\Localization $l11n */
|
||||
$l11n = $this->getData('defaultlocalization') ?? new NullLocalization();
|
||||
|
||||
echo $this->getData('nav')->render();
|
||||
echo $this->data['nav']->render();
|
||||
?>
|
||||
|
||||
<div class="tabview tab-2">
|
||||
|
|
@ -433,7 +433,7 @@ echo $this->getData('nav')->render();
|
|||
<td>
|
||||
<select id="iLanguages" name="settings_1000000020">
|
||||
<?php foreach ($languages as $code => $language) : ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->getLanguage() ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->language ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<tr>
|
||||
|
|
@ -442,7 +442,7 @@ echo $this->getData('nav')->render();
|
|||
<td>
|
||||
<select id="iLanguages" name="settings_1000000020">
|
||||
<?php foreach ($languages as $code => $language) : ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->getLanguage() ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->language ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<tr>
|
||||
|
|
@ -501,7 +501,7 @@ echo $this->getData('nav')->render();
|
|||
<td>
|
||||
<select id="iLanguages" name="settings_1000000020">
|
||||
<?php foreach ($languages as $code => $language) : ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->getLanguage() ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->language ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<tr>
|
||||
|
|
@ -510,7 +510,7 @@ echo $this->getData('nav')->render();
|
|||
<td>
|
||||
<select id="iLanguages" name="settings_1000000020">
|
||||
<?php foreach ($languages as $code => $language) : ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->getLanguage() ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->language ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<tr>
|
||||
|
|
@ -519,7 +519,7 @@ echo $this->getData('nav')->render();
|
|||
<td>
|
||||
<select id="iLanguages" name="settings_1000000020">
|
||||
<?php foreach ($languages as $code => $language) : ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->getLanguage() ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->language ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<tr>
|
||||
|
|
@ -857,7 +857,7 @@ echo $this->getData('nav')->render();
|
|||
<td>
|
||||
<select id="iEarningIndicator" name="settings_1000000020">
|
||||
<?php foreach ($languages as $code => $language) : ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->getLanguage() ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->language ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<tr>
|
||||
|
|
@ -866,7 +866,7 @@ echo $this->getData('nav')->render();
|
|||
<td>
|
||||
<select id="iCostIndicator" name="settings_1000000020">
|
||||
<?php foreach ($languages as $code => $language) : ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->getLanguage() ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->language ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<tr>
|
||||
|
|
@ -875,7 +875,7 @@ echo $this->getData('nav')->render();
|
|||
<td>
|
||||
<select id="iCostCenter" name="settings_1000000020">
|
||||
<?php foreach ($languages as $code => $language) : ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->getLanguage() ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->language ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<tr>
|
||||
|
|
@ -884,7 +884,7 @@ echo $this->getData('nav')->render();
|
|||
<td>
|
||||
<select id="iCostObject" name="settings_1000000020">
|
||||
<?php foreach ($languages as $code => $language) : ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->getLanguage() ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<option value="<?= $this->printHtml($code); ?>" <?= $this->printHtml(\strtolower($code) === $l11n->language ? ' selected' : ''); ?>><?= $this->printHtml($language); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ use phpOMS\Uri\UriFactory;
|
|||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
/** @var \Modules\ItemManagement\Models\Item[] $items */
|
||||
$items = $this->getData('items') ?? [];
|
||||
$items = $this->data['items'] ?? [];
|
||||
|
||||
echo $this->getData('nav')->render(); ?>
|
||||
echo $this->data['nav']->render(); ?>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ final class ItemTest extends \PHPUnit\Framework\TestCase
|
|||
self::assertEquals('', $this->item->info);
|
||||
self::assertEquals(ItemStatus::ACTIVE, $this->item->getStatus());
|
||||
self::assertEquals([], $this->item->getNotes());
|
||||
self::assertEquals([], $this->item->getFiles());
|
||||
self::assertEquals([], $this->item->files);
|
||||
self::assertEquals([], $this->item->getAttributes());
|
||||
self::assertInstanceOf(BaseStringL11n::class, $this->item->getL11n(''));
|
||||
self::assertInstanceOf('phpOMS\Localization\Money', $this->item->salesPrice);
|
||||
|
|
@ -72,7 +72,7 @@ final class ItemTest extends \PHPUnit\Framework\TestCase
|
|||
public function testFileInputOutput() : void
|
||||
{
|
||||
$this->item->addFile($temp = new Media());
|
||||
self::assertCount(1, $this->item->getFiles());
|
||||
self::assertCount(1, $this->item->files);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user