Skip to content
Snippets Groups Projects
Commit a4ac120e authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Finishing up queue backend

parent 9c27b01d
No related branches found
No related tags found
No related merge requests found
......@@ -61,7 +61,7 @@ class QueueController extends ActionController {
$this->view->assign('selectedTemplateKey', $selectedTemplate);
$this->view->assign('selectedExtensionKey', $selectedExtension);
$this->view->assign('templates', $registerArray);
$this->view->assign('queue', $queue->toArray());
$this->view->assign('queue', $queue);
$this->view->assign('mode', 'queue');
}
......
......@@ -68,6 +68,6 @@ class MailRepository extends AbstractRepository {
$constraintsAnd[] = $query->equals('template_name', $templateName);
$query->setOrderings(['tstamp' => Query::ORDER_DESCENDING]);
return $query->matching($query->logicalAnd($constraintsAnd))->execute();
return $query->matching($query->logicalAnd($constraintsAnd))->execute(TRUE);
}
}
......@@ -24,7 +24,7 @@ namespace SGalinski\SgMail\ViewHelpers\Backend\Widget;
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use SGalinski\SgRoutes\ViewHelpers\Backend\Widget\Controller\PaginateController;
use SGalinski\SgMail\ViewHelpers\Backend\Widget\Controller\PaginateController;
use TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetViewHelper;
/**
......@@ -32,7 +32,7 @@ use TYPO3\CMS\Fluid\Core\Widget\AbstractWidgetViewHelper;
*/
class PaginateViewHelper extends AbstractWidgetViewHelper {
/**
* @var \SGalinski\SgRoutes\ViewHelpers\Backend\Widget\Controller\PaginateController
* @var \SGalinski\SgMail\ViewHelpers\Backend\Widget\Controller\PaginateController
*/
protected $controller;
......
......@@ -12,35 +12,55 @@
<div class="panel panel-default recordlist">
<div class="table-fit">
<table data-table="tx_sgmail_domain_model_mail" class="table table-striped table-hover">
<sg:backend.widget.paginate objects="{queue}" as="paginatedMails" configuration="{insertAbove: 1, itemsPerPage: 20}">
<sgm:backend.widget.paginate objects="{queue}" as="paginatedMails" configuration="{insertAbove: 1, itemsPerPage: 20}">
<tbody>
<f:for each="{paginatedMails}" as="mail">
{sg:backend.editOnClick(table: 'tx_sgmail_domain_model_mail', uid: mail.uid) -> sg:set(name: 'editOnClick')}
{sgm:backend.editOnClick(table: 'tx_sgmail_domain_model_mail', uid: mail.uid) -> sgm:set(name: 'editOnClick')}
<tr data-uid="{mail.uid}">
<td nowrap="nowrap" class="col-icon">
<sg:backend.icon table="tx_sgmail_domain_model_mail" row="{mail}" />
<sgm:backend.icon table="tx_sgmail_domain_model_mail" row="{mail}" />
</td>
<td nowrap="nowrap">
<a href="#" onclick="{editOnClick}">
<span>{mail.uid}</span>
<span>{mail.from_address} -> {mail.to_address}, {mail.mail_subject}</span>
</a>
</td>
<td nowrap="nowrap" class="col-control">
<sg:backend.control table="tx_sgmail_domain_model_mail" row="{mail}" />
<sgm:backend.control table="tx_sgmail_domain_model_mail" row="{mail}" />
</td>
<td>
<f:if condition="{mail.sent} == '0'">
<f:then>
<f:link.action class="btn-send-now btn btn-primary" controller="Queue" action="sendMail" arguments="{uid: mail.uid}">Send Now</f:link.action>
<f:link.action class="btn btn-default btn-send-now" controller="Queue" action="sendMail" arguments="{uid: mail.uid}">
<span class="t3js-icon icon icon-size-small icon-state-default actions-document-import-t3d">
<span class="icon-markup">
<img src="/typo3/sysext/core/Resources/Public/Icons/T3Icons/actions/actions-document-import-t3d.svg" width="16" height="16">
</span>
</span>
Send Now
</f:link.action>
</f:then>
<f:else>
<f:link.action class="btn-resend btn btn-warning" controller="Queue" action="sendMail" arguments="{uid: mail.uid}">Send Again</f:link.action>
<f:link.action class="btn btn-default btn-resend" controller="Queue" action="sendMail" arguments="{uid: mail.uid}">
<span class="t3js-icon icon icon-size-small icon-state-default icon-actions-insert-reference">
<span class="icon-markup">
<img src="/typo3/sysext/core/Resources/Public/Icons/T3Icons/actions/actions-insert-reference.svg" width="16" height="16">
</span>
</span>
Send Again
</f:link.action>
</f:else>
</f:if>
</td>
<td>
<button class="btn-toggle btn btn-primary" data-uid="{mail.uid}">
<f:translate key="backend.showBody" /></button>
<a class="btn btn-default btn-toggle" data-uid="{mail.uid}" >
<span class="t3js-icon icon icon-size-small icon-state-default actions-document-view">
<span class="icon-markup">
<img src="/typo3/sysext/core/Resources/Public/Icons/T3Icons/actions/actions-document-view.svg" width="16" height="16">
</span>
</span>
<f:translate key="backend.showBody" />
</a>
</td>
</tr><!-- Modal -->
<div class="modal fade" id="toggle-{mail.uid}" tabindex="-1" role="dialog" aria-labelledby="login-modal-label">
......@@ -49,12 +69,12 @@
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="login-modal-label">{mail.mailSubject}</h4>
<h4 class="modal-title" id="login-modal-label">{mail.mail_subject}</h4>
</div>
<div class="modal-body" id="login-modal-body">
<div class="modalcol modalcol-left">
<f:format.html>
{mail.mailBody}
{mail.mail_body}
</f:format.html>
</div>
</div>
......@@ -63,7 +83,7 @@
</div>
</f:for>
</tbody>
</sg:backend.widget.paginate>
</sgm:backend.widget.paginate>
</table>
</div>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment