mirror of
https://github.com/Karaka-Management/oms-Messages.git
synced 2026-02-17 17:58:40 +00:00
update
This commit is contained in:
parent
d1138a6518
commit
1882f1ad6b
|
|
@ -94,7 +94,7 @@
|
||||||
"type": 3,
|
"type": 3,
|
||||||
"subtype": 1,
|
"subtype": 1,
|
||||||
"name": "Templates",
|
"name": "Templates",
|
||||||
"uri": "{/base}/messages/templates?{?}",
|
"uri": "{/base}/messages/template/list?{?}",
|
||||||
"target": "self",
|
"target": "self",
|
||||||
"icon": null,
|
"icon": null,
|
||||||
"order": 30,
|
"order": 30,
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^.*/messages/templates.*$' => [
|
'^.*/messages/template/list.*$' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\Messages\Controller\BackendController:viewMessageTemplates',
|
'dest' => '\Modules\Messages\Controller\BackendController:viewMessageTemplates',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -84,6 +84,17 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'^.*/messages/template/single.*$' => [
|
||||||
|
[
|
||||||
|
'dest' => '\Modules\Messages\Controller\BackendController:viewMessageTemplate',
|
||||||
|
'verb' => RouteVerb::GET,
|
||||||
|
'permission' => [
|
||||||
|
'module' => BackendController::NAME,
|
||||||
|
'type' => PermissionType::READ,
|
||||||
|
'state' => PermissionCategory::MESSAGE,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
'^.*/messages/mail/create.*$' => [
|
'^.*/messages/mail/create.*$' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\Messages\Controller\BackendController:viewMessageCreate',
|
'dest' => '\Modules\Messages\Controller\BackendController:viewMessageCreate',
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,36 @@ final class BackendController extends Controller
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Routing end-point for application behaviour.
|
||||||
|
*
|
||||||
|
* @param RequestAbstract $request Request
|
||||||
|
* @param ResponseAbstract $response Response
|
||||||
|
* @param mixed $data Generic data
|
||||||
|
*
|
||||||
|
* @return RenderableInterface
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
*/
|
||||||
|
public function viewMessageTemplate(RequestAbstract $request, ResponseAbstract $response, mixed $data = null) : RenderableInterface
|
||||||
|
{
|
||||||
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
|
$view->setTemplate('/Modules/Messages/Theme/Backend/mail-template');
|
||||||
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1001201001, $request, $response);
|
||||||
|
|
||||||
|
$template = EmailMapper::get()
|
||||||
|
->with('l11n')
|
||||||
|
->where('isTemplate', true)
|
||||||
|
->where('account', $request->header->account)
|
||||||
|
->where('id', $request->getDataInt('id'))
|
||||||
|
->execute();
|
||||||
|
|
||||||
|
$view->data['template'] = $template;
|
||||||
|
|
||||||
|
return $view;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Routing end-point for application behaviour.
|
* Routing end-point for application behaviour.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ return ['Messages' => [
|
||||||
'Interval' => 'Interval',
|
'Interval' => 'Interval',
|
||||||
'Mailboxes' => 'Mailboxes',
|
'Mailboxes' => 'Mailboxes',
|
||||||
'Messages' => 'Messages',
|
'Messages' => 'Messages',
|
||||||
|
'Templates' => 'Templates',
|
||||||
'Month' => 'Month',
|
'Month' => 'Month',
|
||||||
'New' => 'New',
|
'New' => 'New',
|
||||||
'Outbox' => 'Outbox',
|
'Outbox' => 'Outbox',
|
||||||
|
|
|
||||||
79
Theme/Backend/mail-template.tpl.php
Normal file
79
Theme/Backend/mail-template.tpl.php
Normal file
|
|
@ -0,0 +1,79 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Jingga
|
||||||
|
*
|
||||||
|
* PHP Version 8.1
|
||||||
|
*
|
||||||
|
* @package Modules\Messages
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 2.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link https://jingga.app
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use phpOMS\Localization\ISO639Enum;
|
||||||
|
use phpOMS\Uri\UriFactory;
|
||||||
|
use phpOMS\Utils\Formatter\HtmlFormatter;
|
||||||
|
|
||||||
|
$mail = $this->data['template'];
|
||||||
|
|
||||||
|
echo $this->data['nav']->render(); ?>
|
||||||
|
|
||||||
|
<div class="tabview tab-2 right">
|
||||||
|
<div class="box">
|
||||||
|
<ul class="tab-links">
|
||||||
|
<?php foreach ($mail->l11n as $idx => $l11n) : ?>
|
||||||
|
<li<?= $idx === 1 ? ' class="active"' : ''; ?>><label for="c-tab-<?= $idx; ?>"><?= $this->printHtml(ISO639Enum::getBy2Code($l11n->language)); ?></label></li>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="tab-content">
|
||||||
|
<?php foreach ($mail->l11n as $idx => $l11n) : ?>
|
||||||
|
<input type="radio" id="c-tab-<?= $idx; ?>" name="tabular-1" checked>
|
||||||
|
<div class="tab">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="portlet">
|
||||||
|
<div class="portlet-body">
|
||||||
|
<input type="text" value="<?= $this->printHtml($l11n->subject); ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="portlet">
|
||||||
|
<div class="portlet-body">
|
||||||
|
<pre><?= $this->printHtml(HtmlFormatter::format($l11n->body)); ?></pre>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="portlet">
|
||||||
|
<div class="portlet-body">
|
||||||
|
<?= $l11n->body; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="portlet">
|
||||||
|
<div class="portlet-body">
|
||||||
|
<pre><?= $l11n->bodyAlt; ?></pre>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -43,7 +43,7 @@ echo $this->data['nav']->render(); ?>
|
||||||
<?php $count = 0;
|
<?php $count = 0;
|
||||||
foreach ($messages as $key => $value) : ++$count;
|
foreach ($messages as $key => $value) : ++$count;
|
||||||
$url = UriFactory::build('{/base}/messages/template/single?{?}&id=' . $value->id); ?>
|
$url = UriFactory::build('{/base}/messages/template/single?{?}&id=' . $value->id); ?>
|
||||||
<tr>
|
<tr data-href="<?= $url ?>">
|
||||||
<td><span class="check"><input type="checkbox" name=""></span>
|
<td><span class="check"><input type="checkbox" name=""></span>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml(empty($value->subject) ? $value->getL11nByLanguage($this->response->header->l11n->language)->subject : $value->subject); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml(empty($value->subject) ? $value->getL11nByLanguage($this->response->header->l11n->language)->subject : $value->subject); ?></a>
|
||||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->createdAt->format('Y-m-d')); ?></a>
|
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->createdAt->format('Y-m-d')); ?></a>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user