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


PHP CBPDocument::delegateTasks方法代码示例

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


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

示例1: isset

if ($allowAdminAccess && !empty($_REQUEST['action']) && check_bitrix_sessid()) {
    $ids = isset($_REQUEST['ID']) && is_array($_REQUEST['ID']) ? $_REQUEST['ID'] : array();
    if ($ids) {
        $errors = array();
        $action = $_REQUEST['action'];
        $status = 0;
        if (strpos($action, 'set_status_') === 0) {
            $status = substr($action, strlen('set_status_'));
            $action = 'set_status';
        }
        foreach ($ids as $id) {
            list($taskId, $userId) = explode('_', $id);
            if ($action == 'set_status' && $status > 0) {
                CBPDocument::setTasksUserStatus($userId, $status, $taskId, $errors);
            } elseif ($action == 'delegate' && !empty($_REQUEST['delegate_to'])) {
                CBPDocument::delegateTasks($userId, $_REQUEST['delegate_to'], $taskId, $errors);
            }
        }
        if ($errors) {
            foreach ($errors as $error) {
                $actionErrorMessage .= $error . PHP_EOL;
            }
        }
        unset($ids, $errors, $action, $status, $taskId, $userId);
    }
}
if ($actionErrorMessage) {
    $lAdmin->BeginPrologContent();
    CAdminMessage::ShowMessage($actionErrorMessage);
    $lAdmin->EndPrologContent();
}
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:task_list.php

示例2: array

 $arResult["SORT"] = $gridSort["sort"];
 $arResult["RECORDS"] = array();
 if (!empty($_REQUEST['action_button_' . $arResult["GRID_ID"]]) && check_bitrix_sessid()) {
     $action = $_REQUEST['action_button_' . $arResult["GRID_ID"]];
     $ids = isset($_REQUEST['ID']) && is_array($_REQUEST['ID']) ? $_REQUEST['ID'] : null;
     if (isset($_REQUEST['action_all_rows_' . $arResult["GRID_ID"]]) && $_REQUEST['action_all_rows_' . $arResult["GRID_ID"]] == 'Y') {
         $ids = array();
     }
     if (is_array($ids)) {
         if (strpos($action, 'set_status_') === 0) {
             $status = substr($action, strlen('set_status_'));
             CBPDocument::setTasksUserStatus($targetUserId, $status, $ids, $arResult['ERRORS']);
         }
         if ($action == 'delegate_to' && !empty($_REQUEST['ACTION_DELEGATE_TO_ID'])) {
             if ($isAdmin || CBPHelper::checkUserSubordination($currentUserId, $_REQUEST['ACTION_DELEGATE_TO_ID'])) {
                 CBPDocument::delegateTasks($targetUserId, $_REQUEST['ACTION_DELEGATE_TO_ID'], $ids, $arResult['ERRORS']);
             } else {
                 $arResult['ERRORS'][] = GetMessage('BPATL_ERROR_DELEGATE');
             }
         }
     }
 }
 $dbRecordsList = CBPTaskService::GetList($gridSort["sort"], $arFilter, false, $gridOptions->GetNavParams(), $arSelectFields);
 $arResult['IS_MY_TASKS'] = $currentUserId == $targetUserId;
 $arResult['TARGET_USER_ID'] = (int) $targetUserId;
 $useComments = (bool) CModule::IncludeModule("forum");
 $workflows = array();
 while ($arRecord = $dbRecordsList->getNext()) {
     if ($useComments) {
         $workflows[] = 'WF_' . $arRecord['WORKFLOW_ID'];
     }
开发者ID:k-kalashnikov,项目名称:geekcon,代码行数:31,代码来源:component.php

示例3: array

     if ($_POST["action"] == "doTask") {
         $arErrorsTmp = array();
         if (CBPDocument::PostTaskForm($arTask, $userId, $_REQUEST + $_FILES, $arErrorsTmp, $USER->GetFormattedName(false))) {
             $showType = "Success";
             if (strlen($backUrl) > 0) {
                 LocalRedirect($backUrl);
                 die;
             }
         } else {
             foreach ($arErrorsTmp as $e) {
                 $errorMessage .= $e["message"] . ".<br />";
             }
         }
     } elseif ($_POST["action"] == "delegate" && $showType == 'Form' && $allowAdminAccess && !empty($_POST['delegate_to']) && $arTask["USER_ID"] != $_POST['delegate_to']) {
         $errors = array();
         CBPDocument::delegateTasks($arTask["USER_ID"], $_POST['delegate_to'], $arTask['ID'], $errors);
         if ($errors) {
             $errorMessage .= $errors[0] . '.';
         } else {
             LocalRedirect($backUrl);
         }
     }
 }
 require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
 $aMenu = array(array("TEXT" => GetMessage("BPAT_BACK"), "LINK" => $backUrl, "ICON" => "btn_list"));
 if ($showType == 'Form' && $allowAdminAccess) {
     $aMenu[] = array("TEXT" => GetMessage('BPAT_ACTION_DELEGATE'), 'ONCLICK' => 'bizprocShowDelegateDialog();');
 }
 $context = new CAdminContextMenu($aMenu);
 $context->Show();
 $APPLICATION->SetTitle(str_replace("#ID#", $taskId, GetMessage("BPAT_TITLE")));
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:task.php

示例4: substr

global $APPLICATION, $USER;
$SITE_ID = '';
if (isset($_REQUEST["SITE_ID"]) && is_string($_REQUEST["SITE_ID"])) {
    $SITE_ID = substr(preg_replace("/[^a-z0-9_]/i", "", $_REQUEST["SITE_ID"]), 0, 2);
}
if ($SITE_ID != '') {
    define("SITE_ID", $SITE_ID);
}
require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php';
\Bitrix\Main\Localization\Loc::loadLanguageFile(__FILE__);
if (!check_bitrix_sessid() || !$USER->IsAuthorized()) {
    die;
}
if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'delegate') {
    CModule::IncludeModule('bizproc');
    $isAdmin = $USER->IsAdmin() || CModule::IncludeModule('bitrix24') && CBitrix24::IsPortalAdmin($USER->GetID());
    $errors = array();
    if (!empty($_REQUEST['task_id']) && !empty($_REQUEST['from_user_id']) && !empty($_REQUEST['to_user_id']) && ($isAdmin || CBPHelper::checkUserSubordination($USER->GetID(), $_REQUEST['to_user_id']))) {
        if (!CBPDocument::delegateTasks($_REQUEST['from_user_id'], $_REQUEST['to_user_id'], $_REQUEST['task_id'], $errors)) {
            $errors[] = GetMessage('BPAT_DELEGATE_NOTASKS');
        }
    } else {
        $errors[] = GetMessage('BPAT_DELEGATE_ERROR');
    }
    $message = $errors ? $errors[0] : GetMessage('BPAT_DELEGATE_SUCCESS');
    echo CUtil::PhpToJSObject(array('message' => $message, 'success' => empty($errors)));
} else {
    $APPLICATION->ShowAjaxHead();
    $APPLICATION->IncludeComponent('bitrix:intranet.user.selector.new', '.default', array('MULTIPLE' => 'N', 'NAME' => 'bp_task_delegate', 'SHOW_EXTRANET_USERS' => 'NONE', 'NAME_TEMPLATE' => COption::GetOptionString("bizproc", "name_template", CSite::GetNameFormat(false), SITE_ID), 'ON_SELECT' => 'BX.Bizproc.delegationOnSelect', 'SITE_ID' => SITE_ID), null, array('HIDE_ICONS' => 'Y'));
}
require $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/epilog_after.php';
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:delegate.php


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