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


PHP CSocNetFeaturesPerms::CurrentUserCanPerformOperation方法代码示例

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


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

示例1: filterByFeaturePerms

function filterByFeaturePerms(&$arGroups, $arFeaturePerms)
{
    $arGroupsIDs = array();
    foreach ($arGroups as $value) {
        $arGroupsIDs[] = $value["ID"];
    }
    if (sizeof($arGroupsIDs) > 0) {
        $feature = $arFeaturePerms[0];
        $operations = $arFeaturePerms[1];
        if (!is_array($operations)) {
            $operations = explode(",", $operations);
        }
        $arGroupsPerms = array();
        foreach ($operations as $operation) {
            $tmpOps = CSocNetFeaturesPerms::CurrentUserCanPerformOperation(SONET_ENTITY_GROUP, $arGroupsIDs, $feature, $operation);
            if (is_array($tmpOps)) {
                foreach ($tmpOps as $key => $val) {
                    if (!$arGroupsPerms[$key]) {
                        $arGroupsPerms[$key] = $val;
                    }
                }
            }
        }
        $arGroupsActive = CSocNetFeatures::IsActiveFeature(SONET_ENTITY_GROUP, $arGroupsIDs, $arFeaturePerms[0]);
        foreach ($arGroups as $key => $group) {
            if (!$arGroupsActive[$group["ID"]] || !$arGroupsPerms[$group["ID"]]) {
                unset($arGroups[$key]);
            }
        }
    }
    $arGroups = array_values($arGroups);
}
开发者ID:Satariall,项目名称:izurit,代码行数:32,代码来源:functions.php

