Merge branch 'spidev' into 'master'

Device Update

See merge request fronk/thetool!941
This commit is contained in:
Daniel Spitzer
2025-01-22 17:19:29 +00:00
2 changed files with 69 additions and 54 deletions
+24 -9
View File
@@ -211,7 +211,9 @@ foreach ($devicesall as $deviceall) {
<?php if ($devices->parent_id) : ?> <?php if ($devices->parent_id) : ?>
<tr> <tr>
<th>Parent Device</th> <th>Parent Device</th>
<td><a href="<?= self::getUrl("Device", "Detail", ["id" => $devices->parent_id]) ?>"><?= $DevicesAll[$devices->parent_id]?></a></td> <td>
<a href="<?= self::getUrl("Device", "Detail", ["id" => $devices->parent_id]) ?>"><?= $DevicesAll[$devices->parent_id] ?></a>
</td>
</tr> </tr>
<?php endif; ?> <?php endif; ?>
<tr> <tr>
@@ -728,13 +730,21 @@ foreach ($devicesall as $deviceall) {
allonts++; allonts++;
if (typeof customers[ont['serial']] !== "undefined") { if (typeof customers[ont['serial']] !== "undefined") {
customerid = customers[ont['serial']]['customer_number']; customerid = customers[ont['serial']]['customer_number'];
if (customers[ont['serial']]['lastname'] != "" && customers[ont['serial']]['lastname'] != null) {
customername = customers[ont['serial']]['lastname'] + " " + customers[ont['serial']]['firstname'];
} else if (customers[ont['serial']]['lastname'] == null) { if (customers[ont['serial']]['company'] != "" && customers[ont['serial']]['company'] != null) {
customername = customers[ont['serial']]['street'] + ", " + customers[ont['serial']]['zip'] + " " + customers[ont['serial']]['city']
} else {
customername = "" + customers[ont['serial']]['company'] + " (C)"; customername = "" + customers[ont['serial']]['company'] + " (C)";
} else if (customers[ont['serial']]['lastname'] != "" && customers[ont['serial']]['lastname'] != null) {
customername = customers[ont['serial']]['lastname'] + " " + customers[ont['serial']]['firstname'];
} else if (customers[ont['serial']]['TerminationContact'] != "" && customers[ont['serial']]['TerminationContact'] != null) {
customername = customers[ont['serial']]['TerminationContact'];
} else if (customers[ont['serial']]['BuildingContact'] != "" && customers[ont['serial']]['BuildingContact'] != null) {
customername = customers[ont['serial']]['BuildingContact'];
} else if (customers[ont['serial']]['lastname'] == null) {
} }
customername +='&nbsp;<br>'+ customers[ont['serial']]['street'] + ", " + customers[ont['serial']]['zip'] + " " + customers[ont['serial']]['city']
} else { } else {
customername = "N/A"; customername = "N/A";
customerid = "N/A"; customerid = "N/A";
@@ -749,20 +759,25 @@ foreach ($devicesall as $deviceall) {
<td class="sp-ont-text"><div class="text-decoration-underline" data-port="` + item['portsimple'] + `" data-ontid="` + o + `" data-portid="` + item['portindex'] + `" data-snr="` + ont['serial'] + `" data-toggle="modal" data-target="#ontDetailInfo">` + ont['serial'] + `</div></td> <td class="sp-ont-text"><div class="text-decoration-underline" data-port="` + item['portsimple'] + `" data-ontid="` + o + `" data-portid="` + item['portindex'] + `" data-snr="` + ont['serial'] + `" data-toggle="modal" data-target="#ontDetailInfo">` + ont['serial'] + `</div></td>
</tr> </tr>
`); `);
}); }
)
;
$('#olt-splitter').append('<tr><td class=""><span title="Doppelklick zum editieren" data-portid="' + item['portindex'] + '" class="float-left sp-splitter-count-left ">' + allonts + '</span><span data-shown="0" data-port="' + item['portsimple'] + '" data-portid="' + item['portindex'] + '" data-splitcounter="' + datacounter + '" data-oltport=' + i + ' class="sp-splitter-count-show">show</span><span class="float-right sp-splitter-count-right"><span style="color: green">' + online + '</span>/<span style="color: red">' + offline + '</span></span></td></tr>'); $('#olt-splitter').append('<tr><td class=""><span title="Doppelklick zum editieren" data-portid="' + item['portindex'] + '" class="float-left sp-splitter-count-left ">' + allonts + '</span><span data-shown="0" data-port="' + item['portsimple'] + '" data-portid="' + item['portindex'] + '" data-splitcounter="' + datacounter + '" data-oltport=' + i + ' class="sp-splitter-count-show">show</span><span class="float-right sp-splitter-count-right"><span style="color: green">' + online + '</span>/<span style="color: red">' + offline + '</span></span></td></tr>');
} else { } else {
$('#olt-splitter').append('<tr><td class=""><span title="Doppelklick zum editieren" data-portid="' + item['portindex'] + '" class="float-left sp-splitter-count-left ">N/A</span><span class="float-right sp-splitter-count-right">N/A</span></td></tr>'); $('#olt-splitter').append('<tr><td class=""><span title="Doppelklick zum editieren" data-portid="' + item['portindex'] + '" class="float-left sp-splitter-count-left ">N/A</span><span class="float-right sp-splitter-count-right">N/A</span></td></tr>');
} }
datacounter++; datacounter++;
}); }
)
;
$('#olt-datatables').show(); $('#olt-datatables').show();
} }
$('.spinner-big').hide(); $('.spinner-big').hide();
$('#olt-info').show(); $('#olt-info').show();
}).done(function (data) { }
).done(function (data) {
var hidesearch = [3]; var hidesearch = [3];
let table; let table;
if (typeof hidesearch === "undefined") { if (typeof hidesearch === "undefined") {
+1 -1
View File
@@ -144,7 +144,7 @@ class DeviceModel
{ {
$items = []; $items = [];
$db = FronkDB::singleton(); $db = FronkDB::singleton();
$sql = "Select Patching.id,lastname,firstname,customer_number,company,device_name,device_port,value_string,Building.`street`,Building.`zip`, Building.`city` FROM Workflowvalue $sql = "Select Patching.id,lastname,firstname,customer_number,company,device_name,device_port,value_string,Building.`street`,Building.`zip`, `Building`.`city`,`Building`.`contact` `BuildingContact`,`Termination`.`contact` TerminationContact FROM Workflowvalue
LEFT JOIN Termination ON Termination.id=Workflowvalue.object_id LEFT JOIN Patching ON Termination.id = Patching.termination_id LEFT JOIN Termination ON Termination.id=Workflowvalue.object_id LEFT JOIN Patching ON Termination.id = Patching.termination_id
LEFT JOIN OrderProduct ON (Patching.termination_id=OrderProduct.termination_id) LEFT JOIN OrderProduct ON (Patching.termination_id=OrderProduct.termination_id)
LEFT JOIN `Order` ON (`Order`.id=OrderProduct.order_id) LEFT JOIN `Order` ON (`Order`.id=OrderProduct.order_id)