Device Update

* Device Backups können nun automatisch übers Tool getriggert werden

Zeiterfassung Update
 * Vorbereitung für ZA Buchungen
This commit is contained in:
Spitzer Daniel
2024-03-10 21:25:23 +01:00
parent 901131fbce
commit 6e02b849bd
10 changed files with 124 additions and 5 deletions

View File

@@ -177,8 +177,18 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "device-detail") {
</select>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="autobackup">Autobackup</label>
<div class="col-lg-10">
<div class="custom-control custom-switch mt-1">
<input type="checkbox" <?= ($device->autobackup == "1") ? "checked='checked'" : "" ?> class="custom-control-input" value="1" id="autobackup" name="autobackup">
<label class="custom-control-label no-user-select" for="autobackup">(Es wird täglich um 24:00 ein Device Backup erstellt)</label>
</div>
</div>
</div>
<?php endif; ?>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="serial">Seriennummer</label>
<div class="col-lg-10">

View File

@@ -67,7 +67,7 @@ $pagination_entity_name = "Device";
<th></th>
<th></th>
<th></th>
<th></th>
<th class="pr-1"></th>
<th></th>
</tr>
</thead>
@@ -97,7 +97,9 @@ $pagination_entity_name = "Device";
} else {
$backup = '<i class="fa-regular fa-ban" title="Kein Configbackup"><span style="display: none">N/A</span></i>';
}
if ($device->autobackup==1) {
$backup = '<i class="fa-regular fa-circle-a mr-1"><span style="display: none">Auto</span></i>'.$backup;
}
if ($device->pop->id) {
$destination = '<a href="' . self::getUrl("Pop", "Detail", ["id" => $device->pop->id]) . '">' . $device->pop->name . '</a>';
} else if ($device->addr_street) {
@@ -153,7 +155,7 @@ $pagination_entity_name = "Device";
var columndefs = {type: 'ip-address', targets: 4};
var columnfilter = [9];
var columnoptions = '<option value=""></option><option value="OK">OK</option><option value="AGED">AGED</option><option value="N/A">N/A</option>';
var columnoptions = '<option value=""></option><option value="OK">OK</option><option value="AGED">AGED</option><option value="N/A">N/A</option><option value="Auto">AUTO</option>';
$(document).ready(function () {
});

View File

@@ -21,6 +21,7 @@ class DeviceApicontroller extends mfBaseApicontroller
$deviceReturn[$key]['serial'] = $device->serial;
$deviceReturn[$key]['last_config_backup'] = $device->last_config_backup;
$deviceReturn[$key]['manufactor'] = $device->devicetype->devicemanufactor->name;
$deviceReturn[$key]['autobackup'] = $device->autobackup;
}

View File

@@ -102,6 +102,8 @@ class DeviceController extends mfBaseController
$data = [];
$data['name'] = trim($r->name);
$data['devicetype_id'] = $r->devicetype_id;
$data['autobackup'] = trim($r->autobackup);
if (trim($r->pop_id) == "0") {
$data['pop_id'] = NULL;
} else {
@@ -127,6 +129,9 @@ class DeviceController extends mfBaseController
$data['gps_lat'] = $r->gps_lat;
$data['gps_long'] = $r->gps_long;
}
if ($data['autobackup'] != "1") {
$data['autobackup'] = "0";
}
$data['ip'] = $r->ip;
$data['mac'] = $r->mac;
$data['serial'] = $r->serial;

View File

@@ -16,6 +16,7 @@ class DeviceModel
public $gps_lat = null;
public $addr_city = null;
public $gps_long = null;
public $autobackup = null;
public $create_by = null;
public $snmp_version = null;
public $edit_by = null;

View File

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

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class TimerecordingAddFieldEnddate extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("TimerecordingEmployee", ["signed" => true]);
$table->addColumn("enddate", "integer", ["null" => true,"default" => NULL, "after" => "startdate"]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("TimerecordingEmployee")->removeColumn("enddate")->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class TimerecordingAddFieldHours extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table("Timerecording", ["signed" => true]);
$table->addColumn("hours", "integer", ["null" => true, "default" => NULL, "after" => "end"]);
$table->update();
}
if ($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if ($this->getEnvironment() == "thetool") {
$this->table("Timerecording")->removeColumn("hours")->save();
}
if ($this->getEnvironment() == "addressdb") {
}
}
}

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class DeviceAddFieldAutobackup extends AbstractMigration
{
public function up(): void
{
if($this->getEnvironment() == "thetool") {
$table = $this->table("Device", ["signed" => true]);
$table->addColumn("autobackup", "integer", ["null" => false, "default" => '0', "after" => "last_config_backup"]);
$table->update();
}
if($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if($this->getEnvironment() == "thetool") {
$this->table("Device")->removeColumn("autobackup")->save();
}
if($this->getEnvironment() == "addressdb") {
}
}
}

View File

@@ -107,7 +107,7 @@ table.dataTable > tbody > tr.child span.dtr-data {
font-size: 15px;
}
.fa-circle-check {
.fa-circle-check,.fa-circle-a {
color: #23b900;
font-size: 15px;
}
@@ -151,6 +151,13 @@ table.dataTable.table-sm > thead > tr > th:not(.sorting_disabled) {
min-width: 150px;
}
.no-user-select {
-ms-user-select: None;
-moz-user-select: None;
-webkit-user-select: None;
user-select: None;
}
@media (max-width: 1200px) {
.fa-circle-xmark, .fa-ban, .fa-trash, .fa-edit, .fa-square-check, .fa-arrows-up-down-left-right {
font-size: 25px;