예제 #1
0
 public function getReceptionItemName($items_id, $itemtype)
 {
     global $CFG_GLPI;
     if ($items_id == 0) {
         return __("No associated item", "order");
     } else {
         switch ($itemtype) {
             case 'ConsumableItem':
             case 'CartridgeItem':
                 $table = getTableForItemType($itemtype);
                 if ($itemtype == 'ConsumableItem') {
                     $item = new Consumable();
                 } else {
                     $item = new Cartridge();
                 }
                 $item->getFromDB($items_id);
                 $item_type = new $itemtype();
                 $item_type->getFromDB($item->fields[getForeignKeyFieldForTable($table)]);
                 return $item_type->getLink(array('comments' => 1));
             default:
                 $item = new $itemtype();
                 $item->getFromDB($items_id);
                 return $item->getLink(array('comments' => 1));
         }
     }
 }