Faserplanung Update
* Umbau Rohrverzeichnis auf Ajax Table * Auslagerung der JS vom Rohrverzeichnis in eigene Datei
This commit is contained in:
@@ -19,14 +19,6 @@ class FiberPlanPipeController extends mfBaseController
|
||||
protected function indexAction()
|
||||
{
|
||||
$this->layout()->setTemplate("FiberPlanPipe/Index");
|
||||
$fiberplanpipes = FiberPlanPipeModel::getAll();
|
||||
$pipworkeraddresses = FiberPlanPipeModel::getPipeworkerAddresses();
|
||||
$fiberplanpipeEndpoints = FiberPlanPipeEndpointModel::getAll();
|
||||
|
||||
$this->layout()->set("fiberplanpipeEndpoints", $fiberplanpipeEndpoints);
|
||||
$this->layout()->set("pipworkeraddresses", $pipworkeraddresses);
|
||||
$this->layout()->set("fiberplanpipes", $fiberplanpipes);
|
||||
|
||||
}
|
||||
|
||||
protected function addAction()
|
||||
@@ -56,6 +48,9 @@ class FiberPlanPipeController extends mfBaseController
|
||||
case "getPops":
|
||||
$return = $this->getPops($network);
|
||||
break;
|
||||
case "getFiberPlanPipes":
|
||||
$return = $this->getFiberPlanPipes();
|
||||
break;
|
||||
default:
|
||||
$return = false;
|
||||
}
|
||||
@@ -283,4 +278,110 @@ class FiberPlanPipeController extends mfBaseController
|
||||
{
|
||||
FiberPlanPipeModel::getBuildingInfo($network, $bdtype);
|
||||
}
|
||||
|
||||
|
||||
protected function getFiberPlanPipes()
|
||||
{
|
||||
|
||||
$fiberplanpipes = FiberPlanPipeModel::getAll();
|
||||
$pipworkeraddresses = FiberPlanPipeModel::getPipeworkerAddresses();
|
||||
$fiberplanpipeEndpoints = FiberPlanPipeEndpointModel::getAll();
|
||||
$typeOption = FiberPlanPipeModel::$type_definition;
|
||||
$statusOption = FiberPlanPipeModel::$status_definition;
|
||||
$dimension_v1Option = FiberPlanPipeModel::$type_descrition_definition;
|
||||
$responsibleOption[1] = "(F)";
|
||||
$responsibleOption[2] = "(P)";
|
||||
|
||||
foreach ($pipworkeraddresses as $pipworkeraddress) {
|
||||
$Pipeworker[$pipworkeraddress->id] = $pipworkeraddress->company;
|
||||
}
|
||||
$responsecount = count($fiberplanpipes);
|
||||
|
||||
foreach ($fiberplanpipes as $fiberplanpipe) {
|
||||
unset($networks);
|
||||
unset($endpoints);
|
||||
|
||||
// Performance Killer muss bereinigt werden
|
||||
foreach ($fiberplanpipeEndpoints[$fiberplanpipe->id] as $fiberplanpipeEndpoint) {
|
||||
if ($fiberplanpipeEndpoint->pop_id) {
|
||||
$networks[$fiberplanpipeEndpoint->pop->network->name] = $fiberplanpipeEndpoint->pop->network->name;
|
||||
$endpoints[] = '<span title="POP">(P) </span>' . $fiberplanpipeEndpoint->pop->name;
|
||||
} else if ($fiberplanpipeEndpoint->building_id) {
|
||||
$networks[$fiberplanpipeEndpoint->building->network->name] = $fiberplanpipeEndpoint->building->network->name;
|
||||
$endpoints[] = '<span title="Building">(B) </span>' . $fiberplanpipeEndpoint->building->street . " " . $fiberplanpipeEndpoint->building->number;
|
||||
} else if ($fiberplanpipeEndpoint->fiberPlanDispatcher_id) {
|
||||
$networks[$fiberplanpipeEndpoint->fiberPlanDispatcher->network->name] = $fiberplanpipeEndpoint->fiberPlanDispatcher->network->name;
|
||||
if ($fiberplanpipeEndpoint->fiberPlanDispatcher->object_type == "1") {
|
||||
$endpoints[] = '<span title="Verteiler">(V) </span>' . $fiberplanpipeEndpoint->fiberPlanDispatcher->description;
|
||||
} elseif ($fiberplanpipeEndpoint->fiberPlanDispatcher->object_type == "2") {
|
||||
$endpoints[] = '<span title="Schacht">(S) </span>' . $fiberplanpipeEndpoint->fiberPlanDispatcher->description;
|
||||
} else if ($fiberplanpipeEndpoint->fiberPlanDispatcher->object_type == "3") {
|
||||
$endpoints[] = '<span title="Greenfield">(G) </span>' . $fiberplanpipeEndpoint->fiberPlanDispatcher->description;
|
||||
} else if ($fiberplanpipeEndpoint->fiberPlanDispatcher->object_type == "4") {
|
||||
$endpoints[] = '<span title="Abzweigepunkt">(A) </span>' . $fiberplanpipeEndpoint->fiberPlanDispatcher->description;
|
||||
}
|
||||
}
|
||||
}
|
||||
//....
|
||||
|
||||
if ($fiberplanpipe->type == "3") {
|
||||
$name = "";
|
||||
if ($fiberplanpipe->fiberPlanPipeTemplate->pipe7x4 && $fiberplanpipe->fiberPlanPipeTemplate->pipe14x10) {
|
||||
$name = $fiberplanpipe->fiberPlanPipeTemplate->fiberPlanPipeManufacturer->name . " " . $fiberplanpipe->fiberPlanPipeTemplate->pipe7x4 . "*7x4" . "/" . $fiberplanpipe->fiberPlanPipeTemplate->pipe14x10 . "*14x10";
|
||||
} else if ($fiberplanpipe->fiberPlanPipeTemplate->pipe7x4) {
|
||||
$name = $fiberplanpipe->fiberPlanPipeTemplate->fiberPlanPipeManufacturer->name . " " . $fiberplanpipe->fiberPlanPipeTemplate->pipe7x4 . "*7x4";
|
||||
} else if ($fiberplanpipe->fiberPlanPipeTemplate->pipe14x10) {
|
||||
$name = $fiberplanpipe->fiberPlanPipeTemplate->fiberPlanPipeManufacturer->name . " " . $fiberplanpipe->fiberPlanPipeTemplate->pipe14x10 . "*14x10";
|
||||
}
|
||||
$typeDescription = $name;
|
||||
//
|
||||
} else {
|
||||
$typeDescription = $dimension_v1Option[$fiberplanpipe->type_description];
|
||||
}
|
||||
$startpoint = '<span class="startpoint" data-toggle="modal" data-target="#pipemap" data-gpslat="' . $buildings[$fiberplanpipe->startpoint_type][$fiberplanpipe->startpoint]['gps_lat'] . '" data-gpslong="' . $buildings[$fiberplanpipe->startpoint_type][$fiberplanpipe->startpoint]['gps_long'] . '">' . $starting_pointOption[$fiberplanpipe->startpoint_type] . "/" . $buildings[$fiberplanpipe->startpoint_type][$fiberplanpipe->startpoint]['name'] . '</span>';
|
||||
$endpoint = '<span class="endpoint" data-toggle="modal" data-target="#pipemap" data-gpslat="' . $buildings[$fiberplanpipe->entpoint_type][$fiberplanpipe->endpoint]['gps_lat'] . '" data-gpslong="' . $buildings[$fiberplanpipe->entpoint_type][$fiberplanpipe->endpoint]['gps_long'] . '">' . $starting_pointOption[$fiberplanpipe->entpoint_type] . "/" . $buildings[$fiberplanpipe->entpoint_type][$fiberplanpipe->endpoint]['name'] . '</span>';
|
||||
|
||||
$responsible = $responsibleOption[$fiberplanpipe->responsible];
|
||||
|
||||
if ($fiberplanpipe->address_id) {
|
||||
$responsible .= " " . $Pipeworker[$fiberplanpipe->address_id];
|
||||
if ($fiberplanpipe->responsible_text) {
|
||||
$responsible .= " (" . $fiberplanpipe->responsible_text . ")";
|
||||
}
|
||||
} else {
|
||||
$responsible .= " " . $fiberplanpipe->responsible_text;
|
||||
}
|
||||
if ($fiberplanpipe->startpoint_network_id == $fiberplanpipe->endpoint_network_id) {
|
||||
$networkName = $Network[$fiberplanpipe->startpoint_network_id];
|
||||
} else {
|
||||
$networkName = $Network[$fiberplanpipe->startpoint_network_id] . " / " . $Network[$fiberplanpipe->endpoint_network_id];
|
||||
}
|
||||
$edit = '<a href="' . self::getUrl("FiberPlanPipe", "edit", ["id" => $fiberplanpipe->id]) . '"><i
|
||||
class="far fa-edit" title="Bearbeiten"></i></a><a href="' . self::getUrl("FiberPlanPipe", "delete", ["id" => $fiberplanpipe->id]) . '"
|
||||
onclick="if(!confirm("Rohrverzeichnis wirklich löschen?")) return false;"
|
||||
class="text-danger"
|
||||
title="Löschen"><i class="fas fa-trash"></i></a>';
|
||||
|
||||
$rows[] = array(
|
||||
'description' => array('description' => '<a href="' . self::getUrl("FiberPlanPipe", "Detail", ["id" => $fiberplanpipe->id]) . '">' . $fiberplanpipe->description . '</a>', 'order' => $fiberplanpipe->description),
|
||||
'typeOption' => array('typeOption' => $typeOption[$fiberplanpipe->type] . " / " . $typeDescription, 'order' => $typeOption[$fiberplanpipe->type] . " / " . $typeDescription),
|
||||
'length' => array('length' => $fiberplanpipe->length, 'order' => $fiberplanpipe->length),
|
||||
'networks' => array('networks' => implode(',', $networks), 'order' => implode(',', $networks)),
|
||||
'startpoint' => array('startpoint' => $endpoints[0], 'order' => $endpoints[0]),
|
||||
'endpoint' => array('endpoint' => $endpoints[count($endpoints) - 1], 'order' => $endpoints[count($endpoints) - 1]),
|
||||
'responsible' => array('responsible' => $responsible, 'order' => $responsible),
|
||||
'state' => array('state' => $statusOption[$fiberplanpipe->status], 'order' => $statusOption[$fiberplanpipe->status]),
|
||||
'edit' => array('edit' => $edit, 'order' => ''),
|
||||
);
|
||||
}
|
||||
|
||||
$json['success'] = true;
|
||||
$json['data'] = $rows;
|
||||
$json['recordsFiltered'] = $responsecount;
|
||||
$json['recordsTotal'] = $responsecount;
|
||||
$json = json_encode($json);
|
||||
echo trim($json);
|
||||
die();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user