@@ -67,6 +67,16 @@ function getSearchOptions() {
6767 $ tab [4 ]['name ' ] = __ ('Ping free Ip ' , 'addressing ' );
6868 $ tab [4 ]['datatype ' ] = 'bool ' ;
6969
70+ $ tab [5 ]['table ' ] = 'glpi_locations ' ;
71+ $ tab [5 ]['field ' ] = 'name ' ;
72+ $ tab [5 ]['name ' ] = __ ('Location ' );
73+ $ tab [5 ]['datatype ' ] = 'dropdown ' ;
74+
75+ $ tab [6 ]['table ' ] = 'glpi_fqdns ' ;
76+ $ tab [6 ]['field ' ] = 'name ' ;
77+ $ tab [6 ]['name ' ] = FQDN ::getTypeName (1 );
78+ $ tab [6 ]['datatype ' ] = 'dropdown ' ;
79+
7080 $ tab [30 ]['table ' ] = $ this ->getTable ();
7181 $ tab [30 ]['field ' ] = 'id ' ;
7282 $ tab [30 ]['name ' ] = __ ('ID ' );
@@ -159,28 +169,31 @@ function showForm ($ID, $options=array()) {
159169 echo "</tr> " ;
160170
161171 echo "<tr class='tab_bg_1'> " ;
162- echo "<td> " .__ ('Select the network ' , ' addressing ' )."</td> " ;
172+ echo "<td> " .__ ('Location ' )."</td> " ;
163173 echo "<td> " ;
164- Dropdown::show ('Network ' , array ('name ' => "networks_id " ,
165- 'value ' => $ this ->fields ["networks_id " ]));
174+ Dropdown::show ('Location ' , array ('name ' => "locations_id " ,
175+ 'value ' => $ this ->fields ["locations_id " ],
176+ 'entity ' => $ this ->fields ['entities_id ' ]));
166177 echo "</td> " ;
167178
168179 if ($ PluginAddressingConfig ->fields ["free_ip " ]) {
169180 echo "<td> " .__ ('Free Ip ' , 'addressing ' )."</td><td> " ;
170181 Dropdown::showYesNo ('free_ip ' , $ this ->fields ["free_ip " ]);
171182 echo "</td> " ;
172183 } else {
173- echo "<td> " ;
184+ echo "<td> " ;
174185 echo Html::hidden ('free_ip ' , array ('value ' => 0 ));
175186 echo "</td><td></td> " ;
176187 //echo "<td><input type='hidden' name='free_ip' value='0'></td><td></td>";
177188 }
178189 echo "</tr> " ;
179190
180191 echo "<tr class='tab_bg_1'> " ;
181- echo "<td> " .__ ( ' Detected subnet list ' , ' addressing ' )."</td> " ;
192+ echo "<td> " .FQDN :: getTypeName ( 1 )."</td> " ;
182193 echo "<td> " ;
183- $ this ->dropdownSubnet ($ ID >0 ? $ this ->fields ["entities_id " ] : $ _SESSION ["glpiactive_entity " ]);
194+ Dropdown::show ('FQDN ' , array ('name ' => "fqdns_id " ,
195+ 'value ' => $ this ->fields ["fqdns_id " ],
196+ 'entity ' => $ this ->fields ['entities_id ' ]));
184197 echo "</td> " ;
185198
186199 if ($ PluginAddressingConfig ->fields ["double_ip " ]) {
@@ -189,62 +202,81 @@ function showForm ($ID, $options=array()) {
189202 echo "</td> " ;
190203 } else {
191204 //echo "<td><input type='hidden' name='double_ip' value='0'></td><td></td>";
192- echo "<td> " ;
205+ echo "<td> " ;
193206 echo Html::hidden ('double_ip ' , array ('value ' => 0 ));
194207 echo "</td><td></td> " ;
195208 }
196209 echo "</tr> " ;
197210
198211 echo "<tr class='tab_bg_1'> " ;
199- echo "<td> " .__ ('First IP ' , 'addressing ' )."</td> " ; // Subnet
212+ echo "<td> " .__ ('Select the network ' , 'addressing ' )."</td> " ;
200213 echo "<td> " ;
201- echo "<input type='text' id='plugaddr_ipdeb0' value='' name='_ipdeb0' size='3' " .
202- "onChange='plugaddr_ChangeNumber( \"" .__ ('Invalid data !! ' , 'addressing ' )."\");'>. " ;
203- echo "<input type='text' id='plugaddr_ipdeb1' value='' name='_ipdeb1' size='3' " .
204- "onChange='plugaddr_ChangeNumber( \"" .__ ('Invalid data !! ' , 'addressing ' )."\");'>. " ;
205- echo "<input type='text' id='plugaddr_ipdeb2' value='' name='_ipdeb2' size='3' " .
206- "onChange='plugaddr_ChangeNumber( \"" .__ ('Invalid data !! ' , 'addressing ' )."\");'>. " ;
207- echo "<input type='text' id='plugaddr_ipdeb3' value='' name='_ipdeb3' size='3' " .
208- "onChange='plugaddr_ChangeNumber( \"" .__ ('Invalid data !! ' , 'addressing ' )."\");'> " ;
214+ Dropdown::show ('Network ' , array ('name ' => "networks_id " ,
215+ 'value ' => $ this ->fields ["networks_id " ]));
209216 echo "</td> " ;
210217
211218 if ($ PluginAddressingConfig ->fields ["reserved_ip " ]) {
212219 echo "<td> " .__ ('Reserved IP ' , 'addressing ' )."</td><td> " ;
213220 Dropdown::showYesNo ('reserved_ip ' ,$ this ->fields ["reserved_ip " ]);
214221 echo "</td> " ;
215222 } else {
216- echo "<td> " ;
223+ echo "<td> " ;
217224 echo Html::hidden ('reserved_ip ' , array ('value ' => 0 ));
218225 echo "</td><td></td> " ;
219226 //echo "<td><input type='hidden' name='reserved_ip' value='0'></td><td></td>";
220227 }
221228 echo "</tr> " ;
222229
223230 echo "<tr class='tab_bg_1'> " ;
224- echo "<td> " .__ ('Last IP ' , 'addressing ' )."</td> " ; // Mask
231+ echo "<td> " .__ ('Detected subnet list ' , 'addressing ' )."</td> " ;
225232 echo "<td> " ;
226- echo "<input type='text' id='plugaddr_ipfin0' value='' name='_ipfin0' size='3' " .
227- "onChange='plugaddr_ChangeNumber( \"" .__ ('Invalid data !! ' , 'addressing ' )."\");'>. " ;
228- echo "<input type='text' id='plugaddr_ipfin1' value='' name='_ipfin1' size='3' " .
229- "onChange='plugaddr_ChangeNumber( \"" .__ ('Invalid data !! ' , 'addressing ' )."\");'>. " ;
230- echo "<input type='text' id='plugaddr_ipfin2' value='' name='_ipfin2' size='3' " .
231- "onChange='plugaddr_ChangeNumber( \"" .__ ('Invalid data !! ' , 'addressing ' )."\");'>. " ;
232- echo "<input type='text' id='plugaddr_ipfin3' value='' name='_ipfin3' size='3' " .
233- "onChange='plugaddr_ChangeNumber( \"" .__ ('Invalid data !! ' , 'addressing ' )."\");'> " ;
233+ $ this ->dropdownSubnet ($ ID >0 ? $ this ->fields ["entities_id " ] : $ _SESSION ["glpiactive_entity " ]);
234234 echo "</td> " ;
235235
236236 if ($ PluginAddressingConfig ->fields ["use_ping " ]) {
237237 echo "<td> " .__ ('Ping free Ip ' , 'addressing ' )."</td><td> " ;
238238 Dropdown::showYesNo ('use_ping ' , $ this ->fields ["use_ping " ]);
239239 echo "</td> " ;
240240 } else {
241- echo "<td> " ;
241+ echo "<td> " ;
242242 echo Html::hidden ('use_ping ' , array ('value ' => 0 ));
243243 echo "</td><td></td> " ;
244244 //echo "<td><input type='hidden' name='use_ping' value='0'></td><td></td>";
245245 }
246246 echo "</tr> " ;
247247
248+ echo "<tr class='tab_bg_1'> " ;
249+ echo "<td> " .__ ('First IP ' , 'addressing ' )."</td> " ; // Subnet
250+ echo "<td> " ;
251+ echo "<input type='text' id='plugaddr_ipdeb0' value='' name='_ipdeb0' size='3' " .
252+ "onChange='plugaddr_ChangeNumber( \"" .__ ('Invalid data !! ' , 'addressing ' )."\");'>. " ;
253+ echo "<input type='text' id='plugaddr_ipdeb1' value='' name='_ipdeb1' size='3' " .
254+ "onChange='plugaddr_ChangeNumber( \"" .__ ('Invalid data !! ' , 'addressing ' )."\");'>. " ;
255+ echo "<input type='text' id='plugaddr_ipdeb2' value='' name='_ipdeb2' size='3' " .
256+ "onChange='plugaddr_ChangeNumber( \"" .__ ('Invalid data !! ' , 'addressing ' )."\");'>. " ;
257+ echo "<input type='text' id='plugaddr_ipdeb3' value='' name='_ipdeb3' size='3' " .
258+ "onChange='plugaddr_ChangeNumber( \"" .__ ('Invalid data !! ' , 'addressing ' )."\");'> " ;
259+ echo "</td> " ;
260+ echo "<td></td> " ;
261+ echo "<td></td> " ;
262+ echo "</tr> " ;
263+
264+ echo "<tr class='tab_bg_1'> " ;
265+ echo "<td> " .__ ('Last IP ' , 'addressing ' )."</td> " ; // Mask
266+ echo "<td> " ;
267+ echo "<input type='text' id='plugaddr_ipfin0' value='' name='_ipfin0' size='3' " .
268+ "onChange='plugaddr_ChangeNumber( \"" .__ ('Invalid data !! ' , 'addressing ' )."\");'>. " ;
269+ echo "<input type='text' id='plugaddr_ipfin1' value='' name='_ipfin1' size='3' " .
270+ "onChange='plugaddr_ChangeNumber( \"" .__ ('Invalid data !! ' , 'addressing ' )."\");'>. " ;
271+ echo "<input type='text' id='plugaddr_ipfin2' value='' name='_ipfin2' size='3' " .
272+ "onChange='plugaddr_ChangeNumber( \"" .__ ('Invalid data !! ' , 'addressing ' )."\");'>. " ;
273+ echo "<input type='text' id='plugaddr_ipfin3' value='' name='_ipfin3' size='3' " .
274+ "onChange='plugaddr_ChangeNumber( \"" .__ ('Invalid data !! ' , 'addressing ' )."\");'> " ;
275+ echo "</td> " ;
276+ echo "<td></td> " ;
277+ echo "<td></td> " ;
278+ echo "</tr> " ;
279+
248280 echo "<tr class='tab_bg_1'> " ;
249281 echo "<td> " .__ ('Report for the IP Range ' , 'addressing ' )."</td> " ; // Mask
250282 echo "<td> " ;
@@ -261,13 +293,11 @@ function showForm ($ID, $options=array()) {
261293 echo "</tr> " ;
262294
263295 echo "<tr class='tab_bg_1'> " ;
264- echo "<td colspan = '4'> " ;
265- echo "<table cellpadding='2' cellspacing='2'><tr><td> " ;
266- echo __ ('Comments ' )."</td></tr> " ;
267- echo "<tr><td class='center'> " .
268- "<textarea cols='125' rows='3' name='comment'> " .$ this ->fields ["comment " ]."</textarea> " ;
269- echo "</td></tr></table> " ;
270- echo "</td> " ;
296+ echo "<td> " ;
297+ echo __ ('Comments ' )."</td> " ;
298+ echo "<td class='center' colspan='3'> " .
299+ "<textarea cols='125' rows='3' name='comment'> " .$ this ->fields ["comment " ]."</textarea> " ;
300+ echo "</td></tr> " ;
271301
272302 $ this ->showFormButtons ($ options );
273303
0 commit comments