Exemple #1
0
 /**
  * @see CommonGLPI::getTabNameForItem()
  **/
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (!$withtemplate && Session::haveRight("reservation", READ)) {
         return self::getTypeName(Session::getPluralNumber());
     }
     return '';
 }
 /**
  * @see CommonGLPI::getAdditionalMenuOptions()
  **/
 static function getAdditionalMenuOptions()
 {
     if (static::canView()) {
         $options['networkportmigration']['title'] = NetworkPortMigration::getTypeName(Session::getPluralNumber());
         $options['networkportmigration']['page'] = NetworkPortMigration::getSearchURL(false);
         $options['networkportmigration']['search'] = NetworkPortMigration::getSearchURL(false);
         return $options;
     }
     return false;
 }
 /**
  * @see CommonGLPI::getTabNameForItem()
  **/
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (self::canBeTranslated($item)) {
         if ($_SESSION['glpishow_count_on_tabs']) {
             return self::createTabEntry(self::getTypeName(Session::getPluralNumber()), self::getNumberOfTranslationsForItem($item));
         }
         return self::getTypeName(Session::getPluralNumber());
     }
     return '';
 }
 /**
  * @see CommonGLPI::getTabNameForItem()
  **/
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (!$withtemplate && $item->getType() == 'Computer' && Computer::canView()) {
         if ($_SESSION['glpishow_count_on_tabs']) {
             return self::createTabEntry(self::getTypeName(Session::getPluralNumber()), countElementsInTable('glpi_computervirtualmachines', "computers_id = '" . $item->getID() . "'\n                                                                 AND `is_deleted`='0'"));
         }
         return self::getTypeName(Session::getPluralNumber());
     }
     return '';
 }
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (!$withtemplate) {
         switch ($item->getType()) {
             case __CLASS__:
                 return array(1 => __('Main'), 2 => _n('Item', 'Items', Session::getPluralNumber()));
         }
     }
     return '';
 }
 /**
  * @see CommonGLPI::getTabNameForItem()
  **/
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (!$withtemplate && $item->getType() == 'Computer' && Computer::canView()) {
         $nb = 0;
         if ($_SESSION['glpishow_count_on_tabs']) {
             $nb = countElementsInTable('glpi_computervirtualmachines', ['computers_id' => $item->getID(), 'is_deleted' => 0]);
         }
         return self::createTabEntry(self::getTypeName(Session::getPluralNumber()), $nb);
     }
     return '';
 }
 /**
  * @see CommonGLPI::getTabNameForItem()
  **/
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     // can exists for template
     if ($item->getType() == static::$itemtype && static::canView()) {
         if ($_SESSION['glpishow_count_on_tabs']) {
             return self::createTabEntry(self::getTypeName(Session::getPluralNumber()), countElementsInTable($this->getTable(), "`" . $item->getForeignKeyField() . "`\n                                                                = '" . $item->getID() . "'"));
         }
         return self::getTypeName(Session::getPluralNumber());
     }
     return '';
 }
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (!$withtemplate && $item->getType() == $this->getType()) {
         $nb = 0;
         if ($_SESSION['glpishow_count_on_tabs']) {
             $nb = countElementsInTable($this->getTable(), "`" . $this->getForeignKeyField() . "` = '" . $item->getID() . "'");
         }
         return self::createTabEntry($this->getTypeName(Session::getPluralNumber()), $nb);
     }
     return '';
 }
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if ($item->getType() == __CLASS__) {
         $tabs[1] = __('Personal View');
         $tabs[2] = __('Group View');
         $tabs[3] = __('Global View');
         $tabs[4] = _n('RSS feed', 'RSS feeds', Session::getPluralNumber());
         return $tabs;
     }
     return '';
 }
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     // can exists for template
     if ($item->getType() == 'TicketTemplate' && Session::haveRight("tickettemplate", READ)) {
         if ($_SESSION['glpishow_count_on_tabs']) {
             return self::createTabEntry(self::getTypeName(Session::getPluralNumber()), countElementsInTable($this->getTable(), "`tickettemplates_id`\n                                                               = '" . $item->getID() . "'"));
         }
         return self::getTypeName(Session::getPluralNumber());
     }
     return '';
 }
 /**
  * @see CommonGLPI::getTabNameForItem()
  **/
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     // can exists for template
     if ($item->getType() == 'Contract' && Contract::canView()) {
         if ($_SESSION['glpishow_count_on_tabs']) {
             return self::createTabEntry(self::getTypeName(Session::getPluralNumber()), countElementsInTable('glpi_contractcosts', "contracts_id = '" . $item->getID() . "'"));
         }
         return self::getTypeName(Session::getPluralNumber());
     }
     return '';
 }
