Skip to content

Commit

Permalink
enhancement: uke/pit: implemented foreign subject export to csv (rest…
Browse files Browse the repository at this point in the history
…ore PSR-2 compliance)
  • Loading branch information
chilek committed Feb 15, 2023
1 parent 901b6da commit dbbe61a
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions modules/ukepit.php
Original file line number Diff line number Diff line change
Expand Up @@ -965,11 +965,17 @@ function find_nodes_for_netdev($customerid, $netdevid, &$customer_nodes, &$custo
JOIN netdevices nd ON nd.id = n.netdev
WHERE n.ownerid IS NOT NULL AND n.netdev IS NOT NULL AND n.linktype = ? AND n.linktechnology = ? AND addr.city_id = ?
AND (addr.street_id = ? OR addr.street_id IS NULL) AND addr.house = ?
AND a.suspended = 0 AND a.period IN (".implode(',', array(YEARLY, HALFYEARLY, QUARTERLY, MONTHLY, DISPOSABLE)).")
AND a.suspended = 0 AND a.period IN (" . implode(',', array(YEARLY, HALFYEARLY, QUARTERLY, MONTHLY, DISPOSABLE)) . ")
AND (a.datefrom = 0 OR a.datefrom < ?NOW?) AND (a.dateto = 0 OR a.dateto > ?NOW?)
AND allsuspended.total IS NULL
GROUP BY na.nodeid, c.type, n.invprojectid, nd.id, nd.status",
array($range['linktype'], $range['linktechnology'], $range['location_city'], $range['location_street'], $range['location_house'])
array(
$range['linktype'],
$range['linktechnology'],
$range['location_city'],
$range['location_street'],
$range['location_house']
)
);
if (empty($nodes)) {
$nodes = array();
Expand Down Expand Up @@ -999,7 +1005,7 @@ function find_nodes_for_netdev($customerid, $netdevid, &$customer_nodes, &$custo
AS allsuspended ON allsuspended.cid = c.id
JOIN netdevices nd ON nd.id = n.netdev
WHERE n.id IN (" . implode(',', $uni_link['nodes']) . ")
AND a.suspended = 0 AND a.period IN (".implode(',', array(YEARLY, HALFYEARLY, QUARTERLY, MONTHLY, DISPOSABLE)).")
AND a.suspended = 0 AND a.period IN (" . implode(',', array(YEARLY, HALFYEARLY, QUARTERLY, MONTHLY, DISPOSABLE)) . ")
AND a.datefrom < ?NOW? AND (a.dateto = 0 OR a.dateto > ?NOW?)
AND allsuspended.total IS NULL
GROUP BY na.nodeid, c.type",
Expand All @@ -1019,8 +1025,8 @@ function find_nodes_for_netdev($customerid, $netdevid, &$customer_nodes, &$custo

// check if this is range with the same location as owning network node
if ($range['location_city'] == $netnode['location_city']
&& $range['location_street'] == $netnode['location_street']
&& $range['location_house'] == $netnode['location_house']) {
&& $range['location_street'] == $netnode['location_street']
&& $range['location_house'] == $netnode['location_house']) {
$range_netbuilding = true;
}

Expand Down Expand Up @@ -1223,12 +1229,11 @@ function find_nodes_for_netdev($customerid, $netdevid, &$customer_nodes, &$custo
}

$us_data = array_merge($us_data, array(
'us_invproject' => strlen($prj) ? $prj : '',
'us_invstatus' => strlen($prj) ? $NETELEMENTSTATUSES[$status] : '',
'us_invproject' => strlen($prj) ? $prj : '',
'us_invstatus' => strlen($prj) ? $NETELEMENTSTATUSES[$status] : '',
));

$buffer .= 'U,' . to_csv($us_data) . EOL;
}
$netrangeid++;
}

Expand Down Expand Up @@ -1269,6 +1274,7 @@ function find_nodes_for_netdev($customerid, $netdevid, &$customer_nodes, &$custo
$netbuildingid++;
}
}
}

// unfortunately network node doesn't have range with the same location
if (!$range_netbuilding) {
Expand Down

0 comments on commit dbbe61a

Please sign in to comment.