當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TicketValidation::getFromDB方法代碼示例

本文整理匯總了PHP中TicketValidation::getFromDB方法的典型用法代碼示例。如果您正苦於以下問題:PHP TicketValidation::getFromDB方法的具體用法?PHP TicketValidation::getFromDB怎麽用?PHP TicketValidation::getFromDB使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TicketValidation的用法示例。


在下文中一共展示了TicketValidation::getFromDB方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: TicketValidation

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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--------------------------------------------------------------------------
*/
// ----------------------------------------------------------------------
// Original Author of file: Julien Dombre
// Purpose of file:
// ----------------------------------------------------------------------
define('GLPI_ROOT', '..');
include GLPI_ROOT . "/inc/includes.php";
header("Content-Type: text/html; charset=UTF-8");
header_nocache();
if (!isset($_POST["id"])) {
    exit;
}
if (!isset($_REQUEST['glpi_tab'])) {
    exit;
}
$validation = new TicketValidation();
if ($_POST["id"] > 0 && $validation->getFromDB($_POST["id"])) {
    switch ($_REQUEST['glpi_tab']) {
        default:
            Plugin::displayAction($validation, $_REQUEST['glpi_tab']);
    }
}
ajaxFooter();
開發者ID:ryukansent,項目名稱:Thesis-SideB,代碼行數:31,代碼來源:ticketvalidation.tabs.php

示例2: methodsetTicketValidation

 /**
  * Answer to a ticket validation request
  * for an authenticated user
  *
  * @param $params    array of options (ticket, id2name)
  * @param $protocol        the communication protocol used
  *
  * @return array of hashtable as glpi.getTicket
  **/
 static function methodsetTicketValidation($params, $protocol)
 {
     global $DB, $CFG_GLPI;
     if (isset($params['help'])) {
         return array('approval' => 'integer,mandatory', 'id2name' => 'bool,optional', 'status' => 'text,mandatory', 'comment' => 'text,optional', 'help' => 'bool,optional');
     }
     if (!Session::getLoginUserID()) {
         return self::Error($protocol, WEBSERVICES_ERROR_NOTAUTHENTICATED);
     }
     $ticket = new Ticket();
     if (!isset($params['approval'])) {
         return self::Error($protocol, WEBSERVICES_ERROR_MISSINGPARAMETER, '', 'approval');
     }
     if (!isset($params['status'])) {
         return self::Error($protocol, WEBSERVICES_ERROR_MISSINGPARAMETER, '', 'status');
     }
     $tabstatus = TicketValidation::getAllStatusArray();
     if (!isset($tabstatus[$params['status']])) {
         return self::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER, '', 'status=' . $params['status']);
     }
     if ($params['status'] == 'rejected' && !isset($params['comment'])) {
         return self::Error($protocol, WEBSERVICES_ERROR_MISSINGPARAMETER, '', 'comment');
     }
     $valid = new TicketValidation();
     if (!$valid->getFromDB($params['approval'])) {
         return self::Error($protocol, WEBSERVICES_ERROR_NOTFOUND, '', 'approval');
     }
     $input = array('id' => $valid->getField('id'), 'status' => $params['status']);
     if (isset($params['comment'])) {
         $input['comment_validation'] = addslashes($params['comment']);
     }
     if (!$valid->can($params['approval'], 'w')) {
         return self::Error($protocol, WEBSERVICES_ERROR_NOTALLOWED);
     }
     if ($valid->update($input)) {
         unset($params['approval'], $params['status'], $params['comment']);
         $params['ticket'] = $valid->getField('tickets_id');
         return self::methodGetTicket($params, $protocol);
     }
     return self::Error($protocol, WEBSERVICES_ERROR_FAILED, '', self::getDisplayError());
 }
開發者ID:geldarr,項目名稱:hack-space,代碼行數:50,代碼來源:methodhelpdesk.class.php


注:本文中的TicketValidation::getFromDB方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。