Exemple #12
0
 /**
  * @see CommonGLPI::getTabNameForItem()
  **/
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     // can exists for template
     if ($item->getType() == 'Computer' && Computer::canView()) {
         $nb = 0;
         if ($_SESSION['glpishow_count_on_tabs']) {
             $nb = countElementsInTable('glpi_computerdisks', "computers_id = '" . $item->getID() . "' AND `is_deleted`='0'");
         }
         return self::createTabEntry(self::getTypeName(Session::getPluralNumber()), $nb);
     }
     return '';
 }
 /**
  * @see CommonGLPI::getTabNameForItem()
  **/
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     // can exists for template
     if ($item->getType() == 'Project' && Project::canView()) {
         $nb = 0;
         if ($_SESSION['glpishow_count_on_tabs']) {
             $nb = countElementsInTable('glpi_projectcosts', ['projects_id' => $item->getID()]);
         }
         return self::createTabEntry(self::getTypeName(Session::getPluralNumber()), $nb);
     }
     return '';
 }
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (!$withtemplate && Printer::canView()) {
         switch ($item->getType()) {
             case 'CartridgeItem':
                 if ($_SESSION['glpishow_count_on_tabs']) {
                     return self::createTabEntry(PrinterModel::getTypeName(Session::getPluralNumber()), self::countForCartridgeItem($item));
                 }
                 return PrinterModel::getTypeName(Session::getPluralNumber());
                 break;
         }
     }
     return '';
 }
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (!$withtemplate) {
         switch ($item->getType()) {
             case 'CronTask':
                 $ong = array();
                 $ong[1] = __('Statistics');
                 if ($_SESSION['glpishow_count_on_tabs']) {
                     $ong[2] = self::createTabEntry(_n('Log', 'Logs', Session::getPluralNumber()), countElementsInTable($this->getTable(), "crontasks_id\n                                                                        = '" . $item->getID() . "'\n                                                                       AND `state`\n                                                                        = '" . self::STATE_STOP . "' "));
                 } else {
                     $ong[2] = _n('Log', 'Logs', Session::getPluralNumber());
                 }
                 return $ong;
         }
     }
     return '';
 }
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (!$withtemplate) {
         $nb = 0;
         switch ($item->getType()) {
             case 'CronTask':
                 $ong = array();
                 $ong[1] = __('Statistics');
                 if ($_SESSION['glpishow_count_on_tabs']) {
                     $nb = countElementsInTable($this->getTable(), ['crontasks_id' => $item->getID(), 'state' => self::STATE_STOP]);
                 }
                 $ong[2] = self::createTabEntry(_n('Log', 'Logs', Session::getPluralNumber()), $nb);
                 return $ong;
         }
     }
     return '';
 }
 function getCriterias()
 {
     static $criterias = array();
     if (count($criterias)) {
         return $criterias;
     }
     $criterias['name']['field'] = 'name';
     $criterias['name']['name'] = _n('Software', 'Software', Session::getPluralNumber());
     $criterias['name']['table'] = 'glpi_softwares';
     $criterias['manufacturer']['field'] = 'name';
     $criterias['manufacturer']['name'] = __('Publisher');
     $criterias['manufacturer']['table'] = 'glpi_manufacturers';
     $criterias['comment']['field'] = 'comment';
     $criterias['comment']['name'] = __('Comments');
     $criterias['comment']['table'] = 'glpi_softwares';
     return $criterias;
 }
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (!$withtemplate && Session::haveRight("contact_enterprise", READ)) {
         switch ($item->getType()) {
             case 'Supplier':
                 if ($_SESSION['glpishow_count_on_tabs']) {
                     return self::createTabEntry(_n('Contact', 'Contacts', Session::getPluralNumber()), self::countForSupplier($item));
                 }
                 return _n('Contact', 'Contacts', Session::getPluralNumber());
             case 'Contact':
                 if ($_SESSION['glpishow_count_on_tabs']) {
                     return self::createTabEntry(_n('Supplier', 'Suppliers', Session::getPluralNumber()), self::countForContact($item));
                 }
                 return _n('Supplier', 'Suppliers', Session::getPluralNumber());
         }
     }
     return '';
 }
 function getTags()
 {
     $tags = array('mailcollector.action' => _n('Event', 'Events', 1), 'mailcollector.name' => __('Name'), 'mailcollector.errors' => __('Connection errors'));
     foreach ($tags as $tag => $label) {
         $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true));
     }
     $tags = array('mailcollector.url' => sprintf(__('%1$s: %2$s'), _n('Receiver', 'Receivers', 1), __('URL')));
     foreach ($tags as $tag => $label) {
         $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => true, 'lang' => false));
     }
     //Foreach global tags
     $tags = array('mailcollectors' => _n('Receiver', 'Receivers', Session::getPluralNumber()));
     foreach ($tags as $tag => $label) {
         $this->addTagToList(array('tag' => $tag, 'label' => $label, 'value' => false, 'foreach' => true));
     }
     asort($this->tag_descriptions);
     return $this->tag_descriptions;
 }
 /**
  * @see CommonGLPI::getTabNameForItem()
  **/
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (static::canView()) {
         $nb = 0;
         switch ($item->getType()) {
             case 'Ticket':
                 if ($_SESSION['glpishow_count_on_tabs']) {
                     $nb = countElementsInTable('glpi_problems_tickets', ['tickets_id' => $item->getID()]);
                 }
                 return self::createTabEntry(Problem::getTypeName(Session::getPluralNumber()), $nb);
             case 'Problem':
                 if ($_SESSION['glpishow_count_on_tabs']) {
                     $nb = countElementsInTable('glpi_problems_tickets', ['problems_id' => $item->getID()]);
                 }
                 return self::createTabEntry(Ticket::getTypeName(Session::getPluralNumber()), $nb);
         }
     }
     return '';
 }
 /**
  * @since version 0.85
  *
  * @see CommonGLPI::getTabNameForItem()
  **/
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (static::canView()) {
         $nb = 0;
         switch ($item->getType()) {
             case 'Change':
                 if ($_SESSION['glpishow_count_on_tabs']) {
                     $nb = countElementsInTable('glpi_changes_tickets', "`changes_id` = '" . $item->getID() . "'");
                 }
                 return self::createTabEntry(Ticket::getTypeName(Session::getPluralNumber()), $nb);
             case 'Ticket':
                 if ($_SESSION['glpishow_count_on_tabs']) {
                     $nb = countElementsInTable('glpi_changes_tickets', "`tickets_id` = '" . $item->getID() . "'");
                 }
                 return self::createTabEntry(Change::getTypeName(Session::getPluralNumber()), $nb);
         }
     }
     return '';
 }
