diff --git a/Layout/default/FiberPlanCable/Detail.php b/Layout/default/FiberPlanCable/Detail.php index dea675416..38606a864 100644 --- a/Layout/default/FiberPlanCable/Detail.php +++ b/Layout/default/FiberPlanCable/Detail.php @@ -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 - ' . $summcounter . ' @@ -512,6 +514,14 @@ foreach ($fiberPlanCablePipes as $fiberPlanCablePipe) { $pipeheightinfoheight = "15px"; $pipeheightinfomarge = "3px"; $pipsstriped = '
'; + } 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) { fibers]); } ?> diff --git a/application/FiberPlanCable/FiberPlanCableController.php b/application/FiberPlanCable/FiberPlanCableController.php index ef11149ff..d833456f3 100644 --- a/application/FiberPlanCable/FiberPlanCableController.php +++ b/application/FiberPlanCable/FiberPlanCableController.php @@ -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); diff --git a/application/FiberPlanCable/FiberPlanCableModel.php b/application/FiberPlanCable/FiberPlanCableModel.php index 8d654785e..6eae1e5e1 100644 --- a/application/FiberPlanCable/FiberPlanCableModel.php +++ b/application/FiberPlanCable/FiberPlanCableModel.php @@ -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; } diff --git a/public/js/pages/FiberPlanCable/Form.js b/public/js/pages/FiberPlanCable/Form.js index 5c7499130..3ba59ff6f 100644 --- a/public/js/pages/FiberPlanCable/Form.js +++ b/public/js/pages/FiberPlanCable/Form.js @@ -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(`

` + destinationtype + ` (` + destination_typename + `)

`); - console.log(destinations); $.each(destinations, function (index, destination) { @@ -182,10 +182,10 @@ function generateDestinationmid(destinations, destinationtype, destinationdiv, p
`); - console.log(randid); + var sleeveoptions = ''; $.each(destination.sleeves, function (k, val) { - console.log(val); + sleeveoptions = sleeveoptions + ''; }); $('#' + randid + '_sleeves_div').append(`
@@ -252,7 +252,6 @@ function generateDestination(destination, destinationtype, destinationdiv, param $.each(data.data, function (k, val) { sleeveoptions = sleeveoptions + ''; }); - console.log(destinationdiv); $('#' + destinationdiv).append(`
@@ -325,7 +324,7 @@ function generateDestination(destination, destinationtype, destinationdiv, param checkusedfibers($('#' + destinationdiv)); } } else if (append === 1) { - console.log('cool'); + $('#' + destinationdiv).append(`
@@ -364,7 +363,6 @@ function addModule(thistrigger, poprackid, append = 0, param = 0, selected = nul $.each(data.data, function (k, val) { rackoptions = rackoptions + ''; }); - console.log('cool1'); $('#destinationstartpoint').append(`
@@ -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 = ''; var thisis = $(this); + var index = thisis.data('index'); $('#destination-div').empty(); $('#destination-div').append('
'); $.getJSON(fiberPlanPipeSubUrl + "&fiberplanpipe_id=" + $.trim($(thisis).val()), {}) @@ -631,6 +631,7 @@ $(document).ready(function () { ) ; + $(thisis).closest(".form-group").next().find('.subpipe-div').html(''); $(".fiberplanpipesub").select2({ placeholder: "", @@ -648,8 +649,9 @@ $(document).ready(function () { checkracks(); // $("#fiberplanpipesub option[value=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(`
@@ -869,7 +873,7 @@ $(document).ready(function () {
-
+