mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' of ssh://**REDACTED**/~/_cakephp/gradido_single_node
This commit is contained in:
commit
92f62f55a9
@ -231,6 +231,34 @@ class AppController extends Controller
|
||||
}
|
||||
*/
|
||||
|
||||
public function addAdminError($controller, $action, $returnTable, $state_user_id) {
|
||||
if(!is_array($returnTable)) {
|
||||
$this->addAdminError('AppController', 'addAdminError', ['state' => 'error', 'msg' => 'returnTable isn\'t array', 'details' => gettype($returnTable)]);
|
||||
return false;
|
||||
}
|
||||
$adminErrorTable = TableRegistry::getTableLocator()->get('AdminErrors');
|
||||
$adminErrorEntity = $adminErrorTable->newEntity();
|
||||
$adminErrorEntity->state_user_id = $state_user_id;
|
||||
$adminErrorEntity->controller = $controller;
|
||||
$adminErrorEntity->action = $action;
|
||||
$adminErrorEntity->state = $returnTable->state;
|
||||
if(isset($returnTable['msg'])) {
|
||||
$adminErrorEntity->msg = $returnTable['msg'];
|
||||
}
|
||||
if(isset($returnTable['details'])) {
|
||||
$adminErrorEntity->details = $returnTable['details'];
|
||||
}
|
||||
if(!$adminErrorTable->save($adminErrorEntity)) {
|
||||
$this->Flash->error(__('Serious error, couldn\'t save to db, please write the admin: ' . $this->getAdminEmailLink()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getAdminEmailLink($text) {
|
||||
$serverAdminEmail = Configure::read('ServerAdminEmail');
|
||||
return '<a href="mailto:' . $serverAdminEmail . '">'. $serverAdminEmail . '</a>';
|
||||
}
|
||||
|
||||
public function returnJsonEncoded($json) {
|
||||
$this->autoRender = false;
|
||||
$response = $this->response->withType('application/json');
|
||||
|
||||
@ -3,7 +3,7 @@ namespace App\Controller;
|
||||
|
||||
use App\Controller\AppController;
|
||||
//use Cake\Routing\Router;
|
||||
//use Cake\ORM\TableRegistry;
|
||||
use Cake\ORM\TableRegistry;
|
||||
|
||||
/**
|
||||
* StateUsers Controller
|
||||
@ -49,8 +49,10 @@ class DashboardController extends AppController
|
||||
{
|
||||
$startTime = microtime(true);
|
||||
$this->viewBuilder()->setLayout('frontend');
|
||||
$adminErrorsTable = TableRegistry::getTableLocator()->get('AdminErrors');
|
||||
$adminErrorCount = $adminErrorsTable->find('all')->count();
|
||||
|
||||
|
||||
$this->set('adminErrorCount', $adminErrorCount);
|
||||
$this->set('timeUsed', microtime(true) - $startTime);
|
||||
}
|
||||
|
||||
|
||||
@ -243,6 +243,7 @@ class TransactionCreationsController extends AppController
|
||||
$timeUsed = microtime(true) - $startTime;
|
||||
$this->set(compact('timeUsed', 'stateUsers', 'creationForm', 'possibleReceiver'));
|
||||
|
||||
$this->set('activeUser', $user);
|
||||
$this->set('creationForm', $creationForm);
|
||||
$this->set('timeUsed', microtime(true) - $startTime);
|
||||
|
||||
|
||||
@ -23,4 +23,8 @@ $this->assign('title', __('Willkommen'));
|
||||
['class' => 'grd-nav-bn grd-nav-bn-large']
|
||||
);?>
|
||||
</fieldset>
|
||||
<?= $this->Html->link(
|
||||
__('Fehler') . ' (' . $adminErrorCount . ')',
|
||||
['controller' => 'AdminErrors'], ['class' => 'grd-nav-bn']);
|
||||
?>
|
||||
</div>
|
||||
@ -42,9 +42,17 @@ $this->assign('title', __('Schöpfungstransaktion'));
|
||||
<fieldset>
|
||||
<?= $this->Form->control('memo'); ?>
|
||||
<?= $this->Form->control('amount'); ?>
|
||||
<?php foreach($possibleReceiver as $possibleReceiver) : ?>
|
||||
<?php foreach($possibleReceiver as $possibleReceiver) :
|
||||
$disable = '';
|
||||
if($activeUser['id'] == $possibleReceiver['id']) {
|
||||
$disable = 'disabled';
|
||||
}
|
||||
?>
|
||||
<div class="grd_big_checkbox">
|
||||
<?= $this->Form->checkbox('user[' .$possibleReceiver['id'] . ']', ['value' => $possibleReceiver['id'], 'hiddenField' => false]); ?>
|
||||
<?= $this->Form->checkbox('user[' .$possibleReceiver['id'] . ']', ['value' => $possibleReceiver['id'], 'hiddenField' => false, $disable]); ?>
|
||||
<?php if($disable != '') : ?>
|
||||
<span style="color:grey" title="Du kannst leider nicht für dich selbst schöpfen.">
|
||||
<?php endif; ?>
|
||||
<?= $possibleReceiver['name'] ?>
|
||||
<?php if($possibleReceiver['email'] != '') : ?>
|
||||
<<?= $possibleReceiver['email'] ?>>
|
||||
@ -52,6 +60,9 @@ $this->assign('title', __('Schöpfungstransaktion'));
|
||||
<?php if($possibleReceiver['amount'] != 0) : ?>
|
||||
<span class="grd_smaller">
|
||||
In diesem Monat bereits geschöpft: <?= $this->element('printGradido', ['number' => $possibleReceiver['amount']]);?></span>
|
||||
<?php endif; ?>
|
||||
<?php if($disable != '') : ?>
|
||||
</span>
|
||||
<?php endif; ?>
|
||||
<br>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user