mirror of
https://github.com/Karaka-Management/oms-Kanban.git
synced 2026-02-18 13:18:41 +00:00
implement todos
This commit is contained in:
parent
a495a65476
commit
124bad80e5
9
Admin/Install/Media.install.json
Normal file
9
Admin/Install/Media.install.json
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[
|
||||
{
|
||||
"type": "collection",
|
||||
"create_directory": true,
|
||||
"name": "Kanban",
|
||||
"virtualPath": "/Modules",
|
||||
"user": 1
|
||||
}
|
||||
]
|
||||
43
Admin/Install/Media.php
Normal file
43
Admin/Install/Media.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
/**
|
||||
* Orange Management
|
||||
*
|
||||
* PHP Version 8.0
|
||||
*
|
||||
* @package Modules\Kanban\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\Kanban\Admin\Install;
|
||||
|
||||
use phpOMS\Application\ApplicationAbstract;
|
||||
|
||||
/**
|
||||
* Media class.
|
||||
*
|
||||
* @package Modules\Kanban\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 ApplicationAbstract $app Application
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function install(string $path, ApplicationAbstract $app) : void
|
||||
{
|
||||
\Modules\Media\Admin\Installer::installExternal($app, ['path' => __DIR__ . '/Media.install.json']);
|
||||
}
|
||||
}
|
||||
|
|
@ -112,6 +112,20 @@ final class ApiController extends Controller
|
|||
}
|
||||
}
|
||||
|
||||
if (!empty($uploadedFiles = $request->getFiles() ?? [])) {
|
||||
$uploaded = $this->app->moduleManager->get('Media')->uploadFiles(
|
||||
[''],
|
||||
$uploadedFiles,
|
||||
$request->header->account,
|
||||
__DIR__ . '/../../../Modules/Media/Files/Modules/Kanban',
|
||||
'/Modules/Kanban',
|
||||
);
|
||||
|
||||
foreach ($uploaded as $media) {
|
||||
$card->addMedia($media);
|
||||
}
|
||||
}
|
||||
|
||||
return $card;
|
||||
}
|
||||
|
||||
|
|
@ -188,6 +202,20 @@ final class ApiController extends Controller
|
|||
$comment->setCard((int) $request->getData('card'));
|
||||
$comment->createdBy = new NullAccount($request->header->account);
|
||||
|
||||
if (!empty($uploadedFiles = $request->getFiles() ?? [])) {
|
||||
$uploaded = $this->app->moduleManager->get('Media')->uploadFiles(
|
||||
[''],
|
||||
$uploadedFiles,
|
||||
$request->header->account,
|
||||
__DIR__ . '/../../../Modules/Media/Files/Modules/Kanban',
|
||||
'/Modules/Kanban',
|
||||
);
|
||||
|
||||
foreach ($uploaded as $media) {
|
||||
$comment->addMedia($media);
|
||||
}
|
||||
}
|
||||
|
||||
return $comment;
|
||||
}
|
||||
|
||||
|
|
|
|||
BIN
Docs/Dev/img/er.png
Normal file
BIN
Docs/Dev/img/er.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 257 KiB |
|
|
@ -33,6 +33,11 @@ $comments = $card->getComments();
|
|||
<div class="portlet-body">
|
||||
<article><?= $card->description; ?></article>
|
||||
</div>
|
||||
<div class="portlet-foot">
|
||||
<?php $files = $card->getMedia(); foreach ($files as $file) : ?>
|
||||
<span class="file"><?= $this->printHtml($file->name); ?></span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -44,6 +49,11 @@ $comments = $card->getComments();
|
|||
<div class="portlet-body">
|
||||
<article><?= $comment->description; ?></article>
|
||||
</div>
|
||||
<div class="portlet-foot">
|
||||
<?php $files = $comment->getMedia(); foreach ($files as $file) : ?>
|
||||
<span class="file"><?= $this->printHtml($file->name); ?></span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user