當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CIBlockElement::WF_GetCurrentStatus方法代碼示例

本文整理匯總了PHP中CIBlockElement::WF_GetCurrentStatus方法的典型用法代碼示例。如果您正苦於以下問題:PHP CIBlockElement::WF_GetCurrentStatus方法的具體用法?PHP CIBlockElement::WF_GetCurrentStatus怎麽用?PHP CIBlockElement::WF_GetCurrentStatus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CIBlockElement的用法示例。


在下文中一共展示了CIBlockElement::WF_GetCurrentStatus方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _CIBlockError

			// 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"));
				$errorTriger = true;
			}
			elseif($STATUS_ID==1)
			{
				$WF_ID = $ID;
				$STATUS_ID = CIBlockElement::WF_GetCurrentStatus($WF_ID, $STATUS_TITLE);
				$STATUS_PERMISSION = CIBlockElement::WF_GetStatusPermission($STATUS_ID);
			}

			if (!$errorTriger)
			{
				// check if document is locked
				$isLocked = CIBlockElement::WF_IsLocked($ID, $locked_by, $date_lock);
				if($isLocked)
				{
					if($locked_by > 0)
					{
						$rsUser = CUser::GetList(($by="ID"), ($order="ASC"), array("ID_EQUAL_EXACT" => $locked_by));
						if($arUser = $rsUser->GetNext())
							$locked_by = rtrim("[".$arUser["ID"]."] (".$arUser["LOGIN"].") ".$arUser["NAME"]." ".$arUser["LAST_NAME"]);
					}
開發者ID:ASDAFF,項目名稱:entask.ru,代碼行數:31,代碼來源:iblock_element_edit.php

示例2: ShowError

 if (!CModule::IncludeModule("iblock")) {
     $this->AbortResultCache();
     ShowError(GetMessage("IBLOCK_MODULE_NOT_INSTALLED"));
     return;
 }
 if ($arParams["ELEMENT_ID"] > 0) {
     $ELEMENT_ID = $arParams["ELEMENT_ID"];
 } else {
     //Handle case when ELEMENT_CODE used
     $ELEMENT_ID = CIBlockFindTools::GetElementID($arParams["ELEMENT_ID"], $arParams["ELEMENT_CODE"], false, false, array("IBLOCK_ACTIVE" => "Y", "IBLOCK_ID" => $arParams["IBLOCK_ID"], "ACTIVE_DATE" => "Y", "ACTIVE" => "Y", "CHECK_PERMISSIONS" => "Y"));
 }
 if ($ELEMENT_ID) {
     $WF_SHOW_HISTORY = "N";
     if ($arParams["SHOW_WORKFLOW"] && CModule::IncludeModule("workflow")) {
         $WF_ELEMENT_ID = CIBlockElement::WF_GetLast($ELEMENT_ID);
         $WF_STATUS_ID = CIBlockElement::WF_GetCurrentStatus($WF_ELEMENT_ID, $WF_STATUS_TITLE);
         $WF_STATUS_PERMISSION = CIBlockElement::WF_GetStatusPermission($WF_STATUS_ID);
         if ($WF_STATUS_ID == 1 || $WF_STATUS_PERMISSION < 1) {
             $WF_ELEMENT_ID = $ELEMENT_ID;
         } else {
             $WF_SHOW_HISTORY = "Y";
         }
         $ELEMENT_ID = $WF_ELEMENT_ID;
     }
     //SELECT
     $arSelect = array_merge($arParams["FIELD_CODE"], array("ID", "CODE", "IBLOCK_ID", "IBLOCK_SECTION_ID", "SECTION_PAGE_URL", "NAME", "DETAIL_PICTURE", "PREVIEW_PICTURE", "DETAIL_TEXT", "DETAIL_PAGE_URL", "PREVIEW_TEXT_TYPE", "DETAIL_TEXT_TYPE"));
     $bGetProperty = count($arParams["PROPERTY_CODE"]) > 0 || $arParams["BROWSER_TITLE"] != "-" || $arParams["META_KEYWORDS"] != "-" || $arParams["META_DESCRIPTION"] != "-";
     if ($bGetProperty) {
         $arSelect[] = "PROPERTY_*";
     }
     //WHERE
開發者ID:k-kalashnikov,項目名稱:geekcon_new,代碼行數:31,代碼來源:component.php

示例3: CheckWebRights


//.........這裏部分代碼省略.........
                             $arError[] = array("id" => "", "text" => GetMessage("WD_ACCESS_DENIED"));
                         }
                     } else {
                         $res = $this->GetPermission($type, $arElement['item_id'], 'section_delete', false);
                         if (!$res) {
                             $arError[] = array("id" => "", "text" => GetMessage("WD_ACCESS_DENIED"));
                         }
                     }
                 } elseif ($action == 'destroy') {
                     //arElement
                     $id = $arElement['item_id'];
                     $type = $arElement['is_dir'] ? 'SECTION' : 'ELEMENT';
                     $op = $arElement['is_dir'] ? 'section_delete' : 'element_delete';
                     if (!$this->GetPermission($type, $id, $op, false)) {
                         $arError[] = array("id" => "", "text" => GetMessage("WD_ACCESS_DENIED"));
                     }
                 } elseif ($action == 'edit' || $action == 'lock' || $action == 'proppatch' || $action == 'delete_dropped') {
                     //arElement
                     $id = $arElement['item_id'];
                     $type = $arElement['is_dir'] ? 'SECTION' : 'ELEMENT';
                     if ($arElement['is_dir']) {
                         if (!$this->GetPermission($type, $id, 'section_edit')) {
                             $arError[] = array("id" => "", "text" => GetMessage("WD_ACCESS_DENIED"));
                         }
                     } else {
                         if ($arElement["LOCK_STATUS_BP"] == "red") {
                             $arError[] = array("id" => "locked", "text" => GetMessage("WD_FILE_ERROR107"));
                         } elseif ($this->check_creator && $arElement["CREATED_BY"] != $GLOBALS["USER"]->GetID()) {
                             $arError[] = array("id" => "bad_author", "text" => GetMessage("WD_FILE_ERROR108"));
                         } elseif ($this->GetPermission($type, $id, 'element_edit_any_wf_status')) {
                             true;
                         } elseif ($this->workflow == "workflow" && $this->GetPermission($type, $id, 'element_edit')) {
                             $arWorkFlow = array("LAST_ID" => CIBlockElement::WF_GetLast($arElement["item_id"]));
                             $arWorkFlow["STATUS_ID"] = CIBlockElement::WF_GetCurrentStatus($arWorkFlow["LAST_ID"], $arWorkFlow["STATUS_TITLE"]);
                             $arWorkFlow["STATUS_PERMISSION"] = CIBlockElement::WF_GetStatusPermission($arWorkFlow["STATUS_ID"]);
                             if ($arWorkFlow["STATUS_ID"] > 1 && $arWorkFlow["STATUS_PERMISSION"] < 2) {
                                 $arError[] = array("id" => "bad_wf_status_permission", "text" => GetMessage("WD_FILE_ERROR109"));
                             }
                         } elseif ($this->workflow == 'bizproc' && $this->GetPermission($type, $id, 'element_edit')) {
                             $documentId = $this->wfParams['DOCUMENT_TYPE'];
                             $documentId[2] = $arElement["item_id"];
                             $arDocumentStates = CBPDocument::GetDocumentStates($this->wfParams['DOCUMENT_TYPE'], $documentId);
                             $arUserGroups = $this->USER["GROUPS"];
                             if ($arElement["CREATED_BY"] == $GLOBALS["USER"]->GetID()) {
                                 $arUserGroups[] = "Author";
                             }
                             if (!CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::WriteDocument, $GLOBALS["USER"]->GetID(), $documentId, array("IBlockPermission" => $this->permission, "AllUserGroups" => $arUserGroups, "DocumentStates" => $arDocumentStates))) {
                                 $arError[] = array("id" => "bad_bizproc_permision", "text" => GetMessage("WD_ACCESS_DENIED"));
                             }
                         } else {
                             $arError[] = array("id" => "bad_permision", "text" => GetMessage("WD_ACCESS_DENIED"));
                         }
                     }
                 } elseif ($action == 'read' || $action == 'propfind') {
                     //arElement, null
                     if ($arElement) {
                         $id = $arElement['item_id'];
                         $type = $arElement['is_dir'] ? 'SECTION' : 'ELEMENT';
                         $op = $arElement['is_dir'] ? 'section_read' : 'element_read';
                         if (!$this->GetPermission($type, $id, $op)) {
                             $arError[] = array("id" => "bad_permision", "text" => GetMessage("WD_ACCESS_DENIED"));
                         }
                         if ($type == 'SECTION' && $id == $this->GetMetaID('TRASH')) {
                             if (!$this->GetPermission($type, $id, 'section_delete')) {
                                 $arError[] = array("id" => "bad_permision", "text" => GetMessage("WD_ACCESS_DENIED"));
                             }
開發者ID:mrdeadmouse,項目名稱:u136006,代碼行數:67,代碼來源:iblock.php


注:本文中的CIBlockElement::WF_GetCurrentStatus方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。