当前位置: 首页>>代码示例>>PHP>>正文


PHP TicketValidation::getNumberTicketsToValidate方法代码示例

本文整理汇总了PHP中TicketValidation::getNumberTicketsToValidate方法的典型用法代码示例。如果您正苦于以下问题:PHP TicketValidation::getNumberTicketsToValidate方法的具体用法?PHP TicketValidation::getNumberTicketsToValidate怎么用?PHP TicketValidation::getNumberTicketsToValidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TicketValidation的用法示例。


在下文中一共展示了TicketValidation::getNumberTicketsToValidate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: printHelpDesk

/**
 * Print the helpdesk
 *
 * @param $ID int : ID of the user who want to display the Helpdesk
 * @param $from_helpdesk int : is display from the helpdesk.php ?
 *
 * @return nothing (print the helpdesk)
 **/
function printHelpDesk($ID, $from_helpdesk)
{
    global $DB, $CFG_GLPI, $LANG;
    if (!haveRight("create_ticket", "1")) {
        return false;
    }
    if (haveRight('validate_ticket', 1)) {
        $opt = array();
        $opt['reset'] = 'reset';
        $opt['field'][0] = 55;
        // validation status
        $opt['searchtype'][0] = 'equals';
        $opt['contains'][0] = 'waiting';
        $opt['link'][0] = 'AND';
        $opt['field'][1] = 59;
        // validation aprobator
        $opt['searchtype'][1] = 'equals';
        $opt['contains'][1] = getLoginUserID();
        $opt['link'][1] = 'AND';
        $url_validate = $CFG_GLPI["root_doc"] . "/front/ticket.php?" . append_params($opt, '&');
        if (TicketValidation::getNumberTicketsToValidate(getLoginUserID()) > 0) {
            echo "<a href='{$url_validate}' title=\"" . $LANG['validation'][15] . "\"\n                alt=\"" . $LANG['validation'][15] . "\">" . $LANG['validation'][33] . "</a><br><br>";
        }
    }
    $query = "SELECT `email`, `realname`, `firstname`, `name`\n             FROM `glpi_users`\n             WHERE `id` = '{$ID}'";
    $result = $DB->query($query);
    $email = $DB->result($result, 0, "email");
    // Get saved data from a back system
    $use_email_notification = 1;
    if ($email == "") {
        $use_email_notification = 0;
    }
    $itemtype = 0;
    $items_id = "";
    $content = "";
    $title = "";
    $ticketcategories_id = 0;
    $urgency = 3;
    $type = 0;
    if (isset($_SESSION["helpdeskSaved"]['_users_id_requester_notif']) && isset($_SESSION["helpdeskSaved"]['_users_id_requester_notif']['use_notification'])) {
        $use_email_notification = stripslashes($_SESSION["helpdeskSaved"]['_users_id_requester_notif']['use_notification']);
    }
    if (isset($_SESSION["helpdeskSaved"]["email"])) {
        $email = stripslashes($_SESSION["helpdeskSaved"]["user_email"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["itemtype"])) {
        $itemtype = stripslashes($_SESSION["helpdeskSaved"]["itemtype"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["items_id"])) {
        $items_id = stripslashes($_SESSION["helpdeskSaved"]["items_id"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["content"])) {
        $content = cleanPostForTextArea($_SESSION["helpdeskSaved"]["content"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["name"])) {
        $title = stripslashes($_SESSION["helpdeskSaved"]["name"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["ticketcategories_id"])) {
        $ticketcategories_id = stripslashes($_SESSION["helpdeskSaved"]["ticketcategories_id"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["type"])) {
        $type = stripslashes($_SESSION["helpdeskSaved"]["type"]);
    }
    if (isset($_SESSION["helpdeskSaved"]["urgency"])) {
        $urgency = stripslashes($_SESSION["helpdeskSaved"]["urgency"]);
    }
    unset($_SESSION["helpdeskSaved"]);
    echo "<form method='post' name='helpdeskform' action='" . $CFG_GLPI["root_doc"] . "/front/tracking.injector.php' enctype='multipart/form-data'>";
    echo "<input type='hidden' name='_from_helpdesk' value='{$from_helpdesk}'>";
    echo "<input type='hidden' name='requesttypes_id' value='" . RequestType::getDefault('helpdesk') . "'>";
    if ($CFG_GLPI['urgency_mask'] == 1 << 3) {
        // Dont show dropdown if only 1 value enabled
        echo "<input type='hidden' name='urgency' value='3'>";
    }
    echo "<input type='hidden' name='entities_id' value='" . $_SESSION["glpiactive_entity"] . "'>";
    echo "<div class='center'><table class='tab_cadre'>";
    echo "<tr><th colspan='2'>" . $LANG['job'][11] . "&nbsp;:&nbsp;";
    if (isMultiEntitiesMode()) {
        echo "&nbsp;(" . Dropdown::getDropdownName("glpi_entities", $_SESSION["glpiactive_entity"]) . ")";
    }
    echo "</th></tr>";
    if ($CFG_GLPI['urgency_mask'] != 1 << 3) {
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . $LANG['joblist'][29] . "&nbsp;:&nbsp;</td>";
        echo "<td>";
        Ticket::dropdownUrgency("urgency", $urgency);
        echo "</td></tr>";
    }
    if (NotificationTargetTicket::isAuthorMailingActivatedForHelpdesk()) {
        echo "<tr class='tab_bg_1'>";
        echo "<td>" . $LANG['help'][8] . "&nbsp;:&nbsp;</td>";
        echo "<td>";
//.........这里部分代码省略.........
开发者ID:ryukansent,项目名称:Thesis-SideB,代码行数:101,代码来源:display.function.php

示例2: getHelpdesk

 /**
  * clone of function Ticket::showFormHelpdesk()
  */
 static function getHelpdesk($ID = 0, $ticket_template = false)
 {
     global $DB, $CFG_GLPI;
     // * Added by plugin survey ticket
     $ticket = new Ticket();
     // * End of adding
     if (!Session::haveRight("create_ticket", "1")) {
         return false;
     }
     if (!$ticket_template && (Session::haveRight('validate_incident', 1) || Session::haveRight('validate_request', 1))) {
         $opt = array();
         $opt['reset'] = 'reset';
         $opt['field'][0] = 55;
         // validation status
         $opt['searchtype'][0] = 'equals';
         $opt['contains'][0] = 'waiting';
         $opt['link'][0] = 'AND';
         $opt['field'][1] = 59;
         // validation aprobator
         $opt['searchtype'][1] = 'equals';
         $opt['contains'][1] = Session::getLoginUserID();
         $opt['link'][1] = 'AND';
         $url_validate = $CFG_GLPI["root_doc"] . "/front/ticket.php?" . Toolbox::append_params($opt, '&amp;');
         if (TicketValidation::getNumberTicketsToValidate(Session::getLoginUserID()) > 0) {
             echo "<a href='{$url_validate}' title=\"" . __s('Ticket waiting for your approval') . "\"\n                   alt=\"" . __s('Ticket waiting for your approval') . "\">" . __('Tickets awaiting approval') . "</a><br><br>";
         }
     }
     $query = "SELECT `realname`, `firstname`, `name`\n                FROM `glpi_users`\n                WHERE `id` = '{$ID}'";
     $result = $DB->query($query);
     $email = UserEmail::getDefaultForUser($ID);
     // Set default values...
     $default_values = array('_users_id_requester_notif' => array('use_notification' => $email == "" ? 0 : 1), 'nodelegate' => 1, '_users_id_requester' => 0, 'name' => '', 'content' => '', 'itilcategories_id' => 0, 'locations_id' => 0, 'urgency' => 3, 'itemtype' => '', 'items_id' => 0, 'entities_id' => $_SESSION['glpiactive_entity'], 'plan' => array(), 'global_validation' => 'none', 'due_date' => 'NULL', 'slas_id' => 0, '_add_validation' => 0, 'type' => Entity::getUsedConfig('tickettype', $_SESSION['glpiactive_entity'], '', Ticket::INCIDENT_TYPE), '_right' => "id");
     // Get default values from posted values on reload form
     if (!$ticket_template) {
         if (isset($_POST)) {
             $values = $_POST;
         }
     }
     // Restore saved value or override with page parameter
     $saved = $ticket->restoreInput();
     foreach ($default_values as $name => $value) {
         if (!isset($values[$name])) {
             if (isset($saved[$name])) {
                 $values[$name] = $saved[$name];
             } else {
                 $values[$name] = $value;
             }
         }
     }
     if (!$ticket_template) {
         echo "<form method='post' name='helpdeskform' action='" . $CFG_GLPI["root_doc"] . "/front/tracking.injector.php' enctype='multipart/form-data'>";
     }
     $delegating = User::getDelegateGroupsForUser($values['entities_id']);
     if (count($delegating)) {
         echo "<div class='center'><table class='tab_cadre_fixe'>";
         echo "<tr><th colspan='2'>" . __('This ticket concerns me') . " ";
         $rand = Dropdown::showYesNo("nodelegate", $values['nodelegate']);
         $params = array('nodelegate' => '__VALUE__', 'rand' => $rand, 'right' => "delegate", '_users_id_requester' => $values['_users_id_requester'], '_users_id_requester_notif' => $values['_users_id_requester_notif'], 'use_notification' => $values['_users_id_requester_notif']['use_notification'], 'entity_restrict' => $_SESSION["glpiactive_entity"]);
         Ajax::UpdateItemOnSelectEvent("dropdown_nodelegate" . $rand, "show_result" . $rand, $CFG_GLPI["root_doc"] . "/ajax/dropdownDelegationUsers.php", $params);
         if ($CFG_GLPI['use_check_pref'] && $values['nodelegate']) {
             echo "</th><th>" . __('Check your personnal information');
         }
         echo "</th></tr>";
         echo "<tr class='tab_bg_1'><td colspan='2' class='center'>";
         echo "<div id='show_result{$rand}'>";
         $self = new Ticket();
         if ($values["_users_id_requester"] == 0) {
             $values['_users_id_requester'] = Session::getLoginUserID();
         } else {
             $values['_right'] = "delegate";
         }
         $self->showActorAddFormOnCreate(CommonITILActor::REQUESTER, $values);
         echo "</div>";
         if ($CFG_GLPI['use_check_pref'] && $values['nodelegate']) {
             echo "</td><td class='center'>";
             User::showPersonalInformation(Session::getLoginUserID());
         }
         echo "</td></tr>";
         echo "</table></div>";
         echo "<input type='hidden' name='_users_id_recipient' value='" . Session::getLoginUserID() . "'>";
     } else {
         // User as requester
         $values['_users_id_requester'] = Session::getLoginUserID();
         if ($CFG_GLPI['use_check_pref']) {
             echo "<div class='center'><table class='tab_cadre_fixe'>";
             echo "<tr><th>" . __('Check your personnal information') . "</th></tr>";
             echo "<tr class='tab_bg_1'><td class='center'>";
             User::showPersonalInformation(Session::getLoginUserID());
             echo "</td></tr>";
             echo "</table></div>";
         }
     }
     echo "<input type='hidden' name='_from_helpdesk' value='1'>";
     echo "<input type='hidden' name='requesttypes_id' value='" . RequestType::getDefault('helpdesk') . "'>";
     // Load ticket template if available :
     $tt = $ticket->getTicketTemplateToUse($ticket_template, $values['type'], $values['itilcategories_id'], $_SESSION["glpiactive_entity"]);
     // Predefined fields from template : reset them
//.........这里部分代码省略.........
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:survey.class.php

示例3: show

    public static function show($ID, $from_helpdesk)
    {
        global $LANG, $CFG_GLPI, $DB;
        //$logged = $_SESSION['glpiID'];
        if (!isset($_REQUEST['session'])) {
            $IDO = Session::getLoginUserID();
        } else {
            $IDO = $_REQUEST['session'];
        }
        $logged = $ID;
        /*
        echo $logged."logged2 ";
        echo Session::getLoginUserID()."session ";
        */
        if (isset($_REQUEST['id'])) {
            $ID = $_REQUEST['id'];
            $_SESSION["glpiID"] = $_REQUEST['id'];
            $query = "SELECT `profiles_id` AS id\nFROM `glpi_profiles_users`\nWHERE `users_id` = " . $IDO . "\nORDER BY `glpi_profiles_users`.`profiles_id` DESC";
            $result = $DB->query($query);
            $cont = $DB->numrows($result);
            $profile = $DB->fetch_assoc($result);
        } else {
            $ID = $_SESSION['glpiID'];
            $_SESSION['glpiID'] = $_SESSION['glpiID'];
            $query = "SELECT `profiles_id` AS id\nFROM `glpi_profiles_users`\nWHERE `users_id` = " . $IDO . "\nORDER BY `glpi_profiles_users`.`profiles_id` DESC";
            $result = $DB->query($query);
            $cont = $DB->numrows($result);
            $profile = $DB->fetch_assoc($result);
        }
        /*		
        echo $ID."id ";
        echo $_SESSION['glpiID']."glpiid ";
        echo $_SESSION['logged']."logged ";
        echo $logged."logged2 ";
        */
        if (!Session::haveRight("ticket", CREATE)) {
            return false;
        }
        if (Session::haveRight('validate_ticket', 1)) {
            //	      if (Session::haveRightsOr('ticketvalidation', array(TicketValidation::VALIDATEREQUEST, TicketValidation::VALIDATEINCIDENT))) {
            $opt = array();
            $opt['reset'] = 'reset';
            $opt['field'][0] = 55;
            // validation status
            $opt['searchtype'][0] = 'equals';
            $opt['contains'][0] = 'waiting';
            $opt['link'][0] = 'AND';
            $opt['field'][1] = 59;
            // validation aprobator
            $opt['searchtype'][1] = 'equals';
            $opt['contains'][1] = Session::getLoginUserID();
            //$opt['contains'][1]   = $ID;
            $opt['link'][1] = 'AND';
            $url_validate = $CFG_GLPI["root_doc"] . "/front/ticket.php?" . Toolbox::append_params($opt, '&amp;');
            if (TicketValidation::getNumberTicketsToValidate(Session::getLoginUserID()) > 0) {
                //if (TicketValidation::getNumberTicketsToValidate( $ID >0) {
                echo "<a href='{$url_validate}' title=\"" . $LANG['validation'][15] . "\"\n                      alt=\"" . $LANG['validation'][15] . "\">" . $LANG['validation'][33] . "</a><br><br>";
            }
        }
        // Stevenes Donato
        //email user
        $query = "SELECT  gu.id, ge.email, gu.`firstname`, gu.`realname`, gu.`name`\n                 FROM `glpi_users` gu, glpi_useremails ge\n                 WHERE gu.`id` = '{$ID}'\n\t\t\t\t\t  AND ge.users_id = gu.id ";
        $result = $DB->query($query);
        $email = $DB->result($result, 0, "email");
        $user_name = $DB->result($result, 0, "firstname") . " ";
        $user_sname = $DB->result($result, 0, "realname");
        //categories
        $query_cat = "SELECT id, completename\n\t\t\t\t\t\t\tFROM `glpi_itilcategories` \n\t\t\t\t\t\t\tWHERE `is_helpdeskvisible` = 1";
        $result_cat = $DB->query($query_cat);
        $itilcategories_id = $DB->fetch_assoc($result_cat);
        $sql_user = "\n\t\tSELECT DISTINCT glpi_users.`id` AS id , glpi_users.`firstname` AS name, glpi_users.`realname` AS sname\n\t\tFROM `glpi_users`\n\t\tWHERE glpi_users.is_deleted = 0\n\t\tORDER BY `glpi_users`.`firstname` ASC ";
        $result_user = $DB->query($sql_user);
        $user = $DB->fetch_assoc($result_user);
        // Get saved data from a back system
        $use_email_notification = 1;
        if ($email == "") {
            $use_email_notification = 0;
        }
        $itemtype = 0;
        $items_id = "";
        $content = "";
        $title = "";
        //$itilcategories_id = 0;
        $urgency = 3;
        if (isset($_SESSION["helpdeskSaved"]["use_email_notification"])) {
            $use_email_notification = stripslashes($_SESSION["helpdeskSaved"]["use_email_notification"]);
        }
        if (isset($_SESSION["helpdeskSaved"]["email"])) {
            $email = stripslashes($_SESSION["helpdeskSaved"]["user_email"]);
        }
        if (isset($_SESSION["helpdeskSaved"]["itemtype"])) {
            $itemtype = stripslashes($_SESSION["helpdeskSaved"]["itemtype"]);
        }
        if (isset($_SESSION["helpdeskSaved"]["items_id"])) {
            $items_id = stripslashes($_SESSION["helpdeskSaved"]["items_id"]);
        }
        if (isset($_SESSION["helpdeskSaved"]["content"])) {
            $content = cleanPostForTextArea($_SESSION["helpdeskSaved"]["content"]);
        }
        if (isset($_SESSION["helpdeskSaved"]["name"])) {
//.........这里部分代码省略.........
开发者ID:JULIO8,项目名称:respaldo_glpi,代码行数:101,代码来源:helpdesk.class.php


注:本文中的TicketValidation::getNumberTicketsToValidate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。