Merge branch 'master' into fronkdev

This commit is contained in:
Frank Schubert
2023-11-21 17:56:59 +01:00
5 changed files with 19 additions and 37 deletions
+3 -2
View File
@@ -717,8 +717,10 @@ if ($devices->power != "0.0") {
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'] != "") { if (customers[ont['serial']]['lastname'] != "" && customers[ont['serial']]['lastname'] != null) {
customername = customers[ont['serial']]['lastname'] + " " + customers[ont['serial']]['firstname']; customername = customers[ont['serial']]['lastname'] + " " + customers[ont['serial']]['firstname'];
} else if (customers[ont['serial']]['lastname'] == null) {
customername = customers[ont['serial']]['street'] + ", " + customers[ont['serial']]['zip'] + " " + customers[ont['serial']]['city']
} else { } else {
customername = "" + customers[ont['serial']]['company'] + " (C)"; customername = "" + customers[ont['serial']]['company'] + " (C)";
} }
@@ -736,7 +738,6 @@ if ($devices->power != "0.0") {
<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 {
+3 -2
View File
@@ -498,6 +498,7 @@ if (!empty(trim($pops->vlan_ipv6)))
$extTextspan = ""; $extTextspan = "";
foreach ($module['slots'] as $slots) { foreach ($module['slots'] as $slots) {
$extText = ""; $extText = "";
$title=$slots['modulname'];
if ($slots['type'] == '0') { if ($slots['type'] == '0') {
$color = '#9fff6e'; $color = '#9fff6e';
$colorclass = "rack-color-lwl"; $colorclass = "rack-color-lwl";
@@ -506,6 +507,7 @@ if (!empty(trim($pops->vlan_ipv6)))
$extTextspan = "<span style='font-size: 12px;font-weight: 400'>" . $extText . "</span>"; $extTextspan = "<span style='font-size: 12px;font-weight: 400'>" . $extText . "</span>";
} }
} else if ($slots['type'] == '1') { } else if ($slots['type'] == '1') {
$slots['modulname']='<a style="color: #000000;text-decoration: underline;" target="_self" href="'.self::getUrl("Device", "detail", ["id" => $slots['device_id']]).'">'.$slots['modulname'].'</a>';
?> ?>
<script> <script>
$("#module-device-id option[value='<?= $slots['device_id'] ?>']").remove(); $("#module-device-id option[value='<?= $slots['device_id'] ?>']").remove();
@@ -514,7 +516,6 @@ if (!empty(trim($pops->vlan_ipv6)))
$color = '#b6c6ff'; $color = '#b6c6ff';
$colorclass = "rack-color-device"; $colorclass = "rack-color-device";
} else if ($slots['type'] == '2') { } else if ($slots['type'] == '2') {
$color = '#ff8100'; $color = '#ff8100';
$colorclass = "rack-color-rpanel"; $colorclass = "rack-color-rpanel";
} else if ($slots['type'] == '3') { } else if ($slots['type'] == '3') {
@@ -556,7 +557,7 @@ if (!empty(trim($pops->vlan_ipv6)))
$position++; $position++;
$calcwidth = $calcwidth + $slots['width']; $calcwidth = $calcwidth + $slots['width'];
} }
echo '<td title="' . $slots['modulname'] . $extText . '" colspan="' . $slots['width'] . '" class="text-center border-top border-bottom border-right text-nowrap text-truncate pl-1 pr-1 ' . $colorclass . '" data-id="' . $slots['moduleid'] . '" data-type="' . $slots['type'] . '" data-name="' . $slots['modulname'] . '" data-starthe="' . $module['start_he'] . '" data-ports="' . $slots['ports'] . '" data-plug="' . $slots['plug'] . '" rowspan="' . $modulelenght . '" style="width: ' . $width . '; background-color: ' . $color . ';border-color: #797979 !important; white-space: nowrap; text-overflow: ellipsis;max-width: ' . $maxwidth . 'px;"><span></span> ' . $slots['modulname'] . $extTextspan . '</td>'; echo '<td title="' . $title . $extText . '" colspan="' . $slots['width'] . '" class="text-center border-top border-bottom border-right text-nowrap text-truncate pl-1 pr-1 ' . $colorclass . '" data-id="' . $slots['moduleid'] . '" data-type="' . $slots['type'] . '" data-name="' . $title . '" data-starthe="' . $module['start_he'] . '" data-ports="' . $slots['ports'] . '" data-plug="' . $slots['plug'] . '" rowspan="' . $modulelenght . '" style="width: ' . $width . '; background-color: ' . $color . ';border-color: #797979 !important; white-space: nowrap; text-overflow: ellipsis;max-width: ' . $maxwidth . 'px;"><span></span> ' . $slots['modulname'] . $extTextspan . '</td>';
$position++; $position++;
$calcwidth = $calcwidth + $slots['width']; $calcwidth = $calcwidth + $slots['width'];
} }
+3 -24
View File
@@ -142,39 +142,18 @@ class DeviceModel
{ {
$items = []; $items = [];
$db = FronkDB::singleton(); $db = FronkDB::singleton();
// $sql = "SELECT Patching.id,lastname,firstname,customer_number,company,device_name,device_port FROM `Patching` $sql = "Select Patching.id,lastname,firstname,customer_number,company,device_name,device_port,value_string,Building.`street`,Building.`zip`, Building.`city` FROM Workflowvalue
//LEFT JOIN OrderProduct ON (Patching.termination_id=OrderProduct.termination_id) LEFT JOIN Termination ON Termination.id=Workflowvalue.object_id LEFT JOIN Patching ON Termination.id = Patching.termination_id
//LEFT JOIN `Order` ON (`Order`.id=OrderProduct.order_id)
//LEFT JOIN Address ON Address.id=`Order`.owner_id
//WHERE Patching.`device_name` LIKE '".$ip."%'";
// $res = $db->query($sql);
// if ($db->num_rows($res)) {
// while ($data = $db->fetch_array($res)) {
// $devicePort = str_replace($ip, "", $data['device_name']);
// $devicePort=trim($devicePort);
// $devicePort=ltrim($devicePort,"/");
// $devicePort=ltrim($devicePort,"-");
// $devicePort=$devicePort."/".$data['device_port'];
// $devicePort=str_replace("/","-",$devicePort);
// $devicePort=rtrim($devicePort,"-");
// $items[$devicePort] = $data;
//
//
// }
// }
$sql = "Select Patching.id,lastname,firstname,customer_number,company,device_name,device_port,value_string FROM Workflowvalue
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)
LEFT JOIN Address ON Address.id=`Order`.owner_id LEFT JOIN Address ON Address.id=`Order`.owner_id
LEFT JOIN Building ON Building.id=Termination.building_id
WHERE `item_id` = '55' "; WHERE `item_id` = '55' ";
$res = $db->query($sql); $res = $db->query($sql);
if ($db->num_rows($res)) { if ($db->num_rows($res)) {
while ($data = $db->fetch_array($res)) { while ($data = $db->fetch_array($res)) {
$ontSn=$data['value_string']; $ontSn=$data['value_string'];
$ontSn= str_replace("HWTC","48575443",$ontSn); $ontSn= str_replace("HWTC","48575443",$ontSn);
$items[$ontSn] = $data; $items[$ontSn] = $data;
} }
} }
+3 -2
View File
@@ -143,6 +143,7 @@ class PoprackController extends mfBaseController
$extTextspan=""; $extTextspan="";
foreach ($module['slots'] as $slots) { foreach ($module['slots'] as $slots) {
$extText = ""; $extText = "";
$title=$slots['modulname'];
if ($slots['type'] == '0') { if ($slots['type'] == '0') {
$color = '#9fff6e'; $color = '#9fff6e';
$colorclass = "rack-color-lwl"; $colorclass = "rack-color-lwl";
@@ -152,7 +153,7 @@ class PoprackController extends mfBaseController
$extTextspan = "<span style='font-size: 12px;font-weight: 400'>".$extText."</span>"; $extTextspan = "<span style='font-size: 12px;font-weight: 400'>".$extText."</span>";
} }
} else if ($slots['type'] == '1') { } else if ($slots['type'] == '1') {
$slots['modulname']='<a style="color: #000000;text-decoration: underline;" target="_self" href="'.self::getUrl("Device", "detail", ["id" => $slots['device_id']]).'">'.$slots['modulname'].'</a>';
$color = '#b6c6ff'; $color = '#b6c6ff';
$colorclass = "rack-color-device"; $colorclass = "rack-color-device";
} else if ($slots['type'] == '2') { } else if ($slots['type'] == '2') {
@@ -198,7 +199,7 @@ class PoprackController extends mfBaseController
$position++; $position++;
$calcwidth = $calcwidth + $slots['width']; $calcwidth = $calcwidth + $slots['width'];
} }
echo '<td title="' . $slots['modulname'] . $extText . '" colspan="' . $slots['width'] . '" class="text-center border-top border-bottom border-right text-nowrap text-truncate pl-1 pr-1 ' . $colorclass . '" data-id="' . $slots['moduleid'] . '" data-type="' . $slots['type'] . '" data-name="' . $slots['modulname'] . '" data-starthe="' . $module['start_he'] . '" data-ports="' . $slots['ports'] . '" data-plug="' . $slots['plug'] . '" rowspan="' . $modulelenght . '" style="width: ' . $width . '; background-color: ' . $color . ';border-color: #797979 !important; white-space: nowrap; text-overflow: ellipsis;max-width: ' . $maxwidth . 'px;"><span></span> ' . $slots['modulname'] . $extTextspan . '</td>'; echo '<td title="' . $title . $extText . '" colspan="' . $slots['width'] . '" class="text-center border-top border-bottom border-right text-nowrap text-truncate pl-1 pr-1 ' . $colorclass . '" data-id="' . $slots['moduleid'] . '" data-type="' . $slots['type'] . '" data-name="' . $title . '" data-starthe="' . $module['start_he'] . '" data-ports="' . $slots['ports'] . '" data-plug="' . $slots['plug'] . '" rowspan="' . $modulelenght . '" style="width: ' . $width . '; background-color: ' . $color . ';border-color: #797979 !important; white-space: nowrap; text-overflow: ellipsis;max-width: ' . $maxwidth . 'px;"><span></span> ' . $slots['modulname'] . $extTextspan . '</td>';
$position++; $position++;
$calcwidth = $calcwidth + $slots['width']; $calcwidth = $calcwidth + $slots['width'];
} }
@@ -54,7 +54,7 @@ class PoprackmoduleModel
{ {
$items = []; $items = [];
$db = FronkDB::singleton(); $db = FronkDB::singleton();
$sql = "SELECT `id`, `name`, `start_he`,`end_he` FROM `Poprackmodule` WHERE `poprack_id`='" . $poprack_id . "' AND type ='0' ORDER by name"; $sql = "SELECT `id`, `name`, `start_he`,`end_he`,`plug`,`ports` FROM `Poprackmodule` WHERE `poprack_id`='" . $poprack_id . "' AND type ='0' ORDER by start_he";
$res = $db->query($sql); $res = $db->query($sql);
if ($db->num_rows($res)) { if ($db->num_rows($res)) {