本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}