This commit is contained in:
Christine Slotty 2020-06-08 19:04:40 +02:00
parent 0d9d1b595e
commit 5d324d6809
15 changed files with 293 additions and 163 deletions

View File

@ -27,12 +27,12 @@ class ServerUsersController extends AppController
public function index()
{
$serverUsers = $this->paginate($this->ServerUsers);
$this->set(compact('serverUsers'));
}
public function login()
{
$startTime = microtime(true);
if ($this->request->is('post')) {
$user = $this->Auth->identify();
if ($user) {
@ -41,6 +41,7 @@ class ServerUsersController extends AppController
}
$this->Flash->error(__('Invalid username or password, try again'));
}
$this->set('timeUsed', microtime(true) - $startTime);
}
public function logout()

View File

@ -3,6 +3,9 @@ namespace App\Controller;
use App\Controller\AppController;
use Model\Navigation\NaviHierarchy;
use Model\Navigation\NaviHierarchyEntry;
/**
* StateErrors Controller
*
@ -12,13 +15,19 @@ use App\Controller\AppController;
*/
class StateErrorsController extends AppController
{
public function initialize()
{
parent::initialize();
$this->Auth->allow(['showForUser', 'deleteForUser']);
$this->set(
'naviHierarchy',
(new NaviHierarchy())->
add(new NaviHierarchyEntry(__('Startseite'), 'Dashboard', 'index', false))->
add(new NaviHierarchyEntry(__('Fehler'), 'StateErrors', 'ShowForUser', true))
);
}
/**
* Index method
*
@ -33,8 +42,8 @@ class StateErrorsController extends AppController
$this->set(compact('stateErrors'));
}
public function showForUser()
public function showForUser()
{
$startTime = microtime(true);
$this->viewBuilder()->setLayout('frontend');
@ -47,15 +56,15 @@ class StateErrorsController extends AppController
}
$user = $session->read('StateUser');
}
$errors = $this->StateErrors->find('all')->where(['state_user_id' => $user['id']])->contain(false);
$transactionTypes = $this->StateErrors->TransactionTypes->find('all')->select(['id', 'name', 'text'])->order(['id']);
$this->set('errors', $errors);
$this->set('transactionTypes', $transactionTypes->toList());
$this->set('timeUsed', microtime(true) - $startTime);
}
public function deleteForUser($id = null)
{
$this->request->allowMethod(['post', 'delete', 'get']);
@ -76,7 +85,7 @@ class StateErrorsController extends AppController
}
return $this->redirect(['action' => 'showForUser']);
}
/**
* View method

View File

@ -52,15 +52,7 @@ $this->assign(
<h3>Gradido ...</h3>
<div class="content-collection">
<div class="content-item action-button">
<i class="material-icons-outlined">add_box</i>
<?= $this->Html->link(
__('einzeln schöpfen'),
['controller' => 'TransactionCreations', 'action' => 'create'],
['class' => 'action-button-link']
);?>
</div>
<div class="content-item action-button">
<i class="material-icons-outlined">library_add</i>
<i class="material-icons-outlined">redeem</i>
<?= $this->Html->link(
__('viele schöpfen'),
['controller' => 'TransactionCreations', 'action' => 'createMulti'],

View File

@ -1,30 +1,36 @@
<?php
/*
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
$this->assign('title', __('Willkommen'));
$this->assign(
'header',
'<h1>Server Dashboard, nur für Admins</h1>'
);
?>
<h1>Server Dashboard, nur für Admins</h1>
<div class="grd_container_small">
<fieldset>
<h3>Gradido ...</h3>
<div class="content-region">
<h3>Gradido ...</h3>
<div class="content-collection">
<div class="content-item action-button">
<i class="material-icons-outlined">redeem</i>
<?= $this->Html->link(
__('einzeln schöpfen'),
['controller' => 'TransactionCreations', 'action' => 'create'],
['class' => 'grd-nav-bn grd-nav-bn-large']
);?>
__('viele schöpfen'),
['controller' => 'TransactionCreations', 'action' => 'createMulti'],
['class' => 'action-button-link']
);?>
</div>
</div>
<div class="content-collection">
<div class="content-item info-item">
<i class="material-icons-outlined">error_outline</i>
<?= $this->Html->link(
__('viele schöpfen'),
['controller' => 'TransactionCreations', 'action' => 'createMulti'],
['class' => 'grd-nav-bn grd-nav-bn-large']
);?>
</fieldset>
<?= $this->Html->link(
__('Fehler') . ' (' . $adminErrorCount . ')',
['controller' => 'AdminErrors'], ['class' => 'grd-nav-bn']);
?>
['controller' => 'AdminErrors'], ['class' => 'info-item-link']);
?>
</div>
</div>
</div>

View File

@ -47,6 +47,4 @@ if(intval($transactionPendings) > 0) {
?>
<ul>
<?php foreach($navi as $n) echo $n; ?>
</ul>

View File

@ -1,6 +1,6 @@
<?php
/*
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
@ -19,27 +19,25 @@ class NavHeaderEntry
;
}
public function
public function
}
*/
?>
<ul class="nav ml-auto">
<?php if($errorCount > 0) : ?>
<li class="nav-item">
<?= $this->Html->link(
'<i class="mdi mdi-alert-outline grd-alert-color mdi-1x"></i>'
. '<span class="notification-indicator notification-indicator-warning notification-indicator-ripple"></span>',
['controller' => 'StateErrors', 'action' => 'ShowForUser'],
['class' => 'nav-link', 'escape' => false, 'title' => "$errorCount " . __('Fehler')]) ?>
</li>
<?php endif; ?>
<?php if($transactionPendings > 0) : ?>
<li class="nav-item">
<a class="nav-link" title="<?= "$transactionPendings " . __('Transaktionen sind noch zu unterzeichnen')?>" href="<?= Router::url('./', true) ?>account/checkTransactions">
<i class="mdi mdi-signature-freehand mdi-1x"></i>
<!--(<?= $transactionPendings ?>)-->
<span class="notification-indicator notification-indicator-primary notification-indicator-ripple"></span>
</a>
</li>
<?php endif; ?>
</ul>
<?php if($errorCount > 0) : ?>
<li>
<?= $this->Html->link(
'<i class="mdi mdi-alert-outline grd-alert-color mdi-1x"></i>'
. '<span class="notification-indicator notification-indicator-warning notification-indicator-ripple"></span>',
['controller' => 'StateErrors', 'action' => 'ShowForUser'],
['class' => 'nav-link', 'escape' => false, 'title' => "$errorCount " . __('Fehler')]) ?>
</li>
<?php endif; ?>
<?php if($transactionPendings > 0) : ?>
<li>
<a class="nav-link" title="<?= "$transactionPendings " . __('Transaktionen sind noch zu unterzeichnen')?>" href="<?= Router::url('./', true) ?>account/checkTransactions">
<i class="mdi mdi-signature-freehand mdi-1x"></i>
<!--(<?= $transactionPendings ?>)-->
<span class="notification-indicator notification-indicator-primary notification-indicator-ripple"></span>
</a>
</li>
<?php endif; ?>

View File

@ -25,37 +25,29 @@ $cakeDescription = 'Gradido';
<?= $this->fetch('title') ?>
</title>
<?= $this->Html->meta('icon') ?>
<?= $this->Html->css('base.css') ?>
<?= $this->Html->css('style.css') ?>
<?= $this->Html->css(['main.css']) ?>
<?= $this->Html->script(['basic']) ?>
<?= $this->fetch('meta') ?>
<?= $this->fetch('css') ?>
<?= $this->fetch('script') ?>
</head>
<body>
<nav class="top-bar expanded" data-topbar role="navigation">
<ul class="title-area large-3 medium-4 columns">
<li class="name">
<h1><a href=""><?= $this->fetch('title') ?></a></h1>
</li>
</ul>
<div class="top-bar-section">
<ul class="right">
<li><?= $this->html->link(__('Logout'), ['controller' => 'ServerUsers', 'action' => 'logout'])?></li>
<li><a target="_blank" href="https://book.cakephp.org/3.0/">Documentation</a></li>
<li><a target="_blank" href="https://api.cakephp.org/3.0/">API</a></li>
<div class="content-default">
<div class="content-container info-container">
<h1><a href=""><?= $this->fetch('title') ?></a></h1>
<ul class="nav-horizontal">
<li><?= $this->html->link(__('Logout'), ['controller' => 'ServerUsers', 'action' => 'logout'])?></li>
<li><a target="_blank" href="https://book.cakephp.org/3.0/">Documentation</a></li>
<li><a target="_blank" href="https://api.cakephp.org/3.0/">API</a></li>
</ul>
<?= $this->Flash->render() ?>
<?= $this->fetch('content') ?>
</div>
</nav>
<?= $this->Flash->render() ?>
<div class="container clearfix">
<?= $this->fetch('content') ?>
<?php if(isset($timeUsed)) : ?>
<div class="bottomleft">
<?= round($timeUsed * 1000.0, 4) ?> ms
</div>
<?php endif;?>
</div>
<?php if(isset($timeUsed)) : ?>
<div class="grd-time-used dev-info">
<?= round($timeUsed * 1000.0, 4) ?> ms
</div>
<?php endif;?>
</body>
</html>

View File

@ -58,10 +58,12 @@ $GLOBALS["self"] = $this;
<div class="flash-messages">
<?= $this->Flash->render() ?>
</div>
<?= $this->element('navi_header'); ?>
<!-- XXX -->
<div class="nav-vertical">
<ul>
<?= $this->element('navi_header'); ?>
<?= $this->element('navi'); ?>
</ul>
</div>
</div>
<div class="content">

View File

@ -1,19 +1,22 @@
<?php
/*
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
$this->loadHelper('Form', [
'templates' => 'horizontal_form',
]);
?>
<div class="users form large-6 medium-8 columns content center">
<?= $this->Flash->render() ?>
<?= $this->Form->create() ?>
<div class="center-form">
<?= $this->Form->create() ?>
<fieldset>
<legend><?= __('Please enter your username and password') ?></legend>
<?= $this->Form->control('username') ?>
<?= $this->Form->control('password') ?>
<legend><?= __('Please enter your username and password') ?></legend>
<?= $this->Form->control('username') ?>
<?= $this->Form->control('password') ?>
</fieldset>
<?= $this->Form->button(__('Login')); ?>
<?= $this->Form->end() ?>
</div>
<?= $this->Form->button(__('Login'), ['class' => 'form-button']); ?>
<?= $this->Form->end() ?>
</div>

View File

@ -27,11 +27,11 @@ $this->assign('header', $header);
<div class="content-list">
<p class="content-list-title">Überweisungen</p>
<div class="content-list-table wiretransfer">
<span class="header-cell"><?= __('Absender') . ' / ' . ('Empfänger') ?></span>
<span class="header-cell"><?= __('Verwendungszweck') ?></span>
<span class="header-cell"><?= __('Datum') ?></span>
<span class="header-cell"><?= __('Betrag') ?></span>
<span class="header-cell" title="<?= __('Transaktions Nr.') ?>"><?= __('Nr') ?></span>
<div class="cell header-cell"><?= __('Absender') . ' / ' . ('Empfänger') ?></div>
<div class="cell header-cell"><?= __('Verwendungszweck') ?></div>
<div class="cell header-cell"><?= __('Datum') ?></div>
<div class="cell header-cell"><?= __('Betrag') ?></div>
<div class="cell header-cell" title="<?= __('Transaktions Nr.') ?>"><?= __('Nr') ?></div>
<?php foreach($transactions as $transaction):
$send = $transaction['type'] == 'send';
$balance = $transaction['balance'];
@ -47,14 +47,14 @@ $this->assign('header', $header);
$cellColorClass = 'grd-orange-color';
}
?>
<span>
<?= $this->Html->image('50x50.png', ['class' => 'profile-img img-sm', 'alt' => 'profile image']) ?>
<div class="cell">
<?= $this->Html->image('50x50.png', ['class' => 'profile-img', 'alt' => 'profile image']) ?>
<?php if(isset($transaction['email']) && $transaction['email'] != ''): ?>
<a href="mailto:<?= $transaction['email'] ?>" title="<?= $transaction['email'] ?>">
<small class="text-black font-weight-medium d-block"><?= $transaction['name'] ?></small>
<small class="tx-email"><?= $transaction['name'] ?></small>
</a>
<?php else : ?>
<small class="text-black font-weight-medium d-block"><?= $transaction['name'] ?></small>
<small class="tx-email"><?= $transaction['name'] ?></small>
<?php endif; ?>
<span class=" <?= $cellColorClass ?>">
<?php if($transaction['type'] == 'creation') : ?>
@ -68,19 +68,19 @@ $this->assign('header', $header);
<?= __('Empfangen') ?>
<?php endif; ?>
</span>
</span>
<span data-toggle="tooltip" data-placement="bottom" title="<?= $transaction['memo'] ?>">
</div>
<div class="cell" data-toggle="tooltip" data-placement="bottom" title="<?= $transaction['memo'] ?>">
<?php if(strlen($transaction['memo']) > 30): ?>
<?= substr($memoShort, 0, 30) . '...' ?>
<?php else : ?>
<?= $transaction['memo'] ?>
<?php endif;?>
</span>
<span><?= $transaction['date']->nice() ?></span>
<span><?= $this->element('printGradido', ['number' => $balance]) ?></span>
<span>
</div>
<div class="cell"><?= $transaction['date']->nice() ?></div>
<div class="cell"><?= $this->element('printGradido', ['number' => $balance]) ?></div>
<div class="cell">
<?= $transaction['transaction_id'] ?>
</span>
</div>
<?php endforeach; ?>
</div>
</div>

View File

@ -1,6 +1,6 @@
<?php
/*
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
@ -10,39 +10,33 @@ $this->assign('title', __('Fehlermeldungen'));
//var_dump($transactionTypes);
/*foreach($transactionTypes as $i => $t) {
echo "$i => ";
var_dump($t);
var_dump($t);
echo "<br>";
}*/
?>
<div class="grd_container_small">
<table>
<thead>
<tr><th>Transaktion Typ</th><th>Datum</th><th>Fehler</th><th>Aktionen</th></tr>
</thead>
<tbody>
<?php foreach($errors as $error) :
$type = $transactionTypes[$error->transaction_type_id-1];
$errorMessage = "";
$errorArray = json_decode($error->message_json, true);
if(isset($errorArray['details']) && is_array($errorArray['details'])) {
foreach($errorArray['details'][0] as $function => $errorString) {
$errorMessage = '<b>' . $function . '</b><br> ' . $errorString;
}
} else {
$errorMessage = $error->message_json;
<div class="content-list">
<p class="content-list-title">Fehler</p>
<div class="content-list-table error-list">
<span class="header-cell">Transaktion Typ</span>
<span class="header-cell">Datum</span>
<span class="header-cell">Fehler</span>
<span class="header-cell">Aktionen</span>
<?php foreach($errors as $error) :
$type = $transactionTypes[$error->transaction_type_id-1];
$errorMessage = "";
$errorArray = json_decode($error->message_json, true);
if(isset($errorArray['details']) && is_array($errorArray['details'])) {
foreach($errorArray['details'][0] as $function => $errorString) {
$errorMessage = '<b>' . $function . '</b><br> ' . $errorString;
}
?>
<tr>
<td title="<?= $type->text ?>"><?= $type->name ?></td>
<td><?= $error->created ?></td>
<td><?= $errorMessage ?></td>
<td><?= $this->Html->link(__('Delete'), ['action' => 'deleteForUser', $error->id], ['class' => 'grd-form-bn grd-form-bn-discard']) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
} else {
$errorMessage = $error->message_json;
}
?>
<span title="<?= $type->text ?>"><?= $type->name ?></span>
<span><?= $error->created ?></span>
<span><?= $errorMessage ?></span>
<span><?= $this->Html->link(__('Delete'), ['action' => 'deleteForUser', $error->id], ['class' => 'grd-form-bn grd-form-bn-discard']) ?></span>
<?php endforeach; ?>
</div>
</div>

View File

@ -453,6 +453,11 @@
/* =========
CONTENT
=========*/
.content-default {
display: flex;
justify-content: center;
padding-top: 50px;
}
.content {
display: flex;
justify-content: flex-start;
@ -492,6 +497,9 @@
border: 1px solid rgba(238, 238, 238, 0.75);
margin: 1em 0.25em;
}
.content-default .content-container {
min-width: 800px;
}
/* Top Info Above Main */
.info-container {
max-width: 70%;
@ -541,8 +549,10 @@
font-size: 16px;
color: #212529;
}
.cell {
padding: 1em 1.5em;
}
.header-cell {
padding: 1em 2em;
border-top: 1px solid #f2f4f9;
background-color: #fafafa;
color: #101010;
@ -560,6 +570,28 @@
.wiretransfer {
grid-template-columns: 5fr 4fr 3fr 2fr 1fr;
}
.error-list {
grid-template-columns: 2fr 2fr 5fr 1fr;
}
.profile-img {
width: 30px;
height: 30px;
border-radius: 6px;
box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.2);
overflow: hidden;
vertical-align: middle;
border-style: none;
box-sizing: border-box;
}
.tx-email {
cursor: pointer;
display: block;
color: #101010;
}
.small {
font-size: 80%;
font-weight: 400;
}
/* OTHER */
.info-item i,
.info-item-link,
@ -715,12 +747,6 @@ and open the template in the editor.
margin-bottom: 15px;
border-radius: 0 6px 0 0;
}
.form-body form {
display: grid;
grid-template-columns: 200px 1fr;
margin: 36px 75px;
grid-gap: 1em;
}
.form-label {
grid-column: 0.5;
font-weight: 400;
@ -769,6 +795,22 @@ and open the template in the editor.
background-color: #034b04;
border-color: #023f03;
}
/* CENTER FORM SPECIFICS */
.form-body form {
display: grid;
grid-template-columns: 200px 1fr;
margin: 36px 75px;
grid-gap: 1em;
}
.center-form {
width: 450px;
}
.center-form .form-control {
width: 90%;
}
.center-form fieldset {
margin-bottom: 1em;
}
}
/*
Button

View File

@ -453,6 +453,11 @@
/* =========
CONTENT
=========*/
.content-default {
display: flex;
justify-content: center;
padding-top: 50px;
}
.content {
display: flex;
justify-content: flex-start;
@ -492,6 +497,9 @@
border: 1px solid rgba(238, 238, 238, 0.75);
margin: 1em 0.25em;
}
.content-default .content-container {
min-width: 800px;
}
/* Top Info Above Main */
.info-container {
max-width: 70%;
@ -541,8 +549,10 @@
font-size: 16px;
color: #212529;
}
.cell {
padding: 1em 1.5em;
}
.header-cell {
padding: 1em 2em;
border-top: 1px solid #f2f4f9;
background-color: #fafafa;
color: #101010;
@ -560,6 +570,28 @@
.wiretransfer {
grid-template-columns: 5fr 4fr 3fr 2fr 1fr;
}
.error-list {
grid-template-columns: 2fr 2fr 5fr 1fr;
}
.profile-img {
width: 30px;
height: 30px;
border-radius: 6px;
box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.2);
overflow: hidden;
vertical-align: middle;
border-style: none;
box-sizing: border-box;
}
.tx-email {
cursor: pointer;
display: block;
color: #101010;
}
.small {
font-size: 80%;
font-weight: 400;
}
/* OTHER */
.info-item i,
.info-item-link,
@ -715,12 +747,6 @@ and open the template in the editor.
margin-bottom: 15px;
border-radius: 0 6px 0 0;
}
.form-body form {
display: grid;
grid-template-columns: 200px 1fr;
margin: 36px 75px;
grid-gap: 1em;
}
.form-label {
grid-column: 0.5;
font-weight: 400;
@ -769,6 +795,22 @@ and open the template in the editor.
background-color: #034b04;
border-color: #023f03;
}
/* CENTER FORM SPECIFICS */
.form-body form {
display: grid;
grid-template-columns: 200px 1fr;
margin: 36px 75px;
grid-gap: 1em;
}
.center-form {
width: 450px;
}
.center-form .form-control {
width: 90%;
}
.center-form fieldset {
margin-bottom: 1em;
}
}
/*
Button

View File

@ -13,6 +13,12 @@
/* =========
CONTENT
=========*/
.content-default {
display: flex;
justify-content: center;
padding-top: 50px;
}
.content {
display: flex;
justify-content: flex-start;
@ -64,6 +70,10 @@
margin: 1em .25em;
}
.content-default .content-container {
min-width: 800px;
}
/* Top Info Above Main */
.info-container {
max-width: 70%;
@ -123,8 +133,11 @@
color: #212529;
}
.cell {
padding: 1em 1.5em;
}
.header-cell {
padding: 1em 2em;
border-top: 1px solid @content-table-header-border;
background-color: @content-table-header-bg;
color: @content-table-header;
@ -146,6 +159,32 @@
grid-template-columns: 5fr 4fr 3fr 2fr 1fr;
}
.error-list {
grid-template-columns: 2fr 2fr 5fr 1fr;
}
.profile-img {
width: 30px;
height: 30px;
border-radius: 6px;
box-shadow: 0 0 2px 0 rgba(0, 0, 0, .2);
overflow: hidden;
vertical-align: middle;
border-style: none;
box-sizing: border-box;
}
.tx-email {
cursor: pointer;
display: block;
color: @content-table-header;
}
.small {
font-size: 80%;
font-weight: 400;
}
/* OTHER */
.info-item i,
.info-item-link,

View File

@ -34,13 +34,6 @@ and open the template in the editor.
border-radius: 0 6px 0 0;
}
.form-body form {
display: grid;
grid-template-columns: 200px 1fr;
margin: 36px 75px;
grid-gap: 1em;
}
.form-label {
grid-column: 1 / 2;
font-weight: 400;
@ -94,6 +87,25 @@ and open the template in the editor.
border-color: #023f03;
}
/* CENTER FORM SPECIFICS */
.form-body form {
display: grid;
grid-template-columns: 200px 1fr;
margin: 36px 75px;
grid-gap: 1em;
}
.center-form {
width: 450px;
}
.center-form .form-control {
width: 90%;
}
.center-form fieldset {
margin-bottom: 1em;
}
}
/*