Commit 4cb65357 authored by Oliver Eglseder's avatar Oliver Eglseder
Browse files

[WIP][TASK] List people that did not receive an invitation yet

parent 098b00b9
......@@ -35,6 +35,7 @@ class BeElectionCircularController extends AbstractProtectedBeController
const ACTION_PREVIEW = 'preview';
const ACTION_TEST_SEND = 'testSend';
const ACTION_SEND = 'send';
const ACTION_SEND_PREVIEW = 'sendPreview';
/**
* @var \TYPO3\Election\Domain\Repository\ElectionCircularRepository
......@@ -135,6 +136,14 @@ class BeElectionCircularController extends AbstractProtectedBeController
);
}
/**
* @param ElectionCircular $electionCircular
*/
public function sendPreviewAction(ElectionCircular $electionCircular)
{
$this->view->assign('electionCircular', $electionCircular);
}
/**
* @param ElectionCircular $electionCircular
*/
......@@ -175,6 +184,7 @@ class BeElectionCircularController extends AbstractProtectedBeController
self::ACTION_PREVIEW,
self::ACTION_TEST_SEND,
self::ACTION_SEND,
self::ACTION_SEND_PREVIEW,
]
);
}
......
......@@ -132,4 +132,13 @@ class ElectionCircular extends AbstractEntity
{
return 'sakdjfhlkasdjhf';
}
/**
* @return Elector[]
*/
public function getRemainingReceivers()
{
// TODO: return only those who did not receive an invitation yet
return $this->getElection()->getElectorate()->getElectors();
}
}
......@@ -363,6 +363,12 @@
<trans-unit id="view.be.election_circular.preview.send_invitations">
<source>Send invitations</source>
</trans-unit>
<trans-unit id="view.be.election_circular.send_preview.welcome">
<source>Send invitations</source>
</trans-unit>
<trans-unit id="view.be.election_circular.send_preview.remaining_receivers">
<source>Remaining receivers</source>
</trans-unit>
<!-- MODEL ELECTION CIRCULARS -->
......
<div>
<h2>
<f:translate key="view.be.election_circular.send_preview.remaining_receivers">Remaining receivers</f:translate>
</h2>
<table class="table">
<thead>
<tr>
<th>
<f:translate key="model.abstract_person.field.full_name">Name</f:translate>
</th>
<th>
<f:translate key="model.abstract_person.field.email">email</f:translate>
</th>
</tr>
</thead>
<tbody>
<f:for each="{electionCircular.remainingReceivers}" as="elector">
<tr>
<td>
{elector.fullName}
</td>
<td>
{elector.email}
</td>
</tr>
</f:for>
</tbody>
</table>
</div>
......@@ -9,7 +9,7 @@
</f:link.action>
<f:if condition="{isPluginInstalled}">
<f:then>
<f:link.action class="btn btn-default" action="send" controller="BeElectionCircular"
<f:link.action class="btn btn-default" action="sendPreview" controller="BeElectionCircular"
arguments="{electionCircular:electionCircular}">
<core:icon identifier="actions-system-list-open"/>
<f:translate key="view.be.election_circular.preview.send_invitations">Send invitations</f:translate>
......
{namespace core=TYPO3\CMS\Core\ViewHelpers}
<f:layout name="Backend"/>
<f:section name="LeftToolBar">
</f:section>
<f:section name="RightToolBar">
</f:section>
<f:section name="Welcome">
<h1>
<f:translate key="view.be.election_circular.send_preview.welcome">
Send invitations
</f:translate>
</h1>
</f:section>
<f:section name="Main">
<f:render partial="Model/ElectionCircular/SendPreview" arguments="{electionCircular:electionCircular}"/>
</f:section>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment