Beispiel #1
0
 static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
 {
     switch ($item->getType()) {
         case __CLASS__:
             switch ($tabnum) {
                 case 1:
                     echo "<div class='timeline_box'>";
                     $rand = mt_rand();
                     $item->showTimelineForm($rand);
                     $item->showTimeline($rand);
                     echo "</div>";
                     break;
                 case 2:
                     if (!isset($_GET['load_kb_sol'])) {
                         $_GET['load_kb_sol'] = 0;
                     }
                     $item->showSolutionForm($_GET['load_kb_sol']);
                     if ($item->canApprove()) {
                         $fup = new TicketFollowup();
                         $fup->showApprobationForm($item);
                     }
                     break;
                 case 3:
                     $satisfaction = new TicketSatisfaction();
                     if ($item->fields['status'] == self::CLOSED && $satisfaction->getFromDB($_GET["id"])) {
                         $duration = Entity::getUsedConfig('inquest_duration', $item->fields['entities_id']);
                         $date2 = strtotime($satisfaction->fields['date_begin']);
                         if ($duration == 0 || strtotime("now") - $date2 <= $duration * DAY_TIMESTAMP) {
                             $satisfaction->showForm($item);
                         } else {
                             echo "<p class='center b'>" . __('Satisfaction survey expired') . "</p>";
                         }
                     } else {
                         echo "<p class='center b'>" . __('No generated survey') . "</p>";
                     }
                     break;
                 case 4:
                     $item->showStats();
                     break;
             }
             break;
         case 'Group':
         case 'SLT':
         default:
             self::showListForItem($item);
     }
     return true;
 }