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