Commit 8dd5f20e authored by mabolek's avatar mabolek

[WIP] Work on ManagerController::manualKarmaIssuanceReviewFormAction()

parent 03f0f292
Pipeline #6274 failed with stages
in 26 seconds
......@@ -3,6 +3,7 @@
namespace T3o\Karma\Controller;
use T3o\Karma\Utility\UserProfileChangeKarmaIssuerUtility;
use TYPO3\CMS\Core\Messaging\AbstractMessage;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
......@@ -79,6 +80,39 @@ class ManagerController extends AbstractController
*/
public function manualKarmaIssuanceReviewFormAction(string $usernames, string $issuerAction, string $note)
{
if($issuerAction === '') {
$this->addFlashMessage(
'Please choose a karma-earning action.',
'No Action Selected',
AbstractMessage::ERROR
);
$this->forward(
'manualKarmaIssuanceForm',
null,
null,
[
'usernames' => $usernames,
'issuerAction' => $issuerAction,
'note' => $note
]
);
}
$usernamesArray = preg_split('#\s*[\\n,]+\s*#', $usernames, -1, PREG_SPLIT_NO_EMPTY);
$frontendUsers = [];
$usernamesWithoutFrontendUser = [];
foreach($usernamesArray as $username) {
$frontendUser = $this->frontendUserRepository->findOneByUsername($username);
if ($frontendUser !== null) {
$frontendUsers[] = $frontendUser;
} else {
$usernamesWithoutFrontendUser[] = $username;
}
}
}
......
<section class="container" xmlns:f="http://www.w3.org/1999/html">
<h1>Issue Karma to Users</h1>
<f:flashMessages />
<f:form action="manualKarmaIssuanceReviewForm" method="post">
<div class="form-group">
<label for="manualKarmaIssuanceReviewForm_usernames">Usernames</label>
......
Markdown is supported
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