auto fixes + some impl.

This commit is contained in:
Dennis Eichhorn 2024-01-26 22:53:59 +00:00
parent e83bfffc2f
commit 8106743eec
44 changed files with 525 additions and 506 deletions

View File

@ -248,6 +248,11 @@
"type": "TINYINT(1)",
"null": false
},
"contractmgmt_attr_type_internal": {
"name": "contractmgmt_attr_type_internal",
"type": "TINYINT(1)",
"null": false
},
"contractmgmt_attr_type_required": {
"description": "Every contract must have this attribute type if set to true.",
"name": "contractmgmt_attr_type_required",

View File

@ -20,7 +20,6 @@ use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse;
use phpOMS\Module\InstallerAbstract;
use phpOMS\Module\ModuleInfo;
use phpOMS\Uri\HttpUri;
/**
* Installer class.
@ -81,7 +80,7 @@ final class Installer extends InstallerAbstract
foreach ($types as $type) {
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('name', $type['name'] ?? '');
@ -109,7 +108,7 @@ final class Installer extends InstallerAbstract
}
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('title', $l11n);

View File

@ -18,7 +18,7 @@ use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
'^.*/contract/type.*$' => [
'^.*/contract/type(\?.*$|$)' => [
[
'dest' => '\Modules\ContractManagement\Controller\ApiContractTypeController:apiContractTypeCreate',
'verb' => RouteVerb::PUT,
@ -60,7 +60,7 @@ return [
],
],
'^.*/contract/attribute.*$' => [
'^.*/contract/attribute(\?.*$|$)' => [
[
'dest' => '\Modules\ContractManagement\Controller\ApiAttributeController:apiContractAttributeCreate',
'verb' => RouteVerb::PUT,

View File

@ -18,7 +18,7 @@ use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
'^.*/contract/list.*$' => [
'^.*/contract/list(\?.*$|$)' => [
[
'dest' => '\Modules\ContractManagement\Controller\BackendController:viewContractList',
'verb' => RouteVerb::GET,
@ -29,7 +29,7 @@ return [
],
],
],
'^.*/contract/single.*$' => [
'^.*/contract/view(\?.*$|$)' => [
[
'dest' => '\Modules\ContractManagement\Controller\BackendController:viewContract',
'verb' => RouteVerb::GET,
@ -40,7 +40,7 @@ return [
],
],
],
'^.*/contract/type/list.*$' => [
'^.*/contract/type/list(\?.*$|$)' => [
[
'dest' => '\Modules\ContractManagement\Controller\BackendController:viewContractTypeList',
'verb' => RouteVerb::GET,
@ -51,7 +51,7 @@ return [
],
],
],
'^.*/contract/type/profile.*$' => [
'^.*/contract/type/view(\?.*$|$)' => [
[
'dest' => '\Modules\ContractManagement\Controller\BackendController:viewContractType',
'verb' => RouteVerb::GET,

View File

@ -148,13 +148,20 @@ final class ApiAttributeController extends Controller
->where('id', $request->getDataInt('type') ?? 0)
->execute();
if ($type->isInternal) {
$response->header->status = RequestStatusCode::R_403;
$this->createInvalidCreateResponse($request, $response, $val);
return;
}
$attrValue = $this->createAttributeValueFromRequest($request, $type);
$this->createModel($request->header->account, $attrValue, ContractAttributeValueMapper::class, 'attr_value', $request->getOrigin());
if ($attrValue->isDefault) {
$this->createModelRelation(
$request->header->account,
(int) $request->getData('type'),
$type->id,
$attrValue->id,
ContractAttributeTypeMapper::class, 'defaults', '', $request->getOrigin()
);

View File

@ -73,7 +73,10 @@ final class ApiContractTypeController extends Controller
private function createContractTypeFromRequest(RequestAbstract $request) : BaseStringL11nType
{
$contractType = new BaseStringL11nType();
$contractType->setL11n($request->getDataString('title') ?? '', $request->getDataString('language') ?? ISO639x1Enum::_EN);
$contractType->setL11n(
$request->getDataString('title') ?? '',
ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? ISO639x1Enum::_EN
);
$contractType->title = $request->getDataString('name') ?? '';
return $contractType;
@ -137,12 +140,10 @@ final class ApiContractTypeController extends Controller
*/
private function createContractTypeL11nFromRequest(RequestAbstract $request) : BaseStringL11n
{
$contractTypeL11n = new BaseStringL11n();
$contractTypeL11n->ref = $request->getDataInt('type') ?? 0;
$contractTypeL11n->setLanguage(
$request->getDataString('language') ?? $request->header->l11n->language
);
$contractTypeL11n->content = $request->getDataString('title') ?? '';
$contractTypeL11n = new BaseStringL11n();
$contractTypeL11n->ref = $request->getDataInt('type') ?? 0;
$contractTypeL11n->language = ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? $request->header->l11n->language;
$contractTypeL11n->content = $request->getDataString('title') ?? '';
return $contractTypeL11n;
}
@ -327,10 +328,8 @@ final class ApiContractTypeController extends Controller
*/
public function updateContractTypeL11nFromRequest(RequestAbstract $request, BaseStringL11n $new) : BaseStringL11n
{
$new->setLanguage(
$request->getDataString('language') ?? $new->language
);
$new->content = $request->getDataString('title') ?? $new->content;
$new->language = ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? $new->language;
$new->content = $request->getDataString('title') ?? $new->content;
return $new;
}

View File

@ -150,7 +150,7 @@ final class BackendController extends Controller
{
$view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/ContractManagement/Theme/Backend/contract-single');
$view->setTemplate('/Modules/ContractManagement/Theme/Backend/contract-view');
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007901001, $request, $response);
$contract = ContractMapper::get()

View File

@ -37,10 +37,10 @@ final class ContractAttributeMapper extends DataMapperFactory
* @since 1.0.0
*/
public const COLUMNS = [
'contractmgmt_contract_attr_id' => ['name' => 'contractmgmt_contract_attr_id', 'type' => 'int', 'internal' => 'id'],
'contractmgmt_contract_attr_contract' => ['name' => 'contractmgmt_contract_attr_contract', 'type' => 'int', 'internal' => 'ref'],
'contractmgmt_contract_attr_type' => ['name' => 'contractmgmt_contract_attr_type', 'type' => 'int', 'internal' => 'type'],
'contractmgmt_contract_attr_value' => ['name' => 'contractmgmt_contract_attr_value', 'type' => 'int', 'internal' => 'value'],
'contractmgmt_contract_attr_id' => ['name' => 'contractmgmt_contract_attr_id', 'type' => 'int', 'internal' => 'id'],
'contractmgmt_contract_attr_contract' => ['name' => 'contractmgmt_contract_attr_contract', 'type' => 'int', 'internal' => 'ref'],
'contractmgmt_contract_attr_type' => ['name' => 'contractmgmt_contract_attr_type', 'type' => 'int', 'internal' => 'type'],
'contractmgmt_contract_attr_value' => ['name' => 'contractmgmt_contract_attr_value', 'type' => 'int', 'internal' => 'value'],
];
/**

View File

@ -42,7 +42,8 @@ final class ContractAttributeTypeMapper extends DataMapperFactory
'contractmgmt_attr_type_datatype' => ['name' => 'contractmgmt_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'],
'contractmgmt_attr_type_fields' => ['name' => 'contractmgmt_attr_type_fields', 'type' => 'int', 'internal' => 'fields'],
'contractmgmt_attr_type_custom' => ['name' => 'contractmgmt_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'],
'contractmgmt_attr_type_repeatable' => ['name' => 'contractmgmt_attr_type_repeatable', 'type' => 'bool', 'internal' => 'repeatable'],
'contractmgmt_attr_type_repeatable' => ['name' => 'contractmgmt_attr_type_repeatable', 'type' => 'bool', 'internal' => 'repeatable'],
'contractmgmt_attr_type_internal' => ['name' => 'contractmgmt_attr_type_internal', 'type' => 'bool', 'internal' => 'isInternal'],
'contractmgmt_attr_type_pattern' => ['name' => 'contractmgmt_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'],
'contractmgmt_attr_type_required' => ['name' => 'contractmgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'],
];

View File

@ -37,10 +37,10 @@ final class ContractAttributeValueL11nMapper extends DataMapperFactory
* @since 1.0.0
*/
public const COLUMNS = [
'contractmgmt_attr_value_l11n_id' => ['name' => 'contractmgmt_attr_value_l11n_id', 'type' => 'int', 'internal' => 'id'],
'contractmgmt_attr_value_l11n_title' => ['name' => 'contractmgmt_attr_value_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
'contractmgmt_attr_value_l11n_value' => ['name' => 'contractmgmt_attr_value_l11n_value', 'type' => 'int', 'internal' => 'ref'],
'contractmgmt_attr_value_l11n_lang' => ['name' => 'contractmgmt_attr_value_l11n_lang', 'type' => 'string', 'internal' => 'language'],
'contractmgmt_attr_value_l11n_id' => ['name' => 'contractmgmt_attr_value_l11n_id', 'type' => 'int', 'internal' => 'id'],
'contractmgmt_attr_value_l11n_title' => ['name' => 'contractmgmt_attr_value_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
'contractmgmt_attr_value_l11n_value' => ['name' => 'contractmgmt_attr_value_l11n_value', 'type' => 'int', 'internal' => 'ref'],
'contractmgmt_attr_value_l11n_lang' => ['name' => 'contractmgmt_attr_value_l11n_lang', 'type' => 'string', 'internal' => 'language'],
];
/**

View File

@ -37,15 +37,15 @@ final class ContractAttributeValueMapper extends DataMapperFactory
* @since 1.0.0
*/
public const COLUMNS = [
'contractmgmt_attr_value_id' => ['name' => 'contractmgmt_attr_value_id', 'type' => 'int', 'internal' => 'id'],
'contractmgmt_attr_value_default' => ['name' => 'contractmgmt_attr_value_default', 'type' => 'bool', 'internal' => 'isDefault'],
'contractmgmt_attr_value_valueStr' => ['name' => 'contractmgmt_attr_value_valueStr', 'type' => 'string', 'internal' => 'valueStr'],
'contractmgmt_attr_value_valueInt' => ['name' => 'contractmgmt_attr_value_valueInt', 'type' => 'int', 'internal' => 'valueInt'],
'contractmgmt_attr_value_valueDec' => ['name' => 'contractmgmt_attr_value_valueDec', 'type' => 'float', 'internal' => 'valueDec'],
'contractmgmt_attr_value_valueDat' => ['name' => 'contractmgmt_attr_value_valueDat', 'type' => 'DateTime', 'internal' => 'valueDat'],
'contractmgmt_attr_value_unit' => ['name' => 'contractmgmt_attr_value_unit', 'type' => 'string', 'internal' => 'unit'],
'contractmgmt_attr_value_deptype' => ['name' => 'contractmgmt_attr_value_deptype', 'type' => 'int', 'internal' => 'dependingAttributeType'],
'contractmgmt_attr_value_depvalue' => ['name' => 'contractmgmt_attr_value_depvalue', 'type' => 'int', 'internal' => 'dependingAttributeValue'],
'contractmgmt_attr_value_id' => ['name' => 'contractmgmt_attr_value_id', 'type' => 'int', 'internal' => 'id'],
'contractmgmt_attr_value_default' => ['name' => 'contractmgmt_attr_value_default', 'type' => 'bool', 'internal' => 'isDefault'],
'contractmgmt_attr_value_valueStr' => ['name' => 'contractmgmt_attr_value_valueStr', 'type' => 'string', 'internal' => 'valueStr'],
'contractmgmt_attr_value_valueInt' => ['name' => 'contractmgmt_attr_value_valueInt', 'type' => 'int', 'internal' => 'valueInt'],
'contractmgmt_attr_value_valueDec' => ['name' => 'contractmgmt_attr_value_valueDec', 'type' => 'float', 'internal' => 'valueDec'],
'contractmgmt_attr_value_valueDat' => ['name' => 'contractmgmt_attr_value_valueDat', 'type' => 'DateTime', 'internal' => 'valueDat'],
'contractmgmt_attr_value_unit' => ['name' => 'contractmgmt_attr_value_unit', 'type' => 'string', 'internal' => 'unit'],
'contractmgmt_attr_value_deptype' => ['name' => 'contractmgmt_attr_value_deptype', 'type' => 'int', 'internal' => 'dependingAttributeType'],
'contractmgmt_attr_value_depvalue' => ['name' => 'contractmgmt_attr_value_depvalue', 'type' => 'int', 'internal' => 'dependingAttributeValue'],
];
/**

View File

@ -42,24 +42,24 @@ final class ContractMapper extends DataMapperFactory
* @since 1.0.0
*/
public const COLUMNS = [
'contractmgmt_contract_id' => ['name' => 'contractmgmt_contract_id', 'type' => 'int', 'internal' => 'id'],
'contractmgmt_contract_parent' => ['name' => 'contractmgmt_contract_parent', 'type' => 'int', 'internal' => 'parent'],
'contractmgmt_contract_template' => ['name' => 'contractmgmt_contract_template', 'type' => 'bool', 'internal' => 'isTemplate'],
'contractmgmt_contract_title' => ['name' => 'contractmgmt_contract_title', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true],
'contractmgmt_contract_description' => ['name' => 'contractmgmt_contract_description', 'type' => 'string', 'internal' => 'description'],
'contractmgmt_contract_account' => ['name' => 'contractmgmt_contract_account', 'type' => 'int', 'internal' => 'account'],
'contractmgmt_contract_costs' => ['name' => 'contractmgmt_contract_costs', 'type' => 'Serializable', 'internal' => 'costs'],
'contractmgmt_contract_renewal' => ['name' => 'contractmgmt_contract_renewal', 'type' => 'int', 'internal' => 'renewal'],
'contractmgmt_contract_autorenewal' => ['name' => 'contractmgmt_contract_autorenewal', 'type' => 'bool', 'internal' => 'autoRenewal'],
'contractmgmt_contract_duration' => ['name' => 'contractmgmt_contract_duration', 'type' => 'int', 'internal' => 'duration'],
'contractmgmt_contract_warning' => ['name' => 'contractmgmt_contract_warning', 'type' => 'int', 'internal' => 'warning'],
'contractmgmt_contract_startoriginal' => ['name' => 'contractmgmt_contract_startoriginal', 'type' => 'DateTime', 'internal' => 'originalStart'],
'contractmgmt_contract_start' => ['name' => 'contractmgmt_contract_start', 'type' => 'DateTime', 'internal' => 'start'],
'contractmgmt_contract_end' => ['name' => 'contractmgmt_contract_end', 'type' => 'DateTime', 'internal' => 'end'],
'contractmgmt_contract_responsible' => ['name' => 'contractmgmt_contract_responsible', 'type' => 'int', 'internal' => 'responsible'],
'contractmgmt_contract_unit' => ['name' => 'contractmgmt_contract_unit', 'type' => 'int', 'internal' => 'unit'],
'contractmgmt_contract_type' => ['name' => 'contractmgmt_contract_type', 'type' => 'int', 'internal' => 'type'],
'contractmgmt_contract_created_at' => ['name' => 'contractmgmt_contract_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt'],
'contractmgmt_contract_id' => ['name' => 'contractmgmt_contract_id', 'type' => 'int', 'internal' => 'id'],
'contractmgmt_contract_parent' => ['name' => 'contractmgmt_contract_parent', 'type' => 'int', 'internal' => 'parent'],
'contractmgmt_contract_template' => ['name' => 'contractmgmt_contract_template', 'type' => 'bool', 'internal' => 'isTemplate'],
'contractmgmt_contract_title' => ['name' => 'contractmgmt_contract_title', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true],
'contractmgmt_contract_description' => ['name' => 'contractmgmt_contract_description', 'type' => 'string', 'internal' => 'description'],
'contractmgmt_contract_account' => ['name' => 'contractmgmt_contract_account', 'type' => 'int', 'internal' => 'account'],
'contractmgmt_contract_costs' => ['name' => 'contractmgmt_contract_costs', 'type' => 'Serializable', 'internal' => 'costs'],
'contractmgmt_contract_renewal' => ['name' => 'contractmgmt_contract_renewal', 'type' => 'int', 'internal' => 'renewal'],
'contractmgmt_contract_autorenewal' => ['name' => 'contractmgmt_contract_autorenewal', 'type' => 'bool', 'internal' => 'autoRenewal'],
'contractmgmt_contract_duration' => ['name' => 'contractmgmt_contract_duration', 'type' => 'int', 'internal' => 'duration'],
'contractmgmt_contract_warning' => ['name' => 'contractmgmt_contract_warning', 'type' => 'int', 'internal' => 'warning'],
'contractmgmt_contract_startoriginal' => ['name' => 'contractmgmt_contract_startoriginal', 'type' => 'DateTime', 'internal' => 'originalStart'],
'contractmgmt_contract_start' => ['name' => 'contractmgmt_contract_start', 'type' => 'DateTime', 'internal' => 'start'],
'contractmgmt_contract_end' => ['name' => 'contractmgmt_contract_end', 'type' => 'DateTime', 'internal' => 'end'],
'contractmgmt_contract_responsible' => ['name' => 'contractmgmt_contract_responsible', 'type' => 'int', 'internal' => 'responsible'],
'contractmgmt_contract_unit' => ['name' => 'contractmgmt_contract_unit', 'type' => 'int', 'internal' => 'unit'],
'contractmgmt_contract_type' => ['name' => 'contractmgmt_contract_type', 'type' => 'int', 'internal' => 'type'],
'contractmgmt_contract_created_at' => ['name' => 'contractmgmt_contract_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt'],
];
/**

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'اتفافية',
'Contracts' => 'انكماش',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'عنوان',
'Type' => '',
'Unit' => '',
'With' => '',
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'اتفافية',
'Contracts' => 'انكماش',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'عنوان',
'Type' => '',
'Unit' => '',
'With' => '',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Smlouva',
'Contracts' => 'Smlouvy',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Titul',
'Type' => '',
'Unit' => '',
'With' => '',
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Smlouva',
'Contracts' => 'Smlouvy',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Titul',
'Type' => '',
'Unit' => '',
'With' => '',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Kontrakt',
'Contracts' => 'Kontrakter',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Titel',
'Type' => '',
'Unit' => '',
'With' => '',
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Kontrakt',
'Contracts' => 'Kontrakter',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Titel',
'Type' => '',
'Unit' => '',
'With' => '',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => 'Account',
'AutoRenewal' => 'Automatische Verlängerung',
'Contract' => 'Vertrag',
'Contracts' => 'Verträge',
'Costs' => 'Kosten',
'Description' => 'Beschreibung',
'End' => 'Ende',
'Files' => 'Dateien',
'Name' => 'Name',
'Overview' => 'Übersicht',
'Parties' => 'Parteien',
'Start' => 'Start',
'Termination' => 'Beendigung',
'Title' => 'Titel',
'Type' => 'Typ',
'Unit' => 'Unit',
'With' => 'Mit',
'Account' => 'Account',
'AutoRenewal' => 'Automatische Verlängerung',
'Contract' => 'Vertrag',
'Contracts' => 'Verträge',
'Costs' => 'Kosten',
'Description' => 'Beschreibung',
'End' => 'Ende',
'Files' => 'Dateien',
'Name' => 'Name',
'Overview' => 'Übersicht',
'Parties' => 'Parteien',
'Start' => 'Start',
'Termination' => 'Beendigung',
'Title' => 'Titel',
'Type' => 'Typ',
'Unit' => 'Unit',
'With' => 'Mit',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Σύμβαση',
'Contracts' => 'Συμβάσεις',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Τίτλος',
'Type' => '',
'Unit' => '',
'With' => '',
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Σύμβαση',
'Contracts' => 'Συμβάσεις',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Τίτλος',
'Type' => '',
'Unit' => '',
'With' => '',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => 'Account',
'AutoRenewal' => 'Auto Renewal',
'Contract' => 'Contract',
'Contracts' => 'Contracts',
'Costs' => 'Costs',
'Description' => 'Description',
'End' => 'End',
'Files' => 'Files',
'Name' => '',
'Overview' => 'Overview',
'Parties' => 'Parties',
'Start' => 'Start',
'Termination' => 'Termination',
'Title' => 'Title',
'Type' => 'Type',
'Unit' => 'Unit',
'With' => 'With',
'Account' => 'Account',
'AutoRenewal' => 'Auto Renewal',
'Contract' => 'Contract',
'Contracts' => 'Contracts',
'Costs' => 'Costs',
'Description' => 'Description',
'End' => 'End',
'Files' => 'Files',
'Name' => '',
'Overview' => 'Overview',
'Parties' => 'Parties',
'Start' => 'Start',
'Termination' => 'Termination',
'Title' => 'Title',
'Type' => 'Type',
'Unit' => 'Unit',
'With' => 'With',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Contrato',
'Contracts' => 'Contrato',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Título',
'Type' => '',
'Unit' => '',
'With' => '',
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Contrato',
'Contracts' => 'Contrato',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Título',
'Type' => '',
'Unit' => '',
'With' => '',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Sopimus',
'Contracts' => 'Sopimukset',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Otsikko',
'Type' => '',
'Unit' => '',
'With' => '',
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Sopimus',
'Contracts' => 'Sopimukset',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Otsikko',
'Type' => '',
'Unit' => '',
'With' => '',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Contracter',
'Contracts' => 'Contrats',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Titre',
'Type' => '',
'Unit' => '',
'With' => '',
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Contracter',
'Contracts' => 'Contrats',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Titre',
'Type' => '',
'Unit' => '',
'With' => '',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Szerződés',
'Contracts' => 'Szerződések',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Cím',
'Type' => '',
'Unit' => '',
'With' => '',
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Szerződés',
'Contracts' => 'Szerződések',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Cím',
'Type' => '',
'Unit' => '',
'With' => '',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Contrarre',
'Contracts' => 'Contratti',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Titolo',
'Type' => '',
'Unit' => '',
'With' => '',
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Contrarre',
'Contracts' => 'Contratti',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Titolo',
'Type' => '',
'Unit' => '',
'With' => '',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => '',
'AutoRenewal' => '',
'Contract' => '契約',
'Contracts' => '契約',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'タイトル',
'Type' => '',
'Unit' => '',
'With' => '',
'Account' => '',
'AutoRenewal' => '',
'Contract' => '契約',
'Contracts' => '契約',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'タイトル',
'Type' => '',
'Unit' => '',
'With' => '',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => '',
'AutoRenewal' => '',
'Contract' => '계약',
'Contracts' => '계약서',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => '제목',
'Type' => '',
'Unit' => '',
'With' => '',
'Account' => '',
'AutoRenewal' => '',
'Contract' => '계약',
'Contracts' => '계약서',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => '제목',
'Type' => '',
'Unit' => '',
'With' => '',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Kontrakt',
'Contracts' => 'Kontrakter',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Tittel',
'Type' => '',
'Unit' => '',
'With' => '',
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Kontrakt',
'Contracts' => 'Kontrakter',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Tittel',
'Type' => '',
'Unit' => '',
'With' => '',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Kontrakt',
'Contracts' => 'Kontrakty',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Tytuł',
'Type' => '',
'Unit' => '',
'With' => '',
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Kontrakt',
'Contracts' => 'Kontrakty',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Tytuł',
'Type' => '',
'Unit' => '',
'With' => '',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Contrato',
'Contracts' => 'Contratos',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Título',
'Type' => '',
'Unit' => '',
'With' => '',
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Contrato',
'Contracts' => 'Contratos',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Título',
'Type' => '',
'Unit' => '',
'With' => '',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Договор',
'Contracts' => 'Контракты',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Заголовок',
'Type' => '',
'Unit' => '',
'With' => '',
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Договор',
'Contracts' => 'Контракты',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Заголовок',
'Type' => '',
'Unit' => '',
'With' => '',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Avtal',
'Contracts' => 'Kontrakt',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Titel',
'Type' => '',
'Unit' => '',
'With' => '',
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Avtal',
'Contracts' => 'Kontrakt',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Titel',
'Type' => '',
'Unit' => '',
'With' => '',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'สัญญา',
'Contracts' => 'สัญญา',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'ชื่อ',
'Type' => '',
'Unit' => '',
'With' => '',
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'สัญญา',
'Contracts' => 'สัญญา',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'ชื่อ',
'Type' => '',
'Unit' => '',
'With' => '',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Sözleşme',
'Contracts' => 'Sözleşme',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Başlık',
'Type' => '',
'Unit' => '',
'With' => '',
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Sözleşme',
'Contracts' => 'Sözleşme',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Başlık',
'Type' => '',
'Unit' => '',
'With' => '',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Договір',
'Contracts' => 'Контракти',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Заголовок',
'Type' => '',
'Unit' => '',
'With' => '',
'Account' => '',
'AutoRenewal' => '',
'Contract' => 'Договір',
'Contracts' => 'Контракти',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => 'Заголовок',
'Type' => '',
'Unit' => '',
'With' => '',
]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1);
return ['ContractManagement' => [
'Account' => '',
'AutoRenewal' => '',
'Contract' => '合同',
'Contracts' => '合同',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => '标题',
'Type' => '',
'Unit' => '',
'With' => '',
'Account' => '',
'AutoRenewal' => '',
'Contract' => '合同',
'Contracts' => '合同',
'Costs' => '',
'Description' => '',
'End' => '',
'Files' => '',
'Name' => '',
'Overview' => '',
'Parties' => '',
'Start' => '',
'Termination' => '',
'Title' => '标题',
'Type' => '',
'Unit' => '',
'With' => '',
]];

View File

@ -73,7 +73,7 @@ echo $this->data['nav']->render(); ?>
</label>
<tbody>
<?php foreach ($contracts as $key => $value) :
$url = UriFactory::build('{/base}/contract/single?{?}&id=' . $value->id);
$url = UriFactory::build('{/base}/contract/view?{?}&id=' . $value->id);
$type = 'ok';
if (($value->end->getTimestamp() < $now->getTimestamp() && $value->end->getTimestamp() + 7776000 > $now->getTimestamp())
@ -88,7 +88,7 @@ echo $this->data['nav']->render(); ?>
?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('Title'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->title); ?></a>
<td data-label="<?= $this->getHtml('Account'); ?>"><a class="content" href="<?= UriFactory::build('{/base}/profile/single?{?}&for=' . $value->account->id); ?>"><?= $this->printHtml($value->account->name1); ?> <?= $this->printHtml($value->account->name2); ?></a>
<td data-label="<?= $this->getHtml('Account'); ?>"><a class="content" href="<?= UriFactory::build('{/base}/profile/view?{?}&for=' . $value->account->id); ?>"><?= $this->printHtml($value->account->name1); ?> <?= $this->printHtml($value->account->name2); ?></a>
<td data-label="<?= $this->getHtml('End'); ?>"><a href="<?= $url; ?>"><span class="tag <?= $type; ?>"><?= $value->end !== null ? $value->end->format('Y-m-d') : ''; ?></span></a>
<?php endforeach; ?>
</table>

View File

@ -55,7 +55,7 @@ echo $this->data['nav']->render(); ?>
<?php
$count = 0;
foreach ($types as $key => $value) : ++$count;
$url = UriFactory::build('{/base}/contract/type/profile?{?}&id=' . $value->id);
$url = UriFactory::build('{/base}/contract/type/view?{?}&id=' . $value->id);
?>
<tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= $value->id; ?></a>

View File

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

View File

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

View File

@ -19,7 +19,6 @@ use phpOMS\Localization\ISO639x1Enum;
use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Uri\HttpUri;
trait ApiControllerAttributeTrait
{
@ -30,7 +29,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeTypeCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('title', 'EN:1');
@ -48,7 +47,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeTypeL11nCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('title', 'DE:2');
@ -66,7 +65,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeValueIntCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('default', '1');
@ -86,7 +85,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeValueStrCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('value', '1');
@ -105,7 +104,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeValueFloatCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('value', '1.1');
@ -124,7 +123,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeValueDatCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('value', '2020-08-02');
@ -143,7 +142,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('ref', '1');
@ -161,7 +160,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeValueCreateInvalidData() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');
@ -177,7 +176,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeTypeCreateInvalidData() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');
@ -193,7 +192,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeTypeL11nCreateInvalidData() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');
@ -209,7 +208,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeCreateInvalidData() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');

View File

@ -17,7 +17,6 @@ namespace Modules\ContractManagement\tests\Controller\Api;
use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Uri\HttpUri;
use phpOMS\Utils\TestUtils;
trait ApiControllerContractTrait
@ -29,7 +28,7 @@ trait ApiControllerContractTrait
public function testApiContractCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('title', 'Title');
@ -49,7 +48,7 @@ trait ApiControllerContractTrait
public function testApiContractCreateInvalidData() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');
@ -65,7 +64,7 @@ trait ApiControllerContractTrait
public function testApiContractDocCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
if (!\is_file(__DIR__ . '/test_tmp.pdf')) {
\copy(__DIR__ . '/test.pdf', __DIR__ . '/test_tmp.pdf');
@ -96,7 +95,7 @@ trait ApiControllerContractTrait
public function testApiContractDocCreateInvalidData() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');

View File

@ -18,7 +18,6 @@ use phpOMS\Localization\ISO639x1Enum;
use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Uri\HttpUri;
trait ApiControllerContractTypeTrait
{
@ -29,7 +28,7 @@ trait ApiControllerContractTypeTrait
public function testApiContractTypeCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('title', 'Test');
@ -46,7 +45,7 @@ trait ApiControllerContractTypeTrait
public function testApiContractTypeCreateInvalidData() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');
@ -62,7 +61,7 @@ trait ApiControllerContractTypeTrait
public function testApiContractTypeL11nCreate() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('title', 'Test');
@ -80,7 +79,7 @@ trait ApiControllerContractTypeTrait
public function testApiContractTypeL11nCreateInvalidData() : void
{
$response = new HttpResponse();
$request = new HttpRequest(new HttpUri(''));
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('invalid', '1');

View File

@ -60,13 +60,13 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
protected string $appName = 'Api';
};
$this->app->dbPool = $GLOBALS['dbpool'];
$this->app->unitId = 1;
$this->app->accountManager = new AccountManager($GLOBALS['session']);
$this->app->appSettings = new CoreSettings();
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../../Modules/');
$this->app->dispatcher = new Dispatcher($this->app);
$this->app->eventManager = new EventManager($this->app->dispatcher);
$this->app->dbPool = $GLOBALS['dbpool'];
$this->app->unitId = 1;
$this->app->accountManager = new AccountManager($GLOBALS['session']);
$this->app->appSettings = new CoreSettings();
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../../Modules/');
$this->app->dispatcher = new Dispatcher($this->app);
$this->app->eventManager = new EventManager($this->app->dispatcher);
$this->app->eventManager->importFromFile(__DIR__ . '/../../../../Web/Api/Hooks.php');
$this->app->sessionManager = new HttpSession(36000);
$this->app->l11nManager = new L11nManager();

View File

@ -57,16 +57,16 @@ final class ContractTest extends \PHPUnit\Framework\TestCase
self::assertEquals(
[
'id' => 0,
'title' => 'Title',
'description' => 'Description',
'start' => null,
'end' => null,
'duration' => 123,
'warning' => 2,
'responsible' => null,
'costs' => null,
'type' => null,
'id' => 0,
'title' => 'Title',
'description' => 'Description',
'start' => null,
'end' => null,
'duration' => 123,
'warning' => 2,
'responsible' => null,
'costs' => null,
'type' => null,
],
$serialized
);