auto fixes + some impl.

This commit is contained in:
Dennis Eichhorn 2024-01-26 22:53:58 +00:00
parent f8afe183e1
commit fdaa7fd557
22 changed files with 184 additions and 163 deletions

View File

@ -152,6 +152,11 @@
"type": "TINYINT(1)", "type": "TINYINT(1)",
"null": false "null": false
}, },
"assetmgmt_attr_type_internal": {
"name": "assetmgmt_attr_type_internal",
"type": "TINYINT(1)",
"null": false
},
"assetmgmt_attr_type_required": { "assetmgmt_attr_type_required": {
"description": "Every asset must have this attribute type if set to true.", "description": "Every asset must have this attribute type if set to true.",
"name": "assetmgmt_attr_type_required", "name": "assetmgmt_attr_type_required",

View File

@ -20,7 +20,6 @@ use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse; use phpOMS\Message\Http\HttpResponse;
use phpOMS\Module\InstallerAbstract; use phpOMS\Module\InstallerAbstract;
use phpOMS\Module\ModuleInfo; use phpOMS\Module\ModuleInfo;
use phpOMS\Uri\HttpUri;
/** /**
* Installer class. * Installer class.
@ -65,7 +64,7 @@ final class Installer extends InstallerAbstract
} }
/** @var array $types */ /** @var array $types */
$types = \json_decode($fileContent, true); $types = \json_decode($fileContent, true);
$assetTypes = self::createAssetTypes($app, $types); $assetTypes = self::createAssetTypes($app, $types);
} }
@ -90,7 +89,7 @@ final class Installer extends InstallerAbstract
/** @var array $type */ /** @var array $type */
foreach ($types as $type) { foreach ($types as $type) {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('duration', $type['duration']); $request->setData('duration', $type['duration']);
@ -119,7 +118,7 @@ final class Installer extends InstallerAbstract
} }
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('title', $l11n); $request->setData('title', $l11n);
@ -154,7 +153,7 @@ final class Installer extends InstallerAbstract
/** @var array $type */ /** @var array $type */
foreach ($types as $type) { foreach ($types as $type) {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('name', $type['name'] ?? ''); $request->setData('name', $type['name'] ?? '');
@ -180,7 +179,7 @@ final class Installer extends InstallerAbstract
} }
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('title', $l11n); $request->setData('title', $l11n);
@ -215,13 +214,15 @@ final class Installer extends InstallerAbstract
/** @var array $attribute */ /** @var array $attribute */
foreach ($attributes as $attribute) { foreach ($attributes as $attribute) {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('name', $attribute['name'] ?? ''); $request->setData('name', $attribute['name'] ?? '');
$request->setData('title', \reset($attribute['l11n'])); $request->setData('title', \reset($attribute['l11n']));
$request->setData('language', \array_keys($attribute['l11n'])[0] ?? 'en'); $request->setData('language', \array_keys($attribute['l11n'])[0] ?? 'en');
$request->setData('is_required', $attribute['is_required'] ?? false); $request->setData('is_required', $attribute['is_required'] ?? false);
$request->setData('repeatable', $attribute['repeatable'] ?? false);
$request->setData('internal', $attribute['internal'] ?? false);
$request->setData('custom', $attribute['is_custom_allowed'] ?? false); $request->setData('custom', $attribute['is_custom_allowed'] ?? false);
$request->setData('validation_pattern', $attribute['validation_pattern'] ?? ''); $request->setData('validation_pattern', $attribute['validation_pattern'] ?? '');
$request->setData('datatype', (int) $attribute['value_type']); $request->setData('datatype', (int) $attribute['value_type']);
@ -245,7 +246,7 @@ final class Installer extends InstallerAbstract
} }
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('title', $l11n); $request->setData('title', $l11n);
@ -284,7 +285,7 @@ final class Installer extends InstallerAbstract
/** @var array $value */ /** @var array $value */
foreach ($attribute['values'] as $value) { foreach ($attribute['values'] as $value) {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('value', $value['value'] ?? ''); $request->setData('value', $value['value'] ?? '');
@ -318,7 +319,7 @@ final class Installer extends InstallerAbstract
} }
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('title', $l11n); $request->setData('title', $l11n);

View File

@ -6,7 +6,7 @@ use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb; use phpOMS\Router\RouteVerb;
return [ return [
'^.*/accounting/attribute/type/list.*$' => [ '^.*/accounting/attribute/type/list(\?.*$|$)' => [
[ [
'dest' => '\Modules\EquipmentManagement\Controller\BackendController:viewEquipmentManagementAttributeTypeList', 'dest' => '\Modules\EquipmentManagement\Controller\BackendController:viewEquipmentManagementAttributeTypeList',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
@ -17,7 +17,7 @@ return [
], ],
], ],
], ],
'^.*/accounting/attribute/type\?.*$' => [ '^.*/accounting/attribute/type(\?.*$|$)' => [
[ [
'dest' => '\Modules\EquipmentManagement\Controller\BackendController:viewEquipmentManagementAttributeType', 'dest' => '\Modules\EquipmentManagement\Controller\BackendController:viewEquipmentManagementAttributeType',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
@ -29,7 +29,7 @@ return [
], ],
], ],
'^.*/accounting/asset/list.*$' => [ '^.*/accounting/asset/list(\?.*$|$)' => [
[ [
'dest' => '\Modules\AssetManagement\Controller\BackendController:viewAssetManagementList', 'dest' => '\Modules\AssetManagement\Controller\BackendController:viewAssetManagementList',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
@ -40,9 +40,9 @@ return [
], ],
], ],
], ],
'^.*/accounting/asset/profile.*$' => [ '^.*/accounting/asset/view(\?.*$|$)' => [
[ [
'dest' => '\Modules\AssetManagement\Controller\BackendController:viewAssetManagementProfile', 'dest' => '\Modules\AssetManagement\Controller\BackendController:viewAssetManagementView',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
'permission' => [ 'permission' => [
'module' => BackendController::MODULE_NAME, 'module' => BackendController::MODULE_NAME,
@ -51,7 +51,7 @@ return [
], ],
], ],
], ],
'^.*/accounting/asset/entry/list.*$' => [ '^.*/accounting/asset/entry/list(\?.*$|$)' => [
[ [
'dest' => '\Modules\AssetManagement\Controller\BackendController:viewAssetManagementEntryList', 'dest' => '\Modules\AssetManagement\Controller\BackendController:viewAssetManagementEntryList',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
@ -62,7 +62,7 @@ return [
], ],
], ],
], ],
'^.*/accounting/asset/entry/view.*$' => [ '^.*/accounting/asset/entry/view(\?.*$|$)' => [
[ [
'dest' => '\Modules\AssetManagement\Controller\BackendController:viewAssetManagementEntryView', 'dest' => '\Modules\AssetManagement\Controller\BackendController:viewAssetManagementEntryView',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
@ -73,7 +73,7 @@ return [
], ],
], ],
], ],
'^.*/accounting/asset/create.*$' => [ '^.*/accounting/asset/create(\?.*$|$)' => [
[ [
'dest' => '\Modules\AssetManagement\Controller\BackendController:viewAssetManagementCreate', 'dest' => '\Modules\AssetManagement\Controller\BackendController:viewAssetManagementCreate',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
@ -84,7 +84,7 @@ return [
], ],
], ],
], ],
'^.*/accounting/asset/table.*$' => [ '^.*/accounting/asset/table(\?.*$|$)' => [
[ [
'dest' => '\Modules\AssetManagement\Controller\BackendController:viewAssetManagementAssetTable', 'dest' => '\Modules\AssetManagement\Controller\BackendController:viewAssetManagementAssetTable',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
@ -94,5 +94,5 @@ return [
'state' => PermissionCategory::ASSET, 'state' => PermissionCategory::ASSET,
], ],
], ],
] ],
]; ];

