Mobilnummern mit Leerzeichen bereinigung/Zeiterfassung Erweiterungen

This commit is contained in:
Spitzer Daniel
2024-01-10 13:13:23 +01:00
parent fccb15888f
commit ff2e311666
7 changed files with 54 additions and 2 deletions

View File

@@ -76,7 +76,16 @@
<div class="col-lg-3"> <div class="col-lg-3">
<div class="form-check"> <div class="form-check">
<input class="form-check-input" <?php if ($timerecordingcategoriess->require_comment) echo 'checked="checked"'; ?> <input class="form-check-input" <?php if ($timerecordingcategoriess->require_comment) echo 'checked="checked"'; ?>
type="checkbox" name="require_comment" value="1" id="olt"> type="checkbox" name="require_comment" value="1">
</div>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="only_admin">Nur für Buchhaltung zu buchen</label>
<div class="col-lg-3">
<div class="form-check">
<input class="form-check-input" <?php if ($timerecordingcategoriess->only_admin) echo 'checked="checked"'; ?>
type="checkbox" name="only_admin" value="1">
</div> </div>
</div> </div>
</div> </div>

View File

@@ -41,6 +41,7 @@
<th class="text-center">Buchungszeitraum</th> <th class="text-center">Buchungszeitraum</th>
<th class="text-center">Genehmigungspflichtig</th> <th class="text-center">Genehmigungspflichtig</th>
<th class="text-center">Anmerkung Pflichtfeld</th> <th class="text-center">Anmerkung Pflichtfeld</th>
<th class="text-center">Nur Buchhaltung</th>
<th class="edit-width"></th> <th class="edit-width"></th>
</tr> </tr>
<tr id="filterrow"> <tr id="filterrow">
@@ -50,6 +51,7 @@
<th></th> <th></th>
<th></th> <th></th>
<th></th> <th></th>
<th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -60,6 +62,7 @@
<td><?= $timerecordingcategorieshourday[$timerecordingcategories->hourday] ?></td> <td><?= $timerecordingcategorieshourday[$timerecordingcategories->hourday] ?></td>
<td><?= $timerecordingcategoriesapproval[$timerecordingcategories->approval] ?></td> <td><?= $timerecordingcategoriesapproval[$timerecordingcategories->approval] ?></td>
<td><?= $timerecordingcategoriesrequire_comment[$timerecordingcategories->require_comment] ?></td> <td><?= $timerecordingcategoriesrequire_comment[$timerecordingcategories->require_comment] ?></td>
<td><?= $timerecordingcategoriesrequire_comment[$timerecordingcategories->only_admin] ?></td>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;"> <td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<a href="<?= self::getUrl("TimerecordingCategory", "edit", ["id" => $timerecordingcategories->id]) ?>"><i <a href="<?= self::getUrl("TimerecordingCategory", "edit", ["id" => $timerecordingcategories->id]) ?>"><i
class="far fa-edit" title="Bearbeiten"></i></a> class="far fa-edit" title="Bearbeiten"></i></a>
@@ -80,7 +83,7 @@
<script type="text/javascript"> <script type="text/javascript">
var hidesearch = [5]; var hidesearch = [6];
$(document).ready(function () { $(document).ready(function () {

View File

@@ -81,6 +81,7 @@ class TimerecordingCategoryController extends mfBaseController
$data['hourday'] = trim($r->hourday); $data['hourday'] = trim($r->hourday);
$data['approval'] = trim($r->approval); $data['approval'] = trim($r->approval);
$data['require_comment'] = trim($r->require_comment); $data['require_comment'] = trim($r->require_comment);
$data['only_admin'] = trim($r->only_admin);
if (!$data['name']) { if (!$data['name']) {
@@ -95,6 +96,9 @@ class TimerecordingCategoryController extends mfBaseController
if (!$data['require_comment']) { if (!$data['require_comment']) {
$data['require_comment'] = 0; $data['require_comment'] = 0;
} }
if (!$data['only_admin']) {
$data['only_admin'] = 0;
}
// var_dump($_FILES); // var_dump($_FILES);
// var_dump($upload); // var_dump($upload);

View File

@@ -7,6 +7,7 @@ class TimerecordingCategoryModel
private $hourday; private $hourday;
private $approval; private $approval;
private $require_comment; private $require_comment;
private $only_admin;
public static $hourday_definition = array(1 => "Uhrzeit (von/bis)", 2 => "Tage (von/bis)", 3 => "Startdatum", 4 => "Enddatum"); public static $hourday_definition = array(1 => "Uhrzeit (von/bis)", 2 => "Tage (von/bis)", 3 => "Startdatum", 4 => "Enddatum");
public static $approval_definition = array(0 => "Nein", 1 => "Ja"); public static $approval_definition = array(0 => "Nein", 1 => "Ja");
public static $require_comment_definition = array(0 => "Nein", 1 => "Ja"); public static $require_comment_definition = array(0 => "Nein", 1 => "Ja");

View File

@@ -68,6 +68,7 @@ class UserProfileController extends mfBaseController
$id = $this->me->id; $id = $this->me->id;
$emailaddress = $this->me->email; $emailaddress = $this->me->email;
$mobile = str_replace('+', '', $this->me->mobile); $mobile = str_replace('+', '', $this->me->mobile);
$mobile = str_replace(' ', '', $mobile);
$verification = $r->twofactor; $verification = $r->twofactor;
$User = new User($id); $User = new User($id);
@@ -207,6 +208,7 @@ class UserProfileController extends mfBaseController
$id = $this->me->id; $id = $this->me->id;
$emailaddress = $this->me->email; $emailaddress = $this->me->email;
$mobile = str_replace('+', '', $this->me->mobile); $mobile = str_replace('+', '', $this->me->mobile);
$mobile = str_replace(' ', '', $mobile);
$verification = $r->twofactor; $verification = $r->twofactor;
$User = new User($id); $User = new User($id);

View File

@@ -61,6 +61,7 @@ class UserTwofactor
$User = new User($id); $User = new User($id);
$emailaddress = $User->email; $emailaddress = $User->email;
$mobile = str_replace('+', '', $User->mobile); $mobile = str_replace('+', '', $User->mobile);
$mobile = str_replace(' ', '', $mobile);
$data = []; $data = [];
$data['twofactorcode'] = $code; $data['twofactorcode'] = $code;

View File

@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class TimerecordingCategoryAddOnlyadmin extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$timerecordingCategory = $this->table("TimerecordingCategory");
$timerecordingCategory->addColumn("only_admin", "integer", ["null" => false, "default" => "0", "after" => "require_comment"]);
$timerecordingCategory->update();
}
if ($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if ($this->getEnvironment() == "thetool") {
$timerecordingCategory = $this->table("TimerecordingCategory");
$timerecordingCategory->removeColumn("only_admin");
$timerecordingCategory->save();
}
if ($this->getEnvironment() == "addressdb") {
}
}
}