Merge branch 'devbyspi' into 'master'

Devices OLT Kunden Update

See merge request fronk/thetool!126
This commit is contained in:
Frank Schubert
2023-11-21 16:55:36 +00:00
5 changed files with 19 additions and 37 deletions

View File

@@ -335,8 +335,8 @@ if ($devices->power != "0.0") {
<div class="float-right">
<a id="create-backup-href"
href="<?= self::getUrl("Device", "api", ['do' => 'createconfig', 'ip' => $devices->ip, 'id' => $devices->id]) ?>"
<button class="btn btn-primary "><span id="create-backup-button-text">Backup erstellen</span>
<span id="create-backup-load"></i></span></button>
<button class="btn btn-primary "><span id="create-backup-button-text">Backup erstellen</span>
<span id="create-backup-load"></i></span></button>
</a></div>
</div>
<?php
@@ -717,8 +717,10 @@ if ($devices->power != "0.0") {
allonts++;
if (typeof customers[ont['serial']] !== "undefined") {
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'];
} else if (customers[ont['serial']]['lastname'] == null) {
customername = customers[ont['serial']]['street'] + ", " + customers[ont['serial']]['zip'] + " " + customers[ont['serial']]['city']
} else {
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>
</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 {

View File

@@ -498,6 +498,7 @@ if (!empty(trim($pops->vlan_ipv6)))
$extTextspan = "";
foreach ($module['slots'] as $slots) {
$extText = "";
$title=$slots['modulname'];
if ($slots['type'] == '0') {
$color = '#9fff6e';
$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>";
}
} 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>
$("#module-device-id option[value='<?= $slots['device_id'] ?>']").remove();
@@ -514,7 +516,6 @@ if (!empty(trim($pops->vlan_ipv6)))
$color = '#b6c6ff';
$colorclass = "rack-color-device";
} else if ($slots['type'] == '2') {
$color = '#ff8100';
$colorclass = "rack-color-rpanel";
} else if ($slots['type'] == '3') {
@@ -556,7 +557,7 @@ if (!empty(trim($pops->vlan_ipv6)))
$position++;
$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++;
$calcwidth = $calcwidth + $slots['width'];
}

View File

@@ -142,39 +142,18 @@ class DeviceModel
{
$items = [];
$db = FronkDB::singleton();
// $sql = "SELECT Patching.id,lastname,firstname,customer_number,company,device_name,device_port FROM `Patching`
//LEFT JOIN OrderProduct ON (Patching.termination_id=OrderProduct.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 `Order` ON (`Order`.id=OrderProduct.order_id)
LEFT JOIN Address ON Address.id=`Order`.owner_id
WHERE `item_id` = '55'";
$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 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 `Order` ON (`Order`.id=OrderProduct.order_id)
LEFT JOIN Address ON Address.id=`Order`.owner_id
LEFT JOIN Building ON Building.id=Termination.building_id
WHERE `item_id` = '55' ";
$res = $db->query($sql);
if ($db->num_rows($res)) {
while ($data = $db->fetch_array($res)) {
$ontSn=$data['value_string'];
$ontSn= str_replace("HWTC","48575443",$ontSn);
$items[$ontSn] = $data;
}
}

View File

@@ -143,6 +143,7 @@ class PoprackController extends mfBaseController
$extTextspan="";
foreach ($module['slots'] as $slots) {
$extText = "";
$title=$slots['modulname'];
if ($slots['type'] == '0') {
$color = '#9fff6e';
$colorclass = "rack-color-lwl";
@@ -152,7 +153,7 @@ class PoprackController extends mfBaseController
$extTextspan = "<span style='font-size: 12px;font-weight: 400'>".$extText."</span>";
}
} 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';
$colorclass = "rack-color-device";
} else if ($slots['type'] == '2') {
@@ -198,7 +199,7 @@ class PoprackController extends mfBaseController
$position++;
$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++;
$calcwidth = $calcwidth + $slots['width'];
}

View File

@@ -54,7 +54,7 @@ class PoprackmoduleModel
{
$items = [];
$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);
if ($db->num_rows($res)) {