This commit is contained in:
Dennis Eichhorn 2024-02-28 05:09:11 +00:00
parent c8b92e31ca
commit 3fcc8a8d21
10 changed files with 157 additions and 56 deletions

View File

@ -1,35 +0,0 @@
---
name: Dev Bug Report
about: Create a report to help us improve
title: ''
labels: stat_backlog, type_bug
assignees: ''
---
# Bug Description
A clear and concise description of what the bug is.
# How to Reproduce
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
## Minimal Code Example
```
// your code ...
```
# Expected Behavior
A clear and concise description of what you expected to happen.
# Screenshots
If applicable, add screenshots to help explain your problem.
# Additional Information
Add any other context about the problem here.

View File

@ -1,18 +0,0 @@
---
name: Dev Feature Request
about: Suggest an idea for this project
title: ''
labels: stat_backlog, type_feature
assignees: ''
---
# What is the feature you request
* A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
* A clear and concise description of what you want to happen.
# Alternatives
A clear and concise description of any alternative solutions or features you've considered.
# Additional Information
Add any other context or screenshots about the feature request here.

View File

@ -0,0 +1,44 @@
[
{
"type": "email_template",
"from": "",
"to": "",
"cc": "",
"bcc": "",
"ishtml": true,
"l11n": {
"en": {
"subject": "Header",
"body": "",
"bodyalt": ""
},
"de": {
"subject": "Kopfzeile",
"body": "",
"bodyalt": ""
}
},
"send": false
},
{
"type": "email_template",
"from": "",
"to": "",
"cc": "",
"bcc": "",
"ishtml": true,
"l11n": {
"en": {
"subject": "Footer",
"body": "<p style=\"margin-top: 40px;\">Jingga e.K. - www.jingga.app - CEO Dennis Eichhorn - Amtsgericht Friedberg HRA 5058</p>",
"bodyalt": "\n\n\nJingga e.K. - www.jingga.app - CEO Dennis Eichhorn - Amtsgericht Friedberg HRA 5058"
},
"de": {
"subject": "Fußzeile",
"body": "<p style=\"margin-top: 40px;\">Jingga e.K. - www.jingga.app - CEO Dennis Eichhorn - Amtsgericht Friedberg HRA 5058</p>",
"bodyalt": "\n\n\nJingga e.K. - www.jingga.app - CEO Dennis Eichhorn - Amtsgericht Friedberg HRA 5058"
}
},
"send": false
}
]

View File

@ -0,0 +1,72 @@
<?php
/**
* Jingga
*
* PHP Version 8.1
*
* @package Modules\Messages\Admin\Install
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\Messages\Admin\Install;
use Modules\Messages\Models\SettingsEnum;
use phpOMS\Application\ApplicationAbstract;
use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse;
/**
* Media class.
*
* @package Modules\Messages\Admin\Install
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/
class Messages
{
/**
* Install media providing
*
* @param ApplicationAbstract $app Application
* @param string $path Module path
*
* @return void
*
* @since 1.0.0
*/
public static function install(ApplicationAbstract $app, string $path) : void
{
$messages = \Modules\Messages\Admin\Installer::installExternal($app, ['path' => __DIR__ . '/Messages.install.json']);
/** @var \Modules\Admin\Controller\ApiController $module */
$module = $app->moduleManager->get('Admin');
$settings = [
[
'id' => null,
'name' => SettingsEnum::HEADER_TEMPLATE,
'content' => (string) $messages['email_template'][0]['id'],
'module' => 'Messages',
],
[
'id' => null,
'name' => SettingsEnum::FOOTER_TEMPLATE,
'content' => (string) $messages['email_template'][1]['id'],
'module' => 'Messages',
],
];
$response = new HttpResponse();
$request = new HttpRequest();
$request->header->account = 1;
$request->setData('settings', \json_encode($settings));
$module->apiSettingsSet($request, $response);
}
}

View File

@ -31,6 +31,11 @@ use phpOMS\Message\ResponseAbstract;
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*
* @todo Implement general email header & footer which can be used by all templates
* Load normal template
* Replace {header_template}
* Replace {footer_template}
*/
final class ApiController extends Controller
{

32
Models/SettingsEnum.php Normal file
View File

@ -0,0 +1,32 @@
<?php
/**
* Jingga
*
* PHP Version 8.1
*
* @package Modules\Messages\Models
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\Messages\Models;
use phpOMS\Stdlib\Base\Enum;
/**
* Module settings enum.
*
* @package Modules\Messages\Models
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
*/
abstract class SettingsEnum extends Enum
{
public const HEADER_TEMPLATE = '1001200001';
public const FOOTER_TEMPLATE = '1001200002';
}

View File

@ -20,7 +20,7 @@ $quota = $mail->getQuota();
echo $this->data['nav']->render(); ?>
<section class="box w-100">
<ul class="btns floatLeft">
<ul class="btns lf">
<li><a href="<?= \phpOMS\Uri\UriFactory::build('messages/mail/create'); ?>"><?= $this->getHtml('Create', '0', '0'); ?></a>
<li><a href=""><i class="g-icon">delete</i> <?= $this->getHtml('Delete'); ?></a>
</ul>

View File

@ -20,7 +20,7 @@ $quota = $mail->getQuota();
echo $this->data['nav']->render(); ?>
<section class="box w-100">
<ul class="btns floatLeft">
<ul class="btns lf">
<li><a href="<?= \phpOMS\Uri\UriFactory::build('messages/mail/create'); ?>"><?= $this->getHtml('Create', '0', '0'); ?></a>
<li><a href=""><i class="g-icon">delete</i> <?= $this->getHtml('Delete'); ?></a>
</ul>

View File

@ -20,7 +20,7 @@ $quota = $mail->getQuota();
echo $this->data['nav']->render(); ?>
<section class="box w-100">
<ul class="btns floatLeft">
<ul class="btns lf">
<li><a href="<?= \phpOMS\Uri\UriFactory::build('messages/mail/create'); ?>"><i class="g-icon">stylus</i> <?= $this->getHtml('Create', '0', '0'); ?></a>
<li><a href=""><i class="g-icon">delete</i> <?= $this->getHtml('Delete'); ?></a>
</ul>

View File

@ -22,6 +22,7 @@
},
"providing": {
"Navigation": "*",
"Messages": "*",
"Workflow": "*"
},
"load": [