@@ -222,7 +222,21 @@ public function printObjectInfos(array $args, $fromCurrentPath = true)
222222 'equipment ' => '_getEquipmentInfos '
223223 );
224224
225- return $ this ->_printObjectInfos ($ cases , $ args , $ fromCurrentPath );
225+ $ result = $ this ->_printObjectInfos ($ cases , $ args , $ fromCurrentPath );
226+
227+ if ($ result !== false )
228+ {
229+ list ($ status , $ objectType , $ infos ) = $ result ;
230+
231+ if ($ status && $ objectType === 'equipment ' ) {
232+ $ this ->printEquipmentExtra ($ infos );
233+ }
234+
235+ return $ status ;
236+ }
237+ else {
238+ return false ;
239+ }
226240 }
227241
228242 public function printLocationInfos (array $ args , $ fromCurrentPath = true , $ recursion = false )
@@ -291,14 +305,8 @@ public function printEquipmentInfos(array $args, $fromCurrentPath = true, $recur
291305 if ($ status === false ) {
292306 Tools::e ("Equipement introuvable " , 'orange ' );
293307 }
294- elseif (count ($ infos ) === 1 )
295- {
296- $ this ->_MAIN ->displayWaitingMsg ();
297-
298- $ path = $ infos [0 ]['path ' ].'/ ' .$ infos [0 ]['name ' ];
299- $ objects = $ this ->_getObjects ($ path );
300- $ this ->_MAIN ->deleteWaitingMsg ();
301- $ this ->_printObjectsList ($ objects );
308+ else {
309+ $ this ->printEquipmentExtra ($ infos );
302310 }
303311
304312 return true ;
@@ -307,6 +315,19 @@ public function printEquipmentInfos(array $args, $fromCurrentPath = true, $recur
307315 return false ;
308316 }
309317
318+ protected function printEquipmentExtra (array $ infos )
319+ {
320+ if (count ($ infos ) === 1 )
321+ {
322+ $ this ->_MAIN ->displayWaitingMsg ();
323+
324+ $ path = $ infos [0 ]['path ' ].'/ ' .$ infos [0 ]['name ' ];
325+ $ objects = $ this ->_getObjects ($ path );
326+ $ this ->_MAIN ->deleteWaitingMsg ();
327+ $ this ->_printObjectsList ($ objects );
328+ }
329+ }
330+
310331 protected function _getLocationInfos ($ location , $ fromCurrentPath , $ path = null , $ recursion = false )
311332 {
312333 $ items = array ();
0 commit comments