From 15a95fb3893a06e75ac5b8131c4196a4e42a224b Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 28 Sep 2023 01:04:15 +0000 Subject: [PATCH] fix tests --- Controller/ApiController.php | 26 -------------- Theme/Backend/mail-template.tpl.php | 2 +- Theme/Backend/mail-templates.tpl.php | 52 ++++++++++++---------------- 3 files changed, 23 insertions(+), 57 deletions(-) diff --git a/Controller/ApiController.php b/Controller/ApiController.php index d043a92..5af0f3a 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -48,37 +48,11 @@ final class ApiController extends Controller */ public function apiEmailCreate(RequestAbstract $request, ResponseAbstract $response, array $data = []) : void { - if (!empty($val = $this->validateEmailCreate($request))) { - $response->header->status = RequestStatusCode::R_400; - $this->createInvalidCreateResponse($request, $response, $val); - - return; - } - $email = $this->createEmailFromRequest($request); $this->createModel($request->header->account, $email, EmailMapper::class, 'email', $request->getOrigin()); $this->createStandardCreateResponse($request, $response, $email); } - /** - * Validate email create request - * - * @param RequestAbstract $request Request - * - * @return array - * - * @since 1.0.0 - */ - private function validateEmailCreate(RequestAbstract $request) : array - { - $val = []; - if (($val['subject'] = !$request->hasData('subject'))) { - return $val; - } - - return []; - } - /** * Method to create email from request. * diff --git a/Theme/Backend/mail-template.tpl.php b/Theme/Backend/mail-template.tpl.php index 61f9086..fdad2be 100644 --- a/Theme/Backend/mail-template.tpl.php +++ b/Theme/Backend/mail-template.tpl.php @@ -29,7 +29,7 @@ echo $this->data['nav']->render(); ?>
l11n as $idx => $l11n) : ?> - + response->header->l11n->language ? ' checked' : ''; ?>>
diff --git a/Theme/Backend/mail-templates.tpl.php b/Theme/Backend/mail-templates.tpl.php index 60015e9..c35b605 100755 --- a/Theme/Backend/mail-templates.tpl.php +++ b/Theme/Backend/mail-templates.tpl.php @@ -14,14 +14,6 @@ declare(strict_types=1); use phpOMS\Uri\UriFactory; -/* -$mail = new \phpOMS\Message\Mail\Imap(); -$mail->connect('{imap.gmail.com:993/imap/ssl}INBOX', 'dev.orange.management@gmail.com', 'DEV_PASSWORD'); -$unseen = $mail->getInboxUnseen(); -$seen = $mail->getInboxSeen(); -$quota = $mail->getQuota(); -*/ - $messages = $this->data['templates'] ?? []; $previous = empty($messages) ? 'messages/dashboard' : 'messages/dashboard?{?}&id=' . \reset($messages)->id . '&ptype=p'; @@ -34,29 +26,29 @@ echo $this->data['nav']->render(); ?>
getHtml('Templates'); ?>
- - - - $value) : ++$count; - $url = UriFactory::build('{/base}/messages/template/single?{?}&id=' . $value->id); ?> - - -
- getHtml('Subject'); ?> - getHtml('Date'); ?> -
- printHtml(empty($value->subject) ? $value->getL11nByLanguage($this->response->header->l11n->language)->subject : $value->subject); ?> - printHtml($value->createdAt->format('Y-m-d')); ?> - - -
getHtml('Empty', '0', '0'); ?> - -
+ + + + getHtml('Subject'); ?> + getHtml('Date'); ?> + + $value) : ++$count; + $url = UriFactory::build('{/base}/messages/template/single?{?}&id=' . $value->id); ?> + + + printHtml(empty($value->subject) ? $value->getL11nByLanguage($this->response->header->l11n->language)->subject : $value->subject); ?> + printHtml($value->createdAt->format('Y-m-d')); ?> + + + + getHtml('Empty', '0', '0'); ?> + + +
+ getHtml('Previous', '0', '0'); ?> + getHtml('Next', '0', '0'); ?>