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


PHP CTask::Add方法代码示例

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


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

示例1: array

        CGroup::SetModulePermission($NEW_GROUP_ID, $arTask["MODULE_ID"], $arTask["ID"]);
    }
}
$userGroupID = "";
$dbGroup = CGroup::GetList($by = "", $order = "", array("STRING_ID" => "sale_administrator"));
if ($arGroup = $dbGroup->Fetch()) {
    $userGroupID = $arGroup["ID"];
} 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()) {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:step2.php

示例2: 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

示例3: intval

$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) {
            CTask::SetOperations($ID, $arOperationIds);
        }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:task_edit.php

示例4: array

    die;
}
COption::SetOptionString('socialnetwork', 'allow_tooltip', 'N', false, $site_id);
$userGroupID = "";
$dbGroup = CGroup::GetList($by = "", $order = "", array("STRING_ID" => "content_editor"));
if ($arGroup = $dbGroup->Fetch()) {
    $userGroupID = $arGroup["ID"];
} else {
    $group = new CGroup();
    $arFields = array("ACTIVE" => "Y", "C_SORT" => 300, "NAME" => GetMessage("TASK_WIZARD_CONTENT_EDITOR"), "DESCRIPTION" => GetMessage("TASK_WIZARD_CONTENT_EDITOR_DESCR"), "USER_ID" => array(), "STRING_ID" => "content_editor");
    $userGroupID = $group->Add($arFields);
    $DB->Query("INSERT INTO b_sticker_group_task(GROUP_ID, TASK_ID)\tSELECT " . intVal($userGroupID) . ", ID FROM b_task WHERE NAME='stickers_edit' AND MODULE_ID='fileman'", false, "FILE: " . __FILE__ . "<br> LINE: " . __LINE__);
}
if (IntVal($userGroupID) > 0) {
    WizardServices::SetFilePermission(array($siteID, "/bitrix/admin"), array($userGroupID => "R"));
    $new_task_id = CTask::Add(array("NAME" => GetMessage("TASK_WIZARD_CONTENT_EDITOR"), "DESCRIPTION" => GetMessage("TASK_WIZARD_CONTENT_EDITOR_DESC"), "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"]);
    }
    $rsTasks = CTask::GetList(array(), array("MODULE_ID" => "fileman", "SYS" => "Y", "BINDIG" => "module", "LETTER" => "F"));
    if ($arTask = $rsTasks->Fetch()) {
        CGroup::SetModulePermission($userGroupID, $arTask["MODULE_ID"], $arTask["ID"]);
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:group.php


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