Exemple #22
0
 function getSearchOptions()
 {
     $tab = array();
     $tab['common'] = __('Characteristics');
     $tab[1]['table'] = $this->getTable();
     $tab[1]['field'] = 'name';
     $tab[1]['name'] = __('Name');
     $tab[1]['datatype'] = 'itemlink';
     $tab[1]['massiveaction'] = false;
     $tab[19]['table'] = $this->getTable();
     $tab[19]['field'] = 'date_mod';
     $tab[19]['name'] = __('Last update');
     $tab[19]['datatype'] = 'datetime';
     $tab[19]['massiveaction'] = false;
     $tab[121]['table'] = $this->getTable();
     $tab[121]['field'] = 'date_creation';
     $tab[121]['name'] = __('Creation date');
     $tab[121]['datatype'] = 'datetime';
     $tab[121]['massiveaction'] = false;
     $tab[2]['table'] = $this->getTable();
     $tab[2]['field'] = 'interface';
     $tab[2]['name'] = __("Profile's interface");
     $tab[2]['massiveaction'] = false;
     $tab[2]['datatype'] = 'specific';
     $tab[2]['searchtype'] = array('equals', 'notequals');
     $tab[3]['table'] = $this->getTable();
     $tab[3]['field'] = 'is_default';
     $tab[3]['name'] = __('Default profile');
     $tab[3]['datatype'] = 'bool';
     $tab[3]['massiveaction'] = false;
     $tab[118]['table'] = $this->getTable();
     $tab[118]['field'] = 'create_ticket_on_login';
     $tab[118]['name'] = __('Ticket creation form on login');
     $tab[118]['datatype'] = 'bool';
     $tab[16]['table'] = $this->getTable();
     $tab[16]['field'] = 'comment';
     $tab[16]['name'] = __('Comments');
     $tab[16]['datatype'] = 'text';
     // add objectlock search options
     $tab += ObjectLock::getSearchOptionsToAdd(get_class($this));
     $tab['inventory'] = __('Assets');
     $tab[20]['table'] = 'glpi_profilerights';
     $tab[20]['field'] = 'rights';
     $tab[20]['name'] = _n('Computer', 'Computers', Session::getPluralNumber());
     $tab[20]['datatype'] = 'right';
     $tab[20]['rightclass'] = 'Computer';
     $tab[20]['rightname'] = 'computer';
     $tab[20]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'computer'");
     $tab[21]['table'] = 'glpi_profilerights';
     $tab[21]['field'] = 'rights';
     $tab[21]['name'] = _n('Monitor', 'Monitors', Session::getPluralNumber());
     $tab[21]['datatype'] = 'right';
     $tab[21]['rightclass'] = 'Monitor';
     $tab[21]['rightname'] = 'monitor';
     $tab[21]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'monitor'");
     $tab[22]['table'] = 'glpi_profilerights';
     $tab[22]['field'] = 'rights';
     $tab[22]['name'] = _n('Software', 'Software', Session::getPluralNumber());
     $tab[22]['datatype'] = 'right';
     $tab[22]['rightclass'] = 'Software';
     $tab[22]['rightname'] = 'software';
     $tab[22]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'software'");
     $tab[23]['table'] = 'glpi_profilerights';
     $tab[23]['field'] = 'rights';
     $tab[23]['name'] = _n('Network', 'Networks', Session::getPluralNumber());
     $tab[23]['datatype'] = 'right';
     $tab[23]['rightclass'] = 'Network';
     $tab[23]['rightname'] = 'networking';
     $tab[23]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'networking'");
     $tab[24]['table'] = 'glpi_profilerights';
     $tab[24]['field'] = 'rights';
     $tab[24]['name'] = _n('Printer', 'Printers', Session::getPluralNumber());
     $tab[24]['datatype'] = 'right';
     $tab[24]['rightclass'] = 'Printer';
     $tab[24]['rightname'] = 'printer';
     $tab[24]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'printer'");
     $tab[25]['table'] = 'glpi_profilerights';
     $tab[25]['field'] = 'rights';
     $tab[25]['name'] = _n('Device', 'Devices', Session::getPluralNumber());
     $tab[25]['datatype'] = 'right';
     $tab[25]['rightclass'] = 'Peripheral';
     $tab[25]['rightname'] = 'peripheral';
     $tab[25]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'peripheral'");
     $tab[26]['table'] = 'glpi_profilerights';
     $tab[26]['field'] = 'rights';
     $tab[26]['name'] = _n('Cartridge', 'Cartridges', Session::getPluralNumber());
     $tab[26]['datatype'] = 'right';
     $tab[26]['rightclass'] = 'Cartridge';
     $tab[26]['rightname'] = 'cartridge';
     $tab[26]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'cartridge'");
     $tab[27]['table'] = 'glpi_profilerights';
     $tab[27]['field'] = 'rights';
     $tab[27]['name'] = _n('Consumable', 'Consumables', Session::getPluralNumber());
     $tab[27]['datatype'] = 'right';
     $tab[27]['rightclass'] = 'Consumable';
     $tab[27]['rightname'] = 'consumable';
     $tab[27]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'consumable'");
     $tab[28]['table'] = 'glpi_profilerights';
     $tab[28]['field'] = 'rights';
     $tab[28]['name'] = _n('Phone', 'Phones', Session::getPluralNumber());
     $tab[28]['datatype'] = 'right';
     $tab[28]['rightclass'] = 'Phone';
     $tab[28]['rightname'] = 'phone';
     $tab[28]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'phone'");
     $tab[129]['table'] = 'glpi_profilerights';
     $tab[129]['field'] = 'rights';
     $tab[129]['name'] = __('Internet');
     $tab[129]['datatype'] = 'right';
     $tab[129]['rightclass'] = 'NetworkName';
     $tab[129]['rightname'] = 'internet';
     $tab[129]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'internet'");
     $tab['management'] = __('Management');
     $tab[30]['table'] = 'glpi_profilerights';
     $tab[30]['field'] = 'rights';
     $tab[30]['name'] = __('Contact') . " / " . __('Supplier');
     $tab[30]['datatype'] = 'right';
     $tab[30]['rightclass'] = 'Contact';
     $tab[30]['rightname'] = 'contact_entreprise';
     $tab[30]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'contact_enterprise'");
     $tab[31]['table'] = 'glpi_profilerights';
     $tab[31]['field'] = 'rights';
     $tab[31]['name'] = _n('Document', 'Documents', Session::getPluralNumber());
     $tab[31]['datatype'] = 'right';
     $tab[31]['rightclass'] = 'Document';
     $tab[31]['rightname'] = 'document';
     $tab[31]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'document'");
     $tab[32]['table'] = 'glpi_profilerights';
     $tab[32]['field'] = 'rights';
     $tab[32]['name'] = _n('Contract', 'Contracts', Session::getPluralNumber());
     $tab[32]['datatype'] = 'right';
     $tab[32]['rightclass'] = 'Contract';
     $tab[32]['rightname'] = 'contract';
     $tab[32]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'contract'");
     $tab[33]['table'] = 'glpi_profilerights';
     $tab[33]['field'] = 'rights';
     $tab[33]['name'] = __('Financial and administratives information');
     $tab[33]['datatype'] = 'right';
     $tab[33]['rightclass'] = 'Infocom';
     $tab[33]['rightname'] = 'infocom';
     $tab[33]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'infocom'");
     $tab[101]['table'] = 'glpi_profilerights';
     $tab[101]['field'] = 'rights';
     $tab[101]['name'] = __('Budget');
     $tab[101]['datatype'] = 'right';
     $tab[101]['rightclass'] = 'Budget';
     $tab[101]['rightname'] = 'budget';
     $tab[101]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'budget'");
     $tab['tools'] = __('Tools');
     $tab[34]['table'] = 'glpi_profilerights';
     $tab[34]['field'] = 'rights';
     $tab[34]['name'] = __('Knowledge base');
     $tab[34]['datatype'] = 'right';
     $tab[34]['rightclass'] = 'KnowbaseItem';
     $tab[34]['rightname'] = 'knowbase';
     $tab[34]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'knowbase'");
     $tab[36]['table'] = 'glpi_profilerights';
     $tab[36]['field'] = 'rights';
     $tab[36]['name'] = _n('Reservation', 'Reservations', Session::getPluralNumber());
     $tab[36]['datatype'] = 'right';
     $tab[36]['rightclass'] = 'ReservationItem';
     $tab[36]['rightname'] = 'reservation';
     $tab[36]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'reservation'");
     $tab[38]['table'] = 'glpi_profilerights';
     $tab[38]['field'] = 'rights';
     $tab[38]['name'] = _n('Report', 'Reports', Session::getPluralNumber());
     $tab[38]['datatype'] = 'right';
     $tab[38]['rightclass'] = 'Report';
     $tab[38]['rightname'] = 'reports';
     $tab[38]['nowrite'] = true;
     $tab[38]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'reports'");
     $tab['config'] = __('Setup');
     $tab[42]['table'] = 'glpi_profilerights';
     $tab[42]['field'] = 'rights';
     $tab[42]['name'] = _n('Dropdown', 'Dropdowns', Session::getPluralNumber());
     $tab[42]['datatype'] = 'right';
     $tab[42]['rightclass'] = 'DropdownTranslation';
     $tab[42]['rightname'] = 'dropdown';
     $tab[42]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'dropdown'");
     $tab[44]['table'] = 'glpi_profilerights';
     $tab[44]['field'] = 'rights';
     $tab[44]['name'] = _n('Component', 'Components', Session::getPluralNumber());
     $tab[44]['datatype'] = 'right';
     $tab[44]['rightclass'] = 'Item_Devices';
     $tab[44]['rightname'] = 'device';
     $tab[44]['noread'] = true;
     $tab[44]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'device'");
     $tab[106]['table'] = 'glpi_profilerights';
     $tab[106]['field'] = 'rights';
     $tab[106]['name'] = _n('Notification', 'Notifications', Session::getPluralNumber());
     $tab[106]['datatype'] = 'right';
     $tab[106]['rightclass'] = 'Notification';
     $tab[106]['rightname'] = 'notification';
     $tab[106]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'notification'");
     $tab[45]['table'] = 'glpi_profilerights';
     $tab[45]['field'] = 'rights';
     $tab[45]['name'] = __('Document type');
     $tab[45]['datatype'] = 'right';
     $tab[45]['rightclass'] = 'DocumentType';
     $tab[45]['rightname'] = 'typedoc';
     $tab[45]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'typedoc'");
     $tab[46]['table'] = 'glpi_profilerights';
     $tab[46]['field'] = 'rights';
     $tab[46]['name'] = _n('External link', 'External links', Session::getPluralNumber());
     $tab[46]['datatype'] = 'right';
     $tab[46]['rightclass'] = 'Link';
     $tab[46]['rightname'] = 'link';
     $tab[46]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'link'");
     $tab[47]['table'] = 'glpi_profilerights';
     $tab[47]['field'] = 'rights';
     $tab[47]['name'] = __('General setup');
     $tab[47]['datatype'] = 'right';
     $tab[47]['rightclass'] = 'Config';
     $tab[47]['rightname'] = 'config';
     $tab[47]['noread'] = true;
     $tab[47]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'config'");
     $tab[52]['table'] = 'glpi_profilerights';
     $tab[52]['field'] = 'rights';
     $tab[52]['name'] = __('Search result user display');
     $tab[52]['datatype'] = 'right';
     $tab[52]['rightclass'] = 'DisplayPreference';
     $tab[52]['rightname'] = 'search_config';
     $tab[52]['noread'] = true;
     $tab[52]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'search_config'");
     $tab[107]['table'] = 'glpi_profilerights';
     $tab[107]['field'] = 'rights';
     $tab[107]['name'] = _n('Calendar', 'Calendars', Session::getPluralNumber());
     $tab[107]['datatype'] = 'right';
     $tab[107]['rightclass'] = 'Calendar';
     $tab[107]['rightname'] = 'calendar';
     $tab[107]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'calendar'");
     $tab['admin'] = __('Administration');
     $tab[48]['table'] = 'glpi_profilerights';
     $tab[48]['field'] = 'rights';
     $tab[48]['name'] = __('Business rules for tickets');
     $tab[48]['datatype'] = 'right';
     $tab[48]['rightclass'] = 'RuleTicket';
     $tab[48]['rightname'] = 'rule_ticket';
     $tab[48]['nowrite'] = true;
     $tab[48]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'rule_ticket'");
     $tab[105]['table'] = 'glpi_profilerights';
     $tab[105]['field'] = 'rights';
     $tab[105]['name'] = __('Rules for assigning a ticket created through a mails receiver');
     $tab[105]['datatype'] = 'right';
     $tab[105]['rightclass'] = 'RuleMailCollector';
     $tab[105]['rightname'] = 'rule_mailcollector';
     $tab[105]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'rule_mailcollector'");
     $tab[49]['table'] = 'glpi_profilerights';
     $tab[49]['field'] = 'rights';
     $tab[49]['name'] = __('Rules for assigning a computer to an entity');
     $tab[49]['datatype'] = 'right';
     $tab[49]['rightclass'] = 'RuleImportComputer';
     $tab[49]['rightname'] = 'rule_import';
     $tab[49]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'rule_import'");
     $tab[50]['table'] = 'glpi_profilerights';
     $tab[50]['field'] = 'rights';
     $tab[50]['name'] = __('Authorizations assignment rules');
     $tab[50]['datatype'] = 'right';
     $tab[50]['rightclass'] = 'Rule';
     $tab[50]['rightname'] = 'rule_ldap';
     $tab[50]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'rule_ldap'");
     $tab[51]['table'] = 'glpi_profilerights';
     $tab[51]['field'] = 'rights';
     $tab[51]['name'] = __('Rules for assigning a category to a software');
     $tab[51]['datatype'] = 'right';
     $tab[51]['rightclass'] = 'RuleSoftwareCategory';
     $tab[51]['rightname'] = 'rule_softwarecategories';
     $tab[51]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'rule_softwarecategories'");
     $tab[90]['table'] = 'glpi_profilerights';
     $tab[90]['field'] = 'rights';
     $tab[90]['name'] = __('Software dictionary');
     $tab[90]['datatype'] = 'right';
     $tab[90]['rightclass'] = 'RuleDictionnarySoftware';
     $tab[90]['rightname'] = 'rule_dictionnary_software';
     $tab[90]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'rule_dictionnary_software'");
     $tab[91]['table'] = 'glpi_profilerights';
     $tab[91]['field'] = 'rights';
     $tab[91]['name'] = __('Dropdowns dictionary');
     $tab[91]['datatype'] = 'right';
     $tab[91]['rightclass'] = 'RuleDictionnaryDropdown';
     $tab[91]['rightname'] = 'rule_dictionnary_dropdown';
     $tab[91]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'rule_dictionnary_dropdown'");
     $tab[55]['table'] = 'glpi_profilerights';
     $tab[55]['field'] = 'rights';
     $tab[55]['name'] = self::getTypeName(Session::getPluralNumber());
     $tab[55]['datatype'] = 'right';
     $tab[55]['rightclass'] = 'Profile';
     $tab[55]['rightname'] = 'profile';
     $tab[55]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'profile'");
     $tab[56]['table'] = 'glpi_profilerights';
     $tab[56]['field'] = 'rights';
     $tab[56]['name'] = _n('User', 'Users', Session::getPluralNumber());
     $tab[56]['datatype'] = 'right';
     $tab[56]['rightclass'] = 'User';
     $tab[56]['rightname'] = 'user';
     $tab[56]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'user'");
     $tab[58]['table'] = 'glpi_profilerights';
     $tab[58]['field'] = 'rights';
     $tab[58]['name'] = _n('Group', 'Groups', Session::getPluralNumber());
     $tab[58]['datatype'] = 'right';
     $tab[58]['rightclass'] = 'Group';
     $tab[58]['rightname'] = 'group';
     $tab[58]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'group'");
     $tab[59]['table'] = 'glpi_profilerights';
     $tab[59]['field'] = 'rights';
     $tab[59]['name'] = _n('Entity', 'Entities', Session::getPluralNumber());
     $tab[59]['datatype'] = 'right';
     $tab[59]['rightclass'] = 'Entity';
     $tab[59]['rightname'] = 'entity';
     $tab[59]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'entity'");
     $tab[60]['table'] = 'glpi_profilerights';
     $tab[60]['field'] = 'rights';
     $tab[60]['name'] = __('Transfer');
     $tab[60]['datatype'] = 'right';
     $tab[60]['rightclass'] = 'Transfer';
     $tab[60]['rightname'] = 'transfer';
     $tab[60]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'transfer'");
     $tab[61]['table'] = 'glpi_profilerights';
     $tab[61]['field'] = 'rights';
     $tab[61]['name'] = _n('Log', 'Logs', Session::getPluralNumber());
     $tab[61]['datatype'] = 'right';
     $tab[61]['rightclass'] = 'Log';
     $tab[61]['rightname'] = 'logs';
     $tab[61]['nowrite'] = true;
     $tab[61]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'logs'");
     $tab[62]['table'] = 'glpi_profilerights';
     $tab[62]['field'] = 'rights';
     $tab[62]['name'] = __('Maintenance');
     $tab[62]['datatype'] = 'right';
     $tab[62]['rightclass'] = 'Backup';
     $tab[62]['rightname'] = 'backup';
     $tab[62]['noread'] = true;
     $tab[62]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'backup'");
     $tab['ticket'] = __('Assistance');
     $tab[102]['table'] = 'glpi_profilerights';
     $tab[102]['field'] = 'rights';
     $tab[102]['name'] = __('Create a ticket');
     $tab[102]['datatype'] = 'right';
     $tab[102]['rightclass'] = 'Ticket';
     $tab[102]['rightname'] = 'ticket';
     $tab[102]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'ticket'");
     $tab[108]['table'] = 'glpi_tickettemplates';
     $tab[108]['field'] = 'name';
     $tab[108]['name'] = __('Default ticket template');
     $tab[108]['datatype'] = 'dropdown';
     if (Session::isMultiEntitiesMode()) {
         $tab[108]['condition'] = '`entities_id` = 0 AND `is_recursive`';
     } else {
         $tab[108]['condition'] = '`entities_id` = 0';
     }
     $tab[103]['table'] = 'glpi_profilerights';
     $tab[103]['field'] = 'rights';
     $tab[103]['name'] = _n('Ticket template', 'Ticket templates', Session::getPluralNumber());
     $tab[103]['datatype'] = 'right';
     $tab[103]['rightclass'] = 'TicketTemplate';
     $tab[103]['rightname'] = 'tickettemplate';
     $tab[103]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'tickettemplate'");
     $tab[79]['table'] = 'glpi_profilerights';
     $tab[79]['field'] = 'rights';
     $tab[79]['name'] = __('Planning');
     $tab[79]['datatype'] = 'right';
     $tab[79]['rightclass'] = 'Planning';
     $tab[79]['rightname'] = 'planning';
     $tab[79]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'planning'");
     $tab[85]['table'] = 'glpi_profilerights';
     $tab[85]['field'] = 'rights';
     $tab[85]['name'] = __('Statistics');
     $tab[85]['datatype'] = 'right';
     $tab[85]['rightclass'] = 'Stat';
     $tab[85]['rightname'] = 'statistic';
     $tab[85]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'statistic'");
     $tab[119]['table'] = 'glpi_profilerights';
     $tab[119]['field'] = 'rights';
     $tab[119]['name'] = _n('Ticket cost', 'Ticket costs', Session::getPluralNumber());
     $tab[119]['datatype'] = 'right';
     $tab[119]['rightclass'] = 'TicketCost';
     $tab[119]['rightname'] = 'ticketcost';
     $tab[119]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'ticketcost'");
     $tab[86]['table'] = $this->getTable();
     $tab[86]['field'] = 'helpdesk_hardware';
     $tab[86]['name'] = __('Link with items for the creation of tickets');
     $tab[86]['massiveaction'] = false;
     $tab[86]['datatype'] = 'specific';
     $tab[87]['table'] = $this->getTable();
     $tab[87]['field'] = 'helpdesk_item_type';
     $tab[87]['name'] = __('Associable items to a ticket');
     $tab[87]['massiveaction'] = false;
     $tab[87]['datatype'] = 'specific';
     $tab[89]['table'] = 'glpi_profilerights';
     $tab[89]['field'] = 'rights';
     $tab[89]['name'] = __('See hardware of my groups');
     $tab[89]['datatype'] = 'bool';
     $tab[89]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'show_group_hardware'");
     $tab[100]['table'] = $this->getTable();
     $tab[100]['field'] = 'ticket_status';
     $tab[100]['name'] = __('Life cycle of tickets');
     $tab[100]['nosearch'] = true;
     $tab[100]['datatype'] = 'text';
     $tab[100]['massiveaction'] = false;
     $tab[110]['table'] = $this->getTable();
     $tab[110]['field'] = 'problem_status';
     $tab[110]['name'] = __('Life cycle of problems');
     $tab[110]['nosearch'] = true;
     $tab[110]['datatype'] = 'text';
     $tab[110]['massiveaction'] = false;
     $tab[112]['table'] = 'glpi_profilerights';
     $tab[112]['field'] = 'rights';
     $tab[112]['name'] = _n('Problem', 'Problems', Session::getPluralNumber());
     $tab[112]['datatype'] = 'right';
     $tab[112]['rightclass'] = 'Problem';
     $tab[112]['rightname'] = 'problem';
     $tab[112]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'problem'");
     $tab[111]['table'] = $this->getTable();
     $tab[111]['field'] = 'change_status';
     $tab[111]['name'] = __('Life cycle of changes');
     $tab[111]['nosearch'] = true;
     $tab[111]['datatype'] = 'text';
     $tab[111]['massiveaction'] = false;
     $tab[115]['table'] = 'glpi_profilerights';
     $tab[115]['field'] = 'rights';
     $tab[115]['name'] = _n('Change', 'Changes', Session::getPluralNumber());
     $tab[115]['datatype'] = 'right';
     $tab[115]['rightclass'] = 'Change';
     $tab[115]['rightname'] = 'change';
     $tab[115]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'change'");
     $tab['other'] = __('Other');
     $tab[4]['table'] = 'glpi_profilerights';
     $tab[4]['field'] = 'rights';
     $tab[4]['name'] = __('Update password');
     $tab[4]['datatype'] = 'bool';
     $tab[4]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'password_update'");
     $tab[63]['table'] = 'glpi_profilerights';
     $tab[63]['field'] = 'rights';
     $tab[63]['name'] = _n('Public reminder', 'Public reminders', Session::getPluralNumber());
     $tab[63]['datatype'] = 'right';
     $tab[63]['rightclass'] = 'Reminder';
     $tab[63]['rightname'] = 'reminder_public';
     $tab[63]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'reminder_public'");
     $tab[64]['table'] = 'glpi_profilerights';
     $tab[64]['field'] = 'rights';
     $tab[64]['name'] = _n('Public bookmark', 'Public bookmarks', Session::getPluralNumber());
     $tab[64]['datatype'] = 'right';
     $tab[64]['rightclass'] = 'Bookmark';
     $tab[64]['rightname'] = 'bookmark_public';
     $tab[64]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'bookmark_public'");
     $tab[120]['table'] = 'glpi_profilerights';
     $tab[120]['field'] = 'rights';
     $tab[120]['name'] = _n('Public RSS feed', 'Public RSS feeds', Session::getPluralNumber());
     $tab[120]['datatype'] = 'right';
     $tab[120]['rightclass'] = 'RSSFeed';
     $tab[120]['rightname'] = 'rssfeed_public';
     $tab[120]['joinparams'] = array('jointype' => 'child', 'condition' => "AND `NEWTABLE`.`name`= 'rssfeed_public'");
     return $tab;
 }
 function title()
 {
     Dropdown::showItemTypeMenu(_n('Component', 'Components', Session::getPluralNumber()), Dropdown::getDeviceItemTypes(), $this->getSearchURL());
 }
