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


PHP CTicket::GetRoles方法代码示例

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


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

示例1: Delete

 function Delete($id, $checkRights = true)
 {
     $err_mess = self::err_mess() . "<br>Function: Delete<br>Line: ";
     global $DB, $USER, $APPLICATION;
     $id = intval($id);
     $table = self::TABLE;
     $tableShedule = self::TABLE_SHEDULE;
     if ($id <= 0) {
         return false;
     }
     $isDemo = null;
     $isSupportClient = null;
     $isSupportTeam = null;
     $isAdmin = null;
     $isAccess = null;
     $userID = null;
     CTicket::GetRoles($isDemo, $isSupportClient, $isSupportTeam, $isAdmin, $isAccess, $userID, $checkRights);
     if (!$isAdmin) {
         $arMsg = array();
         $arMsg[] = array("id" => "PERMISSION", "text" => GetMessage("SUP_ERROR_ACCESS_DENIED"));
         $e = new CAdminException($arMsg);
         $APPLICATION->ThrowException($e);
         return false;
     }
     $strSql = "SELECT DISTINCT 'x' FROM b_ticket_sla WHERE TIMETABLE_ID = {$id}";
     $rs = $DB->Query($strSql, false, $err_mess . __LINE__);
     if (!$rs->Fetch()) {
         $DB->Query("DELETE FROM {$table} WHERE ID = {$id}", false, $err_mess . __LINE__);
         $DB->Query("DELETE FROM {$tableShedule} WHERE TIMETABLE_ID = {$id}", false, $err_mess . __LINE__);
         return true;
     } else {
         $APPLICATION->ThrowException(str_replace("#ID#", "{$id}", GetMessage("SUP_ERROR_TIMETABLE_HAS_SLA")));
     }
     return false;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:35,代码来源:timetable.php

示例2: Delete

 function Delete($id, $checkRights = true)
 {
     $err_mess = self::err_mess() . "<br>Function: Delete<br>Line: ";
     global $DB, $USER, $APPLICATION;
     $id = intval($id);
     $table = self::table;
     $table_s2h = self::table_s2h;
     if ($id <= 0) {
         return false;
     }
     $isDemo = null;
     $isSupportClient = null;
     $isSupportTeam = null;
     $isAdmin = null;
     $isAccess = null;
     $userID = null;
     CTicket::GetRoles($isDemo, $isSupportClient, $isSupportTeam, $isAdmin, $isAccess, $userID, $checkRights);
     if (!$isAdmin) {
         $arMsg = array();
         $arMsg[] = array("id" => "PERMISSION", "text" => GetMessage("SUP_ERROR_ACCESS_DENIED"));
         $e = new CAdminException($arMsg);
         $APPLICATION->ThrowException($e);
         return false;
     }
     // get affected sla
     $affected_sla = array();
     $res = $DB->Query("SELECT SLA_ID FROM b_ticket_sla_2_holidays WHERE HOLIDAYS_ID = {$id}");
     while ($row = $res->Fetch()) {
         $affected_sla[] = $row['SLA_ID'];
     }
     // delete
     $DB->Query("DELETE FROM {$table} WHERE ID = {$id}", false, $err_mess . __LINE__);
     $DB->Query("DELETE FROM {$table_s2h} WHERE HOLIDAYS_ID = {$id}", false, $err_mess . __LINE__);
     // recalculate only affected sla
     CSupportTimetableCache::toCache(array("SLA_ID" => $affected_sla));
     return true;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:37,代码来源:holidays.php

示例3: Delete

 public static function Delete($id, $checkRights = true)
 {
     $err_mess = CAllTicketSLA::err_mess() . "<br>Function: Delete<br>Line: ";
     global $DB, $USER, $APPLICATION;
     $id = intval($id);
     if ($id < 1) {
         return false;
     }
     if ($id == 1) {
         $APPLICATION->ThrowException(GetMessage("SUP_ERROR_SLA_1"));
         return false;
     }
     $isDemo = $isSupportClient = $isSupportTeam = $isAdmin = $isAccess = $userID = null;
     CTicket::GetRoles($isDemo, $isSupportClient, $isSupportTeam, $isAdmin, $isAccess, $userID, $checkRights);
     if ($isAdmin) {
         $strSql = "SELECT DISTINCT 'x' FROM b_ticket WHERE SLA_ID = {$id}";
         $rs = $DB->Query($strSql, false, $err_mess . __LINE__);
         if (!$rs->Fetch()) {
             $DB->Query("DELETE FROM b_ticket_sla_2_site WHERE SLA_ID = {$id}", false, $err_mess . __LINE__);
             $DB->Query("DELETE FROM b_ticket_sla_2_category WHERE SLA_ID = {$id}", false, $err_mess . __LINE__);
             $DB->Query("DELETE FROM b_ticket_sla_2_criticality WHERE SLA_ID = {$id}", false, $err_mess . __LINE__);
             $DB->Query("DELETE FROM b_ticket_sla_2_mark WHERE SLA_ID = {$id}", false, $err_mess . __LINE__);
             $DB->Query("DELETE FROM b_ticket_sla_2_user_group WHERE SLA_ID = {$id}", false, $err_mess . __LINE__);
             //$DB->Query("DELETE FROM b_ticket_sla_shedule WHERE SLA_ID = $id", false, $err_mess.__LINE__);
             $DB->Query("DELETE FROM b_ticket_sla_2_holidays WHERE SLA_ID = {$id}", false, $err_mess . __LINE__);
             $DB->Query("DELETE FROM b_ticket_sla WHERE ID = {$id}", false, $err_mess . __LINE__);
             $DB->Query("DELETE FROM b_ticket_timetable_cache WHERE SLA_ID = {$id}", false, $err_mess . __LINE__);
             return true;
         } else {
             $APPLICATION->ThrowException(str_replace("#ID#", "{$id}", GetMessage("SUP_ERROR_SLA_HAS_TICKET")));
         }
     } else {
         $APPLICATION->ThrowException(GetMessage("SUP_ERROR_ACCESS_DENIED"));
     }
     return false;
 }
开发者ID:rasuldev,项目名称:torino,代码行数:36,代码来源:sla.php

示例4: Delete

 function Delete($id, $checkRights = true)
 {
     $err_mess = self::err_mess() . "<br>Function: Delete<br>Line: ";
     global $DB, $USER, $APPLICATION;
     $id = intval($id);
     $table = self::table;
     $table_s2h = self::table_s2h;
     if ($id <= 0) {
         return false;
     }
     $isDemo = null;
     $isSupportClient = null;
     $isSupportTeam = null;
     $isAdmin = null;
     $isAccess = null;
     $userID = null;
     CTicket::GetRoles($isDemo, $isSupportClient, $isSupportTeam, $isAdmin, $isAccess, $userID, $checkRights);
     if (!$isAdmin) {
         $arMsg = array();
         $arMsg[] = array("id" => "PERMISSION", "text" => GetMessage("SUP_ERROR_ACCESS_DENIED"));
         $e = new CAdminException($arMsg);
         $APPLICATION->ThrowException($e);
         return false;
     }
     $DB->Query("DELETE FROM {$table} WHERE ID = {$id}", false, $err_mess . __LINE__);
     $DB->Query("DELETE FROM {$table_s2h} WHERE HOLIDAYS_ID = {$id}", false, $err_mess . __LINE__);
     CSupportTimetableCache::toCache();
     return true;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:29,代码来源:holidays.php


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