本文整理汇总了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)) {
示例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
示例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;
}