예제 #1
0
 public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if ($item->getType() == 'PluginOrderOrder') {
         if (Session::haveRight('plugin_order_order', PluginOrderOrder::canView()) && $item->getState() > PluginOrderOrderState::DRAFT) {
             return self::createTabEntry(__("Item delivered", "order"), self::countForOrder($item));
         }
     }
 }
예제 #2
0
 public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     switch ($item->getType()) {
         case 'Budget':
             return __("Orders", "order");
         case __CLASS__:
             $ong = array();
             $config = PluginOrderConfig::getConfig();
             if (Session::haveRight("plugin_order_order", self::RIGHT_VALIDATION) || Session::haveRight("plugin_order_order", self::RIGHT_CANCEL) || Session::haveRight("plugin_order_order", self::RIGHT_UNDO_VALIDATION)) {
                 $ong[1] = __("Validation", "order");
             }
             if ($config->canGenerateOrderPDF() && ($item->getState() > PluginOrderOrderState::DRAFT || $this->canGenerateWithoutValidation())) {
                 // generation
                 $ong[2] = __("Purchase order", "order");
             }
             return $ong;
     }
 }
예제 #3
0
 function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
 {
     if ($item->getType() == 'Budget') {
         return __("Orders", "order");
     } else {
         if ($item->getType() == __CLASS__) {
             $ong = array();
             $config = PluginOrderConfig::getConfig();
             if (plugin_order_haveRight("validation", "w") || plugin_order_haveRight("cancel", "w") || plugin_order_haveRight("undo_validation", "w")) {
                 $ong[1] = __("Validation", "order");
             }
             if ($config->canGenerateOrderPDF() && $item->getState() > PluginOrderOrderState::DRAFT) {
                 // generation
                 $ong[2] = __("Order", "order");
             }
             return $ong;
         }
     }
 }