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


PHP CIBlockElement::WF_GetLockStatus方法代码示例

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


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

示例1: WF_IsLocked

 function WF_IsLocked($ID, &$locked_by, &$date_lock)
 {
     if (CIBlockElement::WF_GetLockStatus($ID, $locked_by, $date_lock) == "red") {
         return true;
     } else {
         return false;
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:8,代码来源:iblockelement.php

示例2: array

if (isset($_REQUEST["ACTION"]) && in_array($_REQUEST["ACTION"], array("LOCK", "UNLOCK"))) {
    if (!check_bitrix_sessid()) {
        $APPLICATION->RestartBuffer();
        CUtil::PhpToJSObject(array("result" => "reload"));
        die;
    }
    $options = array("element_id" => $arParams["ELEMENT_ID"], "scope" => "exclusive", "type" => "write", "owner" => $GLOBALS["USER"]->GetLogin());
    if ($_REQUEST["ACTION"] === "LOCK") {
        $res = $ob->LOCK($options);
        $success = intval($res) === 200;
    } elseif ($_REQUEST["ACTION"] === "UNLOCK") {
        $res = $ob->UNLOCK($options);
        $success = intval($res) === 204;
    }
    $res = array();
    $res["LOCK_STATUS"] = CIBlockElement::WF_GetLockStatus($arParams["ELEMENT_ID"], $res['WF_LOCKED_BY'], $res['WF_DATE_LOCK']);
    $lockTill = FormatDate(array("today" => "H:i", "" => preg_replace('/:s$/', '', $DB->DateFormatToPHP(CSite::GetDateFormat("FULL")))), MakeTimeStamp($res['WF_DATE_LOCK']) + 60 * intval(COption::GetOptionString("workflow", "MAX_LOCK_TIME", "60")));
    $status = '';
    if ($res["LOCK_STATUS"] != "green") {
        if ($res['WF_LOCKED_BY'] == $USER->GetID()) {
            $res['LOCKED_USER_NAME'] = $USER->GetFormattedName(false);
        } else {
            $rUser = $USER->GetByID($res["WF_LOCKED_BY"]);
            $arUser = $rUser->Fetch();
            $res['LOCKED_USER_NAME'] = $arUser["NAME"] . (strlen($arUser["NAME"]) <= 0 || strlen($arUser["LAST_NAME"]) <= 0 ? "" : " ") . $arUser["LAST_NAME"];
        }
        $status .= '<div class="element-status-' . $res['LOCK_STATUS'] . '">';
        if ($res['LOCK_STATUS'] == "yellow") {
            $status .= '[' . GetMessage("IBLOCK_YELLOW_MSG", array('#DATE#' => $lockTill)) . ']';
        } else {
            $status .= '[' . GetMessage("IBLOCK_RED_MSG", array('#NAME#' => htmlspecialcharsbx($res['LOCKED_USER_NAME']))) . ']';
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:action.php

示例3: array

    /** @var \Bitrix\Disk\File $diskFile */
    $diskFile = \Bitrix\Disk\File::load(array('XML_ID' => $arResult['ELEMENT']['ID']), array('STORAGE'));
    if ($diskFile) {
        LocalRedirect(\Bitrix\Disk\Driver::getInstance()->getUrlManager()->getPathFileDetail($diskFile));
    }
}
$ob->_get_file_info_arr($arResult["ELEMENT"]);
$arResult["WRITEABLE"] = $arResult['ELEMENT']['SHOW']['EDIT'];
if (in_array($arParams["ACTION"], array("EDIT", "PULL")) && $arParams["DOCUMENT_LOCK"] != "N") {
    CIBlockElement::WF_Lock($arParams["ELEMENT_ID"], $ob->workflow == "workflow");
    /**
     * This part of code is necessary because info about element is got
     * already but information about locking is absent. We can not lock
     * element until check all rulles.
     */
    $arResult["ELEMENT"]["LOCK_STATUS"] = CIBlockElement::WF_GetLockStatus($arParams["ELEMENT_ID"], $arResult['ELEMENT']['WF_LOCKED_BY'], $arResult['ELEMENT']['WF_DATE_LOCK']);
}
/********************************************************************
				Default params
********************************************************************/
CJSCore::Init(array('viewer'));
__prepare_item_info($arResult["ELEMENT"], $arParams);
$arResult["ELEMENT"]['URL']['THIS'] = $ob->_uencode($arResult["ELEMENT"]['URL']['THIS'], array("utf8" => "Y", "convert" => $arParams["CONVERT"]));
$arError = array();
$bVarsFromForm = false;
$CHILD_ID = 0;
/************** Parent element *************************************/
$arResult["ELEMENT_ORIGINAL"] = array();
if (intVal($arResult["ELEMENT"]["WF_PARENT_ELEMENT_ID"]) > 0 && $arResult["ELEMENT"]["WF_PARENT_ELEMENT_ID"] != $arParams["ELEMENT_ID"]) {
    $db_res = CIBlockElement::GetList(array(), array("ID" => $arResult["ELEMENT"]["WF_PARENT_ELEMENT_ID"], "SHOW_NEW" => "Y"));
    if ($db_res && ($obElement = $db_res->GetNextElement())) {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例4: DELETE

 function DELETE($options)
 {
     $options["~path"] = $this->_udecode($options["path"]);
     WDUnpackCookie();
     if (isset($options['path'])) {
         $arPath = explode('/', $options['path']);
         // ms excel tries to create and delete ~\$FileName.xls
         $basename = array_pop($arPath);
         $basename = $this->CorrectName($this->_udecode($basename));
         array_push($arPath, $basename);
         $options['path'] = implode('/', $arPath);
     }
     if (!empty($options["~path"]) && $_SESSION["WEBDAV_DATA"]["PUT_MAC_OS"] == $options["~path"]) {
         $this->IsDir($options);
         $_SESSION["WEBDAV_DATA"]["PUT_MAC_OS"] = "";
         WDPackCookie();
         if (intVal($this->arParams["element_id"]) > 0) {
             $this->_ib_elm_delete($this->arParams["element_id"]);
             return "204 No Content";
         }
         return "404 Not Found";
     } else {
         $this->IsDir($options);
         //symlink logic
         list($contextType, $contextEntityId) = $this->getContextData();
         //we can't forward delete symlink. Only delete symlink section.
         $sectionData = $this->getSectionDataForLinkAnalyze($this->arParams['is_dir'] ? $this->arParams['dir_array']['ID'] : $this->arParams['element_array']['IBLOCK_SECTION_ID'], array(), false);
         if (CWebDavSymlinkHelper::isLink($contextType, $contextEntityId, $sectionData)) {
             //we don't enable symlink mode, because we move to real trash
             $parentSectionData = CWebDavSymlinkHelper::getLinkData($contextType, $contextEntityId, $sectionData);
             if ($parentSectionData) {
                 $linkWebdav = new self($parentSectionData[self::UF_LINK_IBLOCK_ID], $this->base_url . $this->_path, array('ROOT_SECTION_ID' => $parentSectionData[self::UF_LINK_ROOT_SECTION_ID]));
                 return $linkWebdav->DELETE($options);
             } else {
                 return "404 Not Found";
             }
         }
         if (!$this->CheckWebRights("DELETE", array('action' => 'delete', 'arElement' => $this->arParams), false)) {
             return $this->ThrowAccessDenied(__LINE__);
         }
         $resLock = array();
         $lockedBy = $lockedDate = null;
         $resLock["LOCK_STATUS"] = CIBlockElement::WF_GetLockStatus($this->arParams["item_id"], $lockedBy, $lockedDate);
         if ($resLock['LOCK_STATUS'] == 'red' && !$GLOBALS['USER']->CanDoOperation('webdav_change_settings')) {
             return $this->ThrowAccessDenied(__LINE__);
         }
         //delete symlink. Not move to trash
         if (!empty($this->arParams['dir_array'][self::UF_LINK_SECTION_ID])) {
             $options['force'] = true;
         }
         if (!isset($options['force']) && ($this->arParams["is_dir"] === true || intval($this->arParams["element_id"]) > 0)) {
             if ($trashID = $this->GetMetaID("TRASH")) {
                 $item_id = $this->arParams['item_id'];
                 $arSectionsChain = array();
                 $bRootFounded = empty($this->arRootSection) ? true : false;
                 foreach (CWebDavSymlinkHelper::getNavChain($this->IBLOCK_ID, $this->arParams['parent_id']) as $res) {
                     if (!$bRootFounded && $res["ID"] == $this->arRootSection["ID"]) {
                         $bRootFounded = true;
                         continue;
                     }
                     if (!$bRootFounded) {
                         continue;
                     }
                     $arSectionsChain[] = $res["ID"];
                 }
                 if ($item_id == $trashID && $this->arParams["is_dir"]) {
                     if ($this->CheckWebRights("DESTROY", array('action' => 'destroy', 'arElement' => $this->arParams), false)) {
                         if (isset($this->attributes['user_id']) && $this->attributes['user_id'] == $GLOBALS['USER']->GetID()) {
                             //now we clean own bin so simple, so fast
                             $this->runCleaningTrash($trashID);
                         } else {
                             //old cleaning. So-so
                             $this->_delete_section($options["section_id"]);
                         }
                         $this->GetMetaID('TRASH');
                         // create
                         return "204 No Content";
                     } else {
                         return $this->ThrowAccessDenied(__LINE__);
                     }
                 } elseif (!in_array($trashID, $arSectionsChain) && strpos($this->arParams['file_name'], "_\$") !== 0) {
                     return $this->_move_to_trash($options);
                 }
             } else {
                 return "404 Not Found";
             }
         }
         $this->IsDir($options);
         if (!$this->CheckWebRights("DESTROY", array('action' => 'destroy', 'arElement' => $this->arParams), false)) {
             return $this->ThrowAccessDenied(__LINE__);
         }
         if ($this->arParams["is_dir"] === true) {
             if ($this->check_creator) {
                 return $this->ThrowAccessDenied(__LINE__);
             }
             if ($this->_delete_section($options["section_id"]) === true && !empty($this->arParams['dir_array'][self::UF_LINK_SECTION_ID]) && $this->attributes['user_id']) {
                 if (!empty($this->attributes['user_id'])) {
                     CWebDavDiskDispatcher::sendChangeStatus($this->attributes['user_id'], 'delete_symlink');
                 }
                 \Bitrix\Webdav\FolderInviteTable::deleteByFilter(array('=INVITE_USER_ID' => $this->attributes['user_id'], '=IS_APPROVED' => true, '=IBLOCK_ID' => $this->arParams['dir_array'][self::UF_LINK_IBLOCK_ID], '=SECTION_ID' => $this->arParams['dir_array'][self::UF_LINK_SECTION_ID]));
//.........这里部分代码省略.........
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:101,代码来源:iblock.php


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