Beispiel #1
0
			$f_ID,
			array("IBlockId" => $IBLOCK_ID, "UserGroups" => $USER->GetUserGroupArray(), "AllUserGroups" => $arRes["CURENT_USER_GROUPS"], "DocumentStates" => $arDocumentStates)
		);

		if ($bStartWorkflowPermission)
		{
			$arActions[] = array(
				"ICON" => "",
				"TEXT" => GetMessage("IBLIST_BP_START"),
				"ACTION" => $lAdmin->ActionRedirect('iblock_start_bizproc.php?document_id='.$f_ID.'&document_type=iblock_'.$IBLOCK_ID.'&back_url='.urlencode($APPLICATION->GetCurPageParam("", array("mode", "table_id"))).''),
			);
		}

		if ($lockStatus == "red")
		{
			if (CBPDocument::IsAdmin())
			{
				$arActions[] = Array(
					"ICON" => "unlock",
					"TEXT" => GetMessage("IBLIST_A_UNLOCK"),
					"TITLE" => GetMessage("IBLIST_A_UNLOCK_ALT"),
					"ACTION" => "if(confirm('".GetMessageJS("IBLIST_A_UNLOCK_CONFIRM")."')) ".$lAdmin->ActionDoGroup($f_TYPE.$f_ID, "unlock", $sThisSectionUrl),
				);
			}
		}
		elseif ($bWritePermission)
		{
			$arActions[] = array(
				"ICON" => "edit",
				"TEXT" => GetMessage("IBLOCK_CHANGE"),
				"DEFAULT" => true,
Beispiel #2
0
 function _get_file_info_arr(&$res, $arParams = array())
 {
     global $USER;
     static $arFiles = array();
     static $arBPTemplateStates = array();
     static $arBPParamRequired = array();
     $trashID = $this->GetMetaID('TRASH');
     if ($this->workflow == 'bizproc') {
         if (!isset($arBPParamRequired[$this->IBLOCK_ID])) {
             $arBPParamRequired[$this->IBLOCK_ID] = $this->IsBpParamRequired();
         }
     }
     $info = array();
     if (!in_array($res["ID"], $arFiles)) {
         $res["SHOW"] = array();
         $res["PERMISSION"] = $this->permission;
         $res['SHOW']['SHARED'] = $res['SHARED'];
         $res["~NAME"] = $res["NAME"];
         $res['USER_FIELDS'] = $this->GetUfFields($res['ID']);
         if ($this->permission >= "U") {
             $res["SHOW"]["RIGHTS"] = $this->e_rights && (isset($res['E_RIGHTS']['element_rights_edit']) || $GLOBALS['USER']->CanDoOperation('webdav_change_settings')) ? "Y" : "N";
             if ($this->workflow == 'workflow') {
                 $original = $res;
                 $LAST_ID = CIBlockElement::WF_GetLast($res['ID']);
                 if ($LAST_ID != $res['ID']) {
                     $db_res = CIBlockElement::GetList(array(), array("ID" => $LAST_ID, "SHOW_HISTORY" => "Y"), false, array("nTopCount" => 1), $this->wfParams["selected_fields"]);
                     $res = $db_res->GetNext();
                     $res["FILE"]["FILE_SIZE"] = $this->GetFileSize($res);
                     if ($this->e_rights) {
                         $res['E_RIGHTS'] = $this->GetPermission('ELEMENT', $res['ID']);
                     }
                 }
                 $res["ORIGINAL"] = $original;
                 $res["PERMISSION"] = $original["PERMISSION"];
                 $res["REAL_ID"] = $res["ID"];
                 $res["ID"] = $original["ID"];
                 $res["PROPERTY_WEBDAV_INFO_VALUE"] = $original["PROPERTY_WEBDAV_INFO_VALUE"];
                 $res["PROPERTY_WEBDAV_INFO_VALUE_ID"] = $original["PROPERTY_WEBDAV_INFO_VALUE_ID"];
                 $res["TAGS"] = $original["TAGS"];
                 $res["~TAGS"] = $original["~TAGS"];
                 $res["PREVIEW_TEXT"] = $original["PREVIEW_TEXT"];
                 $res["~PREVIEW_TEXT"] = $original["~PREVIEW_TEXT"];
                 $res["NAME"] = $original["NAME"];
                 $res["~NAME"] = $original["~NAME"];
                 $res["LOCK_STATUS"] = $original["LOCK_STATUS"];
                 $res["LOCKED_USER_NAME"] = $original["LOCKED_USER_NAME"];
                 $res["WF_LOCKED_BY"] = $original["WF_LOCKED_BY"];
                 $res["WF_DATE_LOCK"] = $original["WF_DATE_LOCK"];
                 $res["LAST_ID"] = $LAST_ID;
                 $res["TYPE"] = "E";
                 $res["SHOW"]["COPY"] = "Y";
                 $res["STATUS_ID"] = CIBlockElement::WF_GetCurrentStatus($LAST_ID, $res["STATUS_TITLE"]);
                 $res["STATUS_PERMISSION"] = CIBlockElement::WF_GetStatusPermission($res["STATUS_ID"]);
                 if ($res["STATUS_PERMISSION"] >= 2 || ($this->e_rights ? isset($res['E_RIGHTS']['element_edit_any_wf_status']) : $this->permission >= "W")) {
                     $res["SHOW"]["UNLOCK"] = $res['LOCK_STATUS'] == "yellow" || $res['LOCK_STATUS'] == "red" && CWorkflow::IsAdmin() ? "Y" : "N";
                     $res["SHOW"]["LOCK"] = $res['LOCK_STATUS'] == "green" ? "Y" : "N";
                     $res["PERMISSION"] = $res['LOCK_STATUS'] == "red" && !CWorkflow::IsAdmin() ? "R" : $res["PERMISSION"];
                     // Edit History Delete
                     if ($res['ORIGINAL']['WF_NEW'] == "Y" || $res["WF_STATUS_ID"] <= 1) {
                         $res["SHOW"]["HISTORY"] = $res["SHOW"]["DELETE"] = $res["SHOW"]["EDIT"] = $this->check_creator && $res["CREATED_BY"] != $GLOBALS["USER"]->GetId() ? "N" : "Y";
                     } elseif ($res["WF_STATUS_ID"] > 1) {
                         $res["SHOW"]["HISTORY"] = $res["SHOW"]["EDIT"] = $this->check_creator && $res["CREATED_BY"] != $GLOBALS["USER"]->GetId() ? "N" : "Y";
                         $res["SHOW"]["DELETE"] = $res["SHOW"]["EDIT"] == "Y" && $res["PERMISSION"] > "U" ? "Y" : "N";
                     }
                     if ($res["LOCK_STATUS"] == "red") {
                         $res["SHOW"]["UNLOCK"] = CWorkflow::IsAdmin() ? "Y" : "N";
                         $res["SHOW"]["EDIT"] = "N";
                         $res["SHOW"]["DELETE"] = "N";
                     } elseif ($this->check_creator && $res["CREATED_BY"] != $GLOBALS["USER"]->GetId()) {
                         $res["SHOW"]["UNLOCK"] = "N";
                         $res["SHOW"]["LOCK"] = "N";
                         $res["SHOW"]["DELETE"] = "N";
                         $res["SHOW"]["EDIT"] = "N";
                     }
                 }
                 if ($res["STATUS_PERMISSION"] >= 2 || ($this->e_rights ? isset($res['E_RIGHTS']['element_delete']) : $this->permission >= "W")) {
                     $res["PERMISSION"] = $res['LOCK_STATUS'] == "red" && !CWorkflow::IsAdmin() ? "R" : $res["PERMISSION"];
                     if ($res['ORIGINAL']['WF_NEW'] == "Y" || $res["WF_STATUS_ID"] <= 1) {
                         $res["SHOW"]["DELETE"] = $this->check_creator && $res["CREATED_BY"] != $GLOBALS["USER"]->GetId() ? "N" : "Y";
                     } elseif ($res["WF_STATUS_ID"] > 1) {
                         $res["SHOW"]["DELETE"] = $this->check_creator && $res["CREATED_BY"] != $GLOBALS["USER"]->GetId() && $res["PERMISSION"] > "U" ? "N" : "Y";
                     }
                 }
             } elseif ($this->workflow == "bizproc") {
                 if ($this->e_rights) {
                     $res["PERMISSION"] = $res["E_RIGHTS"];
                 }
                 if ($res['LOCK_STATUS'] != "red") {
                     $res['LOCK_STATUS_BP'] = call_user_func(array($this->wfParams["DOCUMENT_TYPE"][1], "IsDocumentLocked"), $res["ID"] | $res["item_id"], "") ? "red" : "green";
                     $res['LOCK_STATUS'] = $res['LOCK_STATUS_BP'] == "red" ? "red" : $res['LOCK_STATUS'];
                 }
                 $res["PERMISSION"] = $res['LOCK_STATUS'] == "red" ? "R" : $res["PERMISSION"];
                 $res["USER_GROUPS"] = $this->USER["GROUPS"];
                 if ($res["CREATED_BY"] == $GLOBALS["USER"]->GetID()) {
                     $res["USER_GROUPS"][] = "Author";
                 }
                 $res["DOCUMENT_ID"] = $this->wfParams["DOCUMENT_TYPE"];
                 $res["DOCUMENT_ID"][2] = $res["ID"] | $res["item_id"];
                 $res["~arDocumentStates"] = CBPDocument::GetDocumentStates($this->wfParams["DOCUMENT_TYPE"], $res["DOCUMENT_ID"]);
                 $res["arDocumentStates"] = array();
                 foreach ($res["~arDocumentStates"] as $key => $arDocumentState) {
                     $res["~arDocumentStates"][$key]["ViewWorkflow"] = CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::ViewWorkflow, $GLOBALS["USER"]->GetID(), $res["DOCUMENT_ID"], array("DocumentType" => $this->wfParams["DOCUMENT_TYPE"], "AllUserGroups" => $res["USER_GROUPS"], "DocumentStates" => $res["~arDocumentStates"], "WorkflowId" => $key));
                     if (strlen($arDocumentState["ID"]) > 0 && $res["~arDocumentStates"][$key]["ViewWorkflow"]) {
                         $res["arDocumentStates"][$key] = $arDocumentState;
                         $res["PERMISSION"] = "U";
                     }
                 }
                 if ($res['LOCK_STATUS'] != "red") {
                     if (CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::WriteDocument, $GLOBALS["USER"]->GetID(), $res["DOCUMENT_ID"], array("DocumentType" => $this->wfParams["DOCUMENT_TYPE"], "IBlockId" => $this->IBLOCK_ID, "UserGroups" => $this->USER["GROUPS"], "AllUserGroups" => $res["USER_GROUPS"], "DocumentStates" => $res["~arDocumentStates"]))) {
                         $res["PERMISSION"] = "W";
                     } elseif (!CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::ReadDocument, $GLOBALS["USER"]->GetID(), $res["DOCUMENT_ID"], array("DocumentType" => $this->wfParams["DOCUMENT_TYPE"], "IBlockId" => $this->IBLOCK_ID, "UserGroups" => $this->USER["GROUPS"], "AllUserGroups" => $res["USER_GROUPS"], "DocumentStates" => $res["~arDocumentStates"]))) {
                         $res["PERMISSION"] = "D";
                     }
                 }
                 if ($this->CheckRight($res["PERMISSION"], 'element_read') > "D") {
                     if ($arParams["get_clones"] == "Y" && intVal($res["WF_PARENT_ELEMENT_ID"]) <= 0) {
                         $arFilter = array("WF_PARENT_ELEMENT_ID" => $res["ID"], "SHOW_HISTORY" => "Y");
                         $db_rs = CIBlockElement::GetList(array("ID" => "ASC"), $arFilter);
                         if ($db_rs && ($rs = $db_rs->Fetch())) {
                             $res["CHILDREN"] = array();
                             do {
                                 if ($rs["IBLOCK_SECTION_ID"] == $trashID) {
                                     continue;
                                 }
                                 $rs["SHOW"] = array();
                                 $rs["PERMISSION"] = "R";
                                 $rs["DOCUMENT_ID"] = $res["DOCUMENT_ID"];
                                 $rs["DOCUMENT_ID"][2] = $rs["ID"];
                                 $rs["~arDocumentStates"] = CBPDocument::GetDocumentStates($this->wfParams["DOCUMENT_TYPE"], $rs["DOCUMENT_ID"]);
                                 $USER_GROUPS = $this->USER["GROUPS"];
                                 if ($rs["CREATED_BY"] == $GLOBALS["USER"]->GetID()) {
                                     $USER_GROUPS[] = "Author";
                                 }
                                 if (!CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::ReadDocument, $GLOBALS["USER"]->GetID(), $rs["DOCUMENT_ID"], array("DocumentType" => $this->wfParams["DOCUMENT_TYPE"], "IBlockId" => $this->IBLOCK_ID, "UserGroups" => $this->USER["GROUPS"], "AllUserGroups" => $USER_GROUPS, "DocumentStates" => $rs["~arDocumentStates"]))) {
                                     continue;
                                 }
                                 if (CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::WriteDocument, $GLOBALS["USER"]->GetID(), $rs["DOCUMENT_ID"], array("DocumentType" => $this->wfParams["DOCUMENT_TYPE"], "IBlockId" => $this->IBLOCK_ID, "UserGroups" => $this->USER["GROUPS"], "AllUserGroups" => $USER_GROUPS, "DocumentStates" => $rs["~arDocumentStates"]))) {
                                     $rs["PERMISSION"] = "W";
                                 }
                                 $rs["arDocumentStates"] = array();
                                 foreach ($rs["~arDocumentStates"] as $key => $arDocumentState) {
                                     if (CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::ViewWorkflow, $GLOBALS["USER"]->GetID(), $rs["DOCUMENT_ID"], array("DocumentType" => $this->wfParams["DOCUMENT_TYPE"], "IBlockId" => $this->IBLOCK_ID, "UserGroups" => $this->USER["GROUPS"], "AllUserGroups" => $USER_GROUPS, "DocumentStates" => $rs["~arDocumentStates"], "WorkflowId" => $key))) {
                                         $rs["arDocumentStates"][$key] = $arDocumentState;
                                         $rs["PERMISSION"] = empty($rs["PERMISSION"]) ? "U" : $rs["PERMISSION"];
                                     }
                                 }
                                 if ($rs["PERMISSION"] >= "U") {
                                     if (CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::StartWorkflow, $USER->GetID(), $rs["DOCUMENT_ID"], array("IBlockId" => $this->IBLOCK_ID, "UserGroups" => $this->USER["GROUPS"], "AllUserGroups" => $USER_GROUPS, "DocumentStates" => $rs["~arDocumentStates"]))) {
                                         $rs["SHOW"]["BP_START"] = "Y";
                                     }
                                     $rs["SHOW"]["BP_VIEW"] = !empty($rs["arDocumentStates"]) ? "Y" : "N";
                                     $rs["SHOW"]["EDIT"] = $rs["PERMISSION"] >= "W" ? "Y" : "N";
                                     $rs["SHOW"]["BP"] = $rs["SHOW"]["BP_VIEW"] == "Y" || $rs["SHOW"]["BP_START"] == "Y" ? "Y" : "N";
                                     $rs["SHOW"]["EDIT"] = $rs["PERMISSION"] >= "W" && intVal($rs["WF_PARENT_ELEMENT_ID"]) > 0 || $this->permission >= "W" ? "Y" : "N";
                                     if ($rs["BP_LOCK_STATUS"] == "red") {
                                         $rs["SHOW"]["UNLOCK"] = CBPDocument::IsAdmin() ? "Y" : "N";
                                         $rs["SHOW"]["EDIT"] = "N";
                                     } elseif ($rs["LOCK_STATUS"] == "red" && $this->permission > "U") {
                                         $rs["SHOW"]["UNLOCK"] = "Y";
                                         $rs["SHOW"]["EDIT"] = "N";
                                     } elseif ($this->check_creator && $rs["CREATED_BY"] != $GLOBALS["USER"]->GetId()) {
                                         $rs["SHOW"]["UNLOCK"] = "N";
                                         $rs["SHOW"]["LOCK"] = "N";
                                         $rs["SHOW"]["DELETE"] = "N";
                                         $rs["SHOW"]["EDIT"] = "N";
                                     } else {
                                         $rs["SHOW"]["UNLOCK"] = $rs['LOCK_STATUS'] == "yellow" ? "Y" : "N";
                                         $rs["SHOW"]["LOCK"] = $rs['LOCK_STATUS'] == "green" ? "Y" : "N";
                                         $rs["SHOW"]["DELETE"] = $rs["SHOW"]["HISTORY"] = $rs["PERMISSION"] > "U" ? "Y" : "N";
                                     }
                                 }
                                 $res["CHILDREN"][$rs["ID"]] = $rs;
                             } while ($rs = $db_rs->Fetch());
                         }
                     }
                     if (CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::StartWorkflow, $USER->GetID(), $res["DOCUMENT_ID"], array("IBlockId" => $this->IBLOCK_ID, "UserGroups" => $this->USER["GROUPS"], "AllUserGroups" => $res["USER_GROUPS"], "DocumentStates" => $res["~arDocumentStates"]))) {
                         $res["SHOW"]["BP_START"] = "Y";
                     }
                     $res["SHOW"]["BP_VIEW"] = !empty($res["arDocumentStates"]) ? "Y" : "N";
                     if ($this->workflow == 'bizproc') {
                         $res["SHOW"]["BP_VERSIONS"] = intVal($res["WF_PARENT_ELEMENT_ID"]) <= 0 ? "Y" : "N";
                         $res["SHOW"]["BP_CLONE"] = intVal($res["WF_PARENT_ELEMENT_ID"]) <= 0 ? "Y" : "N";
                         $res["SHOW"]["COPY"] = intVal($res["WF_PARENT_ELEMENT_ID"]) <= 0 ? "Y" : "N";
                     } else {
                         $res["SHOW"]["BP_VERSIONS"] = $res["SHOW"]["BP_CLONE"] = $res["SHOW"]["COPY"] = 'N';
                     }
                     if ($this->CheckRight($res['PERMISSION'], 'element_edit_any_wf_status') < "W" && intVal($res["WF_PARENT_ELEMENT_ID"]) <= 0 || $res["WF_PARENT_ELEMENT_ID"] == $res["ID"]) {
                         $arDocumentStates = CBPDocument::GetDocumentStates($this->wfParams["DOCUMENT_TYPE"], null);
                         if (!empty($arDocumentStates)) {
                             CBPDocument::CanUserOperateDocumentType(CBPCanUserOperateOperation::WriteDocument, $GLOBALS["USER"]->GetID(), $this->wfParams["DOCUMENT_TYPE"], array("IBlockId" => $this->IBLOCK_ID, "IBlockPermission" => $this->permission, "UserGroups" => $this->USER["GROUPS"], "AllUserGroups" => $res["USER_GROUPS"], "DocumentStates" => $arDocumentStates));
                         } else {
                             $res["SHOW"]["BP_CLONE"] = "N";
                         }
                     }
                     $res["SHOW"]["BP"] = $res["SHOW"]["BP_VIEW"] == "Y" || $res["SHOW"]["BP_START"] == "Y" ? "Y" : "N";
                     $res["SHOW"]["EDIT"] = $this->CheckRight($res["PERMISSION"], "element_edit_any_wf_status") >= "W" ? "Y" : "N";
                     if ($res["LOCK_STATUS"] == "red") {
                         $res["SHOW"]["UNLOCK"] = CBPDocument::IsAdmin() || $this->CheckRight($res['PERMISSION'], "element_edit") > "W" ? "Y" : "N";
                         $res["SHOW"]["LOCK"] = "N";
                         $res["SHOW"]["HISTORY"] = $this->CheckRight($res['PERMISSION'], 'element_edit') > "U" ? "Y" : "N";
                         $res["SHOW"]["DELETE"] = "N";
                         $res["SHOW"]["EDIT"] = "N";
                     } elseif ($this->InTrash($res)) {
                         $bRightsEdit_gt_W = $this->CheckRight($res['PERMISSION'], 'element_rights_edit') > "W";
                         $res["SHOW"]["EDIT"] = $bRightsEdit_gt_W ? "Y" : "N";
                         $res["SHOW"]["HISTORY"] = $bRightsEdit_gt_W ? "Y" : "N";
                         $res["SHOW"]["DELETE"] = $bRightsEdit_gt_W ? "Y" : "N";
                         $res["SHOW"]["UNLOCK"] = "N";
                         $res["SHOW"]["LOCK"] = "N";
                         $res["SHOW"]["BP_START"] = "N";
                         $res["SHOW"]["BP_VIEW"] = $bRightsEdit_gt_W ? "Y" : "N";
                         $res["SHOW"]["BP_VERSIONS"] = $bRightsEdit_gt_W ? "Y" : "N";
                         $res["SHOW"]["BP_CLONE"] = $bRightsEdit_gt_W ? "Y" : "N";
                         $res["SHOW"]["COPY"] = intVal($res["WF_PARENT_ELEMENT_ID"]) <= 0 ? "Y" : "N";
                     } elseif ($this->check_creator && $res["CREATED_BY"] != $GLOBALS["USER"]->GetId()) {
                         $res["SHOW"]["UNLOCK"] = "N";
                         $res["SHOW"]["LOCK"] = "N";
                         $res["SHOW"]["DELETE"] = "N";
                         $res["SHOW"]["EDIT"] = "N";
                     } else {
                         $bElementEdit_gt_U = $this->CheckRight($res['PERMISSION'], 'element_rights_edit') > 'U';
                         $res["SHOW"]["HISTORY"] = $bElementEdit_gt_U ? "Y" : "N";
                         $res["SHOW"]["DELETE"] = $bElementEdit_gt_U ? "Y" : "N";
                         $res["SHOW"]["UNLOCK"] = $bElementEdit_gt_U && $res["LOCK_STATUS"] == "yellow" ? "Y" : "N";
                         $res["SHOW"]["LOCK"] = $bElementEdit_gt_U && $res["LOCK_STATUS"] == "green" ? "Y" : "N";
                     }
                     if ($arBPParamRequired[$this->IBLOCK_ID]) {
                         $res["SHOW"]["COPY"] = "N";
                     }
                 }
             } else {
                 $res["SHOW"]["UNLOCK"] = $res['LOCK_STATUS'] == "yellow" || $res['LOCK_STATUS'] == "red" && $res["PERMISSION"] > 'W' ? "Y" : "N";
                 $res["SHOW"]["LOCK"] = $res['LOCK_STATUS'] == "green" ? "Y" : "N";
                 $res["SHOW"]["COPY"] = "Y";
                 $res["SHOW"]["HISTORY"] = $res["SHOW"]["DELETE"] = $res["SHOW"]["EDIT"] = $this->check_creator && $res["CREATED_BY"] != $GLOBALS["USER"]->GetId() ? "N" : "Y";
                 $res["SHOW"]["HISTORY"] = $res["SHOW"]["HISTORY"] == "Y" && $this->workflow == "bizproc_limited" ? "Y" : "N";
                 if ($this->check_creator && $res["CREATED_BY"] != $GLOBALS["USER"]->GetId()) {
                     $res["SHOW"]["UNLOCK"] = "N";
                     $res["SHOW"]["LOCK"] = "N";
                     $res["SHOW"]["DELETE"] = "N";
                     $res["SHOW"]["EDIT"] = "N";
                 } elseif ($res["LOCK_STATUS"] == "red" && $res["PERMISSION"] < 'X') {
                     $res["SHOW"]["DELETE"] = "N";
                     $res["SHOW"]["EDIT"] = "N";
                 }
                 if ($this->e_rights) {
                     $arShow = array("COPY" => "element_edit", "DELETE" => "element_delete", "UNDELETE" => "element_no_prems", "EDIT" => "element_edit", "HISTORY" => "element_edit", "LOCK" => "element_edit", "UNLOCK" => "element_edit", "RIGHTS" => "element_rights_edit");
                     $bInTrash = $this->InTrash($res);
                     foreach ($arShow as $action => $right) {
                         if ($res['LOCK_STATUS'] == 'red' || $bInTrash) {
                             $right = "element_rights_edit";
                         }
                         if (!isset($res['E_RIGHTS'][$right])) {
                             $res['SHOW'][$action] = 'N';
                         }
                     }
                 }
             }
         } else {
             $res["PERMISSION"] = $res["WF_NEW"] == "Y" || intVal($res["WF_PARENT_ELEMENT_ID"]) > 0 && $res["WF_PARENT_ELEMENT_ID"] != $res['ID'] ? "D" : $this->permission;
             if ($res["PERMISSION"] > "D" && $this->workflow == "bizproc") {
                 $res["PERMISSION"] = $res["BP_PUBLISHED"] == "Y" ? $this->permission : "D";
             }
         }
         $res["SHOW"]["UNDELETE"] = "N";
         $secPath = "/" . implode("/", $this->GetNavChain(array("section_id" => $res["IBLOCK_SECTION_ID"]), false));
         $res["SECTION_PATH"] = str_replace("//", "/", $secPath);
         $res["PATH"] = str_replace("//", "/", $secPath . "/" . $res["~NAME"]);
         $arFiles[$res["ID"]] = $res;
     } else {
         $res = array_merge($res, $arFiles[$res["ID"]]);
     }
     if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND') {
         $info["path"] = $res['PATH'];
         $info["path"] = SITE_CHARSET != "UTF-8" ? $GLOBALS["APPLICATION"]->ConvertCharset($info["path"], SITE_CHARSET, "UTF-8") : $info["path"];
         $info["props"] = array();
         $info["props"][] = array('ns' => 'DAV:', 'name' => "creationdate", 'val' => isset($res["DATE_CREATE_UNIX"]) ? $res["DATE_CREATE_UNIX"] : MakeTimeStamp($res["DATE_CREATE"]));
         $info["props"][] = array('ns' => 'DAV:', 'name' => "getlastmodified", 'val' => isset($res["TIMESTAMP_X_UNIX"]) ? $res["TIMESTAMP_X_UNIX"] : MakeTimeStamp($res["TIMESTAMP_X"]));
         $info["props"][] = array('ns' => 'DAV:', 'name' => "creationdate", 'val' => MakeTimeStamp($res["DATE_CREATE"]));
         $info["props"][] = array('ns' => 'DAV:', 'name' => "getlastmodified", 'val' => MakeTimeStamp($res["TIMESTAMP_X"]));
         $info["props"][] = array('ns' => 'DAV:', 'name' => "getcontenttype", 'val' => $res["FILE"]["CONTENT_TYPE"]);
         $info["props"][] = array('ns' => 'DAV:', 'name' => "getcontentlength", 'val' => $res["FILE"]["FILE_SIZE"]);
         $info["props"][] = array('ns' => 'DAV:', 'name' => "isreadonly", 'val' => $res["PERMISSION"] >= "W" ? "false" : "true");
         $info["props"][] = array('ns' => 'DAV:', 'name' => "ishidden", 'val' => $res["ACTIVE"] == "Y" ? "false" : "true");
         $info["props"][] = array('ns' => 'DAV:', 'name' => "iscollection", 'val' => 0);
         $info["props"][] = array('ns' => 'DAV:', 'name' => "resourcetype", 'val' => '');
         // required by RFC && LibreOffice
         $info["props"][] = $this->_get_lock_prop();
     }
     if ($this->InTrash($res)) {
         if ($this->workflow != "bizproc") {
             $res["SHOW"]["EDIT"] = "N";
             $res["SHOW"]["LOCK"] = "N";
             $res["SHOW"]["UNLOCK"] = "N";
             $bAdmin = false;
             if ($GLOBALS['USER']->CanDoOperation('webdav_change_settings')) {
                 $bAdmin = true;
             } elseif ($this->e_rights && isset($res['E_RIGHTS']['element_rights_edit'])) {
                 $bAdmin = true;
             } elseif (!$this->e_rights && $this->permission > "W") {
                 $bAdmin = true;
             }
             $res["SHOW"]["DELETE"] = $bAdmin ? "Y" : "N";
             $res["SHOW"]["UNDELETE"] = $bAdmin ? "Y" : "N";
         }
     }
     if ($this->_parse_webdav_info($res)) {
         if (is_array($res["PROPS"])) {
             foreach ($res["PROPS"] as $ns_name => $ns_props) {
                 foreach ($ns_props as $prop_name => $prop_val) {
                     if (is_scalar($prop_val)) {
                         if ($_SERVER['REQUEST_METHOD'] == 'PROPFIND') {
                             $info["props"][] = CWebDavBase::_mkprop($ns_name, $prop_name, $prop_val);
                         }
                     }
                 }
             }
         }
     }
     return $info;
 }