bug fixes / dbmapper fixes

This commit is contained in:
Dennis Eichhorn 2021-12-19 20:20:39 +01:00
parent df0105c0b2
commit 91c84e20d8
15 changed files with 170 additions and 47 deletions

View File

@ -171,7 +171,7 @@ final class BackendController extends Controller
if ($media->extension === 'collection') { if ($media->extension === 'collection') {
$media = MediaMapper::getByVirtualPath( $media = MediaMapper::getByVirtualPath(
$media->getVirtualPath() . ($media->getVirtualPath() !== '/' ? '/' : '') . $media->name $media->getVirtualPath() . ($media->getVirtualPath() !== '/' ? '/' : '') . $media->name
)->with('tags/title/language', $request->getLanguage())->execute(); )->where('tags/title/language', $request->getLanguage())->execute();
$collection = CollectionMapper::get()->where('id', $id)->execute(); $collection = CollectionMapper::get()->where('id', $id)->execute();
$media = \array_merge($media, $collection->getSources()); $media = \array_merge($media, $collection->getSources());

View File

@ -50,7 +50,7 @@ final class MediaTypeMapper extends DataMapperFactory
'table' => 'media_type_l11n', 'table' => 'media_type_l11n',
'self' => 'media_type_l11n_type', 'self' => 'media_type_l11n_type',
'column' => 'title', 'column' => 'title',
'external' => null, 'external'=> null,
], ],
]; ];

View File

@ -1,4 +1,16 @@
<?php declare(strict_types=1); <?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Template
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
?> ?>
<section id="mediaFile" class="portlet"> <section id="mediaFile" class="portlet">

View File

@ -1,4 +1,16 @@
<?php declare(strict_types=1); <?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Template
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory; use phpOMS\Uri\UriFactory;

View File

@ -1,4 +1,16 @@
<?php declare(strict_types=1); <?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Template
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
use phpOMS\Utils\IO\Csv\CsvSettings; use phpOMS\Utils\IO\Csv\CsvSettings;

View File

@ -1,4 +1,16 @@
<?php declare(strict_types=1); <?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Template
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory; use phpOMS\Uri\UriFactory;

View File

@ -1,4 +1,16 @@
<?php declare(strict_types=1); <?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Template
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
$array = \json_decode($this->getFileContent(($this->media->isAbsolute ? '' : __DIR__ . '/../../../../../../') . $this->media->getPath()), true); $array = \json_decode($this->getFileContent(($this->media->isAbsolute ? '' : __DIR__ . '/../../../../../../') . $this->media->getPath()), true);
?> ?>

View File

@ -1,4 +1,16 @@
<?php declare(strict_types=1); <?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Template
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
use phpOMS\Utils\Parser\Markdown\Markdown; use phpOMS\Utils\Parser\Markdown\Markdown;

View File

@ -1,11 +1,24 @@
<?php declare(strict_types=1); <?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Template
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
use PhpOffice\PhpPresentation\IOFactory; require_once __DIR__ . '/../../../../../../phpOMS/Autoloader.php';
use phpOMS\Autoloader;
Autoloader::addPath(__DIR__ . '/../../../../../../Resources/'); Autoloader::addPath(__DIR__ . '/../../../../../../Resources/');
use PhpOffice\PhpPresentation\IOFactory;
use PhpOffice\PhpPresentation\Writer\Html; use PhpOffice\PhpPresentation\Writer\Html;
use phpOMS\Autoloader;
$reader = IOFactory::createReader('PowerPoint2007'); $reader = IOFactory::createReader('PowerPoint2007');
$presentation = $reader->load(($this->media->isAbsolute ? '' : __DIR__ . '/../../../../../../') . $this->media->getPath()); $presentation = $reader->load(($this->media->isAbsolute ? '' : __DIR__ . '/../../../../../../') . $this->media->getPath());

View File

@ -1,4 +1,16 @@
<?php declare(strict_types=1); <?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Template
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
use PhpOffice\PhpSpreadsheet\IOFactory; use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Writer\Csv; use PhpOffice\PhpSpreadsheet\Writer\Csv;

View File

@ -1,4 +1,16 @@
<?php declare(strict_types=1); <?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Template
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory; use phpOMS\Uri\UriFactory;

View File

@ -1,4 +1,16 @@
<?php declare(strict_types=1); <?php
/**
* Orange Management
*
* PHP Version 8.0
*
* @package Template
* @copyright Dennis Eichhorn
* @license OMS License 1.0
* @version 1.0.0
* @link https://orange-management.org
*/
declare(strict_types=1);
use phpOMS\Uri\UriFactory; use phpOMS\Uri\UriFactory;

View File

@ -17,6 +17,7 @@ use phpOMS\Utils\Converter\FileSizeType;
include __DIR__ . '/template-functions.php'; include __DIR__ . '/template-functions.php';
/** @var \Modules\Media\Views\MediaView $this */
/** @var \Modules\Media\Models\Media $media */ /** @var \Modules\Media\Models\Media $media */
$media = $this->getData('media'); $media = $this->getData('media');
$view = $this->getData('view'); $view = $this->getData('view');
@ -24,7 +25,8 @@ $view = $this->getData('view');
/** @var \Modules\Tag\Models\Tag[] $tag */ /** @var \Modules\Tag\Models\Tag[] $tag */
$tags = $media->getTags(); $tags = $media->getTags();
/** @var \Modules\Media\Views\MediaView $this */ /** @var \phpOMS\Message\Http\HttpRequest $this->request */
echo $this->getData('nav')->render(); echo $this->getData('nav')->render();
?> ?>
<div class="row"> <div class="row">