Exemple #24
0
 /**
  * @see CommonGLPI::getMenuName()
  *
  * @since version 0.85
  **/
 static function getMenuName()
 {
     return Reservation::getTypeName(Session::getPluralNumber());
 }
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if (!$withtemplate) {
         switch ($item->getType()) {
             case 'Problem':
                 $nb = 0;
                 if ($_SESSION['glpishow_count_on_tabs']) {
                     $nb = countElementsInTable('glpi_items_problems', "`problems_id` = '" . $item->getID() . "'");
                 }
                 return self::createTabEntry(_n('Item', 'Items', Session::getPluralNumber()), $nb);
             case 'User':
                 $nb = 0;
                 if ($_SESSION['glpishow_count_on_tabs']) {
                     $nb = countDistinctElementsInTable('glpi_problems_users', 'problems_id', "`users_id` = '" . $item->getID() . "'");
                 }
                 return self::createTabEntry(Problem::getTypeName(Session::getPluralNumber()), $nb);
             case 'Group':
                 $nb = 0;
                 if ($_SESSION['glpishow_count_on_tabs']) {
                     $nb = countDistinctElementsInTable('glpi_groups_problems', 'problems_id', "`groups_id` = '" . $item->getID() . "'");
                 }
                 return self::createTabEntry(Problem::getTypeName(Session::getPluralNumber()), $nb);
             case 'Supplier':
                 $nb = 0;
                 if ($_SESSION['glpishow_count_on_tabs']) {
                     $nb = countDistinctElementsInTable('glpi_problems_suppliers', 'problems_id', "`suppliers_id` = '" . $item->getID() . "'");
                 }
                 return self::createTabEntry(Problem::getTypeName(Session::getPluralNumber()), $nb);
             default:
                 if (Session::haveRight("problem", Problem::READALL)) {
                     $nb = 0;
                     if ($_SESSION['glpishow_count_on_tabs']) {
                         // Direct one
                         $nb = countElementsInTable('glpi_items_problems', " `itemtype` = '" . $item->getType() . "'\n                                                   AND `items_id` = '" . $item->getID() . "'");
                         // Linked items
                         $linkeditems = $item->getLinkedItems();
                         if (count($linkeditems)) {
                             foreach ($linkeditems as $type => $tab) {
                                 foreach ($tab as $ID) {
                                     $nb += countElementsInTable('glpi_items_problems', " `itemtype` = '{$type}'\n                                                            AND `items_id` = '{$ID}'");
                                 }
                             }
                         }
                     }
                     return self::createTabEntry(Problem::getTypeName(Session::getPluralNumber()), $nb);
                 }
         }
     }
     return '';
 }
