Faserplanung

* Kabelverzeichnis Updates
This commit is contained in:
Daniel Spitzer
2024-06-30 14:26:57 +02:00
parent 0f5711ede0
commit edae9b9061
4 changed files with 37 additions and 21 deletions

View File

@@ -324,13 +324,13 @@ function generateendpointbody($destinations, $destinationinfo, $oldsummcounter =
}
endif;
}
if ($sumcounter==0){
if ($sumcounter == 0) {
$sumcounter = $oldsummcounter;
}
return array($body, $sumcounter, $dropout);
}
function generatedestinationmidpoint($markers, $midpoints, $cableendpoints, $fiberPlanCablePipes, $pipesubs)
function generatedestinationmidpoint($markers, $midpoints, $cableendpoints, $fiberPlanCablePipes, $pipesubs, $fibers = 0)
{
$oldendpoint = "";
$midpointcounter = count($midpoints);
@@ -340,6 +340,8 @@ function generatedestinationmidpoint($markers, $midpoints, $cableendpoints, $fib
$counter = 0;
$width = 0;
$oldsummcounter = 0;
$summcounter = $fibers;
foreach ($midpoints as $midpoint):
$pipecol = $pipesubs[$counter]['pipecolor'];
$midcounter = 0;
@@ -366,7 +368,7 @@ function generatedestinationmidpoint($markers, $midpoints, $cableendpoints, $fib
</thead>
<tbody id="olt-ports">
<tr>
<td data-oltport="0"
<td
class="font-13">' . $summcounter . '</td>
</tr>
<tr>
@@ -512,6 +514,14 @@ foreach ($fiberPlanCablePipes as $fiberPlanCablePipe) {
$pipeheightinfoheight = "15px";
$pipeheightinfomarge = "3px";
$pipsstriped = '<div class="pipe-striped"></div>';
} else {
$pipesub = "";
$pipeheight = "";
$pipecolor = "";
$pipecolordesc = $fiberPlanCablePipe->fiberPlanPipe->type_description;
$pipeheightinfoheight = "15px";
$pipeheightinfomarge = "3px";
$pipsstriped = '';
}
/* var_dump($fiberPlanCablePipe->fiberPlanpipe->fiberPlanPipeTemplate);
echo $fiberPlanCablePipe->fiberPlanPipe_sub;
@@ -658,7 +668,7 @@ foreach ($fiberPlanCableEndpoints as $fiberPlanCableEndpoint) {
<?php
if ($fiberPlanPipesEndpoints) {
$markers = generatedestinationmidpoint($markers, $fiberPlanPipesEndpoints, $fiberPlanCableEndpoints, $fiberPlanCablePipes, $pipesubs);
$markers = generatedestinationmidpoint($markers, $fiberPlanPipesEndpoints, $fiberPlanCableEndpoints, $fiberPlanCablePipes, $pipesubs, $fibersArray[$fiberplancables->fibers]);
}
?>
</div>

View File

@@ -92,6 +92,7 @@ class FiberPlanCableController extends mfBaseController
$fiberPlanPipesEndpoints[] = FiberPlanPipeEndpointModel::search(['fiberPlanPipe_id' => $fiberPlanCablePipe->fiberPlanPipe_id]);
}
}
$fibersArray = FiberPlanCableModel::$fibersArray;
$fiberPlanCableEndpoints = FiberPlanCableEndpointModel::search(['fiberPlanCable_id' => $id]);
//$fiberPlanPipeSub = FiberPlanCableModel::getFiberPlanPipeSub($fiberplancables->data->fiberPlanPipe_id, 1);
$fiberPlanPipeTemplates = FiberPlanPipeTemplateModel::getAll();
@@ -100,6 +101,7 @@ class FiberPlanCableController extends mfBaseController
$fiberplanpipemanufacturers = FiberPlanPipeManufacturerModel::getOne(1);
$this->layout()->set("lineworkeraddresses", $lineworkeraddresses);
$this->layout()->set("fibersArray", $fibersArray);
$this->layout()->set("fiberplanpipemanufacturers", $fiberplanpipemanufacturers);
// $this->layout()->set("fiberPlanPipeSub", $fiberPlanPipeSub);
$this->layout()->set("fiberplancables", $fiberplancables);

View File

@@ -4,6 +4,7 @@ class FiberPlanCableModel
{
private $description;
private $fibers;
private $diameter;
private $fiberPlanPipe_id;
private $fiberPlanPipe_sub;
@@ -25,6 +26,7 @@ class FiberPlanCableModel
private $network_id;
private $comment;
public static $fibersArray = array(1 => 4, 2 => 12, 3 => 24, 4 => 24, 5 => 48, 6 => 96, 7 => 144, 8 => 144, 9 => 192, 10 => 288);
public static function find($data)
{
@@ -153,27 +155,27 @@ class FiberPlanCableModel
$res = $db->query($sql);
if ($db->num_rows($res)) {
while ($data = $db->fetch_object($res)) {
$ok=0;
$ok = 0;
$FiberplanPipeEndpoint = new FiberPlanPipeEndpoint($data);
if ($data->fiberPlanDispatcher_id) {
if ($FiberplanPipeEndpoint->fiberPlanDispatcher->network_id == $network_id) {
$ok=1;
$ok = 1;
}
}
if ($data->building_id) {
if ($FiberplanPipeEndpoint->building->network_id == $network_id) {
$ok=1;
$ok = 1;
}
}
if ($data->pop_id) {
$sql = "SELECT id FROM PopNetwork WHERE pop_id='" . $data->pop_id . "' AND network_id='" . $network_id . "'";
$result = $db->query($sql);
if ($db->num_rows($result)) {
$ok=1;
$ok = 1;
}
}
if ($ok==1) {
if ($ok == 1) {
$items[$FiberplanPipeEndpoint->fiberPlanPipe_id]['description'] = $FiberplanPipeEndpoint->fiberPlanPipe->description;
$items[$FiberplanPipeEndpoint->fiberPlanPipe_id]['id'] = $FiberplanPipeEndpoint->fiberPlanPipe_id;
}

View File

@@ -7,6 +7,7 @@ function checkendpoints() {
$(this).find('.move-endpoint-up').remove();
$(this).find('.move-endpoint-down').remove();
$(this).find('.remove-endpoint').remove();
$(this).closest('.fiberplancablepipe-div').find('.fiberPlanPipe_id').data('index', index);
if (index == 0 && endpointcounter - 1 == 0) {
// endpointtext = "Startpunkt";
} else if (index == 0) {
@@ -154,7 +155,6 @@ function generateDestinationmid(destinations, destinationtype, destinationdiv, p
$('#' + destinationdiv).append(` <div class="destination-dropdown row">
<i class="fa-solid fa-square-caret-up "></i><h4>` + destinationtype + ` (` + destination_typename + `) </h4>
</div>`);
console.log(destinations);
$.each(destinations, function (index, destination) {
@@ -182,10 +182,10 @@ function generateDestinationmid(destinations, destinationtype, destinationdiv, p
<div id="` + randid + `_sleeves_div"> </div>
`);
console.log(randid);
var sleeveoptions = '<option value="">&nbsp;</option>';
$.each(destination.sleeves, function (k, val) {
console.log(val);
sleeveoptions = sleeveoptions + '<option value="' + k + '">' + val + '</option>';
});
$('#' + randid + '_sleeves_div').append(`<div class="form-group row">
@@ -252,7 +252,6 @@ function generateDestination(destination, destinationtype, destinationdiv, param
$.each(data.data, function (k, val) {
sleeveoptions = sleeveoptions + '<option value="' + val.id + '">' + val.name + '</option>';
});
console.log(destinationdiv);
$('#' + destinationdiv).append(`<div class="form-group row">
<label class="col-lg-3 col-form-label" for="lenght">Muffe </label>
<div class="col-lg-5">
@@ -325,7 +324,7 @@ function generateDestination(destination, destinationtype, destinationdiv, param
checkusedfibers($('#' + destinationdiv));
}
} else if (append === 1) {
console.log('cool');
$('#' + destinationdiv).append(`<div class="form-group row" style="border-top: 1px dotted #9b9b9b;padding-top: 15px;">
<label class="col-lg-3 col-form-label" for="lenght">Schrank <i data-popid="` + popid + `" class="fa-regular fa-circle-minus remove-rack"></i></label>
<div class="col-lg-5">
@@ -364,7 +363,6 @@ function addModule(thistrigger, poprackid, append = 0, param = 0, selected = nul
$.each(data.data, function (k, val) {
rackoptions = rackoptions + '<option value="' + val.id + '">' + val.name + '</option>';
});
console.log('cool1');
$('#destinationstartpoint').append(`<div class="form-group row" style="border-top: 1px dotted #9b9b9b;padding-top: 15px;">
<label class="col-lg-3 col-form-label" for="lenght">Schrank <i data-popid="` + popid + `" class="fa-regular fa-circle-minus remove-rack"></i></label>
<div class="col-lg-5">
@@ -510,13 +508,14 @@ $(document).ready(function () {
$('.fiberplanpipe_id').eq(counter).val(pipesid[counter]);
$('.fiberPlanPipe_id').eq(counter).trigger("change", "1");
checkendpoints();
counter++;
});
} else if (param == 0) {
checkendpoints();
}
$(".select2select").select2({placeholder: ""});
}
checkendpoints();
});
});
@@ -558,6 +557,7 @@ $(document).ready(function () {
// console.log(param);
var options = '<option value="">&nbsp;</option>';
var thisis = $(this);
var index = thisis.data('index');
$('#destination-div').empty();
$('#destination-div').append('<div id="destinationstartpoint" class="destinationpoint"></div><div id="destinationmidpoint" class="destinationpoint"></div><div id="destinationendpoint" class="destinationpoint"></div>');
$.getJSON(fiberPlanPipeSubUrl + "&fiberplanpipe_id=" + $.trim($(thisis).val()), {})
@@ -631,6 +631,7 @@ $(document).ready(function () {
)
;
$(thisis).closest(".form-group").next().find('.subpipe-div').html('<select name="fiberplanpipesub[]" required="required" class=" form-control fiberplanpipesub">' + options + '</select>');
$(".fiberplanpipesub").select2({
placeholder: "",
@@ -648,8 +649,9 @@ $(document).ready(function () {
checkracks();
// $("#fiberplanpipesub option[value=<?php echo $fiberplancables->fiberPlanPipe_sub; ?>]").attr('selected', 'selected');
} else if (param == 0) {
$('.fiberplanpipe-main-div').eq(index).html('test');
}
}
}
)
@@ -861,6 +863,8 @@ $(document).ready(function () {
$(this).trigger('change', '1')
})
$('body').on('click', '.add-pipe', function () {
var newindex = $('.fiberplancablepipe-div').length;
console.log(newindex);
$('#fiberplancablepipes-div').append(`<div class="fiberplancablepipe-div">
<div class=" form-group row">
<label class="col-lg-3 col-form-label fiberplanpipe-label" for="fiberPlanPipe_id"><span class=" label-text">Rohr *</span> <span class="endpointsymbol"></span></label>
@@ -869,7 +873,7 @@ $(document).ready(function () {
<option value=""></option>
</select>
</div>
<div class="col-lg-4 pipe-div"><select name="fiberplanpipe[]" required="required" class="select2select form-control fiberPlanPipe_id"></select><input type="hidden" name="fiberplanpipe_id[]" class="fiberplanpipe_id" value="x"></div>
<div class="col-lg-4 pipe-div"><select data-index="` + newindex + `" name="fiberplanpipe[]" required="required" class="select2select form-control fiberPlanPipe_id"></select><input type="hidden" name="fiberplanpipe_id[]" class="fiberplanpipe_id" value="x"></div>
</div>
<div class="form-group row">
<label class="col-lg-3 col-form-label" for="fiberPlanPipe_sub">Subrohr
@@ -888,8 +892,6 @@ $(document).ready(function () {
$('.fiberplancablepipe-div').eq(fiberplancablepipelength - 1).find('.pipe-network').trigger('change');
$('.select2select').select2({placeholder: ""});
checkendpoints();