redesign for mulituser

change validation concept (client and server)
using entities
This commit is contained in:
Markus
2026-10-06 08:55:35 +02:00
parent 14e050e4ba
commit 995e2ec111
41 changed files with 2402 additions and 1223 deletions

View File

@@ -3,31 +3,49 @@
<?= $this->section('css'); ?>
<link rel="stylesheet" href="/css/mawim.css">
<link rel="stylesheet" href="/assets/jquery-ui-1.13.2.custom/jquery-ui.css">
<?= $this->endSection(); ?>
<?= $this->section('menu'); ?>
<?= $this->include('sidebar') ?>
<?= $this->endSection(); ?>
<?= $this->section('content'); ?>
<?php if (!function_exists('printBool')) {
function printBool(bool $var){
return ($var)?"true":"false";
}
}
?>
<?php function printsub($id, $all){
<?php if (!function_exists('printsub')) { function printsub(int $id, $all){
$liste = '';
$ret='';
foreach($all as $ele){
$class ="";
$vis ="d-none";
if ($ele->parent_id == $id){
if ($ele->lkz) $class = "text-bg-danger";
else if ($ele->bookable == "f") $class = "text-bg-warning";
$toolt ="bookable: $ele->bookable; lkz: $ele->lkz; Id: $ele->id; PID:$ele->parent_id";
$liste .= "<li><span data-bs-toggle='tooltip' data-bs-html=true title='$toolt'";
if ($ele->deleted_at) {
$class = "text-bg-danger";
$vis="d-none";
}
else {
$vis="";
if (!$ele->bookable)
$class = "text-bg-warning";
}
$toolt = ($ele->bookable)?"":"not ";
$toolt .= "bookable; ";
$toolt .= ($ele->deleted_at)?"gelöscht; ":"";
$toolt .="Id: $ele->id; PID:$ele->parent_id";
$liste .= "<li class=\"$vis\"><i class=\"fa-solid\"></i> <span data-bs-toggle='tooltip' data-bs-html=true title='$toolt'";
$liste .= "data-id=\"$ele->id\"";
$liste .= "data-pid=\"$ele->parent_id\"";
$liste .= "data-bookable=\"$ele->bookable\"";
$liste .= "data-lkz=\"$ele->lkz\"";
$liste .= "data-type=\"$ele->type\"";
$liste .= "data-bookable=\"".printBool($ele->bookable)."\"";
$liste .= "data-account=\"".printBool($ele->account)."\"";
$liste .= "data-monitor=\"".printBool($ele->monitor)."\"";
$liste .= "data-deleted=\"$ele->deleted_at\"";
$liste .= "data-description=\"$ele->description\"";
$liste .= "class='$class'>$ele->description</span></li>";
$liste .= "class='$class'>$ele->description</span>";
$liste .= printsub($ele->id, $all);
$liste .= "</li>";
}
}
if ($liste !=''){
@@ -36,33 +54,53 @@
$ret .= "</ul>";
}
return $ret;
} ?>
}} ?>
<div class="page-heading">
<h3> Kategorien bearbeiten</h3>
<?php if ($saveDB??false) : ?>
<div class='alert <?= $saveDB["mode"] ?> mt-2'>
<?= $saveDB["message"] ?>
</div>
<?php endif; ?>
</div>
<div class="row">
<div class="col-md-3 col-12" id="tree">
<div class="card text-bg-dark">
<div class="card-content">
<div class="card-body">
<div><a class="btn btn-info multi" onclick="newCat();" role="button">Neue Kategorie</a></div>
<div class="d-flex justify-content-between">
<div class="col-sm-12 col-md-6">
<a class="btn btn-info multi" onclick="newCat();" role="button"> + Neue Kategorie</a>
</div>
<div class="col-sm-12 col-md-6 form-check form-check-reverse form-switch justify-content-end">
<input class="form-check-input" type="checkbox" id="viewdeleted" value="1" name="viewdeleted">
<label class="form-check-label" for="viewdeleted">Gelöschte</label>
</div>
</div>
<div class="tree">
<ul>
<?php foreach($parents as $parent): ?>
<?php $class='';
if ($parent->lkz) $class = "text-bg-danger";
else if ($parent->bookable == "f") $class = "text-bg-warning"; ?>
<li> <span data-bs-toggle='tooltip'
<?php $class=''; $vis ="d-none";
if ($parent->deleted_at) {
$class = "text-bg-danger";
$vis = "d-none";
} else {
$vis = "";
if (!$parent->bookable) $class = "text-bg-warning";
}?>
<li class="<?=$vis?>"><i class="fa-solid"></i> <span data-bs-toggle='tooltip'
data-bs-html=true
data-id="<?=$parent->id?>"
data-pid="0"
data-bookable="<?=$parent->bookable?>"
data-lkz=" <?= $parent->lkz?>"
data-type="<?= $parent->type?>"
data-bookable=<?=printBool($parent->bookable)?>
data-monitor=<?=printBool($parent->monitor)?>
data-account=<?=printBool($parent->account)?>
data-deleted="<?= $parent->deleted_at?>"
data-description="<?= $parent->description?>";
title="bookable: <?=$parent->bookable?>; lkz: <?= $parent->lkz?>; Id: <?=$parent->id?>;" class="<?=$class?>"><?=$parent->description?></span>
title="<?=($parent->bookable)?"":"not "?>bookable; <?= ($parent->deleted_at)?"gelöscht; ":""?>Id: <?=$parent->id?>;"
class="<?=$class?>"><?=$parent->description?></span>
<?= printsub($parent->id, $all); ?>
<li>
<?php endforeach; ?>
</ul>
</div>
@@ -70,13 +108,11 @@
</div>
</div>
</div>
<div class="col-md-3 col-12 d-none" id="editor">
<div class="col-md-3 col-12 <?= (empty($errors))?"d-none" :"" ?>" id="editor">
<?= $this->include('accountsform') ?>
</div>
</section>
<?= $this->endSection(); ?>
<?= $this->section('scripts'); ?>
<script src="/assets/jquery-ui-1.13.2.custom/jquery-ui.js"></script>
<script></script>
<script src="/js/accounts.js"></script>
<?= $this->endSection(); ?>