/**
  * Display notification registered for a group
  *
  * @since version 0.83
  *
  * @param $group Group object
  *
  * @return nothing
  **/
 static function showForGroup(Group $group)
 {
     global $DB;
     if (!Notification::canView()) {
         return false;
     }
     $sql = "SELECT `glpi_notifications`.`id`\n              FROM `glpi_notificationtargets`\n              INNER JOIN `glpi_notifications`\n                    ON (`glpi_notifications`.`id` = `glpi_notificationtargets`.`notifications_id`)\n              WHERE `items_id` = '" . $group->getID() . "'\n                    AND (`type` = '" . Notification::SUPERVISOR_GROUP_TYPE . "'\n                         OR `type` = '" . Notification::GROUP_TYPE . "') " . getEntitiesRestrictRequest('AND', 'glpi_notifications', '', '', true);
     $req = $DB->request($sql);
     echo "<table class='tab_cadre_fixe'>";
     if ($req->numrows()) {
         echo "<tr><th>" . __('Name') . "</th>";
         echo "<th>" . Entity::getTypeName(1) . "</th>";
         echo "<th>" . __('Active') . "</th>";
         echo "<th>" . __('Type') . "</th>";
         echo "<th>" . __('Notification method') . "</th>";
         echo "<th>" . NotificationEvent::getTypeName(1) . "</th>";
         echo "<th>" . NotificationTemplate::getTypeName(1) . "</th></tr>";
         $notif = new Notification();
         Session::initNavigateListItems('Notification', sprintf(__('%1$s = %2$s'), Group::getTypeName(1), $group->getName()));
         foreach ($req as $data) {
             Session::addToNavigateListItems('Notification', $data['id']);
             if ($notif->getFromDB($data['id'])) {
                 echo "<tr class='tab_bg_2'><td>" . $notif->getLink();
                 echo "</td><td>" . Dropdown::getDropdownName('glpi_entities', $notif->getEntityID());
                 echo "</td><td>" . Dropdown::getYesNo($notif->getField('is_active')) . "</td><td>";
                 $itemtype = $notif->getField('itemtype');
                 if ($tmp = getItemForItemtype($itemtype)) {
                     echo $tmp->getTypeName(1);
                 } else {
                     echo "&nbsp;";
                 }
                 echo "</td><td>" . Notification::getMode($notif->getField('mode'));
                 echo "</td><td>" . NotificationEvent::getEventName($itemtype, $notif->getField('event'));
                 echo "</td>" . "<td>" . Dropdown::getDropdownName('glpi_notificationtemplates', $notif->getField('notificationtemplates_id'));
                 echo "</td></tr>";
             }
         }
     } else {
         echo "<tr class='tab_bg_2'><td class='b center'>" . __('No item found') . "</td></tr>";
     }
     echo "</table>";
 }
 /**
  * @since version 0.84
  *
  * @param $field
  * @param $values
  * @param $options   array
  **/
 static function getSpecificValueToDisplay($field, $values, array $options = array())
 {
     if (!is_array($values)) {
         $values = array($field => $values);
     }
     switch ($field) {
         case 'event':
             if (isset($values['itemtype']) && !empty($values['itemtype'])) {
                 return NotificationEvent::getEventName($values['itemtype'], $values[$field]);
             }
             break;
         case 'mode':
             return self::getMode($values[$field]);
     }
     return parent::getSpecificValueToDisplay($field, $values, $options);
 }