add app to installer

This commit is contained in:
Dennis Eichhorn 2021-06-24 00:03:34 +02:00
parent 4aa6376238
commit 4b2a771ddd
4 changed files with 157 additions and 36 deletions

View File

@ -18,7 +18,7 @@
"pid": "/contract", "pid": "/contract",
"type": 3, "type": 3,
"subtype": 1, "subtype": 1,
"name": "Boards", "name": "Contracts",
"uri": "{/prefix}contract/list?{?}", "uri": "{/prefix}contract/list?{?}",
"target": "self", "target": "self",
"icon": null, "icon": null,

View File

@ -14,7 +14,7 @@ declare(strict_types=1);
namespace Modules\ContractManagement\Admin\Install; namespace Modules\ContractManagement\Admin\Install;
use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\Application\ApplicationAbstract;
/** /**
* Navigation class. * Navigation class.
@ -30,14 +30,14 @@ class Navigation
* Install navigation providing * Install navigation providing
* *
* @param string $path Module path * @param string $path Module path
* @param DatabasePool $dbPool Database pool for database interaction * @param ApplicationAbstract $app Application
* *
* @return void * @return void
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public static function install(string $path, DatabasePool $dbPool) : void public static function install(string $path, ApplicationAbstract $app) : void
{ {
\Modules\Navigation\Admin\Installer::installExternal($dbPool, ['path' => __DIR__ . '/Navigation.install.json']); \Modules\Navigation\Admin\Installer::installExternal($app, ['path' => __DIR__ . '/Navigation.install.json']);
} }
} }

View File

@ -1,45 +1,144 @@
{ {
"media_contract": { "contractmgmt_type": {
"name": "media_contract", "name": "contractmgmt_type",
"fields": { "fields": {
"media_contract_id": { "contractmgmt_type_id": {
"name": "media_contract_id", "name": "contractmgmt_type_id",
"type": "INT", "type": "INT",
"null": false, "null": false,
"primary": true "primary": true,
"autoincrement": true
}, },
"media_contract_start": { "contractmgmt_type_name": {
"name": "media_contract_start", "name": "contractmgmt_type_name",
"type": "DATETIME", "type": "VARCHAR(255)",
"default": null,
"null": false "null": false
}, }
"media_contract_end": { }
"name": "media_contract_end", },
"type": "DATETIME", "contractmgmt_type_l11n": {
"null": false "name": "contractmgmt_type_l11n",
}, "fields": {
"media_contract_autorenewal": { "contractmgmt_type_l11n_id": {
"name": "media_contract_autorenewal", "name": "contractmgmt_type_l11n_id",
"type": "TINYINT",
"default": 1,
"null": false
},
"media_contract_renewaltime": {
"name": "media_contract_renewaltime",
"type": "INT", "type": "INT",
"null": false,
"primary": true,
"autoincrement": true
},
"contractmgmt_type_l11n_title": {
"name": "contractmgmt_type_l11n_title",
"type": "VARCHAR(255)",
"null": false
},
"contractmgmt_type_l11n_type": {
"name": "contractmgmt_type_l11n_type",
"type": "INT(11)",
"null": false,
"foreignTable": "contractmgmt_type",
"foreignKey": "contractmgmt_type_id"
},
"contractmgmt_type_l11n_lang": {
"name": "contractmgmt_type_l11n_lang",
"type": "VARCHAR(2)",
"null": false,
"foreignTable": "language",
"foreignKey": "language_639_1"
}
}
},
"contractmgmt_contract": {
"name": "contractmgmt_contract",
"fields": {
"contractmgmt_contract_id": {
"name": "contractmgmt_contract_id",
"type": "INT",
"null": false,
"primary": true,
"autoincrement": true
},
"contractmgmt_contract_title": {
"name": "contractmgmt_contract_title",
"type": "VARCHAR(255)",
"null": false
},
"contractmgmt_contract_description": {
"name": "contractmgmt_contract_description",
"type": "TEXT",
"null": false
},
"contractmgmt_contract_start": {
"name": "contractmgmt_contract_start",
"type": "DATETIME",
"null": false
},
"contractmgmt_contract_end": {
"name": "contractmgmt_contract_end",
"type": "DATETIME",
"null": true,
"default": null
},
"contractmgmt_contract_costs": {
"name": "contractmgmt_contract_costs",
"type": "BIGINT",
"null": true,
"default": null
},
"contractmgmt_contract_duration": {
"name": "contractmgmt_contract_duration",
"type": "INT",
"null": false
},
"contractmgmt_contract_warning": {
"name": "contractmgmt_contract_warning",
"type": "INT",
"null": false
},
"contractmgmt_contract_type": {
"name": "contractmgmt_contract_type",
"type": "INT",
"null": false,
"foreignTable": "contractmgmt_type",
"foreignKey": "contractmgmt_type_id"
},
"contractmgmt_contract_responsible": {
"name": "contractmgmt_contract_responsible",
"type": "INT",
"null": true,
"default": null, "default": null,
"null": true "foreignTable": "account",
"foreignKey": "account_id"
}, },
"media_contract_costs": { "contractmgmt_contract_created_at": {
"name": "media_contract_costs", "name": "contractmgmt_contract_created_at",
"type": "BIGINT", "type": "DATETIME",
"null": false "null": false
}
}
},
"contractmgmt_contract_media": {
"name": "contractmgmt_contract_media",
"fields": {
"contractmgmt_contract_media_id": {
"name": "contractmgmt_contract_media_id",
"type": "INT",
"null": false,
"primary": true,
"autoincrement": true
}, },
"media_contract_value": { "contractmgmt_contract_media_contract": {
"name": "media_contract_value", "name": "contractmgmt_contract_media_contract",
"type": "BIGINT", "type": "INT",
"null": false "null": false,
"foreignTable": "contractmgmt_contract",
"foreignKey": "contractmgmt_contract_id"
},
"contractmgmt_contract_media_media": {
"name": "contractmgmt_contract_media_media",
"type": "INT",
"null": false,
"foreignTable": "media",
"foreignKey": "media_id"
} }
} }
} }

View File

@ -6,4 +6,26 @@ use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb; use phpOMS\Router\RouteVerb;
return [ return [
'^.*/contract/list.*$' => [
[
'dest' => '\Modules\ContractManagement\Controller\BackendController:viewContractList',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::CONTRACT,
],
],
],
'^.*/contract/single.*$' => [
[
'dest' => '\Modules\ContractManagement\Controller\BackendController:viewContract',
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::MODULE_NAME,
'type' => PermissionType::READ,
'state' => PermissionState::CONTRACT,
],
],
],
]; ];