View File

@ -14,14 +14,14 @@ declare(strict_types=1);
namespace Modules\AssetManagement\Controller; namespace Modules\AssetManagement\Controller;
use Modules\Attribute\Models\Attribute;
use Modules\Attribute\Models\AttributeType;
use Modules\Attribute\Models\AttributeValue;
use Modules\AssetManagement\Models\Attribute\AssetAttributeMapper; use Modules\AssetManagement\Models\Attribute\AssetAttributeMapper;
use Modules\AssetManagement\Models\Attribute\AssetAttributeTypeL11nMapper; use Modules\AssetManagement\Models\Attribute\AssetAttributeTypeL11nMapper;
use Modules\AssetManagement\Models\Attribute\AssetAttributeTypeMapper; use Modules\AssetManagement\Models\Attribute\AssetAttributeTypeMapper;
use Modules\AssetManagement\Models\Attribute\AssetAttributeValueL11nMapper; use Modules\AssetManagement\Models\Attribute\AssetAttributeValueL11nMapper;
use Modules\AssetManagement\Models\Attribute\AssetAttributeValueMapper; use Modules\AssetManagement\Models\Attribute\AssetAttributeValueMapper;
use Modules\Attribute\Models\Attribute;
use Modules\Attribute\Models\AttributeType;
use Modules\Attribute\Models\AttributeValue;
use phpOMS\Localization\BaseStringL11n; use phpOMS\Localization\BaseStringL11n;
use phpOMS\Message\Http\RequestStatusCode; use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Message\RequestAbstract; use phpOMS\Message\RequestAbstract;
@ -61,12 +61,15 @@ final class ApiAssetAttributeController extends Controller
return; return;
} }
$type = AssetAttributeTypeMapper::get()->with('defaults')->where('id', (int) $request->getData('type'))->execute(); $type = AssetAttributeTypeMapper::get()
->with('defaults')
->where('id', (int) $request->getData('type'))
->execute();
if (!$type->repeatable) { if (!$type->repeatable) {
$attr = AssetAttributeMapper::count() $attr = AssetAttributeMapper::count()
->with('type') ->with('type')
->where('type/id', (int) $request->getData('type')) ->where('type/id', $type->id)
->where('ref', (int) $request->getData('ref')) ->where('ref', (int) $request->getData('ref'))
->execute(); ->execute();
@ -164,13 +167,20 @@ final class ApiAssetAttributeController extends Controller
->where('id', $request->getDataInt('type') ?? 0) ->where('id', $request->getDataInt('type') ?? 0)
->execute(); ->execute();
if ($type->isInternal) {
$response->header->status = RequestStatusCode::R_403;
$this->createInvalidCreateResponse($request, $response, $val);
return;
}
$attrValue = $this->createAttributeValueFromRequest($request, $type); $attrValue = $this->createAttributeValueFromRequest($request, $type);
$this->createModel($request->header->account, $attrValue, AssetAttributeValueMapper::class, 'attr_value', $request->getOrigin()); $this->createModel($request->header->account, $attrValue, AssetAttributeValueMapper::class, 'attr_value', $request->getOrigin());
if ($attrValue->isDefault) { if ($attrValue->isDefault) {
$this->createModelRelation( $this->createModelRelation(
$request->header->account, $request->header->account,
(int) $request->getData('type'), $type->id,
$attrValue->id, $attrValue->id,
AssetAttributeTypeMapper::class, 'defaults', '', $request->getOrigin() AssetAttributeTypeMapper::class, 'defaults', '', $request->getOrigin()
); );

View File

@ -92,7 +92,7 @@ final class ApiAssetController extends Controller
$asset->name = $request->getDataString('name') ?? ''; $asset->name = $request->getDataString('name') ?? '';
$asset->info = $request->getDataString('info') ?? ''; $asset->info = $request->getDataString('info') ?? '';
$asset->type = new NullBaseStringL11nType((int) ($request->getDataInt('type') ?? 0)); $asset->type = new NullBaseStringL11nType((int) ($request->getDataInt('type') ?? 0));
$asset->status = $request->getDataInt('status') ?? AssetStatus::INACTIVE; $asset->status = AssetStatus::tryFromValue($request->getDataInt('status')) ?? AssetStatus::INACTIVE;
$asset->unit = $request->getDataInt('unit') ?? $this->app->unitId; $asset->unit = $request->getDataInt('unit') ?? $this->app->unitId;
return $asset; return $asset;
@ -101,8 +101,8 @@ final class ApiAssetController extends Controller
/** /**
* Create media files for asset * Create media files for asset
* *
* @param Asset $asset Asset * @param Asset $asset Asset
* @param RequestAbstract $request Request incl. media do upload * @param RequestAbstract $request Request incl. media do upload
* *
* @return void * @return void
* *
@ -256,7 +256,7 @@ final class ApiAssetController extends Controller
/** @var \Modules\AssetManagement\Models\Asset $asset */ /** @var \Modules\AssetManagement\Models\Asset $asset */
$asset = AssetMapper::get()->where('id', (int) $request->getData('asset'))->execute(); $asset = AssetMapper::get()->where('id', (int) $request->getData('asset'))->execute();
$path = $this->createAssetDir($asset); $path = $this->createAssetDir($asset);
$uploaded = []; $uploaded = [];
if (!empty($uploadedFiles = $request->files)) { if (!empty($uploadedFiles = $request->files)) {
@ -487,7 +487,7 @@ final class ApiAssetController extends Controller
* Method to update Asset from request. * Method to update Asset from request.
* *
* @param RequestAbstract $request Request * @param RequestAbstract $request Request
* @param Asset $new Model to modify * @param Asset $new Model to modify
* *
* @return Asset * @return Asset
* *
@ -500,7 +500,7 @@ final class ApiAssetController extends Controller
$new->name = $request->getDataString('name') ?? $new->name; $new->name = $request->getDataString('name') ?? $new->name;
$new->info = $request->getDataString('info') ?? $new->info; $new->info = $request->getDataString('info') ?? $new->info;
$new->type = $request->hasData('type') ? new NullBaseStringL11nType((int) ($request->getDataInt('type') ?? 0)) : $new->type; $new->type = $request->hasData('type') ? new NullBaseStringL11nType((int) ($request->getDataInt('type') ?? 0)) : $new->type;
$new->status = $request->getDataInt('status') ?? $new->status; $new->status = AssetStatus::tryFromValue($request->getDataInt('status')) ?? $new->status;
$new->unit = $request->getDataInt('unit') ?? $this->app->unitId; $new->unit = $request->getDataInt('unit') ?? $this->app->unitId;
return $new; return $new;

View File

@ -74,9 +74,12 @@ final class ApiAssetTypeController extends Controller
private function createAssetTypeFromRequest(RequestAbstract $request) : AssetType private function createAssetTypeFromRequest(RequestAbstract $request) : AssetType
{ {
$assetType = new AssetType(); $assetType = new AssetType();
$assetType->setL11n($request->getDataString('title') ?? '', $request->getDataString('language') ?? ISO639x1Enum::_EN); $assetType->setL11n(
$request->getDataString('title') ?? '',
ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? ISO639x1Enum::_EN
);
$assetType->depreciationDuration = $request->getDataInt('duration') ?? 0; $assetType->depreciationDuration = $request->getDataInt('duration') ?? 0;
$assetType->industry = $request->getDataInt('industry') ?? 0; $assetType->industry = $request->getDataInt('industry') ?? 0;
return $assetType; return $assetType;
} }
@ -139,12 +142,10 @@ final class ApiAssetTypeController extends Controller
*/ */
private function createAssetTypeL11nFromRequest(RequestAbstract $request) : BaseStringL11n private function createAssetTypeL11nFromRequest(RequestAbstract $request) : BaseStringL11n
{ {
$assetTypeL11n = new BaseStringL11n(); $assetTypeL11n = new BaseStringL11n();
$assetTypeL11n->ref = $request->getDataInt('type') ?? 0; $assetTypeL11n->ref = $request->getDataInt('type') ?? 0;
$assetTypeL11n->setLanguage( $assetTypeL11n->language = ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? $request->header->l11n->language;
$request->getDataString('language') ?? $request->header->l11n->language $assetTypeL11n->content = $request->getDataString('title') ?? '';
);
$assetTypeL11n->content = $request->getDataString('title') ?? '';
return $assetTypeL11n; return $assetTypeL11n;
} }
@ -329,10 +330,8 @@ final class ApiAssetTypeController extends Controller
*/ */
public function updateAssetTypeL11nFromRequest(RequestAbstract $request, BaseStringL11n $new) : BaseStringL11n public function updateAssetTypeL11nFromRequest(RequestAbstract $request, BaseStringL11n $new) : BaseStringL11n
{ {
$new->setLanguage( $new->language = ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? $new->language;
$request->getDataString('language') ?? $new->language $new->content = $request->getDataString('title') ?? $new->content;
);
$new->content = $request->getDataString('title') ?? $new->content;
return $new; return $new;
} }

View File

@ -14,8 +14,6 @@ declare(strict_types=1);
namespace Modules\AssetManagement\Controller; namespace Modules\AssetManagement\Controller;
use Modules\Admin\Models\LocalizationMapper;
use Modules\Admin\Models\SettingsEnum;
use Modules\AssetManagement\Models\AssetMapper; use Modules\AssetManagement\Models\AssetMapper;
use Modules\AssetManagement\Models\AssetTypeMapper; use Modules\AssetManagement\Models\AssetTypeMapper;
use Modules\AssetManagement\Models\Attribute\AssetAttributeTypeL11nMapper; use Modules\AssetManagement\Models\Attribute\AssetAttributeTypeL11nMapper;
@ -84,7 +82,7 @@ final class BackendController extends Controller
public function viewAssetManagementAttributeType(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface public function viewAssetManagementAttributeType(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
{ {
$view = new View($this->app->l11nManager, $request, $response); $view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/AssetManagement/Theme/Backend/asset-profile'); $view->setTemplate('/Modules/AssetManagement/Theme/Backend/asset-view');
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1006601001, $request, $response); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1006601001, $request, $response);
/** @var \Modules\Attribute\Models\AttributeType $attribute */ /** @var \Modules\Attribute\Models\AttributeType $attribute */
@ -116,19 +114,19 @@ final class BackendController extends Controller
* @since 1.0.0 * @since 1.0.0
* @codeCoverageIgnore * @codeCoverageIgnore
*/ */
public function viewAssetManagementAssetProfile(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface public function viewAssetManagementAssetView(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
{ {
$view = new View($this->app->l11nManager, $request, $response); $view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/AssetManagement/Theme/Backend/asset-profile'); $view->setTemplate('/Modules/AssetManagement/Theme/Backend/asset-view');
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1008402001, $request, $response); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1008402001, $request, $response);
// @todo This langauge filtering doesn't work. But it was working with the old mappers. Maybe there is a bug in the where() definition. Need to inspect the actual query.
$asset = AssetMapper::get() $asset = AssetMapper::get()
->with('attributes') ->with('attributes')
->with('attributes/type') ->with('attributes/type')
->with('attributes/value') ->with('attributes/value')
->with('attributes/type/l11n') ->with('attributes/type/l11n')
//->with('attributes/value/l11n')
->with('files') ->with('files')
->with('files/types') ->with('files/types')
->with('type') ->with('type')
@ -136,6 +134,7 @@ final class BackendController extends Controller
->where('id', (int) $request->getData('id')) ->where('id', (int) $request->getData('id'))
->where('type/l11n/language', $response->header->l11n->language) ->where('type/l11n/language', $response->header->l11n->language)
->where('attributes/type/l11n/language', $response->header->l11n->language) ->where('attributes/type/l11n/language', $response->header->l11n->language)
//->where('attributes/value/l11n/language', $response->header->l11n->language)
->execute(); ->execute();
$view->data['asset'] = $asset; $view->data['asset'] = $asset;
@ -174,14 +173,11 @@ final class BackendController extends Controller
$view->data['units'] = $units; $view->data['units'] = $units;
/** @var \Model\Setting $settings */ $view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response);
$settings = $this->app->appSettings->get(null, SettingsEnum::DEFAULT_LOCALIZATION); $view->data['attributeView']->data['default_localization'] = $this->app->l11nServer;
$view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response); $view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
$view->data['attributeView']->data['default_localization'] = LocalizationMapper::get()->where('id', (int) $settings->id)->execute(); $view->data['asset-notes'] = new \Modules\Editor\Theme\Backend\Components\Compound\BaseView($this->app->l11nManager, $request, $response);
$view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
$view->data['asset-notes'] = new \Modules\Editor\Theme\Backend\Components\Compound\BaseView($this->app->l11nManager, $request, $response);
return $view; return $view;
} }

View File

@ -61,7 +61,7 @@ class Asset implements \JsonSerializable
public function toArray() : array public function toArray() : array
{ {
return [ return [
'id' => $this->id, 'id' => $this->id,
]; ];
} }

View File

@ -14,8 +14,8 @@ declare(strict_types=1);
namespace Modules\AssetManagement\Models; namespace Modules\AssetManagement\Models;
use Modules\Editor\Models\EditorDocMapper;
use Modules\AssetManagement\Models\Attribute\AssetAttributeMapper; use Modules\AssetManagement\Models\Attribute\AssetAttributeMapper;
use Modules\Editor\Models\EditorDocMapper;
use Modules\Media\Models\MediaMapper; use Modules\Media\Models\MediaMapper;
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
@ -39,15 +39,15 @@ final class AssetMapper extends DataMapperFactory
* @since 1.0.0 * @since 1.0.0
*/ */
public const COLUMNS = [ public const COLUMNS = [
'assetmgmt_asset_id' => ['name' => 'assetmgmt_asset_id', 'type' => 'int', 'internal' => 'id'], 'assetmgmt_asset_id' => ['name' => 'assetmgmt_asset_id', 'type' => 'int', 'internal' => 'id'],
'assetmgmt_asset_name' => ['name' => 'assetmgmt_asset_name', 'type' => 'string', 'internal' => 'name'], 'assetmgmt_asset_name' => ['name' => 'assetmgmt_asset_name', 'type' => 'string', 'internal' => 'name'],
'assetmgmt_asset_number' => ['name' => 'assetmgmt_asset_number', 'type' => 'string', 'internal' => 'number'], 'assetmgmt_asset_number' => ['name' => 'assetmgmt_asset_number', 'type' => 'string', 'internal' => 'number'],
'assetmgmt_asset_status' => ['name' => 'assetmgmt_asset_status', 'type' => 'int', 'internal' => 'status'], 'assetmgmt_asset_status' => ['name' => 'assetmgmt_asset_status', 'type' => 'int', 'internal' => 'status'],
'assetmgmt_asset_info' => ['name' => 'assetmgmt_asset_info', 'type' => 'string', 'internal' => 'info'], 'assetmgmt_asset_info' => ['name' => 'assetmgmt_asset_info', 'type' => 'string', 'internal' => 'info'],
'assetmgmt_asset_unit' => ['name' => 'assetmgmt_asset_unit', 'type' => 'int', 'internal' => 'unit'], 'assetmgmt_asset_unit' => ['name' => 'assetmgmt_asset_unit', 'type' => 'int', 'internal' => 'unit'],
'assetmgmt_asset_type' => ['name' => 'assetmgmt_asset_type', 'type' => 'int', 'internal' => 'type'], 'assetmgmt_asset_type' => ['name' => 'assetmgmt_asset_type', 'type' => 'int', 'internal' => 'type'],
'assetmgmt_asset_responsible' => ['name' => 'assetmgmt_asset_responsible', 'type' => 'int', 'internal' => 'responsible'], 'assetmgmt_asset_responsible' => ['name' => 'assetmgmt_asset_responsible', 'type' => 'int', 'internal' => 'responsible'],
'assetmgmt_asset_created_at' => ['name' => 'assetmgmt_asset_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true], 'assetmgmt_asset_created_at' => ['name' => 'assetmgmt_asset_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
]; ];
/** /**
@ -57,7 +57,7 @@ final class AssetMapper extends DataMapperFactory
* @since 1.0.0 * @since 1.0.0
*/ */
public const HAS_MANY = [ public const HAS_MANY = [
'files' => [ 'files' => [
'mapper' => MediaMapper::class, 'mapper' => MediaMapper::class,
'table' => 'assetmgmt_asset_media', 'table' => 'assetmgmt_asset_media',
'external' => 'assetmgmt_asset_media_media', 'external' => 'assetmgmt_asset_media_media',
@ -85,8 +85,8 @@ final class AssetMapper extends DataMapperFactory
*/ */
public const OWNS_ONE = [ public const OWNS_ONE = [
'type' => [ 'type' => [
'mapper' => AssetTypeMapper::class, 'mapper' => AssetTypeMapper::class,
'external' => 'assetmgmt_asset_type', 'external' => 'assetmgmt_asset_type',
], ],
]; ];

View File

@ -18,7 +18,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
use phpOMS\Localization\BaseStringL11n; use phpOMS\Localization\BaseStringL11n;
/** /**
* mapper class. * Asset type l11n mapper class.
* *
* @package Modules\AssetManagement\Models * @package Modules\AssetManagement\Models
* @license OMS License 2.0 * @license OMS License 2.0

View File

@ -35,10 +35,10 @@ final class AssetTypeMapper extends DataMapperFactory
* @since 1.0.0 * @since 1.0.0
*/ */
public const COLUMNS = [ public const COLUMNS = [
'assetmgmt_asset_type_id' => ['name' => 'assetmgmt_asset_type_id', 'type' => 'int', 'internal' => 'id'], 'assetmgmt_asset_type_id' => ['name' => 'assetmgmt_asset_type_id', 'type' => 'int', 'internal' => 'id'],
'assetmgmt_asset_type_name' => ['name' => 'assetmgmt_asset_type_name', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true], 'assetmgmt_asset_type_name' => ['name' => 'assetmgmt_asset_type_name', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true],
'assetmgmt_asset_type_depreciation_duration' => ['name' => 'assetmgmt_asset_type_depreciation_duration', 'type' => 'int', 'internal' => 'depreciationDuration'], 'assetmgmt_asset_type_depreciation_duration' => ['name' => 'assetmgmt_asset_type_depreciation_duration', 'type' => 'int', 'internal' => 'depreciationDuration'],
'assetmgmt_asset_type_industry' => ['name' => 'assetmgmt_asset_type_industry', 'type' => 'int', 'internal' => 'industry'], 'assetmgmt_asset_type_industry' => ['name' => 'assetmgmt_asset_type_industry', 'type' => 'int', 'internal' => 'industry'],
]; ];

View File

@ -37,10 +37,10 @@ final class AssetAttributeMapper extends DataMapperFactory
* @since 1.0.0 * @since 1.0.0
*/ */
public const COLUMNS = [ public const COLUMNS = [
'assetmgmt_asset_attr_id' => ['name' => 'assetmgmt_asset_attr_id', 'type' => 'int', 'internal' => 'id'], 'assetmgmt_asset_attr_id' => ['name' => 'assetmgmt_asset_attr_id', 'type' => 'int', 'internal' => 'id'],
'assetmgmt_asset_attr_asset' => ['name' => 'assetmgmt_asset_attr_asset', 'type' => 'int', 'internal' => 'ref'], 'assetmgmt_asset_attr_asset' => ['name' => 'assetmgmt_asset_attr_asset', 'type' => 'int', 'internal' => 'ref'],
'assetmgmt_asset_attr_type' => ['name' => 'assetmgmt_asset_attr_type', 'type' => 'int', 'internal' => 'type'], 'assetmgmt_asset_attr_type' => ['name' => 'assetmgmt_asset_attr_type', 'type' => 'int', 'internal' => 'type'],
'assetmgmt_asset_attr_value' => ['name' => 'assetmgmt_asset_attr_value', 'type' => 'int', 'internal' => 'value'], 'assetmgmt_asset_attr_value' => ['name' => 'assetmgmt_asset_attr_value', 'type' => 'int', 'internal' => 'value'],
]; ];
/** /**

View File

@ -42,7 +42,8 @@ final class AssetAttributeTypeMapper extends DataMapperFactory
'assetmgmt_attr_type_datatype' => ['name' => 'assetmgmt_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'], 'assetmgmt_attr_type_datatype' => ['name' => 'assetmgmt_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'],
'assetmgmt_attr_type_fields' => ['name' => 'assetmgmt_attr_type_fields', 'type' => 'int', 'internal' => 'fields'], 'assetmgmt_attr_type_fields' => ['name' => 'assetmgmt_attr_type_fields', 'type' => 'int', 'internal' => 'fields'],
'assetmgmt_attr_type_custom' => ['name' => 'assetmgmt_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'], 'assetmgmt_attr_type_custom' => ['name' => 'assetmgmt_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'],
'assetmgmt_attr_type_repeatable' => ['name' => 'assetmgmt_attr_type_repeatable', 'type' => 'bool', 'internal' => 'repeatable'], 'assetmgmt_attr_type_repeatable' => ['name' => 'assetmgmt_attr_type_repeatable', 'type' => 'bool', 'internal' => 'repeatable'],
'assetmgmt_attr_type_internal' => ['name' => 'assetmgmt_attr_type_internal', 'type' => 'bool', 'internal' => 'isInternal'],
'assetmgmt_attr_type_pattern' => ['name' => 'assetmgmt_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'], 'assetmgmt_attr_type_pattern' => ['name' => 'assetmgmt_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'],
'assetmgmt_attr_type_required' => ['name' => 'assetmgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'], 'assetmgmt_attr_type_required' => ['name' => 'assetmgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'],
]; ];

View File

@ -37,10 +37,10 @@ final class AssetAttributeValueL11nMapper extends DataMapperFactory
* @since 1.0.0 * @since 1.0.0
*/ */
public const COLUMNS = [ public const COLUMNS = [
'assetmgmt_attr_value_l11n_id' => ['name' => 'assetmgmt_attr_value_l11n_id', 'type' => 'int', 'internal' => 'id'], 'assetmgmt_attr_value_l11n_id' => ['name' => 'assetmgmt_attr_value_l11n_id', 'type' => 'int', 'internal' => 'id'],
'assetmgmt_attr_value_l11n_title' => ['name' => 'assetmgmt_attr_value_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true], 'assetmgmt_attr_value_l11n_title' => ['name' => 'assetmgmt_attr_value_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
'assetmgmt_attr_value_l11n_value' => ['name' => 'assetmgmt_attr_value_l11n_value', 'type' => 'int', 'internal' => 'ref'], 'assetmgmt_attr_value_l11n_value' => ['name' => 'assetmgmt_attr_value_l11n_value', 'type' => 'int', 'internal' => 'ref'],
'assetmgmt_attr_value_l11n_lang' => ['name' => 'assetmgmt_attr_value_l11n_lang', 'type' => 'string', 'internal' => 'language'], 'assetmgmt_attr_value_l11n_lang' => ['name' => 'assetmgmt_attr_value_l11n_lang', 'type' => 'string', 'internal' => 'language'],
]; ];
/** /**

View File

@ -37,15 +37,15 @@ final class AssetAttributeValueMapper extends DataMapperFactory
* @since 1.0.0 * @since 1.0.0
*/ */
public const COLUMNS = [ public const COLUMNS = [
'assetmgmt_attr_value_id' => ['name' => 'assetmgmt_attr_value_id', 'type' => 'int', 'internal' => 'id'], 'assetmgmt_attr_value_id' => ['name' => 'assetmgmt_attr_value_id', 'type' => 'int', 'internal' => 'id'],
'assetmgmt_attr_value_default' => ['name' => 'assetmgmt_attr_value_default', 'type' => 'bool', 'internal' => 'isDefault'], 'assetmgmt_attr_value_default' => ['name' => 'assetmgmt_attr_value_default', 'type' => 'bool', 'internal' => 'isDefault'],
'assetmgmt_attr_value_valueStr' => ['name' => 'assetmgmt_attr_value_valueStr', 'type' => 'string', 'internal' => 'valueStr'], 'assetmgmt_attr_value_valueStr' => ['name' => 'assetmgmt_attr_value_valueStr', 'type' => 'string', 'internal' => 'valueStr'],
'assetmgmt_attr_value_valueInt' => ['name' => 'assetmgmt_attr_value_valueInt', 'type' => 'int', 'internal' => 'valueInt'], 'assetmgmt_attr_value_valueInt' => ['name' => 'assetmgmt_attr_value_valueInt', 'type' => 'int', 'internal' => 'valueInt'],
'assetmgmt_attr_value_valueDec' => ['name' => 'assetmgmt_attr_value_valueDec', 'type' => 'float', 'internal' => 'valueDec'], 'assetmgmt_attr_value_valueDec' => ['name' => 'assetmgmt_attr_value_valueDec', 'type' => 'float', 'internal' => 'valueDec'],
'assetmgmt_attr_value_valueDat' => ['name' => 'assetmgmt_attr_value_valueDat', 'type' => 'DateTime', 'internal' => 'valueDat'], 'assetmgmt_attr_value_valueDat' => ['name' => 'assetmgmt_attr_value_valueDat', 'type' => 'DateTime', 'internal' => 'valueDat'],
'assetmgmt_attr_value_unit' => ['name' => 'assetmgmt_attr_value_unit', 'type' => 'string', 'internal' => 'unit'], 'assetmgmt_attr_value_unit' => ['name' => 'assetmgmt_attr_value_unit', 'type' => 'string', 'internal' => 'unit'],
'assetmgmt_attr_value_deptype' => ['name' => 'assetmgmt_attr_value_deptype', 'type' => 'int', 'internal' => 'dependingAttributeType'], 'assetmgmt_attr_value_deptype' => ['name' => 'assetmgmt_attr_value_deptype', 'type' => 'int', 'internal' => 'dependingAttributeType'],
'assetmgmt_attr_value_depvalue' => ['name' => 'assetmgmt_attr_value_depvalue', 'type' => 'int', 'internal' => 'dependingAttributeValue'], 'assetmgmt_attr_value_depvalue' => ['name' => 'assetmgmt_attr_value_depvalue', 'type' => 'int', 'internal' => 'dependingAttributeValue'],
]; ];
/** /**

View File

@ -15,5 +15,5 @@ declare(strict_types=1);
return ['Navigation' => [ return ['Navigation' => [
'Assets' => 'Anlagegüter', 'Assets' => 'Anlagegüter',
'Dashboard' => 'Dashboard', 'Dashboard' => 'Dashboard',
'Table' => 'Tabelle', 'Table' => 'Tabelle',
]]; ]];

View File

@ -15,5 +15,5 @@ declare(strict_types=1);
return ['Navigation' => [ return ['Navigation' => [
'Assets' => 'Assets', 'Assets' => 'Assets',
'Dashboard' => 'Dashboard', 'Dashboard' => 'Dashboard',
'Table' => 'Table', 'Table' => 'Table',
]]; ]];

View File

@ -13,12 +13,12 @@
declare(strict_types=1); declare(strict_types=1);
return ['AssetManagement' => [ return ['AssetManagement' => [
'Assets' => 'Assets', 'Assets' => 'Assets',
'Status' => 'Status', 'Status' => 'Status',
'Name' => 'Name', 'Name' => 'Name',
'Type' => 'Type', 'Type' => 'Type',
':status1' => 'Active', ':status1' => 'Active',
':status2' => 'Inactive', ':status2' => 'Inactive',
':status3' => 'Damaged', ':status3' => 'Damaged',
':status4' => 'Out of order', ':status4' => 'Out of order',
]]; ]];

View File

@ -24,53 +24,53 @@ echo $this->data['nav']->render(); ?>
<section class="portlet"> <section class="portlet">
<div class="portlet-head"><?= $this->getHtml('Assets'); ?><i class="g-icon download btn end-xs">download</i></div> <div class="portlet-head"><?= $this->getHtml('Assets'); ?><i class="g-icon download btn end-xs">download</i></div>
<div class="slider"> <div class="slider">
<table id="iSalesClientList" class="default sticky"> <table id="iAssetList" class="default sticky">
<thead> <thead>
<tr> <tr>
<td> <td>
<td><?= $this->getHtml('ID', '0', '0'); ?> <td><?= $this->getHtml('ID', '0', '0'); ?>
<label for="iSalesClientList-sort-1"> <label for="iAssetList-sort-1">
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-1"> <input type="radio" name="iAssetList-sort" id="iAssetList-sort-1">
<i class="sort-asc g-icon">expand_less</i> <i class="sort-asc g-icon">expand_less</i>
</label> </label>
<label for="iSalesClientList-sort-2"> <label for="iAssetList-sort-2">
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-2"> <input type="radio" name="iAssetList-sort" id="iAssetList-sort-2">
<i class="sort-desc g-icon">expand_more</i> <i class="sort-desc g-icon">expand_more</i>
</label> </label>
<label> <label>
<i class="filter g-icon">filter_alt</i> <i class="filter g-icon">filter_alt</i>
</label> </label>
<td><?= $this->getHtml('Status'); ?> <td><?= $this->getHtml('Status'); ?>
<label for="iSalesClientList-sort-3"> <label for="iAssetList-sort-3">
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-3"> <input type="radio" name="iAssetList-sort" id="iAssetList-sort-3">
<i class="sort-asc g-icon">expand_less</i> <i class="sort-asc g-icon">expand_less</i>
</label> </label>
<label for="iSalesClientList-sort-4"> <label for="iAssetList-sort-4">
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-4"> <input type="radio" name="iAssetList-sort" id="iAssetList-sort-4">
<i class="sort-desc g-icon">expand_more</i> <i class="sort-desc g-icon">expand_more</i>
</label> </label>
<label> <label>
<i class="filter g-icon">filter_alt</i> <i class="filter g-icon">filter_alt</i>
</label> </label>
<td class="wf-100"><?= $this->getHtml('Name'); ?> <td class="wf-100"><?= $this->getHtml('Name'); ?>
<label for="iSalesClientList-sort-5"> <label for="iAssetList-sort-5">
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-5"> <input type="radio" name="iAssetList-sort" id="iAssetList-sort-5">
<i class="sort-asc g-icon">expand_less</i> <i class="sort-asc g-icon">expand_less</i>
</label> </label>
<label for="iSalesClientList-sort-6"> <label for="iAssetList-sort-6">
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-6"> <input type="radio" name="iAssetList-sort" id="iAssetList-sort-6">
<i class="sort-desc g-icon">expand_more</i> <i class="sort-desc g-icon">expand_more</i>
</label> </label>
<label> <label>
<i class="filter g-icon">filter_alt</i> <i class="filter g-icon">filter_alt</i>
</label> </label>
<td><?= $this->getHtml('Type'); ?> <td><?= $this->getHtml('Type'); ?>
<label for="iSalesClientList-sort-7"> <label for="iAssetList-sort-7">
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-7"> <input type="radio" name="iAssetList-sort" id="iAssetList-sort-7">
<i class="sort-asc g-icon">expand_less</i> <i class="sort-asc g-icon">expand_less</i>
</label> </label>
<label for="iSalesClientList-sort-8"> <label for="iAssetList-sort-8">
<input type="radio" name="iSalesClientList-sort" id="iSalesClientList-sort-8"> <input type="radio" name="iAssetList-sort" id="iAssetList-sort-8">
<i class="sort-desc g-icon">expand_more</i> <i class="sort-desc g-icon">expand_more</i>
</label> </label>
<label> <label>
@ -81,7 +81,7 @@ echo $this->data['nav']->render(); ?>
$count = 0; $count = 0;
foreach ($assets as $key => $value) : foreach ($assets as $key => $value) :
++$count; ++$count;
$url = UriFactory::build('{/base}/accounting/asset/profile?{?}&id=' . $value->id); $url = UriFactory::build('{/base}/accounting/asset/view?{?}&id=' . $value->id);
?> ?>
<tr data-href="<?= $url; ?>"> <tr data-href="<?= $url; ?>">
<td> <td>

View File

@ -17,18 +17,16 @@ use Modules\AssetManagement\Models\NullAsset;
use Modules\Media\Models\NullMedia; use Modules\Media\Models\NullMedia;
use phpOMS\Uri\UriFactory; use phpOMS\Uri\UriFactory;
$countryCodes = \phpOMS\Localization\ISO3166TwoEnum::getConstants(); $countryCodes = \phpOMS\Localization\ISO3166TwoEnum::getConstants();
$countries = \phpOMS\Localization\ISO3166NameEnum::getConstants(); $countries = \phpOMS\Localization\ISO3166NameEnum::getConstants();
$assetStatus = AssetStatus::getConstants(); $assetStatus = AssetStatus::getConstants();
/** /**
* @var \Modules\AssetManagement\Models\Asset $asset * @var \Modules\AssetManagement\Models\Asset $asset
*/ */
$asset = $this->data['asset'] ?? new NullAsset(); $asset = $this->data['asset'] ?? new NullAsset();
$files = $asset->files; $assetImage = $this->data['assetImage'] ?? new NullMedia();
$assetImage = $this->data['assetImage'] ?? new NullMedia(); $assetTypes = $this->data['types'] ?? [];
$assetTypes = $this->data['types'] ?? [];
$attributeView = $this->data['attributeView'];
/** /**
* @var \phpOMS\Views\View $this * @var \phpOMS\Views\View $this
@ -142,7 +140,7 @@ echo $this->data['nav']->render();
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>> <input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<div class="row"> <div class="row">
<?= $attributeView->render( <?= $this->data['attributeView']->render(
$asset->attributes, $asset->attributes,
$this->data['attributeTypes'] ?? [], $this->data['attributeTypes'] ?? [],
$this->data['units'] ?? [], $this->data['units'] ?? [],

View File

@ -75,8 +75,8 @@ final class Autoloader
*/ */
public static function defaultAutoloader(string $class) : void public static function defaultAutoloader(string $class) : void
{ {
$class = \ltrim($class, '\\'); $class = \ltrim($class, '\\');
$class = \strtr($class, '_\\', '//'); $class = \strtr($class, '_\\', '//');
if (\stripos($class, 'Web/Backend') !== false || \stripos($class, 'Web/Api') !== false) { if (\stripos($class, 'Web/Backend') !== false || \stripos($class, 'Web/Api') !== false) {
$class = \is_dir(__DIR__ . '/Web') ? $class : \str_replace('Web/', 'MainRepository/Web/', $class); $class = \is_dir(__DIR__ . '/Web') ? $class : \str_replace('Web/', 'MainRepository/Web/', $class);

View File

@ -1,4 +1,15 @@
<?php <?php
/**
* Jingga
*
* PHP Version 8.1
*
* @package Modules\AssetManagement\tests
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1); declare(strict_types=1);
\ini_set('memory_limit', '2048M'); \ini_set('memory_limit', '2048M');
@ -67,10 +78,10 @@ $GLOBALS['is_github'] = $IS_GITHUB;
$tmp = FileLogger::getInstance(__DIR__ . '/../Logs'); $tmp = FileLogger::getInstance(__DIR__ . '/../Logs');
$CONFIG = [ $CONFIG = [
'db' => [ 'db' => [
'core' => [ 'core' => [
'masters' => [ 'masters' => [
'admin' => [ 'admin' => [
'db' => 'mysql', /* db type */ 'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */ 'port' => '3306', /* db host port */
@ -80,7 +91,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'insert' => [ 'insert' => [
'db' => 'mysql', /* db type */ 'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */ 'port' => '3306', /* db host port */
@ -90,7 +101,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'select' => [ 'select' => [
'db' => 'mysql', /* db type */ 'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */ 'port' => '3306', /* db host port */
@ -100,7 +111,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'update' => [ 'update' => [
'db' => 'mysql', /* db type */ 'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */ 'port' => '3306', /* db host port */
@ -110,7 +121,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'delete' => [ 'delete' => [
'db' => 'mysql', /* db type */ 'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */ 'port' => '3306', /* db host port */
@ -120,7 +131,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'schema' => [ 'schema' => [
'db' => 'mysql', /* db type */ 'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */ 'port' => '3306', /* db host port */
@ -132,7 +143,7 @@ $CONFIG = [
], ],
], ],
'postgresql' => [ 'postgresql' => [
'admin' => [ 'admin' => [
'db' => 'pgsql', /* db type */ 'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */ 'port' => '5432', /* db host port */
@ -142,7 +153,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'insert' => [ 'insert' => [
'db' => 'pgsql', /* db type */ 'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */ 'port' => '5432', /* db host port */
@ -152,7 +163,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'select' => [ 'select' => [
'db' => 'pgsql', /* db type */ 'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */ 'port' => '5432', /* db host port */
@ -162,7 +173,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'update' => [ 'update' => [
'db' => 'pgsql', /* db type */ 'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */ 'port' => '5432', /* db host port */
@ -172,7 +183,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'delete' => [ 'delete' => [
'db' => 'pgsql', /* db type */ 'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */ 'port' => '5432', /* db host port */
@ -182,7 +193,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'schema' => [ 'schema' => [
'db' => 'pgsql', /* db type */ 'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */ 'port' => '5432', /* db host port */
@ -194,37 +205,37 @@ $CONFIG = [
], ],
], ],
'sqlite' => [ 'sqlite' => [
'admin' => [ 'admin' => [
'db' => 'sqlite', /* db type */ 'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */ 'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'insert' => [ 'insert' => [
'db' => 'sqlite', /* db type */ 'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */ 'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'select' => [ 'select' => [
'db' => 'sqlite', /* db type */ 'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */ 'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'update' => [ 'update' => [
'db' => 'sqlite', /* db type */ 'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */ 'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'delete' => [ 'delete' => [
'db' => 'sqlite', /* db type */ 'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */ 'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'schema' => [ 'schema' => [
'db' => 'sqlite', /* db type */ 'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */ 'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
@ -232,7 +243,7 @@ $CONFIG = [
], ],
], ],
'mssql' => [ 'mssql' => [
'admin' => [ 'admin' => [
'db' => 'mssql', /* db type */ 'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */ 'port' => '1433', /* db host port */
@ -242,7 +253,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'insert' => [ 'insert' => [
'db' => 'mssql', /* db type */ 'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */ 'port' => '1433', /* db host port */
@ -252,7 +263,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'select' => [ 'select' => [
'db' => 'mssql', /* db type */ 'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */ 'port' => '1433', /* db host port */
@ -262,7 +273,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'update' => [ 'update' => [
'db' => 'mssql', /* db type */ 'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */ 'port' => '1433', /* db host port */
@ -272,7 +283,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'delete' => [ 'delete' => [
'db' => 'mssql', /* db type */ 'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */ 'port' => '1433', /* db host port */
@ -282,7 +293,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'schema' => [ 'schema' => [
'db' => 'mssql', /* db type */ 'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */ 'port' => '1433', /* db host port */
@ -322,16 +333,16 @@ $CONFIG = [
'password' => '123456', 'password' => '123456',
], ],
], ],
'log' => [ 'log' => [
'file' => [ 'file' => [
'path' => __DIR__ . '/Logs', 'path' => __DIR__ . '/Logs',
], ],
], ],
'page' => [ 'page' => [
'root' => '/', 'root' => '/',
'https' => false, 'https' => false,
], ],
'app' => [ 'app' => [
'path' => __DIR__, 'path' => __DIR__,
'default' => [ 'default' => [
'app' => 'Backend', 'app' => 'Backend',
@ -350,7 +361,7 @@ $CONFIG = [
], ],
], ],
], ],
'socket' => [ 'socket' => [
'master' => [ 'master' => [
'host' => '127.0.0.1', 'host' => '127.0.0.1',
'limit' => 300, 'limit' => 300,
@ -360,7 +371,7 @@ $CONFIG = [
'language' => [ 'language' => [
'en', 'en',
], ],
'apis' => [ 'apis' => [
], ],
]; ];