示例2: getGroupFeatureAccess

	public static function getGroupFeatureAccess($arFields)
	{
		global $arSocNetFeaturesSettings;

		$groupID = intval($arFields["GROUP_ID"]);
		$feature = trim($arFields["FEATURE"]);
		$operation = trim($arFields["OPERATION"]);

		if ($groupID <= 0)
		{
			throw new Exception("Wrong socialnetwork group ID");
		}

		if (
			strlen($feature) <= 0
			|| !array_key_exists($feature, $arSocNetFeaturesSettings)
			|| !array_key_exists("allowed", $arSocNetFeaturesSettings[$feature])
			|| !in_array(SONET_ENTITY_GROUP, $arSocNetFeaturesSettings[$feature]["allowed"])
		)
		{
			throw new Exception("Wrong feature");
		}

		if (
			strlen($operation) <= 0
			|| !array_key_exists("operations", $arSocNetFeaturesSettings[$feature])
			|| !array_key_exists($operation, $arSocNetFeaturesSettings[$feature]["operations"])
		)
		{
			throw new Exception("Wrong operation");
		}

		return CSocNetFeaturesPerms::CurrentUserCanPerformOperation(SONET_ENTITY_GROUP, $groupID, $feature, $operation);
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:34,代码来源:rest.php

示例3: ob_get_contents

                 $jsonReply['tasksRenderJSON'] = ob_get_contents();
             }
             ob_end_clean();
         }
     }
 } elseif ($_POST["mode"] == "add" && strlen(trim($_POST["title"])) > 0 && intval($_POST["responsible"]) > 0 && in_array($_POST["priority"], array(0, 1, 2)) && is_object($USER) && $USER->IsAuthorized()) {
     $columnsOrder = null;
     if (isset($_POST['columnsOrder'])) {
         $columnsOrder = array_map('intval', $_POST['columnsOrder']);
     }
     $arFields = array("TITLE" => trim($_POST["title"]), "DESCRIPTION" => trim($_POST["description"]), "RESPONSIBLE_ID" => intval($_POST["responsible"]), "PRIORITY" => $_POST["priority"], "SITE_ID" => $SITE_ID, "NAME_TEMPLATE" => $nameTemplate, 'DESCRIPTION_IN_BBCODE' => 'Y');
     if (isset($_POST['group']) && $_POST['group'] > 0) {
         $GROUP_ID = (int) $_POST['group'];
     }
     if ($GROUP_ID > 0) {
         if (CSocNetFeaturesPerms::CurrentUserCanPerformOperation(SONET_ENTITY_GROUP, $GROUP_ID, "tasks", "create_tasks")) {
             $arFields["GROUP_ID"] = $GROUP_ID;
         }
     }
     if ($DB->FormatDate($_POST["deadline"], CSite::GetDateFormat("FULL"))) {
         $arFields["DEADLINE"] = $_POST["deadline"];
     }
     $depth = intval($_POST["depth"]);
     if (intval($_POST["parent"]) > 0) {
         $arFields["PARENT_ID"] = intval($_POST["parent"]);
     }
     $arFields["STATUS"] = $status;
     $task = new CTasks();
     $ID = $task->Add($arFields);
     if ($ID) {
         $rsTask = CTasks::GetByID($ID);
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:ajax.php

示例4: SaveTask

 public static function SaveTask($tasksData)
 {
     $rc = false;
     if (!$GLOBALS['USER']->IsAuthorized()) {
         return false;
     }
     $delegateToUser = false;
     if (isset($tasksData['META::DELEGATE_TO_USER'])) {
         $delegateToUser = (int) $tasksData['META::DELEGATE_TO_USER'];
     }
     $bDelegate = false;
     if ($delegateToUser > 0) {
         $bDelegate = true;
     }
     $curUserId = (int) $GLOBALS['USER']->GetID();
     if (!CModule::IncludeModule('socialnetwork')) {
         return false;
     }
     $arNewTaskFields = false;
     $bErrorOccuredOnTaskCreation = false;
     if (isset($tasksData['TASK_ID']) && check_bitrix_sessid()) {
         $bCreateMode = true;
         if ($tasksData['TASK_ID'] > 0) {
             $bCreateMode = false;
         }
         // We are in edit mode
         if ($bCreateMode && $bDelegate) {
             throw new Exception('$bCreateMode && $bDelegate');
         }
         if (!$bCreateMode && $bDelegate) {
             $arNewTaskFields = array();
             if (intval($delegateToUser) !== $curUserId) {
                 $arNewTaskFields['RESPONSIBLE_ID'] = $delegateToUser;
                 $arNewTaskFields['STATUS'] = CTasks::STATE_PENDING;
                 $rsTask = CTasks::GetByID($tasksData['TASK_ID']);
                 $arTask = $rsTask->Fetch();
                 if (!$arTask || !isset($arTask['ID'])) {
                     return false;
                 }
                 if (sizeof($arTask['AUDITORS'] > 0)) {
                     if (!in_array($curUserId, $arTask['AUDITORS'])) {
                         $arNewTaskFields['AUDITORS'] = $arTask['AUDITORS'];
                         $arNewTaskFields['AUDITORS'][] = $curUserId;
                     }
                 } else {
                     $arNewTaskFields['AUDITORS'] = array($curUserId);
                 }
             } else {
                 return false;
             }
         } else {
             $arNewTaskFields = array('TITLE' => $tasksData['TITLE'], 'DESCRIPTION' => $tasksData['DESCRIPTION'], 'RESPONSIBLE_ID' => $tasksData['RESPONSIBLE_ID'], 'PRIORITY' => $tasksData['PRIORITY'], 'DEADLINE' => CAllDatabase::FormatDate(str_replace('T', ' ', $tasksData['DEADLINE']), 'YYYY-MM-DD HH:MI:SS', FORMAT_DATETIME));
             if (isset($tasksData['ACCOMPLICES'])) {
                 if ($tasksData['ACCOMPLICES'] == -1) {
                     $arNewTaskFields['ACCOMPLICES'] = array();
                 } else {
                     $arNewTaskFields['ACCOMPLICES'] = $tasksData['ACCOMPLICES'];
                 }
             }
             if (isset($tasksData['AUDITORS'])) {
                 if ($tasksData['AUDITORS'] == -1) {
                     $arNewTaskFields['AUDITORS'] = array();
                 } else {
                     $arNewTaskFields['AUDITORS'] = $tasksData['AUDITORS'];
                 }
             }
             $arNewTaskFields['GROUP_ID'] = 0;
             if (isset($tasksData['GROUP_ID']) && intval($tasksData['GROUP_ID']) > 0) {
                 if (CSocNetFeaturesPerms::CurrentUserCanPerformOperation(SONET_ENTITY_GROUP, (int) $tasksData['GROUP_ID'], 'tasks', 'create_tasks')) {
                     $arNewTaskFields['GROUP_ID'] = (int) $tasksData['GROUP_ID'];
                 } else {
                     unset($arNewTaskFields['GROUP_ID']);
                 }
             }
             if ($bCreateMode) {
                 $arNewTaskFields['CREATED_BY'] = $curUserId;
             }
         }
         if (isset($tasksData['META::EVENT_GUID'])) {
             $arNewTaskFields['META::EVENT_GUID'] = $tasksData['META::EVENT_GUID'];
         }
         if ($bCreateMode) {
             $arNewTaskFields['ID'] = 0;
         } else {
             $arNewTaskFields['ID'] = (int) $tasksData['TASK_ID'];
         }
         $oTask = new CTasks();
         if (!$bCreateMode) {
             $rc = $oTask->Update($arNewTaskFields['ID'], $arNewTaskFields);
         } else {
             $arNewTaskFields['MULTITASK'] = 'N';
             $arNewTaskFields['DESCRIPTION_IN_BBCODE'] = 'Y';
             // Only creator or priveleged user can set responsible person.
             $arNewTaskFields['RESPONSIBLE_ID'] = $curUserId;
             if ($arNewTaskFields['CREATED_BY'] === $curUserId || $GLOBALS['USER']->IsAdmin() || CTasksTools::IsPortalB24Admin()) {
                 $arNewTaskFields['RESPONSIBLE_ID'] = (int) $tasksData['RESPONSIBLE_ID'];
             }
             $arNewTaskFields['SITE_ID'] = SITE_ID;
             $rc = $oTask->Add($arNewTaskFields);
             if ($rc > 0) {
//.........这里部分代码省略.........
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:101,代码来源:ajax.php

示例5: GetSocnetGroupFilteredByFeaturePerms

	private static function GetSocnetGroupFilteredByFeaturePerms(&$arGroups, $arFeaturePerms)
	{
		$arGroupsIDs = array();
		foreach($arGroups as $value)
		{
			$arGroupsIDs[] = $value["id"];
		}

		if (sizeof($arGroupsIDs) > 0)
		{
			$feature = $arFeaturePerms[0];
			$operations = $arFeaturePerms[1];
			if (!is_array($operations))
				$operations = explode(",", $operations);
			$arGroupsPerms = array();
			foreach($operations as $operation)
			{
				$tmpOps = CSocNetFeaturesPerms::CurrentUserCanPerformOperation(SONET_ENTITY_GROUP, $arGroupsIDs, $feature, $operation);
				foreach($tmpOps as $key=>$val)
					if (!$arGroupsPerms[$key])
						$arGroupsPerms[$key] = $val;
			}
			$arGroupsActive = CSocNetFeatures::IsActiveFeature(SONET_ENTITY_GROUP, $arGroupsIDs, $arFeaturePerms[0]);
			foreach ($arGroups as $key=>$group)
				if (!$arGroupsActive[$group["id"]] || !$arGroupsPerms[$group["id"]])
					unset($arGroups[$key]);
		}
	}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:28,代码来源:log_destination.php

示例6: unset

    if (is_array($baseTemplate)) {
        $arResult["DATA"]['BASE_TEMPLATE_DATA'] = $baseTemplate;
    } else {
        unset($arResult["DATA"]['BASE_TEMPLATE_ID']);
    }
}
// groups
$rsGroups = CSocNetGroup::GetList(array("NAME" => "ASC"), array("SITE_ID" => SITE_ID));
$arResult["GROUPS"] = array();
$groupIDs = array();
while ($group = $rsGroups->GetNext()) {
    $arResult["GROUPS"][$group["ID"]] = $group;
    $groupIDs[] = $group["ID"];
}
if (sizeof($groupIDs) > 0) {
    $arGroupsPerms = CSocNetFeaturesPerms::CurrentUserCanPerformOperation(SONET_ENTITY_GROUP, $groupIDs, "tasks", "create_tasks");
    foreach ($arResult["GROUPS"] as $key => $group) {
        if (!$arGroupsPerms[$group["ID"]]) {
            unset($arResult["GROUPS"][$key]);
        }
    }
}
$sTitle = "";
if ($arResult["ACTION"] == "edit") {
    $sTitle = str_replace("#TEMPLATE_ID#", $arParams["TEMPLATE_ID"], GetMessage("TASKS_TITLE_EDIT_TEMPLATE"));
} else {
    $sTitle = GetMessage("TASKS_TITLE_CREATE_TEMPLATE");
}
if ($arParams["SET_TITLE"] == "Y") {
    $APPLICATION->SetTitle($sTitle);
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例7: array_merge

    $template = '.default';
    if (defined('SITE_TEMPLATE_ID') && SITE_TEMPLATE_ID === 'bitrix24') {
        $template = 'bitrix24';
    }
    $ynNotGroupList = 'Y';
    if ($arParams['GROUP_ID'] != 0) {
        $ynNotGroupList = 'N';
    }
    $arComponentParams = array_merge($arComponentParams, array('SHOW_TAB_PANEL' => 'Y', 'VIEW_COUNTERS' => $arResult['VIEW_COUNTERS'], 'SHOW_SECTIONS_BAR' => 'Y', 'SHOW_FILTER_BAR' => 'Y', 'SHOW_COUNTERS_BAR' => $ynNotGroupList, 'SHOW_SECTION_PROJECTS' => $ynNotGroupList, 'SHOW_SECTION_MANAGE' => 'A', 'SHOW_SECTION_COUNTERS' => $ynNotGroupList, 'MARK_ACTIVE_ROLE' => 'Y'));
    $filterName = '';
    if (strlen($arResult['SELECTED_PRESET_NAME'])) {
        $filterName .= ': ' . htmlspecialcharsbx($arResult['SELECTED_PRESET_NAME']);
    }
    $arComponentParams['SELECTED_PRESET_NAME'] = $arResult['SELECTED_PRESET_NAME'];
    $arComponentParams['ADDITIONAL_HTML'] = '';
    $arComponentParams['SHOW_TASK_LIST_MODES'] = 'N';
    if ($arParams['USER_ID'] > 0) {
        $arComponentParams['PATH_TO_PROJECTS'] = CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_USER_TASKS_PROJECTS_OVERVIEW'], array('user_id' => $arParams['USER_ID']));
    }
    if (intval($arParams['GROUP_ID']) && !CSocNetFeaturesPerms::CurrentUserCanPerformOperation(SONET_ENTITY_GROUP, $arParams['GROUP_ID'], "tasks", "create_tasks")) {
        $arComponentParams['SHOW_ADD_TASK_BUTTON'] = 'N';
        $arComponentParams['SHOW_QUICK_TASK_ADD'] = 'N';
        $arComponentParams['SHOW_TEMPLATES_TOOLBAR'] = 'N';
    }
    $APPLICATION->IncludeComponent('bitrix:tasks.list.controls', $template, $arComponentParams, null, array('HIDE_ICONS' => 'Y'));
}
?>

<script>tasksListTemplateDefaultInit()</script>
<script>tasksListTemplateDefaultTableViewInit()</script>
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:30,代码来源:template.php

示例8: empty

}
if (!isset($arParams['USE_FILTER_V2'])) {
    $arParams['USE_FILTER_V2'] = COption::GetOptionString('tasks', '~use_filter_v1', null) != '1';
} else {
    $arParams['USE_FILTER_V2'] = $arParams['USE_FILTER_V2'] === 'Y' ? true : false;
}
$arParams['NAME_TEMPLATE'] = empty($arParams['NAME_TEMPLATE']) ? CSite::GetNameFormat(false) : str_replace(array("#NOBR#", "#/NOBR#"), array("", ""), $arParams["NAME_TEMPLATE"]);
$arParams["TASK_ID"] = isset($arParams["TASK_ID"]) ? intval($arParams["TASK_ID"]) : 0;
$arResult["ACTION"] = $arParams["TASK_ID"] > 0 ? "edit" : "create";
$arParams["USER_ID"] = intval($arParams["USER_ID"]) > 0 ? intval($arParams["USER_ID"]) : $loggedInUserId;
$arParams["GROUP_ID"] = isset($arParams["GROUP_ID"]) ? intval($arParams["GROUP_ID"]) : 0;
if ($arParams["GROUP_ID"] > 0) {
    $featurePerms = CSocNetFeaturesPerms::CurrentUserCanPerformOperation(SONET_ENTITY_GROUP, array($arParams['GROUP_ID']), 'tasks', 'view_all');
    $bCanViewGroup = is_array($featurePerms) && isset($featurePerms[$arParams['GROUP_ID']]) && $featurePerms[$arParams['GROUP_ID']];
    if (!$bCanViewGroup) {
        $featurePerms = CSocNetFeaturesPerms::CurrentUserCanPerformOperation(SONET_ENTITY_GROUP, array($arParams['GROUP_ID']), 'tasks', 'view');
        $bCanViewGroup = is_array($featurePerms) && isset($featurePerms[$arParams['GROUP_ID']]) && $featurePerms[$arParams['GROUP_ID']];
    }
    if (!$bCanViewGroup) {
        ShowError(GetMessage('TASKS_ACCESS_TO_GROUP_DENIED'));
        return;
    }
}
$bAttachUserFields = false;
if (isset($arParams['ATTACH_USER_FIELDS']) && $arParams['ATTACH_USER_FIELDS'] === 'Y') {
    $bAttachUserFields = true;
}
if ($bAttachUserFields) {
    $arResult['USER_FIELDS'] = array();
} else {
    $arResult['USER_FIELDS'] = false;
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例9: CanCurrentUserViewTopic

 function CanCurrentUserViewTopic($topicID)
 {
     global $USER;
     $isSocNetModuleIncluded = CModule::IncludeModule("socialnetwork");
     if (($topicID = intval($topicID)) && is_object($USER)) {
         if ($USER->IsAdmin() || CTasksTools::IsPortalB24Admin()) {
             return true;
         }
         $rsTask = $res = CTasks::GetList(array(), array("FORUM_TOPIC_ID" => $topicID));
         if ($arTask = $rsTask->Fetch()) {
             if ((int) $arTask['GROUP_ID'] > 0) {
                 if (in_array(CSocNetFeaturesPerms::GetOperationPerm(SONET_ENTITY_GROUP, $arTask["GROUP_ID"], "tasks", "view_all"), array("G2", "AU"))) {
                     return true;
                 } elseif ($isSocNetModuleIncluded && false !== CSocNetFeaturesPerms::CurrentUserCanPerformOperation(SONET_ENTITY_GROUP, $arTask['GROUP_ID'], 'tasks', 'view_all')) {
                     return true;
                 }
             }
             $arTask["ACCOMPLICES"] = $arTask["AUDITORS"] = array();
             $rsMembers = CTaskMembers::GetList(array(), array("TASK_ID" => $arTask["ID"]));
             while ($arMember = $rsMembers->Fetch()) {
                 if ($arMember["TYPE"] == "A") {
                     $arTask["ACCOMPLICES"][] = $arMember["USER_ID"];
                 } elseif ($arMember["TYPE"] == "U") {
                     $arTask["AUDITORS"][] = $arMember["USER_ID"];
                 }
             }
             if (in_array($USER->GetID(), array_unique(array_merge(array($arTask["CREATED_BY"], $arTask["RESPONSIBLE_ID"]), $arTask["ACCOMPLICES"], $arTask["AUDITORS"])))) {
                 return true;
             }
             $dbRes = CUser::GetList($by = 'ID', $order = 'ASC', array('ID' => $arTask["RESPONSIBLE_ID"]), array('SELECT' => array('UF_DEPARTMENT')));
             if (($arRes = $dbRes->Fetch()) && is_array($arRes['UF_DEPARTMENT']) && count($arRes['UF_DEPARTMENT']) > 0) {
                 if (in_array($USER->GetID(), array_keys(CTasks::GetDepartmentManagers($arRes['UF_DEPARTMENT'], $arTask["RESPONSIBLE_ID"])))) {
                     return true;
                 }
             }
         }
     }
     return false;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:39,代码来源:task.php

示例10: tasksRenderJSON

function tasksRenderJSON($arTask, $childrenCount, $arPaths, $bParent = false, $bGant = false, $top = false, $nameTemplate = "", $arAdditionalFields = array(), $bSkipJsMenu = false, array $params = array())
{
    global $USER;
    $arAllowedTaskActions = array();
    if (isset($arTask['META:ALLOWED_ACTIONS'])) {
        $arAllowedTaskActions = $arTask['META:ALLOWED_ACTIONS'];
    } elseif ($arTask['ID']) {
        $oTask = CTaskItem::getInstanceFromPool($arTask['ID'], $USER->getId());
        $arAllowedTaskActions = $oTask->getAllowedTaskActionsAsStrings();
        $arTask['META:ALLOWED_ACTIONS'] = $arAllowedTaskActions;
    }
    $runningTaskId = $runningTaskTimer = null;
    if ($arTask['ALLOW_TIME_TRACKING'] === 'Y') {
        $oTimer = CTaskTimerManager::getInstance($USER->getId());
        $runningTaskData = $oTimer->getRunningTask(false);
        $runningTaskId = $runningTaskData['TASK_ID'];
        $runningTaskTimer = time() - $runningTaskData['TIMER_STARTED_AT'];
    }
    $canCreateTasks = false;
    $canEditTasks = false;
    if ($arTask["GROUP_ID"]) {
        $canCreateTasks = \CSocNetFeaturesPerms::CurrentUserCanPerformOperation(SONET_ENTITY_GROUP, $arTask["GROUP_ID"], "tasks", "create_tasks");
        $canEditTasks = \CSocNetFeaturesPerms::CurrentUserCanPerformOperation(SONET_ENTITY_GROUP, $arTask["GROUP_ID"], "tasks", "edit_tasks");
    }
    ?>
	{
		id : <?php 
    echo $arTask["ID"];
    ?>
,
		name : "<?php 
    echo CUtil::JSEscape($arTask["TITLE"]);
    ?>
",
		<?php 
    if ($arTask["GROUP_ID"]) {
        ?>
			projectId : <?php 
        echo $arTask["GROUP_ID"];
        ?>
,
			projectName : '<?php 
        echo CUtil::JSEscape($arTask['GROUP_NAME']);
        ?>
',
			projectCanCreateTasks: <?php 
        echo CUtil::PhpToJSObject($canCreateTasks);
        ?>
,
			projectCanEditTasks: <?php 
        echo CUtil::PhpToJSObject($canEditTasks);
        ?>
,
		<?php 
    }
    ?>
		status : "<?php 
    echo tasksStatus2String($arTask["STATUS"]);
    ?>
",
		realStatus : "<?php 
    echo $arTask["REAL_STATUS"];
    ?>
",
		url: '<?php 
    echo CUtil::JSEscape(CComponentEngine::MakePathFromTemplate($arPaths["PATH_TO_TASKS_TASK"], array("task_id" => $arTask["ID"], "action" => "view")));
    ?>
',
		details: window.top.onDetails,
		priority : <?php 
    echo $arTask["PRIORITY"];
    ?>
,
		mark : <?php 
    echo !$arTask["MARK"] ? "null" : "'" . $arTask["MARK"] . "'";
    ?>
,
		responsible: '<?php 
    echo CUtil::JSEscape(tasksFormatNameShort($arTask["RESPONSIBLE_NAME"], $arTask["RESPONSIBLE_LAST_NAME"], $arTask["RESPONSIBLE_LOGIN"], $arTask["RESPONSIBLE_SECOND_NAME"], $nameTemplate));
    ?>
',
		director: '<?php 
    echo CUtil::JSEscape(tasksFormatNameShort($arTask["CREATED_BY_NAME"], $arTask["CREATED_BY_LAST_NAME"], $arTask["CREATED_BY_LOGIN"], $arTask["CREATED_BY_SECOND_NAME"], $nameTemplate));
    ?>
',
		responsibleId : <?php 
    echo $arTask["RESPONSIBLE_ID"];
    ?>
,
		directorId : <?php 
    echo $arTask["CREATED_BY"];
    ?>
,
		responsible_name: '<?php 
    echo CUtil::JSEscape($arTask["RESPONSIBLE_NAME"]);
    ?>
',
		responsible_second_name: '<?php 
    echo CUtil::JSEscape($arTask["RESPONSIBLE_SECOND_NAME"]);
    ?>
//.........这里部分代码省略.........
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:101,代码来源:tools.php

示例11: array

$bErrorOccuredOnTaskCreation = false;
if (isset($_POST['TASK_ID']) && check_bitrix_sessid()) {
    $bCreateMode = true;
    if ($_POST['TASK_ID'] > 0) {
        $bCreateMode = false;
    }
    // We are in edit mode
    $arNewTaskFields = array('TITLE' => $_POST['TITLE'], 'DESCRIPTION' => $_POST['DESCRIPTION'], 'RESPONSIBLE_ID' => $_POST['RESPONSIBLE_ID'], 'PRIORITY' => $_POST['PRIORITY'], 'DEADLINE' => CAllDatabase::FormatDate(str_replace('T', ' ', $_POST['DEADLINE']), 'YYYY-MM-DD HH:MI:SS', FORMAT_DATETIME));
    if ($bCreateMode) {
        $arNewTaskFields['ID'] = 0;
    } else {
        $arNewTaskFields['ID'] = (int) $_POST['TASK_ID'];
    }
    $arNewTaskFields['GROUP_ID'] = 0;
    if (isset($_POST['GROUP_ID']) && intval($_POST['GROUP_ID']) > 0) {
        if (CSocNetFeaturesPerms::CurrentUserCanPerformOperation(SONET_ENTITY_GROUP, (int) $_POST['GROUP_ID'], 'tasks', 'create_tasks')) {
            $arNewTaskFields['GROUP_ID'] = (int) $_POST['GROUP_ID'];
        } else {
            unset($arNewTaskFields['GROUP_ID']);
        }
    }
    $oTask = new CTasks();
    if (!$bCreateMode) {
        // Only priveleged users can change or set any ORIGINATOR
        $arNewTaskFields['CREATED_BY'] = (int) $GLOBALS['USER']->GetID();
        if ($USER->IsAdmin() || CTasksTools::IsPortalB24Admin()) {
            $arNewTaskFields['CREATED_BY'] = (int) $_POST['CREATED_BY'];
        }
        $rc = $oTask->Update($arNewTaskFields['ID'], $arNewTaskFields);
    } else {
        $arNewTaskFields['MULTITASK'] = 'N';
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php


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