Exemple #26
0
 function getActions()
 {
     $actions = array();
     $actions['itilcategories_id']['name'] = __('Category');
     $actions['itilcategories_id']['type'] = 'dropdown';
     $actions['itilcategories_id']['table'] = 'glpi_itilcategories';
     $actions['type']['name'] = __('Type');
     $actions['type']['table'] = 'glpi_tickets';
     $actions['type']['type'] = 'dropdown_tickettype';
     $actions['_users_id_requester']['name'] = __('Requester');
     $actions['_users_id_requester']['type'] = 'dropdown_users';
     $actions['_users_id_requester']['force_actions'] = array('assign', 'append');
     $actions['_users_id_requester']['permitseveral'] = array('append');
     $actions['_users_id_requester']['appendto'] = '_additional_requesters';
     $actions['_users_id_requester']['appendtoarray'] = array('use_notification' => 1);
     $actions['_users_id_requester']['appendtoarrayfield'] = 'users_id';
     $actions['_groups_id_requester']['name'] = __('Requester group');
     $actions['_groups_id_requester']['type'] = 'dropdown';
     $actions['_groups_id_requester']['table'] = 'glpi_groups';
     $actions['_groups_id_requester']['condition'] = '`is_requester`';
     $actions['_groups_id_requester']['force_actions'] = array('assign', 'append', 'fromitem');
     $actions['_groups_id_requester']['permitseveral'] = array('append');
     $actions['_groups_id_requester']['appendto'] = '_additional_groups_requesters';
     $actions['_users_id_assign']['name'] = __('Technician');
     $actions['_users_id_assign']['type'] = 'dropdown_assign';
     $actions['_users_id_assign']['force_actions'] = array('assign', 'append');
     $actions['_users_id_assign']['permitseveral'] = array('append');
     $actions['_users_id_assign']['appendto'] = '_additional_assigns';
     $actions['_users_id_assign']['appendtoarray'] = array('use_notification' => 1);
     $actions['_users_id_assign']['appendtoarrayfield'] = 'users_id';
     $actions['_groups_id_assign']['table'] = 'glpi_groups';
     $actions['_groups_id_assign']['name'] = __('Technician group');
     $actions['_groups_id_assign']['type'] = 'dropdown';
     $actions['_groups_id_assign']['condition'] = '`is_assign`';
     $actions['_groups_id_assign']['force_actions'] = array('assign', 'append');
     $actions['_groups_id_assign']['permitseveral'] = array('append');
     $actions['_groups_id_assign']['appendto'] = '_additional_groups_assigns';
     $actions['_suppliers_id_assign']['table'] = 'glpi_suppliers';
     $actions['_suppliers_id_assign']['name'] = __('Assigned to a supplier');
     $actions['_suppliers_id_assign']['type'] = 'dropdown';
     $actions['_suppliers_id_assign']['force_actions'] = array('assign', 'append');
     $actions['_suppliers_id_assign']['permitseveral'] = array('append');
     $actions['_suppliers_id_assign']['appendto'] = '_additional_suppliers_assigns';
     $actions['_users_id_observer']['name'] = __('Watcher');
     $actions['_users_id_observer']['type'] = 'dropdown_users';
     $actions['_users_id_observer']['force_actions'] = array('assign', 'append');
     $actions['_users_id_observer']['permitseveral'] = array('append');
     $actions['_users_id_observer']['appendto'] = '_additional_observers';
     $actions['_users_id_observer']['appendtoarray'] = array('use_notification' => 1);
     $actions['_users_id_observer']['appendtoarrayfield'] = 'users_id';
     $actions['_groups_id_observer']['table'] = 'glpi_groups';
     $actions['_groups_id_observer']['name'] = __('Watcher group');
     $actions['_groups_id_observer']['type'] = 'dropdown';
     $actions['_groups_id_observer']['condition'] = '`is_requester`';
     $actions['_groups_id_observer']['force_actions'] = array('assign', 'append');
     $actions['_groups_id_observer']['permitseveral'] = array('append');
     $actions['_groups_id_observer']['appendto'] = '_additional_groups_observers';
     $actions['urgency']['name'] = __('Urgency');
     $actions['urgency']['type'] = 'dropdown_urgency';
     $actions['impact']['name'] = __('Impact');
     $actions['impact']['type'] = 'dropdown_impact';
     $actions['priority']['name'] = __('Priority');
     $actions['priority']['type'] = 'dropdown_priority';
     $actions['priority']['force_actions'] = array('assign', 'compute');
     $actions['status']['name'] = __('Status');
     $actions['status']['type'] = 'dropdown_status';
     $actions['affectobject']['name'] = _n('Associated element', 'Associated elements', Session::getPluralNumber());
     $actions['affectobject']['type'] = 'text';
     $actions['affectobject']['force_actions'] = array('affectbyip', 'affectbyfqdn', 'affectbymac');
     $actions['slt_ttr']['table'] = 'glpi_slts';
     $actions['slt_ttr']['field'] = 'name';
     $actions['slt_ttr']['name'] = __('SLT') . " " . __('Time to resolve');
     $actions['slt_ttr']['linkfield'] = 'slt_ttr';
     $actions['slt_ttr']['type'] = 'dropdown';
     $actions['slt_ttr']['condition'] = "`glpi_slts`.`type` = '" . SLT::TTR . "'";
     $actions['slt_tto']['table'] = 'glpi_slts';
     $actions['slt_tto']['field'] = 'name';
     $actions['slt_tto']['name'] = __('SLT') . " " . __('Time to own');
     $actions['slt_tto']['linkfield'] = 'slt_tto';
     $actions['slt_tto']['type'] = 'dropdown';
     $actions['slt_tto']['condition'] = "`glpi_slts`.`type` = '" . SLT::TTO . "'";
     $actions['users_id_validate']['name'] = sprintf(__('%1$s - %2$s'), __('Send an approval request'), __('User'));
     $actions['users_id_validate']['type'] = 'dropdown_users_validate';
     $actions['users_id_validate']['force_actions'] = array('add_validation');
     $actions['groups_id_validate']['name'] = sprintf(__('%1$s - %2$s'), __('Send an approval request'), __('Group'));
     $actions['groups_id_validate']['type'] = 'dropdown_groups_validate';
     $actions['groups_id_validate']['force_actions'] = array('add_validation');
     $actions['validation_percent']['name'] = sprintf(__('%1$s - %2$s'), __('Send an approval request'), __('Minimum validation required'));
     $actions['validation_percent']['type'] = 'dropdown_validation_percent';
     $actions['users_id_validate_requester_supervisor']['name'] = __('Approval request to requester group manager');
     $actions['users_id_validate_requester_supervisor']['type'] = 'yesno';
     $actions['users_id_validate_requester_supervisor']['force_actions'] = array('add_validation');
     $actions['users_id_validate_assign_supervisor']['name'] = __('Approval request to technician group manager');
     $actions['users_id_validate_assign_supervisor']['type'] = 'yesno';
     $actions['users_id_validate_assign_supervisor']['force_actions'] = array('add_validation');
     $actions['locations_id']['name'] = __('Location');
     $actions['locations_id']['type'] = 'dropdown';
     $actions['locations_id']['table'] = 'glpi_locations';
     $actions['locations_id']['force_actions'] = array('assign', 'fromuser', 'fromitem');
     $actions['requesttypes_id']['name'] = __('Request source');
     $actions['requesttypes_id']['type'] = 'dropdown';
     $actions['requesttypes_id']['table'] = 'glpi_requesttypes';
     return $actions;
 }
 /**
  * @since version 0.84
  **/
 static function title()
 {
     global $PLUGIN_HOOKS, $CFG_GLPI;
     $opt_list["Ticket"] = __('Tickets');
     $stat_list["Ticket"]["Ticket_Global"]["name"] = __('Global');
     $stat_list["Ticket"]["Ticket_Global"]["file"] = "stat.global.php?itemtype=Ticket";
     $stat_list["Ticket"]["Ticket_Ticket"]["name"] = __('By ticket');
     $stat_list["Ticket"]["Ticket_Ticket"]["file"] = "stat.tracking.php?itemtype=Ticket";
     $stat_list["Ticket"]["Ticket_Location"]["name"] = __('By hardware characteristics');
     $stat_list["Ticket"]["Ticket_Location"]["file"] = "stat.location.php?itemtype=Ticket";
     $stat_list["Ticket"]["Ticket_Item"]["name"] = __('By hardware');
     $stat_list["Ticket"]["Ticket_Item"]["file"] = "stat.item.php";
     if (Problem::canView()) {
         $opt_list["Problem"] = _n('Problem', 'Problems', Session::getPluralNumber());
         $stat_list["Problem"]["Problem_Global"]["name"] = __('Global');
         $stat_list["Problem"]["Problem_Global"]["file"] = "stat.global.php?itemtype=Problem";
         $stat_list["Problem"]["Problem_Problem"]["name"] = __('By problem');
         $stat_list["Problem"]["Problem_Problem"]["file"] = "stat.tracking.php?itemtype=Problem";
     }
     if (Change::canView()) {
         $opt_list["Change"] = _n('Change', 'Changes', Session::getPluralNumber());
         $stat_list["Change"]["Change_Global"]["name"] = __('Global');
         $stat_list["Change"]["Change_Global"]["file"] = "stat.global.php?itemtype=Change";
         $stat_list["Change"]["Change_Change"]["name"] = __('By change');
         $stat_list["Change"]["Change_Change"]["file"] = "stat.tracking.php?itemtype=Change";
     }
     //Affichage du tableau de presentation des stats
     echo "<table class='tab_cadre_fixe'>";
     echo "<tr><th colspan='2'>" . __('Select statistics to be displayed') . "</th></tr>";
     echo "<tr class='tab_bg_1'><td class='center'>";
     $values = array($CFG_GLPI["root_doc"] . '/front/stat.php' => Dropdown::EMPTY_VALUE);
     $i = 0;
     $selected = -1;
     $count = count($stat_list);
     foreach ($opt_list as $opt => $group) {
         while ($data = each($stat_list[$opt])) {
             $name = $data[1]["name"];
             $file = $data[1]["file"];
             $comment = "";
             if (isset($data[1]["comment"])) {
                 $comment = $data[1]["comment"];
             }
             $key = $CFG_GLPI["root_doc"] . "/front/" . $file;
             $values[$group][$key] = $name;
             if (stripos($_SERVER['REQUEST_URI'], $key) !== false) {
                 $selected = $key;
             }
         }
     }
     // Manage plugins
     $names = array();
     $optgroup = array();
     if (isset($PLUGIN_HOOKS["stats"]) && is_array($PLUGIN_HOOKS["stats"])) {
         foreach ($PLUGIN_HOOKS["stats"] as $plug => $pages) {
             if (is_array($pages) && count($pages)) {
                 foreach ($pages as $page => $name) {
                     $names[$plug . '/' . $page] = array("name" => $name, "plug" => $plug);
                     $optgroup[$plug] = Plugin::getInfo($plug, 'name');
                 }
             }
         }
         asort($names);
     }
     foreach ($optgroup as $opt => $title) {
         $group = $title;
         foreach ($names as $key => $val) {
             if ($opt == $val["plug"]) {
                 $file = $CFG_GLPI["root_doc"] . "/plugins/" . $key;
                 $values[$group][$file] = $val["name"];
                 if (stripos($_SERVER['REQUEST_URI'], $file) !== false) {
                     $selected = $file;
                 }
             }
         }
     }
     Dropdown::showFromArray('statmenu', $values, array('on_change' => "window.location.href=this.options[this.selectedIndex].value", 'value' => $selected));
     echo "</td>";
     echo "</tr>";
     echo "</table>";
 }
 /**
  * @see CommonDevice::getAdditionalFields()
  * @since version 0.85
  */
 function getAdditionalFields()
 {
     return array_merge(parent::getAdditionalFields(), array(array('name' => 'none', 'label' => RegisteredID::getTypeName(Session::getPluralNumber()) . RegisteredID::showAddChildButtonForItemForm($this, '_registeredID', NULL, false), 'type' => 'registeredIDChooser')));
 }
