function showForm($ID, $options = array()) { global $CFG_GLPI; if (!isset($options['several'])) { $options['several'] = false; } if (!Session::haveRight("networking", "r")) { return false; } $this->initForm($ID, $options); $recursiveItems = $this->recursivelyGetItems(); if (count($recursiveItems) > 0) { $lastItem = $recursiveItems[count($recursiveItems) - 1]; $lastItem_entities_id = $lastItem->getField('entities_id'); } else { $lastItem_entities_id = $_SESSION['glpiactive_entity']; } $this->showTabs(); $options['entities_id'] = $lastItem_entities_id; $this->showFormHeader($options); echo "<tr class='tab_bg_1'><td>"; $this->displayRecursiveItems($recursiveItems, 'Type'); echo " :</td>\n<td>"; // Need these to update information echo "<input type='hidden' name='items_id' value='" . $this->fields["items_id"] . "'>\n"; echo "<input type='hidden' name='itemtype' value='" . $this->fields["itemtype"] . "'>\n"; echo "<input type='hidden' name='instantiation_type' value='" . $this->fields["instantiation_type"] . "'>\n"; $this->displayRecursiveItems($recursiveItems, "Link"); echo "</td>\n"; $colspan = 2; if (!$options['several']) { $colspan++; } echo "<td rowspan='{$colspan}'>" . __('Comments') . "</td>"; echo "<td rowspan='{$colspan}' class='middle'>"; echo "<textarea cols='45' rows='{$colspan}' name='comment' >" . $this->fields["comment"] . "</textarea>"; echo "</td></tr>\n"; if (!$options['several']) { echo "<tr class='tab_bg_1'><td>" . _n('Port number', 'Ports number', 1) . "</td>\n"; echo "<td>"; Html::autocompletionTextField($this, "logical_number", array('size' => 5)); echo "</td></tr>\n"; } else { echo "<tr class='tab_bg_1'><td>" . _n('Port number', 'Port numbers', 2) . "</td>\n"; echo "<td>"; echo "<input type='hidden' name='several' value='yes'>"; echo "<input type='hidden' name='logical_number' value=''>\n"; echo __('from') . " "; Dropdown::showInteger('from_logical_number', 0, 0, 100); echo " " . __('to') . " "; Dropdown::showInteger('to_logical_number', 0, 0, 100); echo "</td></tr>\n"; } echo "<tr class='tab_bg_1'><td>" . __('Name') . "</td>\n"; echo "<td>"; Html::autocompletionTextField($this, "name"); echo "</td></tr>\n"; $instantiation = $this->getInstantiation(); if ($instantiation !== false) { echo "<tr class='tab_bg_1'><th colspan='4'>" . $instantiation->getTypeName(1) . "</th></tr>\n"; $instantiation->showInstantiationForm($this, $options, $recursiveItems); unset($instantiation); } if (!$options['several']) { NetworkName::showFormForNetworkPort($this->getID()); } $this->showFormButtons($options); $this->addDivForTabs(); }