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


PHP CIBlockElement::WF_IsLocked方法代码示例

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


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

示例1: _CIBlockError

 if ($ID > 0 && $WF == "Y") {
     // get ID of the last record in workflow
     $WF_ID = CIBlockElement::WF_GetLast($ID);
     // check for edit permissions
     $STATUS_ID = CIBlockElement::WF_GetCurrentStatus($WF_ID, $STATUS_TITLE);
     $STATUS_PERMISSION = CIBlockElement::WF_GetStatusPermission($STATUS_ID);
     if ($STATUS_ID > 1 && $STATUS_PERMISSION < 2) {
         $error = new _CIBlockError(1, "ACCESS_DENIED", GetMessage("IBLOCK_ACCESS_DENIED_STATUS"));
         break;
     } elseif ($STATUS_ID == 1) {
         $WF_ID = $ID;
         $STATUS_ID = CIBlockElement::WF_GetCurrentStatus($WF_ID, $STATUS_TITLE);
         $STATUS_PERMISSION = CIBlockElement::WF_GetStatusPermission($STATUS_ID);
     }
     // check if document is locked
     if (CIBlockElement::WF_IsLocked($ID, $locked_by, $date_lock)) {
         if ($locked_by > 0) {
             $by = "ID";
             $order = "ASC";
             $rsUser = CUser::GetList($by, $order, array("ID_EQUAL_EXACT" => $locked_by));
             if ($arUser = $rsUser->GetNext()) {
                 $locked_by = rtrim("[" . $arUser["ID"] . "] (" . $arUser["LOGIN"] . ") " . $arUser["NAME"] . " " . $arUser["LAST_NAME"]);
             }
         }
         $error = new _CIBlockError(2, "BLOCKED", GetMessage("IBLOCK_DOCUMENT_LOCKED", array("#ID#" => $locked_by, "#DATE#" => $date_lock)));
         break;
     }
 } elseif ($bBizproc) {
     $arDocumentStates = CBPDocument::GetDocumentStates(array(MODULE_ID, ENTITY, DOCUMENT_TYPE), $ID > 0 ? array(MODULE_ID, ENTITY, $ID) : null, "Y");
     $arCurrentUserGroups = $USER->GetUserGroupArray();
     if ($ID > 0 && is_array($arElement)) {
开发者ID:vim84,项目名称:b-markt,代码行数:31,代码来源:iblock_subelement_edit.php

示例2: _CIBlockError

				);
				$canRead = false;
			}

			if (!$canWrite && !$canRead)
			{
				$error = new _CIBlockError(1, "ACCESS_DENIED", GetMessage("IBLOCK_ACCESS_DENIED_STATUS"));
				$errorTriger = true;
			}
		}
	}

	$denyAutosave = false;
	if ($bWorkflow)
	{
		$denyAutosave = CIBlockElement::WF_IsLocked($ID, $locked_by1, $date_lock1);
	}
	else
	{
		$denyAutosave = ($view=="Y")
			|| (
				(($ID <= 0) || $bCopy)
				&& !CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $MENU_SECTION_ID, "section_element_bind")
			)
			|| (
				(($ID > 0) && !$bCopy)
				&& !CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ID, "element_edit")
			)
			|| (
				$bBizproc
				&& !$canWrite
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:31,代码来源:iblock_element_edit.php

示例3: IsLocked

 function IsLocked($ID, $IBLOCK_ID, &$params)
 {
     $params = array("locked_by" => 0, "date_lock" => "");
     $bLocked = true;
     if ($ID <= 0 || $IBLOCK_ID <= 0) {
         $bLocked = false;
     } elseif (!CIBlockElement::WF_IsLocked($ID, $locked_by, $date_lock)) {
         $bLocked = false;
     } elseif (intVal($locked_by) == $GLOBALS["USER"]->GetID()) {
         $bLocked = false;
     } elseif (IsModuleInstalled("workflow")) {
         if (CModule::IncludeModule("workflow") && CIBlock::GetArrayByID($IBLOCK_ID, "WORKFLOW") != "N") {
             $bLocked = CWorkflow::IsAdmin() ? false : true;
         }
     }
     $db_res = CUser::GetByID($locked_by);
     if ($db_res && ($arUser = $db_res->GetNext())) {
         $locked_by = '[' . $arUser["ID"] . '] ' . trim($arUser["LAST_NAME"] . " " . $arUser["NAME"]);
     }
     $params = array("locked_by" => $locked_by, "date_lock" => $date_lock);
     return $bLocked;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:22,代码来源:iblock.php


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