mirror of
https://github.com/Karaka-Management/oms-Auditor.git
synced 2026-02-14 04:38:40 +00:00
bug fixes
This commit is contained in:
parent
a0a7cc70be
commit
da2000e54a
20
Admin/Install/Media.install.json
Normal file
20
Admin/Install/Media.install.json
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"type": "collection",
|
||||||
|
"create_directory": true,
|
||||||
|
"name": "Auditor",
|
||||||
|
"virtualPath": "/Modules",
|
||||||
|
"user": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "upload",
|
||||||
|
"create_collection": true,
|
||||||
|
"name": "Default",
|
||||||
|
"virtualPath": "/Modules/Auditor",
|
||||||
|
"path": "/Modules/Media/Files/Modules/Auditor",
|
||||||
|
"files": [
|
||||||
|
"/Modules/Auditor/Admin/Install/Media/defaultReport.pdf.php"
|
||||||
|
],
|
||||||
|
"user": 1
|
||||||
|
}
|
||||||
|
]
|
||||||
50
Admin/Install/Media.php
Normal file
50
Admin/Install/Media.php
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 8.0
|
||||||
|
*
|
||||||
|
* @package Modules\Auditor\Admin\Install
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Modules\Auditor\Admin\Install;
|
||||||
|
|
||||||
|
use Model\Setting;
|
||||||
|
use Model\SettingMapper;
|
||||||
|
use phpOMS\DataStorage\Database\DatabasePool;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Media class.
|
||||||
|
*
|
||||||
|
* @package Modules\Auditor\Admin\Install
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
class Media
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Install media providing
|
||||||
|
*
|
||||||
|
* @param string $path Module path
|
||||||
|
* @param DatabasePool $dbPool Database pool for database interaction
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
public static function install(string $path, DatabasePool $dbPool) : void
|
||||||
|
{
|
||||||
|
$media = \Modules\Media\Admin\Installer::installExternal($dbPool, ['path' => __DIR__ . '/Media.install.json']);
|
||||||
|
|
||||||
|
$defaultTemplate = \reset($media['upload'][0]);
|
||||||
|
|
||||||
|
$setting = new Setting();
|
||||||
|
SettingMapper::create($setting->with(0, 'default_pdf_template', (string) $defaultTemplate->getId(), 'Auditor'));
|
||||||
|
}
|
||||||
|
}
|
||||||
0
Admin/Install/Media/defaultReport.pdf.php
Normal file
0
Admin/Install/Media/defaultReport.pdf.php
Normal file
Loading…
Reference in New Issue
Block a user