@@ -183,8 +183,9 @@ function defineTabs($options=array()){
183
183
*/
184
184
function getComments () {
185
185
186
- $ comment = __ ('Useragent ' , 'fusioninventory ' ).' : ' .$ this ->fields ['useragent ' ].'<br/>
187
- ' .__ ('Last contact ' , 'fusioninventory ' ).' : ' .Html::convDateTime ($ this ->fields ['last_contact ' ]).' minutes ' ;
186
+ $ comment = __ ('Useragent ' , 'fusioninventory ' ).' : ' .$ this ->fields ['useragent ' ].'<br/> ' .
187
+ __ ('Last contact ' , 'fusioninventory ' ).' : ' .
188
+ Html::convDateTime ($ this ->fields ['last_contact ' ]).' minutes ' ;
188
189
189
190
if (!empty ($ comment )) {
190
191
return Html::showToolTip ($ comment , array ('display ' => false ));
@@ -239,7 +240,8 @@ function showForm($computers_id, $options=array()) {
239
240
$ oComputer = new Computer ();
240
241
$ oComputer ->getFromDB ($ this ->fields ["computers_id " ]);
241
242
echo $ oComputer ->getLink (1 );
242
- echo "<input type='hidden' name='computers_id' value=' " .$ this ->fields ["computers_id " ]."'/> " ;
243
+ echo "<input type='hidden' name='computers_id' " .
244
+ "value=' " .$ this ->fields ["computers_id " ]."'/> " ;
243
245
} else {
244
246
Computer_Item::dropdownConnect ("Computer " , "Computer " , 'computers_id ' ,
245
247
$ _SESSION ['glpiactive_entity ' ]);
@@ -266,9 +268,13 @@ function showForm($computers_id, $options=array()) {
266
268
echo "</tr> " ;
267
269
268
270
echo "<tr class='tab_bg_1'> " ;
269
- echo "<td> " .__ ('Threads number ' , 'fusioninventory ' )." ( " .strtolower (__ ('Network discovery ' , 'fusioninventory ' )).") :</td> " ;
271
+ echo "<td> " .__ ('Threads number ' , 'fusioninventory ' )." " .
272
+ "( " .strtolower (__ ('Network discovery ' , 'fusioninventory ' )).") :</td> " ;
270
273
echo "<td align='center'> " ;
271
- Dropdown::showInteger ("threads_networkdiscovery " , $ this ->fields ["threads_networkdiscovery " ], 1 , 400 );
274
+ Dropdown::showInteger ("threads_networkdiscovery " ,
275
+ $ this ->fields ["threads_networkdiscovery " ],
276
+ 1 ,
277
+ 400 );
272
278
echo "</td> " ;
273
279
echo "<td> " .__ ('Useragent ' , 'fusioninventory ' )." :</td> " ;
274
280
echo "<td align='center'> " ;
@@ -277,9 +283,13 @@ function showForm($computers_id, $options=array()) {
277
283
echo "</tr> " ;
278
284
279
285
echo "<tr class='tab_bg_1'> " ;
280
- echo "<td> " .__ ('Threads number ' , 'fusioninventory ' )." ( " .strtolower (__ ('Network inventory (SNMP) ' , 'fusioninventory ' )).") :</td> " ;
286
+ echo "<td> " .__ ('Threads number ' , 'fusioninventory ' )." " .
287
+ "( " .strtolower (__ ('Network inventory (SNMP) ' , 'fusioninventory ' )).") :</td> " ;
281
288
echo "<td align='center'> " ;
282
- Dropdown::showInteger ("threads_networkinventory " , $ this ->fields ["threads_networkinventory " ], 1 , 400 );
289
+ Dropdown::showInteger ("threads_networkinventory " ,
290
+ $ this ->fields ["threads_networkinventory " ],
291
+ 1 ,
292
+ 400 );
283
293
echo "</td> " ;
284
294
echo "<td> " .__ ('Last contact ' , 'fusioninventory ' )." :</td> " ;
285
295
echo "<td align='center'> " ;
@@ -315,7 +325,7 @@ function InfosByKey($device_id) {
315
325
global $ DB ;
316
326
317
327
$ query = "SELECT * FROM ` " .$ this ->getTable ()."`
318
- WHERE `device_id`=' " .$ device_id ."' LIMIT 1 " ;
328
+ WHERE `device_id`=' " .$ device_id ."' LIMIT 1 " ;
319
329
320
330
$ agent = array ();
321
331
$ result = $ DB ->query ($ query );
@@ -362,7 +372,7 @@ function importToken($arrayinventory) {
362
372
}
363
373
$ input ['last_contact ' ] = date ("Y-m-d H:i:s " );
364
374
if (isset ($ _SERVER ['HTTP_USER_AGENT ' ])) {
365
- $ input ['useragent ' ] = $ _SERVER ['HTTP_USER_AGENT ' ];
375
+ $ input ['useragent ' ] = $ _SERVER ['HTTP_USER_AGENT ' ];
366
376
}
367
377
$ pfAgent ->update ($ input );
368
378
return $ data ['id ' ];
@@ -457,7 +467,8 @@ function setAgentWithComputerid($computers_id, $device_id) {
457
467
458
468
$ a_agent = $ this ->find ("`computers_id`=' " .$ computers_id ."' " , "" , 1 );
459
469
// Is this computer already linked to an agent?
460
- if ($ agent = array_shift ($ a_agent )) {
470
+ $ agent = array_shift ($ a_agent );
471
+ if (is_array ($ agent )) {
461
472
462
473
// relation
463
474
if ($ agent ['device_id ' ] != $ device_id ) {
@@ -524,7 +535,6 @@ function forceRemoteAgent() {
524
535
echo "<tr> " ;
525
536
echo "<th colspan='2'> " ;
526
537
echo __ ('Agent state ' , 'fusioninventory ' );
527
-
528
538
echo "</th> " ;
529
539
echo "</tr> " ;
530
540
@@ -536,7 +546,6 @@ function forceRemoteAgent() {
536
546
$ pfAgent = new PluginFusioninventoryAgent ();
537
547
$ pfAgent ->getFromDB ($ agent_id );
538
548
echo $ pfAgent ->getLink (1 );
539
-
540
549
echo "</td> " ;
541
550
echo "</tr> " ;
542
551
@@ -559,18 +568,15 @@ function forceRemoteAgent() {
559
568
560
569
case 'running ' :
561
570
echo __ ('Running ' );
562
-
563
571
break ;
564
572
565
573
case 'noanswer ' :
566
574
echo __ ('Impossible to communicate with agent! ' , 'fusioninventory ' );
567
-
568
575
break ;
569
576
570
577
case 'waiting ' :
571
578
$ waiting = 1 ;
572
579
echo __ ('Available ' );
573
-
574
580
echo "<input type='hidden' name='ip' value=' " .$ ip ."' /> " ;
575
581
echo "<input type='hidden' name='agent_id' value=' " .$ agent_id ."' /> " ;
576
582
break ;
@@ -588,7 +594,6 @@ function forceRemoteAgent() {
588
594
echo "<tr> " ;
589
595
echo "<th colspan='2'> " ;
590
596
echo "<input name='startagent' value= \"" .__ ('Force inventory ' , 'fusioninventory ' ).
591
-
592
597
"\" class='submit' type='submit'> " ;
593
598
echo "</th> " ;
594
599
echo "</tr> " ;
@@ -750,7 +755,8 @@ static function showConfig() {
750
755
echo "<tr class='tab_bg_1'> " ;
751
756
echo "<td width='50%'> " ;
752
757
$ array = explode ("/ " , $ _SERVER ['HTTP_REFERER ' ]);
753
- $ create_url = $ array [0 ]."// " .$ array [2 ]. str_replace ("front/wizard.php " , "" , $ _SERVER ['PHP_SELF ' ]);
758
+ $ create_url = $ array [0 ]."// " .$ array [2 ].
759
+ str_replace ("front/wizard.php " , "" , $ _SERVER ['PHP_SELF ' ]);
754
760
echo __ ('Communication url of the server ' , 'fusioninventory ' )." : " ;
755
761
echo "</td> " ;
756
762
echo "<td> " ;
0 commit comments