コード例 #1
0
ファイル: rule.class.php プロジェクト: pvasener/glpi
 /**
  * @param $item         CommonGLPI object
  * @param $tabnum       (default 1)
  * @param $withtemplate (default 0)
  **/
 static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
 {
     if ($item->getType() == 'Entity') {
         $collection = new RuleRightCollection();
         if ($collection->canList()) {
             $ldaprule = new RuleRight();
             $ldaprule->showAndAddRuleForm($item);
         }
         $collection = new RuleImportEntityCollection();
         if ($collection->canList()) {
             $importrule = new RuleImportEntity();
             $importrule->showAndAddRuleForm($item);
         }
         $collection = new RuleMailCollectorCollection();
         if ($collection->canList()) {
             $mailcollector = new RuleMailCollector();
             $mailcollector->showAndAddRuleForm($item);
         }
     } else {
         if ($item->getType() == 'SLA') {
             $rule = new RuleTicket();
             $rule->showAndAddRuleForm($item);
         } else {
             if ($item instanceof Rule) {
                 $item->getRuleWithCriteriasAndActions($item->getID(), 1, 1);
                 switch ($tabnum) {
                     case 1:
                         $item->showCriteriasList($item->getID());
                         break;
                     case 2:
                         $item->showActionsList($item->getID());
                         break;
                 }
             }
         }
     }
     return true;
 }
コード例 #2
0
ファイル: slalevel.class.php プロジェクト: jose-martins/glpi
 /**
  * @since version 0.84
  *
  * @see RuleTicket::getCriterias()
  **/
 function getCriterias()
 {
     $actions = parent::getActions();
     unset($actions['slas_id']);
     // Could not be used as criteria
     unset($actions['users_id_validate_requester_supervisor']);
     unset($actions['users_id_validate_assign_supervisor']);
     unset($actions['affectobject']);
     unset($actions['groups_id_validate']);
     unset($actions['users_id_validate']);
     unset($actions['validation_percent']);
     $actions['status']['name'] = __('Status');
     $actions['status']['type'] = 'dropdown_status';
     return $actions;
 }
コード例 #3
0
ファイル: sla.tabs.php プロジェクト: ryukansent/Thesis-SideB
if (!isset($_POST["id"])) {
    exit;
}
if (empty($_POST["id"])) {
    $_POST["id"] = -1;
}
$sla = new SLA();
$slalevel = new SlaLevel();
if ($_POST['id'] > 0 && $sla->getFromDB($_POST['id'])) {
    switch ($_REQUEST['glpi_tab']) {
        case -1:
            $slalevel->showForSLA($sla);
            $rule = new RuleTicket();
            $rule->showAndAddRuleForm($sla);
            Ticket::showListForItem('Sla', $_POST["id"]);
            Plugin::displayAction($sla, $_REQUEST['glpi_tab']);
            break;
        case 4:
            $rule = new RuleTicket();
            $rule->showAndAddRuleForm($sla);
            break;
        case 6:
            Ticket::showListForItem('Sla', $_POST["id"]);
            break;
        default:
            if (!Plugin::displayAction($sla, $_REQUEST['glpi_tab'])) {
                $slalevel->showForSLA($sla);
            }
    }
}
ajaxFooter();
コード例 #4
0
 function getActions()
 {
     global $LANG;
     $actions = parent::getActions();
     unset($actions['slas_id']);
     $actions['recall']['name'] = $LANG['sla'][9];
     $actions['recall']['type'] = 'yesonly';
     $actions['recall']['force_actions'] = array('send');
     return $actions;
 }
コード例 #5
0
ファイル: slalevel.class.php プロジェクト: gaforeror/glpi
 /**
  * @since version 0.84
  *
  * @see RuleTicket::getCriterias()
  **/
 function getCriterias()
 {
     $actions = parent::getActions();
     unset($actions['slas_id']);
     $actions['status']['name'] = __('Status');
     $actions['status']['type'] = 'dropdown_status';
     return $actions;
 }