Changed workflow to compact tables

This commit is contained in:
Frank Schubert
2021-08-24 23:13:24 +02:00
parent 2e9d5d5767
commit 0d7abef945
7 changed files with 104 additions and 101 deletions
+47 -66
View File
@@ -23,74 +23,55 @@
<div class="card"> <div class="card">
<div class="card-body mb-3"> <div class="card-body mb-3">
<div class="float-left"> <h4 class="header-title mb-3">Auftragsliste nach Netzgebiet</h4>
<h4 class="header-title">Auftragsliste</h4>
</div>
<table class="table table-striped table-hover"> <form method="post" action="<?=self::getUrl("Pipework","save")?>" >
<tr>
<th>Netzgebiet</th> <?php foreach($networks as $networkname => $buildings): ?>
<th>POP</th> <h4><?=$networkname?></h4>
<th>Typ</th>
<th>Objektcode</th>
<th>OAN ID</th>
<th>Adresse</th> <table class="table table-striped table-hover">
<th>Einheiten</th> <?php foreach($buildings as $building): ?>
<th>Status</th> <?php
<th></th> $rowspan = 1;
</tr> foreach($building->workflowitems as $item) {
<?php foreach($buildings as $building): ?> if($item->type == "delimiter") {
<tr class="building-list-tr" id="building-<?=$building->id?>"> $rowspan++;
<td onclick="toggleBuilding(<?=$building->id?>)"><?=$building->network->name?></td> }
<td onclick="toggleBuilding(<?=$building->id?>)"><?=$building->pop->name?></td> }
<td onclick="toggleBuilding(<?=$building->id?>)"><?=$building->type->name?></td> ?>
<td onclick="toggleBuilding(<?=$building->id?>)"><?=$building->code?></td> <tr id="building-<?=$building->id?>">
<td onclick="toggleBuilding(<?=$building->id?>)"><?=$building->oan_id?></td> <td>
<td onclick="toggleBuilding(<?=$building->id?>)"> <strong><?=$building->street?></strong><br />
<?=$building->street?><br /> <?=$building->code?><br />
<?=$building->zip?> <?=$building->city?> <br />
</td> Kontakt: <?=$building->contact?><br />
<td onclick="toggleBuilding(<?=$building->id?>)"><?=$building->units?></td> Telefon: <strong><?=$building->phone?></strong><br />
<td onclick="toggleBuilding(<?=$building->id?>)" class="text-monospace"><?=__($building->status->name."-b")?></td> Email: <?=$building->email?>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;"> </td>
<!--<a href="<?=self::getUrl("Building", "edit", ["id" => $building->id])?>"><i class="far fa-edit" title="Objekt Bearbeiten"></i></a> <td>
<a href="<?=self::getUrl("Building", "delete", ["id" => $building->id])?>" class="text-danger" onclick="if(!confirm('Objekt wirklich löschen?')) return false;" title="Objekt Löschen"><i class="fas fa-trash"></i></a> --> <table>
</td> <tr>
</tr> <?php $i = 0; foreach($building->workflowitems as $item): ?>
<tr id="building-detail-<?=$building->id?>" style="display:none; background-color:#fff"> <?php if($item->type == "delimiter"): ?>
<td colspan="8"> <?=($i) ? "</tr></table>" : "" ?>
<?=($item->label) ? "<h5>".$item->label."</h5>" : ""?>
<div class="card"> <table><tr>
<div class="card-body"> <?php else: ?>
<h4 class="card-title">Tätigkeiten im Objekt <strong><?=$building->code?></strong></h4> <?php include(realpath(dirname(__FILE__)."/../")."/Workflow/form.php"); ?>
<p> <?php endif; ?>
<?=$building->street?><br /> <?php $i++; endforeach; ?>
<?=$building->zip?> <?=$building->city?> </tr>
</p> </table>
<div class="card"> </td>
<div class="card-body"> </tr>
<?php endforeach; ?>
<form method="post" action="<?=self::getUrl("Pipework","save")?>" > </table>
<input type="hidden" name="building_id" value="<?=$building->id?>" />
<?php foreach($building->workflowitems as $item): ?>
<?php include(realpath(dirname(__FILE__)."/../")."/Workflow/form.php"); ?>
<?php endforeach; ?>
<button type="submit" class="btn btn-primary">Speichern</button>
</form>
</div>
</div>
</div>
</div>
</td>
</tr>
<tr style="display:none;">
<td colspan="3"></td>
</tr>
<?php endforeach; ?> <?php endforeach; ?>
</table> <button type="submit" class="btn btn-primary">Speichern</button>
</form>
</div> </div>
</div> </div>
+18 -12
View File
@@ -1,11 +1,13 @@
<div class="form-group row"> <td>
<label class="col-lg-2 col-form-label" for="wfitem_<?=$item->name?>"> <?php if($item->type != "gps"): ?>
<?=$item->label?> <label class="form-label" for="wfitem_<?=$item->name?>">
<?=($item->required == 1) ? "*" : ""?> <?=$item->label?>
</label> <?=($item->required == 1) ? "*" : ""?>
<div class="col-lg-10"> </label>
<?php <?php endif; ?>
<?php
switch($item->type) { switch($item->type) {
case "string": case "string":
include(realpath(dirname(__FILE__)."/items/")."/string.php"); include(realpath(dirname(__FILE__)."/items/")."/string.php");
@@ -34,8 +36,12 @@
case "delimiter": case "delimiter":
include(realpath(dirname(__FILE__)."/items/")."/delimiter.php"); include(realpath(dirname(__FILE__)."/items/")."/delimiter.php");
break; break;
case "date":
include(realpath(dirname(__FILE__)."/items/")."/date.php");
break;
default:
include(realpath(dirname(__FILE__)."/items/")."/string.php");
} }
?> ?>
</div> </td>
</div>
+1 -1
View File
@@ -1 +1 @@
<input type="text" class="form-control" name="wfitem_<?=$item->name?>" id="wfitem_<?=$item->name?>" value="<?=$item->value->value_string?>"> <input type="checkbox" class="form-control" name="wfitem_<?=$item->name?>_<?=$item->object_id?>" id="wfitem_<?=$item->name?>_<?=$item->object_id?>" value="<?=$item->value->value_string?>">
+11
View File
@@ -0,0 +1,11 @@
<input type="text" class="form-control" name="wfitem_<?=$item->name?>" id="wfitem_<?=$item->name?>_<?=$building->id?>" value="<?=$item->value->value_string?>" placeholder="<?=$item->placeholder?>" />
<script type="text/javascript">
$('#wfitem_<?=$item->name?>_<?=$building->id?>').datepicker({
language: 'de',
format: "dd.mm.yyyy",
showWeekDays: true,
todayBtn: 'linked',
autoclose: true
});
</script>
+8 -9
View File
@@ -7,19 +7,18 @@
$long = $gps_parts[1]; $long = $gps_parts[1];
} }
?> ?>
<div class="form-group row"> <div class="row">
<label class="col-lg-1 col-form-label" for="wfitem_<?=$item->name?>_lat_<?=$building->id?>">GPS Breite:</label> <div class="col-md-6">
<div class="col-lg-6"> <label class="form-label" for="wfitem_<?=$item->name?>_lat_<?=$building->id?>">GPS Breite <?=($item->required == 1) ? "*" : ""?></label>
<input type="text" class="form-control" name="wfitem_<?=$item->name?>_lat" id="wfitem_<?=$item->name?>_lat_<?=$building->id?>" value="<?=$lat?>" placeholder="<?=str_replace(",", ".", TT_PLACEHOLDER_GPS_LAT)?>"> <input type="text" class="form-control" name="wfitem_<?=$item->name?>_lat" id="wfitem_<?=$item->name?>_lat_<?=$building->id?>" value="<?=$lat?>" placeholder="<?=str_replace(",", ".", TT_PLACEHOLDER_GPS_LAT)?>">
</div> </div>
<div class="col-md-6">
<label class="form-label" for="wfitem_<?=$item->name?>_long_<?=$building->id?>">GPS Länge <?=($item->required == 1) ? "*" : ""?></label>
<input type="text" class="form-control" name="wfitem_<?=$item->name?>_long" id="wfitem_<?=$item->name?>_long_<?=$building->id?>" value="<?=$long?>" placeholder="<?=str_replace(",", ".", TT_PLACEHOLDER_GPS_LONG)?>">
</div>
</div> </div>
<div class="form-group row">
<label class="col-lg-1 col-form-label" for="wfitem_<?=$item->name?>_long_<?=$building->id?>">GPS Länge:</label>
<div class="col-lg-6">
<input type="text" class="form-control" name="wfitem_<?=$item->name?>_lat" id="wfitem_<?=$item->name?>_long_<?=$building->id?>" value="<?=$long?>" placeholder="<?=str_replace(",", ".", TT_PLACEHOLDER_GPS_LONG)?>">
</div>
</div>
<?php if($lat && $long): ?> <?php if($lat && $long): ?>
<a href="https://www.google.com/maps/search/?api=1&query=<?=$lat?>,<?=$long?>" target="_blank"><i class="fas fa-external-link-alt"></i> Auf Google Maps öffnen</a> <a href="https://www.google.com/maps/search/?api=1&query=<?=$lat?>,<?=$long?>" target="_blank"><i class="fas fa-external-link-alt"></i> Auf Google Maps öffnen</a>
<?php endif; ?> <?php endif; ?>
+17 -11
View File
@@ -18,21 +18,27 @@ class PipeworkController extends mfBaseController {
$this->layout()->setTemplate("Pipework/Index"); $this->layout()->setTemplate("Pipework/Index");
if($this->me->is("Admin")) { if($this->me->is("Admin")) {
$this->layout()->set("buildings", BuildingModel::search(["workflow_finished" => 0])); $my_networks = NetworkModel::getAll();
} else { } else {
$buildings = []; $my_networks = $this->me->my_networks;
foreach($this->me->my_networks as $network) { }
foreach(BuildingModel::search(["network_id" => $network->id, "workflow_finished" => 0]) as $b) {
if(!array_key_exists($b->id, $buildings)) { $networks = [];
$buildings[$b->id] = $b; foreach($my_networks as $network) {
} if(!array_key_exists($network->name, $networks)) {
$networks[$network->name] = [];
}
foreach(BuildingModel::search(["network_id" => $network->id, "workflow_finished" => 0]) as $b) {
if(!array_key_exists($b->id, $networks[$network->name])) {
$networks[$network->name][$b->id] = $b;
} }
} }
//var_dump($buildings);exit;
$this->layout()->set("buildings", $buildings);
} }
$this->layout()->set("networks", $networks);
//var_dump(reset(reset($networks))->workflowitems);exit;
// get delimiter count, to adjust rowspan
} }
@@ -60,7 +60,7 @@ class WorkflowitemModel {
$db = FronkDB::singleton(); $db = FronkDB::singleton();
$res = $db->select("Workflowitem", "*", "1=1 ORDER BY name"); $res = $db->select("Workflowitem", "*", "1=1 ORDER BY num");
if($db->num_rows($res)) { if($db->num_rows($res)) {
while($data = $db->fetch_object($res)) { while($data = $db->fetch_object($res)) {
$items[] = new Workflowitem($data); $items[] = new Workflowitem($data);
@@ -74,7 +74,7 @@ class WorkflowitemModel {
$db = FronkDB::singleton(); $db = FronkDB::singleton();
$where = self::getSqlFilter($filter); $where = self::getSqlFilter($filter);
$res = $db->select("Workflowitem", "*", "$where ORDER BY name"); $res = $db->select("Workflowitem", "*", "$where ORDER BY num");
if($db->num_rows($res)) { if($db->num_rows($res)) {
$data = $db->fetch_object($res); $data = $db->fetch_object($res);
$item = new Workflowitem($data); $item = new Workflowitem($data);