Exemple #29
0
based on GLPI - Gestionnaire Libre de Parc Informatique
Copyright (C) 2003-2014 by the INDEPNET Development Team.

-------------------------------------------------------------------------

LICENSE

This file is part of GLPI.

GLPI is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

GLPI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GLPI. If not, see <http://www.gnu.org/licenses/>.
--------------------------------------------------------------------------
*/
/** @file
* @brief
*/
include '../inc/includes.php';
Session::checkRight("contact_enterprise", READ);
Html::header(Contact::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], "management", "contact");
Search::show('Contact');
Html::footer();
$ruleaction = new RuleAction(get_class($rule));
if (isset($_POST["add_action"])) {
    $rulecollection->checkGlobal(CREATE);
    $ruleaction->add($_POST);
    Html::back();
} else {
    if (isset($_POST["update"])) {
        $rulecollection->checkGlobal(UPDATE);
        $rule->update($_POST);
        Event::log($_POST['id'], "rules", 4, "setup", sprintf(__('%s updates an item'), $_SESSION["glpiname"]));
        Html::back();
    } else {
        if (isset($_POST["add"])) {
            $rulecollection->checkGlobal(CREATE);
            $newID = $rule->add($_POST);
            Event::log($newID, "rules", 4, "setup", sprintf(__('%1$s adds the item %2$s'), $_SESSION["glpiname"], $newID));
            Html::redirect($_SERVER['HTTP_REFERER'] . "?id={$newID}");
        } else {
            if (isset($_POST["purge"])) {
                $rulecollection->checkGlobal(PURGE);
                $rulecollection->deleteRuleOrder($_POST["ranking"]);
                $rule->delete($_POST, 1);
                Event::log($_POST["id"], "rules", 4, "setup", sprintf(__('%s purges an item'), $_SESSION["glpiname"]));
                $rule->redirectToList();
            }
        }
    }
}
Html::header(Rule::getTypeName(Session::getPluralNumber()), $_SERVER['PHP_SELF'], 'admin', $rulecollection->menu_type, $rulecollection->menu_option);
$rule->display(array('id' => $_GET["id"]));
Html::footer();