0.3.14
This commit is contained in:
parent
fa0703870a
commit
9d8d4c2a39
@ -1983,6 +1983,7 @@ var $qls;
|
||||
// Generate port name(s)
|
||||
$objName = '';
|
||||
$selected = false;
|
||||
$populated = false;
|
||||
foreach($connectionSide as $port) {
|
||||
|
||||
$objID = $port['objID'];
|
||||
@ -1990,6 +1991,10 @@ var $qls;
|
||||
$objDepth = $port['objDepth'];
|
||||
$objPort = $port['objPort'];
|
||||
$selected = ($port['selected'] == true) ? true : $selected;
|
||||
$cableLength = $port['length'];
|
||||
$mediaTypeID = $port['mediaTypeID'];
|
||||
$connectorTypeID = $port['connectorTypeID'];
|
||||
$populated = (isset($this->populatedPortArray[$objID][$objFace][$objDepth][$objPort])) ? true : $populated;
|
||||
|
||||
$objName .= $this->generateObjectPortName($objID, $objFace, $objDepth, $objPort).'<br>';
|
||||
}
|
||||
@ -1998,20 +2003,44 @@ var $qls;
|
||||
$htmlPort = $this->wrapObject($objID, $objName, $selected, $trunkPairID);
|
||||
|
||||
// Gather connector data
|
||||
if($connectorTypeID) {
|
||||
$portTypeName = $this->connectorTypeValueArray[$connectorTypeID]['name'];
|
||||
} else {
|
||||
$obj = $this->objectArray[$objID];
|
||||
$objTemplateID = $obj['template_id'];
|
||||
$objCompatibility = $this->compatibilityArray[$objTemplateID][$objFace][$objDepth];
|
||||
$portTypeID = $objCompatibility['portType'];
|
||||
$portTypeName = $this->portTypeValueArray[$portTypeID]['name'];
|
||||
}
|
||||
|
||||
// Determine if this port is connected to another
|
||||
if($connectionIndex == 1) {
|
||||
$connected = (count($connection[0])) ? true : false;
|
||||
} else {
|
||||
$connected = (count($connection[1])) ? true : false;
|
||||
}
|
||||
|
||||
if($connected or $populated) {
|
||||
// Compile connector div
|
||||
$htmlConnector = '<div title="'.$portTypeName.'" class="port '.$portTypeName.'" data-connection-pair-id='.$connectionPairID.'></div>';
|
||||
|
||||
// Gather cable data
|
||||
if($mediaTypeID) {
|
||||
$mediaTypeName = $this->mediaTypeValueArray[$mediaTypeID]['name'];
|
||||
} else {
|
||||
$obj = $this->objectArray[$objID];
|
||||
$objTemplateID = $obj['template_id'];
|
||||
$objCompatibility = $this->compatibilityArray[$objTemplateID][$objFace][$objDepth];
|
||||
$mediaTypeID = $objCompatibility['mediaType'];
|
||||
$mediaTypeName = $this->mediaTypeValueArray[$mediaTypeID]['name'];
|
||||
$cableLength = 0;
|
||||
}
|
||||
|
||||
// Compile cable div
|
||||
$htmlCable = '<div style="width:100%;text-align:left;" title="'.$mediaTypeName.'" class="cable '.$mediaTypeName.' adjacent">'.$cableLength.'<br>'.$mediaTypeName.'</div>';
|
||||
} else {
|
||||
$htmlConnector = '';
|
||||
$htmlCable = '';
|
||||
}
|
||||
|
||||
$htmlPathFull .= '<tr>';
|
||||
$htmlPathFull .= '<td>'.$htmlPort.'</td>';
|
||||
|
||||
@ -4,8 +4,8 @@
|
||||
$pathArray = array();
|
||||
|
||||
if($connectorCode39) {
|
||||
$connectorID2 = base_convert($connectorCode39, 36, 10);
|
||||
$rootCable2 = $qls->App->inventoryByIDArray[$connectorID2];
|
||||
$managedCableID = base_convert($connectorCode39, 36, 10);
|
||||
$rootCable2 = $qls->App->inventoryByIDArray[$managedCableID];
|
||||
|
||||
$objID2 = $rootCable2['local_object_id'];
|
||||
$objFace2 = $rootCable2['local_object_face'];
|
||||
@ -135,13 +135,31 @@ function crawlTrunk(&$qls, $portSet) {
|
||||
|
||||
function crawlConn(&$qls, $selected, $objID, $objFace, $objDepth, $objPort, &$connSet=array(array(),array()), $connSetID=0) {
|
||||
|
||||
$managedCableID = (isset($qls->App->inventoryArray[$objID][$objFace][$objDepth][$objPort])) ? $qls->App->inventoryArray[$objID][$objFace][$objDepth][$objPort][0]['localEndID'] : 0;
|
||||
if($managedCableID != 0) {
|
||||
$managedCable = $qls->App->inventoryByIDArray[$managedCableID];
|
||||
$managedCableMediaTypeID = $managedCable['mediaType'];
|
||||
$managedCableLength = $managedCable['length'];
|
||||
$includeUnit = true;
|
||||
$length = $qls->App->calculateCableLength($managedCableMediaTypeID, $managedCableLength, $includeUnit);
|
||||
$mediaTypeID = $managedCable['mediaType'];
|
||||
$connectorTypeID = $managedCable['localConnector'];
|
||||
} else {
|
||||
$length = 'Unk. Length';
|
||||
$mediaTypeID = false;
|
||||
$connectorTypeID = false;
|
||||
}
|
||||
|
||||
// Store port details
|
||||
$workingArray = array(
|
||||
'objID' => $objID,
|
||||
'objFace' => $objFace,
|
||||
'objDepth' => $objDepth,
|
||||
'objPort' => $objPort,
|
||||
'selected' => $selected
|
||||
'selected' => $selected,
|
||||
'length' => $length,
|
||||
'mediaTypeID' => $mediaTypeID,
|
||||
'connectorTypeID' => $connectorTypeID
|
||||
);
|
||||
|
||||
// Add port info to connection set
|
||||
@ -162,6 +180,7 @@ function crawlConn(&$qls, $selected, $objID, $objFace, $objDepth, $objPort, &$co
|
||||
$remoteObjFace = $connection['face'];
|
||||
$remoteObjDepth = $connection['depth'];
|
||||
$remoteObjPort = $connection['port'];
|
||||
$managedCableID = $connection['localEndID'];
|
||||
|
||||
// Verify this node has not been visited already
|
||||
$alreadySeen = false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user