/**
  * Display tab
  *
  * @param CommonGLPI $item
  * @param integer $withtemplate
  *
  * @return varchar name of the tab(s) to display
  */
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     $ong = array();
     if ($item->getType() == 'PluginMonitoringDisplayview') {
         if ($item->getID() > 0) {
             $ong[1] = 'items';
             if ($item->canUpdate()) {
                 $ong[2] = __('Targets');
             }
             $pmDisplayview_rule = new PluginMonitoringDisplayview_rule();
             $ong = $pmDisplayview_rule->addRulesTabs($item->getID(), $ong);
         }
     } else {
         if ($item->getType() == 'Central') {
             $a_views = $this->getViews(1);
             foreach ($a_views as $views_id => $name) {
                 $this->getFromDB($views_id);
                 if (Session::haveRight("plugin_monitoring_displayview", PluginMonitoringDisplayview::HOMEPAGE) && $this->haveVisibilityAccess()) {
                     $ong[] = "[" . _n('View', 'Views', 1, 'monitoring') . "] " . $this->fields['name'];
                 }
             }
         }
     }
     return $ong;
 }
Ejemplo n.º 2
0
 /**
  * Display tab
  *
  * @param CommonGLPI $item
  * @param integer $withtemplate
  *
  * @return varchar name of the tab(s) to display
  */
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     $ong = array();
     if ($item->getType() == 'PluginMonitoringDisplayview') {
         if ($item->getID() > 0) {
             $ong[1] = 'items';
             if ($item->canUpdate() && isset($item->fields['is_frontview']) && $item->fields['is_frontview'] == 1) {
                 $ong[2] = __('Targets');
             }
             $pmDisplayview_rule = new PluginMonitoringDisplayview_rule();
             $ong = $pmDisplayview_rule->addRulesTabs($item->getID(), $ong);
         }
     }
     return $ong;
 }