Faserplanung/Zeiterfassung

* Zeiterfassung
 * Faserplanung Koordinatenanzeige bei Rohrverzeichnis bearbeiten hinzugefügt
 * Migrations
This commit is contained in:
Spitzer Daniel
2024-04-23 20:30:08 +02:00
parent 6310e2446e
commit 1ab898fbce
7 changed files with 109 additions and 58 deletions

View File

@@ -230,9 +230,8 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "fiberplanpipe-detail") {
<?php endforeach; ?>
</select>
</div>
<div class="col-lg-2" id="<?= $randid ?>_end-point-building">
</div>
<div class="col-lg-3" id="<?= $randid ?>_end-point-building"></div>
<div class="col-lg-2 endpoint_coordinates"></div>
</div>
<?php
endif;
@@ -307,12 +306,20 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "fiberplanpipe-detail") {
<div class="col-lg-6"><h4>Legende:</h4></div>
</div>
<div class="row justify-content-center">
<div class="col-lg-5"><img src="<?= self::getResourcePath() ?>img/markers/marker-pop.png "> <label class="font-16"> ... Pop</label></div>
<div class="col-lg-5"><img src="<?= self::getResourcePath() ?>img/markers/marker-home.png "> <label class="font-16"> ... Building</label></div>
<div class="col-lg-5"><img
src="<?= self::getResourcePath() ?>img/markers/marker-pop.png ">
<label class="font-16"> ... Pop</label></div>
<div class="col-lg-5"><img
src="<?= self::getResourcePath() ?>img/markers/marker-home.png ">
<label class="font-16"> ... Building</label></div>
</div>
<div class="row justify-content-center">
<div class="col-lg-5 justify-content-center"><img src="<?= self::getResourcePath() ?>img/markers/marker-dispatcher.png "> <label class="font-16"> ... Schacht/Verteiler</label></div>
<div class="col-lg-5"><img src="<?= self::getResourcePath() ?>img/markers/marker-greenfield.png "> <label class="font-16"> ... Greenfield</label></div>
<div class="col-lg-5 justify-content-center"><img
src="<?= self::getResourcePath() ?>img/markers/marker-dispatcher.png ">
<label class="font-16"> ... Schacht/Verteiler</label></div>
<div class="col-lg-5"><img
src="<?= self::getResourcePath() ?>img/markers/marker-greenfield.png ">
<label class="font-16"> ... Greenfield</label></div>
</div>
</div>
</div>
@@ -422,41 +429,6 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "fiberplanpipe-detail") {
addMarkers();
});
$("body").on("change", "#startpoint_type,#network_id", function () {
var options;
if ($.trim($("#network_id").val()) != "" && $.trim($("#startpoint_type").val())) {
$.getJSON("<?= self::getUrl("FiberPlanPipe", "api", ['do' => 'getBuildingInfo']) ?>&network_id=" + $.trim($("#network_id").val()) + "&bdtype=" + $.trim($("#startpoint_type").val()), {})
.done(function (data) {
$.each(data, function (k, val) {
options = options + '<option value="' + val.id + '">' + val.name + '</option>';
});
$('#starting-point-building').empty();
$('#starting-point-building').append('<select id="startpoint" required="required" name="startpoint" class="select2 form-control">' + options + '</select>');
$(".select2").select2({placeholder: ""});
});
}
});
$("body").on("change", "#entpoint_type,#network_id2", function () {
var options;
if ($.trim($("#network_id2").val()) != "" && $.trim($("#entpoint_type").val())) {
$.getJSON("<?= self::getUrl("FiberPlanPipe", "api", ['do' => 'getBuildingInfo']) ?>&network_id=" + $.trim($("#network_id2").val()) + "&bdtype=" + $.trim($("#entpoint_type").val()), {})
.done(function (data) {
$.each(data, function (k, val) {
options = options + '<option value="' + val.id + '">' + val.name + '</option>';
});
$('#end-point-building').empty();
$('#end-point-building').append('<select id="endpoint" name="endpoint" required="required" class="select2 form-control">' + options + '</select><input type="hidden" name="endpointid[]" value="">');
$(".select2").select2({placeholder: ""});
});
}
});
$("body").on("change", "#type", function () {
if ($(this).val() < 3) {
$('#dimesion-div').show();
@@ -500,7 +472,7 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "fiberplanpipe-detail") {
removePolyline();
var oldlat;
var oldlong;
var gpsconter=0;
var gpsconter = 0;
$.each($('.endpoint_endpoint'), function (index, value) {
if ($(this).find('option:selected').data('gpslat')) {
var lat = $(this).find('option:selected').data('gpslat');
@@ -547,7 +519,15 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "fiberplanpipe-detail") {
oldlat = $(this).find('option:selected').data('gpslat');
oldlong = $(this).find('option:selected').data('gpslong');
gpsconter++;
lat=String(lat);
lng=String(lng);
$(this).closest('.endpoint-maindiv').find('.endpoint_coordinates').html(`<label class="col-form-label"><a title="Google-Maps: ` + $(this).find('option:selected').data('gpslat') + ` , ` + $(this).find('option:selected').data('gpslong') + `"
class="mapsLink"
href="http://maps.google.com/?q=` + $(this).find('option:selected').data('gpslat') + ` , ` + $(this).find('option:selected').data('gpslong') + `"
target="_blank">` + lat.substring(0, 8) + `
, ` + lng.substring(0, 8) + `</a></label>`);
} else {
$(this).closest('.endpoint-maindiv').find('.endpoint_coordinates').html(`<label class="col-form-label">Keine Koordinaten</label>`);
oldlat = "";
oldlong = "";
}
@@ -596,9 +576,8 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "fiberplanpipe-detail") {
` + $('#endpoints').find('.endpoint_type').html() + `
</select>
</div>
<div class="col-lg-3" id="` + randid + `_end-point-building">
</div>
<div class="col-lg-3" id="` + randid + `_end-point-building"></div>
<div class="col-lg-2 endpoint_coordinates"></div>
</div>`);
$('#' + randid + '_endpoint_network_id').val($('#endpoints').find('.endpoint_network_id').eq(endpointcounter - 2).val());
$('#' + randid + '_endpoint_type').val('');

View File

@@ -85,9 +85,15 @@ $daysSelect .= "</select>";
<label class="col-lg-2 col-form-label" for="type">Vertragsart *</label>
<div class="col-lg-3">
<select class="select2 form-control " name="type" id="type">
<option value="1" <?= ($timerecordingemployees->type == '1') ? "selected='selected'" : "" ?>>Angestellter</option>
<option value="2" <?= ($timerecordingemployees->type == '2') ? "selected='selected'" : "" ?>>Arbeiter</option>
<option value="3" <?= ($timerecordingemployees->type == '3') ? "selected='selected'" : "" ?>>Lehrling</option>
<option value="1" <?= ($timerecordingemployees->type == '1') ? "selected='selected'" : "" ?>>
Angestellter
</option>
<option value="2" <?= ($timerecordingemployees->type == '2') ? "selected='selected'" : "" ?>>
Arbeiter
</option>
<option value="3" <?= ($timerecordingemployees->type == '3') ? "selected='selected'" : "" ?>>
Lehrling
</option>
</select>
</div>
</div>
@@ -97,7 +103,7 @@ $daysSelect .= "</select>";
<div class="col-lg-2">
<input required="required" type="date" id="startdate" name="startdate"
class="form-control"
value="<?= ($timerecordingemployees->startdate) ? date('Y-m-d', $timerecordingemployees->startdate): "" ?>"/>
value="<?= ($timerecordingemployees->startdate) ? date('Y-m-d', $timerecordingemployees->startdate) : "" ?>"/>
</div>
</div>
<div class="form-group row">
@@ -106,7 +112,7 @@ $daysSelect .= "</select>";
<div class="col-lg-2">
<input type="date" id="enddate" name="enddate"
class="form-control"
value="<?= ($timerecordingemployees->enddate) ? date('Y-m-d', $timerecordingemployees->enddate): "" ?>"/>
value="<?= ($timerecordingemployees->enddate) ? date('Y-m-d', $timerecordingemployees->enddate) : "" ?>"/>
</div>
</div>
<div class="form-group row">
@@ -114,10 +120,29 @@ $daysSelect .= "</select>";
<div class="col-lg-2">
<input type="date" id="birthday" name="birthday"
class="form-control"
value="<?= ($timerecordingemployees->birthday) ? date('Y-m-d', $timerecordingemployees->birthday): "" ?>"/>
value="<?= ($timerecordingemployees->birthday) ? date('Y-m-d', $timerecordingemployees->birthday) : "" ?>"/>
</div>
</div>
<?php if ($me->superexpertEnabled()): ?>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="bpahours">Black Pig Stunden</label>
<div class="col-lg-1">
<input required="required" type="text" id="bpahours" name="bpahours"
class="form-control"
value="<?= str_replace(".", ",", $timerecordingemployees->bpahours / 3600) ?>"/>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="bpahours_value">Black Pig
Bewertung</label>
<div class="col-lg-1">
<input required="required" type="text" id="bpahours_value"
name="bpahours_value"
class="form-control"
value="<?= str_replace(".", ",", $timerecordingemployees->bpahours_value) ?>"/>
</div>
</div>
<?php endif; ?>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="holidays">Initiale Urlaubstage</label>
<div class="col-lg-1">
@@ -135,6 +160,7 @@ $daysSelect .= "</select>";
value="<?= str_replace(".", ",", $timerecordingemployees->plushours / 3600) ?>"/>
</div>
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="overtime">Initiale Überstunden</label>
<div class="col-lg-1">

View File

@@ -120,7 +120,7 @@ $type[3] = "Lehrling";
data-order="<?= $timerecordingemployees[$timerecordinguser->id]['overtime_now'] ?>"><?= $overTime ?></td>
<?php if ($me->superexpertEnabled()): ?>
<td class="text-center"
data-order="<?= $timerecordingemployees[$timerecordinguser->id]['bpa_hours'] ?>"><?= sprintf('%02dh:%02dm', floor($timerecordingemployees[$timerecordinguser->id]['bpa_hours'] / 3600), floor($timerecordingemployees[$timerecordinguser->id]['bpa_hours'] / 60 % 60)) ?></td>
data-order="<?= $timerecordingemployees[$timerecordinguser->id]['bpahours'] ?>"><?= sprintf('%02dh:%02dm', floor($timerecordingemployees[$timerecordinguser->id]['bpahours'] / 3600), floor($timerecordingemployees[$timerecordinguser->id]['bpahours'] / 60 % 60)) ?></td>
<?php endif; ?>
<td class="text-center"
data-order="<?= ($timerecordingemployees[$timerecordinguser->id]['holidays_now']) ? $timerecordingemployees[$timerecordinguser->id]['holidays_now'] : '' ?>"><?= ($timerecordingemployees[$timerecordinguser->id]['holidays_now']) ? $timerecordingemployees[$timerecordinguser->id]['holidays_now'] . ' Tage' : '' ?> </td>

View File

@@ -364,7 +364,7 @@ INNER JOIN `Address` ON (`Address`.`id`=`Addresstype`.`address_id`)
}
}
$html .= '</select></div><div class="col-lg-2"><input type="hidden" name="endpointid[]" value="' . $Endpoint->id . '" ></div></div>';
$html .= '</select></div><input type="hidden" name="endpointid[]" value="' . $Endpoint->id . '" ><div class="col-lg-2 endpoint_coordinates text-center"></div></div>';
echo $html;
$counter++;
}

View File

@@ -118,7 +118,23 @@ class TimerecordingEmployeeController extends mfBaseController
$data['type'] = trim($r->type);
$data['bmd_active'] = trim($r->bmd_active);
$data['overtime'] = $overtime;
#
if ($r->bpahours) {
$bpahours = $r->bpahours;
$bpahours = str_replace(',', '.', $bpahours);
if (is_numeric($bpahours)) {
$bpahours = $bpahours * 3600;
$data['bpahours'] = $bpahours;
}
}
if ($r->bpahours_value) {
$bpahours_value = $r->bpahours_value;
$bpahours_value = str_replace(',', '.', $bpahours_value);
if (is_numeric($bpahours_value)) {
$data['bpahours_value'] = $bpahours_value;
}
}
if (!$data['overtime']) {
$data['overtime'] = 0;
@@ -149,8 +165,6 @@ class TimerecordingEmployeeController extends mfBaseController
} else {
$timerecordingemployees = TimerecordingEmployeeModel::create($data);
}
// var_dump($filestore);
// exit;
$id = $timerecordingemployees->save();
if (!$id) {

View File

@@ -15,6 +15,7 @@ class TimerecordingEmployeeModel
private $overtime_now;
private $overtime_timestamp;
private $bpahours;
private $bpahours_value;
private $startdate;
private $enddate;
private $bmd_active;

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class TimerecordingEmployeeAddFieldBpahoursvalue extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table("TimerecordingEmployee", ["signed" => true]);
$table->addColumn("bpahours_value", "decimal", ["null" => false, "default" => 0.00, "after" => "bpahours", "precision" => 10, "scale" => 2]);
$table->update();
}
if ($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if ($this->getEnvironment() == "thetool") {
$this->table("TimerecordingEmployee")->removeColumn("bmd_active")->save();
}
if ($this->getEnvironment() == "addressdb") {
}
}
}