Revision ad6689da
Davantage de correction liƩes aux conventions
Change-Id: I7680cf42d0b10ac300d44085d695e15064d33094
Reviewed-on: https://vigilo-dev.si.c-s.fr/review/2369
Tested-by: Build system <qa@vigilo-dev.si.c-s.fr>
Reviewed-by: Francois POIROTTE <francois.poirotte@c-s.fr>
src/Vigilo/VigiloPrinter.php | ||
---|---|---|
46 | 46 |
{ |
47 | 47 |
$location = new Location(); |
48 | 48 |
$location->getFromDB($this->network->fields["locations_id"]); |
49 |
if (!($location->getName()=='N/A')) {
|
|
50 |
$locationCompleteName=explode(" > ", $location->getField("completename"));
|
|
51 |
$locationRealName=implode("/", $locationCompleteName);
|
|
52 |
$this->children[] = new VigiloGroup($locationRealName); |
|
49 |
if ('N/A' !== $location->getName()) {
|
|
50 |
$locationCompleteName = explode(" > ", $location->getField("completename"));
|
|
51 |
$locationRealName = implode("/", $locationCompleteName);
|
|
52 |
$this->children[] = new VigiloGroup($locationRealName);
|
|
53 | 53 |
} |
54 | 54 |
|
55 | 55 |
$entity = new Entity(); |
56 | 56 |
$entity->getFromDB($this->network->fields["entities_id"]); |
57 |
if (!($entity->getName()=='N/A')) {
|
|
58 |
$entityCompleteName=explode(" > ", $entity->getField("completename"));
|
|
59 |
$entityRealName=implode("/", $entityCompleteName);
|
|
60 |
$this->children[] = new VigiloGroup($entityRealName); |
|
57 |
if ('N/A' !== $entity->getName()) {
|
|
58 |
$entityCompleteName = explode(" > ", $entity->getField("completename"));
|
|
59 |
$entityRealName = implode("/", $entityCompleteName);
|
|
60 |
$this->children[] = new VigiloGroup($entityRealName);
|
|
61 | 61 |
} |
62 | 62 |
|
63 | 63 |
$manufacturer = new Manufacturer(); |
64 | 64 |
$manufacturer->getFromDB($this->network->fields["manufacturers_id"]); |
65 |
if (!($manufacturer->getName()=='N/A')) {
|
|
65 |
if ('N/A' !== $manufacturer->getName()) {
|
|
66 | 66 |
$this->children[] = new VigiloGroup($manufacturer->getName()); |
67 | 67 |
} |
68 | 68 |
} |
... | ... | |
71 | 71 |
{ |
72 | 72 |
static $address = null; |
73 | 73 |
|
74 |
if ($address === null && $this->agent) {
|
|
74 |
if (null === $address && $this->agent) {
|
|
75 | 75 |
$addresses = $this->agent->getIPs(); |
76 | 76 |
if (count($addresses)) { |
77 | 77 |
$address = current($addresses); |
78 | 78 |
} |
79 | 79 |
} |
80 | 80 |
|
81 |
if ($address === null) {
|
|
81 |
if (null === $address) {
|
|
82 | 82 |
$address = $this->network->getName(); |
83 | 83 |
foreach ($this->addresses as $addr) { |
84 | 84 |
if (!$addr->is_ipv4()) { |
... | ... | |
113 | 113 |
continue; |
114 | 114 |
} |
115 | 115 |
|
116 |
$args = array(); |
|
117 |
$label = isset($port->fields['comment']) ? $port->fields['comment'] : $port->getName(); |
|
118 |
$ethport = $ethport->find('networkports_id=' . $np['id']); |
|
116 |
$args = array();
|
|
117 |
$label = isset($port->fields['comment']) ? $port->fields['comment'] : $port->getName();
|
|
118 |
$ethport = $ethport->find('networkports_id=' . $np['id']);
|
|
119 | 119 |
foreach ($ethport as $rowEthPort) { |
120 | 120 |
if ($rowEthPort['speed']) { |
121 | 121 |
$args[] = new VigiloArg('max', $rowEthPort['speed']); |
... | ... | |
143 | 143 |
|
144 | 144 |
public function __toString() |
145 | 145 |
{ |
146 |
$outXML=new DOMdocument();
|
|
147 |
$outXML->preserveWhiteSpace=false;
|
|
148 |
$outXML->formatOutput=true;
|
|
146 |
$outXML = new DOMDocument();
|
|
147 |
$outXML->preserveWhiteSpace = false;
|
|
148 |
$outXML->formatOutput = true;
|
|
149 | 149 |
$outXML->loadXML( |
150 | 150 |
self::sprintf( |
151 | 151 |
'<?xml version="1.0"?>' . |
Also available in: Unified diff