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


PHP CTask::SetOperations方法代碼示例

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


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

示例1: array

    } else {
        $ID = CTask::Add($arFields);
    }
    /** @var CAdminException $e */
    if ($e = $APPLICATION->GetException()) {
        $aMsg = $e->messages;
    }
    if (empty($aMsg)) {
        if (!isset($_POST['OPERATION_ID'])) {
            $arOperationIds = array();
        } else {
            $arOperationIds = $_POST['OPERATION_ID'];
        }
        $old_arOperationIds = CTask::GetOperations($ID);
        if (count(array_diff($old_arOperationIds, $arOperationIds)) > 0 || count(array_diff($arOperationIds, $old_arOperationIds)) > 0) {
            CTask::SetOperations($ID, $arOperationIds);
        }
        if ($_POST["save"] != '') {
            LocalRedirect("task_admin.php?lang=" . LANGUAGE_ID);
        } elseif ($_POST["apply"] != '') {
            LocalRedirect($APPLICATION->GetCurPage() . "?lang=" . LANGUAGE_ID . "&ID=" . $ID . "&" . $tabControl->ActiveTabParam());
        }
    } else {
        $message = new CAdminMessage(GetMessage('TASK_SAVE_ERROR'), new CAdminException($aMsg));
    }
}
$z = CTask::GetByID($ID);
if (!$z->ExtractFields("str_") || $ID == 0) {
    $ID = 0;
    $str_SYS = 'N';
    $str_BINDING = 'module';
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:31,代碼來源:task_edit.php

示例2: CGroup

} else {
    $group = new CGroup();
    $arFields = array("ACTIVE" => "Y", "C_SORT" => 200, "NAME" => GetMessage("SALE_WIZARD_ADMIN_SALE"), "DESCRIPTION" => GetMessage("SALE_WIZARD_ADMIN_SALE_DESCR"), "USER_ID" => array(), "STRING_ID" => "sale_administrator");
    $userGroupID = $group->Add($arFields);
}
if (IntVal($userGroupID) > 0) {
    WizardServices::SetFilePermission(array($siteID, "/bitrix/admin"), array($userGroupID => "R"));
    WizardServices::SetFilePermission(array($siteID, "/bitrix/admin"), array($userGroupID => "R"));
    $new_task_id = CTask::Add(array("NAME" => GetMessage("SALE_WIZARD_ADMIN_SALE"), "DESCRIPTION" => GetMessage("SALE_WIZARD_ADMIN_SALE_DESCR"), "LETTER" => "Q", "BINDING" => "module", "MODULE_ID" => "main"));
    if ($new_task_id) {
        $arOps = array();
        $rsOp = COperation::GetList(array(), array("NAME" => "cache_control|view_own_profile|edit_own_profile"));
        while ($arOp = $rsOp->Fetch()) {
            $arOps[] = $arOp["ID"];
        }
        CTask::SetOperations($new_task_id, $arOps);
    }
    $rsTasks = CTask::GetList(array(), array("MODULE_ID" => "main", "SYS" => "N", "BINDIG" => "module", "LETTER" => "Q"));
    if ($arTask = $rsTasks->Fetch()) {
        CGroup::SetModulePermission($userGroupID, $arTask["MODULE_ID"], $arTask["ID"]);
    }
    CMain::SetGroupRight("sale", $userGroupID, "U");
    $rsTasks = CTask::GetList(array(), array("MODULE_ID" => "catalog", "SYS" => "Y", "BINDIG" => "module", "LETTER" => "T"));
    while ($arTask = $rsTasks->Fetch()) {
        CGroup::SetModulePermission($userGroupID, $arTask["MODULE_ID"], $arTask["ID"]);
    }
}
$userGroupID = "";
$dbGroup = CGroup::GetList($by = "", $order = "", array("STRING_ID" => "content_editor"));
if ($arGroup = $dbGroup->Fetch()) {
    $userGroupID = $arGroup["ID"];
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:31,代碼來源:step2.php

示例3: SetTaskSecurity

 function SetTaskSecurity($task_id, $module_id, $arOperations, $letter = '')
 {
     $ID = 0;
     $dbr_task = CTask::GetList(array(), array('NAME' => $task_id, 'MODULE_ID' => $module_id, "BINDING" => 'module'));
     if ($ar_task = $dbr_task->Fetch()) {
         if ($ar_task['SYS'] == 'Y') {
             return false;
         }
         $ID = $ar_task['ID'];
     }
     $arFields = array("NAME" => $task_id, "LETTER" => $letter, "BINDING" => 'module', "MODULE_ID" => $module_id);
     if ($ID > 0) {
         $res = CTask::Update($arFields, $ID);
     } else {
         $ID = CTask::Add($arFields);
         $res = $ID > 0;
         if ($res) {
             $arBackup = CControllerClient::GetBackup();
             $arBackup['security_task'][] = $ID;
             CControllerClient::SetBackup($arBackup);
         }
     }
     if ($res) {
         CTask::SetOperations($ID, $arOperations, true);
     }
 }
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:26,代碼來源:controller_member.php


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