本文整理汇总了PHP中CTask::Update方法的典型用法代码示例。如果您正苦于以下问题:PHP CTask::Update方法的具体用法?PHP CTask::Update怎么用?PHP CTask::Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTask
的用法示例。
在下文中一共展示了CTask::Update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
}
示例2: intval
****************************************************************************/
$ID = intval($_REQUEST["ID"]);
$COPY_ID = intval($_REQUEST["COPY_ID"]);
if ($COPY_ID > 0) {
$ID = $COPY_ID;
}
$message = null;
$aTabs = array(array("DIV" => "edit1", "TAB" => GetMessage("TAB_1"), "ICON" => "", "TITLE" => GetMessage("TAB_1_TITLE")), array("DIV" => "edit2", "TAB" => GetMessage("TAB_2"), "ICON" => "", "TITLE" => GetMessage('TAB_2_TITLE')));
$tabControl = new CAdminTabControl("tabControl", $aTabs);
if ($_SERVER["REQUEST_METHOD"] == "POST" && ($_POST["save"] != '' || $_POST["apply"] != '') && $USER->CanDoOperation('edit_tasks') && check_bitrix_sessid()) {
$aMsg = array();
$LETTER = strtoupper($_POST["LETTER"]);
$arFields = array("NAME" => $_POST["NAME"], "DESCRIPTION" => $_POST["DESCRIPTION"], "LETTER" => $LETTER, "BINDING" => $_POST["BINDING"], "MODULE_ID" => $_POST["MODULE_ID"]);
if ($ID > 0 && $COPY_ID <= 0) {
CTask::UpdateModuleRights($ID, $_POST["MODULE_ID"], $LETTER);
CTask::Update($arFields, $ID);
} 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) {
示例3: array
return false;
}
return true;
}
$arFilter = array();
if (CheckFilter($arFilterFields)) {
$arFilter = array("ID" => $find != '' && $find_type == "id" ? $find : $find_id, "LETTER" => $find_letter, "MODULE_ID" => $find_module_id, "SYS" => $find_sys, "BINDING" => $find_binding);
}
// обработка редактирования (права доступа!)
if ($lAdmin->EditAction() && $USER->CanDoOperation('edit_tasks')) {
foreach ($FIELDS as $ID => $arFields) {
$ID = IntVal($ID);
if (!$lAdmin->IsUpdated($ID)) {
continue;
}
CTask::Update($ID, $arFields);
}
}
// обработка действий групповых и одиночных
if (($arID = $lAdmin->GroupAction()) && $USER->CanDoOperation('edit_tasks')) {
if ($_REQUEST['action_target'] == 'selected') {
$arID = array();
$rsData = CTask::GetList(array($by => $order), $arFilter);
while ($arRes = $rsData->Fetch()) {
$arID[] = $arRes['ID'];
}
}
if ($_REQUEST['action'] == "delete") {
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;