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


PHP CBPDocument类代码示例

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


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

示例1: Execute

 public function Execute()
 {
     $rootActivity = $this->GetRootActivity();
     $documentId = $rootActivity->GetDocumentId();
     CBPDocument::TerminateWorkflow($this->GetWorkflowInstanceId(), $documentId, $arErrorsTmp);
     throw new Exception("TerminateActivity");
     return CBPActivityExecutionStatus::Closed;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:8,代码来源:terminateactivity.php

示例2: processBeforeAction

 protected function processBeforeAction($actionName)
 {
     parent::processBeforeAction($actionName);
     if (strlen($this->arParams['STORAGE_ID']) <= 0) {
         ShowError(Loc::getMessage('ACCESS_DENIED') . ' ' . Loc::getMessage('BIZPROC_WFEDIT_ERROR_TYPE'));
         return false;
     }
     if ($this->arResult['ID'] > 0) {
         $templatesList = CBPWorkflowTemplateLoader::getList(array(), array('ID' => $this->arResult['ID']));
         if ($template = $templatesList->fetch()) {
             if (!CBPDocument::canUserOperateDocumentType(CBPCanUserOperateOperation::CreateWorkflow, $this->getUser()->getID(), $template['DOCUMENT_TYPE'])) {
                 $this->showAccessDenied();
                 return false;
             }
             $this->arResult['TEMPLATE_NAME'] = $template['NAME'];
             $this->arResult['TEMPLATE_DESC'] = $template['DESCRIPTION'];
             $this->arResult['TEMPLATE_AUTOSTART'] = $template['AUTO_EXECUTE'];
             $this->arResult['TEMPLATE'] = $template['TEMPLATE'];
             $this->arResult['PARAMETERS'] = $template['PARAMETERS'];
             $this->arResult['VARIABLES'] = $template['VARIABLES'];
             $this->arResult['CONSTANTS'] = $template['CONSTANTS'];
         } else {
             $this->arResult['ID'] = 0;
         }
         if ($template["ENTITY"] == Bitrix\Disk\BizProcDocument::className()) {
             $this->arResult['DOCUMENT_COMPLEX_TYPE'] = \Bitrix\Disk\BizProcDocument::generateDocumentComplexType($this->arParams['STORAGE_ID']);
             $this->arResult['ENTITY'] = $template['ENTITY'];
         } else {
             $this->arResult['DOCUMENT_COMPLEX_TYPE'] = \Bitrix\Disk\BizProcDocumentCompatible::generateDocumentComplexType($this->arParams['STORAGE_ID']);
             $this->arResult['ENTITY'] = $template['ENTITY'];
         }
     } else {
         $this->arResult['ENTITY'] = Bitrix\Disk\BizProcDocument::className();
         $this->arResult['DOCUMENT_COMPLEX_TYPE'] = \Bitrix\Disk\BizProcDocument::generateDocumentComplexType($this->arParams['STORAGE_ID']);
         if (!CBPDocument::canUserOperateDocumentType(CBPCanUserOperateOperation::CreateWorkflow, $this->getUser()->getID(), $this->arResult['DOCUMENT_COMPLEX_TYPE'])) {
             $this->showAccessDenied();
             return false;
         }
         $this->arResult['TEMPLATE_NAME'] = Loc::getMessage("BIZPROC_WFEDIT_DEFAULT_TITLE");
         $this->arResult['TEMPLATE_DESC'] = '';
         $this->arResult['TEMPLATE_AUTOSTART'] = 1;
         $this->arResult['PARAMETERS'] = array();
         $this->arResult['VARIABLES'] = array();
         $this->arResult['CONSTANTS'] = array();
         if ($this->request->getQuery('init') == 'statemachine') {
             $this->arResult['TEMPLATE'] = array(array('Type' => 'StateMachineWorkflowActivity', 'Name' => 'Template', 'Properties' => array(), 'Children' => array()));
         } else {
             $this->arResult['TEMPLATE'] = array(array('Type' => 'SequentialWorkflowActivity', 'Name' => 'Template', 'Properties' => array(), 'Children' => array()));
         }
     }
     return true;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:52,代码来源:class.php

示例3: Execute

 public function Execute()
 {
     if (!CModule::IncludeModule("intranet")) {
         return CBPActivityExecutionStatus::Closed;
     }
     $iblockId = COption::GetOptionInt("intranet", "iblock_tasks", 0);
     if ($iblockId <= 0) {
         return CBPActivityExecutionStatus::Closed;
     }
     $parentSectionId = 0;
     $dbSectionsList = CIBlockSection::GetList(array(), array("GLOBAL_ACTIVE" => "Y", "XML_ID" => $this->TaskType == "group" ? $this->TaskOwnerId : "users_tasks", "IBLOCK_ID" => $iblockId, "SECTION_ID" => 0), false);
     if ($arSection = $dbSectionsList->GetNext()) {
         $parentSectionId = $arSection["ID"];
     }
     if ($parentSectionId <= 0) {
         $dbSectionsList = CIBlockSection::GetList(array(), array("GLOBAL_ACTIVE" => "Y", "XML_ID" => "users_tasks", "IBLOCK_ID" => $iblockId, "SECTION_ID" => 0), false);
         if ($arSection = $dbSectionsList->GetNext()) {
             $parentSectionId = $arSection["ID"];
         }
     }
     if ($parentSectionId <= 0) {
         return CBPActivityExecutionStatus::Closed;
     }
     $rootActivity = $this->GetRootActivity();
     $documentId = $rootActivity->GetDocumentId();
     $arTaskCreatedBy = CBPHelper::ExtractUsers($this->TaskCreatedBy, $documentId, true);
     $arTaskAssignedTo = CBPHelper::ExtractUsers($this->TaskAssignedTo, $documentId, true);
     if (!$arTaskCreatedBy || !$arTaskAssignedTo) {
         return CBPActivityExecutionStatus::Closed;
     }
     if ($this->TaskType != "group") {
         $this->TaskOwnerId = $arTaskAssignedTo;
     }
     $arTaskTrackers = CBPHelper::ExtractUsers($this->TaskTrackers, $documentId);
     $arFields = array("IBLOCK_SECTION_ID" => $parentSectionId, "MODIFIED_BY" => $arTaskCreatedBy, "CREATED_BY" => $arTaskCreatedBy, "DATE_CREATE" => date($GLOBALS["DB"]->DateFormatToPHP(FORMAT_DATETIME)), "ACTIVE_FROM" => $this->TaskActiveFrom, "ACTIVE_TO" => $this->TaskActiveTo, "NAME" => $this->TaskName, "DETAIL_TEXT" => $this->TaskDetailText, "PROPERTY_TaskPriority" => $this->TaskPriority, "PROPERTY_TaskAssignedTo" => $arTaskAssignedTo, "PROPERTY_TaskTrackers" => $arTaskTrackers);
     $taskId = CIntranetTasksDocument::CreateDocument($arFields);
     if ($this->TaskType == "group") {
         $pathTemplate = str_replace(array("#GROUP_ID#", "#TASK_ID#"), array($this->TaskOwnerId, "{=Document:ID}"), COption::GetOptionString("intranet", "path_task_group_entry", "/workgroups/group/#GROUP_ID#/tasks/task/view/#TASK_ID#/"));
     } else {
         $pathTemplate = str_replace(array("#USER_ID#", "#TASK_ID#"), array($this->TaskOwnerId, "{=Document:ID}"), COption::GetOptionString("intranet", "path_task_user_entry", "/company/personal/user/#USER_ID#/tasks/task/view/#TASK_ID#/"));
     }
     $pathTemplate = str_replace('#HTTP_HOST#', $_SERVER['HTTP_HOST'], "http://#HTTP_HOST#" . $pathTemplate);
     $arTemplateStates = CBPWorkflowTemplateLoader::GetDocumentTypeStates(array("intranet", "CIntranetTasksDocument", "x" . $iblockId), CBPDocumentEventType::Create);
     foreach ($arTemplateStates as $arState) {
         CBPDocument::StartWorkflow($arState["TEMPLATE_ID"], array("intranet", "CIntranetTasksDocument", $taskId), array("OwnerId" => $this->TaskOwnerId, "TaskType" => $this->TaskType, "PathTemplate" => $pathTemplate, "ForumId" => intval($this->TaskForumId), "IBlockId" => $iblockId), $arErrorsTmp);
     }
     return CBPActivityExecutionStatus::Closed;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:48,代码来源:taskactivity.php

示例4: AutoStartWorkflows

 public static function AutoStartWorkflows($ownerTypeID, $ownerID, $eventType, &$errors)
 {
     if (!(IsModuleInstalled('bizproc') && CModule::IncludeModule('bizproc'))) {
         return false;
     }
     $ownerTypeID = intval($ownerTypeID);
     $ownerID = intval($ownerID);
     $eventType = intval($eventType);
     $docName = self::ResolveDocumentName($ownerTypeID);
     if ($docName === '') {
         return false;
     }
     $ownerTypeName = CCrmOwnerType::ResolveName($ownerTypeID);
     if ($ownerTypeName === '') {
         return false;
     }
     CBPDocument::AutoStartWorkflows(array('crm', $docName, $ownerTypeName), $eventType, array('crm', $docName, $ownerTypeName . '_' . $ownerID), array(), $errors);
     return true;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:19,代码来源:crm_bizproc_helper.php

示例5: Recover

 function Recover($HISTORY_ID, $ID, $IBLOCK_ID)
 {
     $this->CleanCacheById($ID, $IBLOCK_ID);
     $rIBlock = CIBlock::getList(array(), array('ID' => $IBLOCK_ID, 'CHECK_PERMISSIONS' => 'N'));
     $arIBlock = $rIBlock->GetNext();
     if ($arIBlock['BIZPROC'] == 'Y' && CModule::IncludeModule('bizproc')) {
         $arErrorsTmp = array();
         $arHistoryResult = CBPDocument::GetDocumentFromHistory($HISTORY_ID, $arErrorsTmp);
         $modifyComment = GetMessage('WIKI_RECOVER_COMMENT') . " " . $arHistoryResult["MODIFIED"];
         if (CBPHistoryService::RecoverDocumentFromHistory($HISTORY_ID)) {
             if ($this->UpdateHistory($ID, $IBLOCK_ID, $modifyComment)) {
                 return true;
             } else {
                 return false;
             }
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
开发者ID:Satariall,项目名称:izurit,代码行数:22,代码来源:wiki.php

示例6: terminateWorkflow

 protected function terminateWorkflow($workflowId, $elementId)
 {
     $this->checkPermission();
     if (!CBPDocument::canUserOperateDocument(CBPCanUserOperateOperation::StartWorkflow, $this->getUser(), BizProcDocument::getDocumentComplexId($this->iblockTypeId, $elementId), array("DocumentStates" => $this->documentStates))) {
         $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_LAC_ACCESS_DENIED'))));
     }
     if ($this->errorCollection->hasErrors()) {
         $this->sendJsonErrorResponse();
     }
     if (CIBlockElementRights::userHasRightTo($this->iblockId, $elementId, "element_rights_edit")) {
         $errors = array();
         CBPDocument::terminateWorkflow($workflowId, BizProcDocument::getDocumentComplexId($this->iblockTypeId, $elementId), $errors);
         foreach ($errors as $error) {
             $this->errorCollection->add(array(new Error($error["message"])));
         }
     } else {
         $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_LAC_ACCESS_DENIED'))));
     }
     if ($this->errorCollection->hasErrors()) {
         $this->sendJsonErrorResponse();
     }
 }
开发者ID:Satariall,项目名称:izurit,代码行数:22,代码来源:ajax.php

示例7: getBizprocData

 protected function getBizprocData()
 {
     $userId = $this->getUser()->getID();
     $currentUserGroups = $this->getUser()->getUserGroupArray();
     if (!$this->lists['ELEMENT_FIELDS'] || $this->lists['ELEMENT_FIELDS']['CREATED_BY'] == $userId) {
         $currentUserGroups[] = 'Author';
     }
     $documentType = 'iblock_' . $this->iblockId;
     CBPDocument::addShowParameterInit('lists', 'only_users', $documentType);
     $this->lists['BIZPROC_FIELDS'] = array();
     $bizprocIndex = 0;
     $documentStates = CBPDocument::getDocumentStates(array('lists', 'BizprocDocument', $documentType), null);
     $runtime = CBPRuntime::getRuntime();
     $runtime->startRuntime();
     $documentService = $runtime->getService('DocumentService');
     foreach ($documentStates as $documentState) {
         $bizprocIndex++;
         $viewWorkflow = CBPDocument::CanUserOperateDocumentType(CBPCanUserOperateOperation::StartWorkflow, $userId, array('lists', 'BizprocDocument', $documentType), array('sectionId' => 0, 'AllUserGroups' => $currentUserGroups, 'DocumentStates' => $documentStates, 'WorkflowId' => $documentState['ID'] > 0 ? $documentState['ID'] : $documentState['TEMPLATE_ID']));
         if ($viewWorkflow) {
             $templateId = intval($documentState['TEMPLATE_ID']);
             $workflowParameters = $documentState['TEMPLATE_PARAMETERS'];
             if (!is_array($workflowParameters)) {
                 $workflowParameters = array();
             }
             if (strlen($documentState["ID"]) <= 0 && $templateId > 0) {
                 $parametersValues = array();
                 $keys = array_keys($workflowParameters);
                 foreach ($keys as $key) {
                     $value = $workflowParameters[$key]["Default"];
                     if (!is_array($value)) {
                         $parametersValues[$key] = htmlspecialcharsbx($value);
                     } else {
                         $keys1 = array_keys($value);
                         foreach ($keys1 as $key1) {
                             $parametersValues[$key][$key1] = htmlspecialcharsbx($value[$key1]);
                         }
                     }
                 }
                 foreach ($workflowParameters as $parameterKey => $arParameter) {
                     $parameterKeyExt = "bizproc" . $templateId . "_" . $parameterKey;
                     $html = $documentService->GetFieldInputControl(array('lists', 'BizprocDocument', $documentType), $arParameter, array("Form" => "start_workflow_form1", "Field" => $parameterKeyExt), $parametersValues[$parameterKey], false, true);
                     $this->lists['BIZPROC_FIELDS'][$parameterKeyExt . $bizprocIndex] = array("id" => $parameterKeyExt . $bizprocIndex, "required" => $arParameter["Required"], "name" => $arParameter["Name"], "title" => $arParameter["Description"], "type" => "custom", "value" => $html, 'show' => 'Y');
                 }
             }
         }
     }
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:47,代码来源:ajax.php

示例8: GetDocumentForHistory

 /**
  * Method return array with all information about document. Array used for method RecoverDocumentFromHistory.
  *
  * @param string $documentId - document id.
  * @return array - document information array.
  */
 public function GetDocumentForHistory($documentId, $historyIndex)
 {
     $documentId = intval($documentId);
     if ($documentId <= 0) {
         throw new CBPArgumentNullException("documentId");
     }
     $result = null;
     $dbDocumentList = CIBlockElement::getList(array(), array("ID" => $documentId, "SHOW_NEW" => "Y", "SHOW_HISTORY" => "Y"));
     if ($objDocument = $dbDocumentList->getNextElement()) {
         $fields = $objDocument->getFields();
         $properties = $objDocument->getProperties();
         $result["NAME"] = $fields["~NAME"];
         $result["FIELDS"] = array();
         foreach ($fields as $fieldKey => $fieldValue) {
             if ($fieldKey == "~PREVIEW_PICTURE" || $fieldKey == "~DETAIL_PICTURE") {
                 $result["FIELDS"][substr($fieldKey, 1)] = CBPDocument::prepareFileForHistory(array("lists", get_called_class(), $documentId), $fieldValue, $historyIndex);
             } elseif (substr($fieldKey, 0, 1) == "~") {
                 $result["FIELDS"][substr($fieldKey, 1)] = $fieldValue;
             }
         }
         $result["PROPERTIES"] = array();
         foreach ($properties as $propertyKey => $propertyValue) {
             if (strlen($propertyValue["USER_TYPE"]) > 0) {
                 $result["PROPERTIES"][$propertyKey] = array("VALUE" => $propertyValue["VALUE"], "DESCRIPTION" => $propertyValue["DESCRIPTION"]);
             } elseif ($propertyValue["PROPERTY_TYPE"] == "L") {
                 $result["PROPERTIES"][$propertyKey] = array("VALUE" => $propertyValue["VALUE_ENUM_ID"], "DESCRIPTION" => $propertyValue["DESCRIPTION"]);
             } elseif ($propertyValue["PROPERTY_TYPE"] == "F") {
                 $result["PROPERTIES"][$propertyKey] = array("VALUE" => CBPDocument::prepareFileForHistory(array("lists", get_called_class(), $documentId), $propertyValue["VALUE"], $historyIndex), "DESCRIPTION" => $propertyValue["DESCRIPTION"]);
             } else {
                 $result["PROPERTIES"][$propertyKey] = array("VALUE" => $propertyValue["VALUE"], "DESCRIPTION" => $propertyValue["DESCRIPTION"]);
             }
         }
     }
     return $result;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:41,代码来源:bizprocdocument.php

示例9: catch

        $showType = 'Success';
    } else {
        try {
            $documentType = $documentService->GetDocumentType($arTask["PARAMETERS"]["DOCUMENT_ID"]);
            if (!array_key_exists("BP_AddShowParameterInit_" . $documentType[0] . "_" . $documentType[1] . "_" . $documentType[2], $GLOBALS)) {
                $GLOBALS["BP_AddShowParameterInit_" . $documentType[0] . "_" . $documentType[1] . "_" . $documentType[2]] = 1;
                CBPDocument::AddShowParameterInit($documentType[0], "only_users", $documentType[2], $documentType[1]);
            }
        } catch (Exception $e) {
            CAdminMessage::ShowMessage(GetMessage('BPAT_NO_STATE'));
            $showType = 'Success';
        }
    }
    list($taskForm, $taskFormButtons) = array("", "");
    if ($showType != "Success") {
        list($taskForm, $taskFormButtons) = CBPDocument::ShowTaskForm($arTask, $userId, "", $_SERVER["REQUEST_METHOD"] == "POST" && $_POST["action"] == "doTask" ? $_REQUEST : null);
    }
    ?>
	<form method="post" name="task_delegate" action="<?php 
    echo GetPagePath(false, true);
    ?>
">
		<input type="hidden" name="action" value="delegate">
		<input type="hidden" name="id" value="<?php 
    echo intval($arTask["ID"]);
    ?>
">
		<input type="hidden" name="workflow_id" value="<?php 
    echo htmlspecialcharsbx($arTask["WORKFLOW_ID"]);
    ?>
">
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:task.php

示例10: GetMessage

echo $arCurrentValues["show_comment"] == "N" ? " selected" : "";
?>
><?php 
echo GetMessage("BPAA_PD_NO");
?>
</option>
		</select>
	</td>
</tr>
<tr>
	<td align="right"><?php 
echo GetMessage("BPAR_PD_COMMENT_LABEL_MESSAGE");
?>
:</td>
	<td><?php 
echo CBPDocument::ShowParameterField("string", 'comment_label_message', $arCurrentValues['comment_label_message'], array('size' => '50'));
?>
</td>
</tr>
<tr>
	<td align="right"><?php 
echo GetMessage("BPAA_PD_TIMEOUT_DURATION");
?>
:<br/><?php 
echo GetMessage("BPAA_PD_TIMEOUT_DURATION_HINT");
?>
</td>
	<td valign="top">
		<input type="text" name="timeout_duration" id="id_timeout_duration" value="<?php 
echo htmlspecialcharsbx($arCurrentValues["timeout_duration"]);
?>
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:properties_dialog.php

示例11: GetPropertiesDialog

    public static function GetPropertiesDialog($documentType, $activityName, $workflowTemplate, $workflowParameters, $workflowVariables, $currentValues = null, $formName = "")
    {
        $runtime = CBPRuntime::GetRuntime();
        $map = array('AuthUserId', 'SetStatusMessage', 'StatusMessage', 'UseSubscription', 'TimeoutDuration', 'TimeoutDurationType');
        $activityData = self::getRestActivityData();
        $properties = isset($activityData['PROPERTIES']) && is_array($activityData['PROPERTIES']) ? $activityData['PROPERTIES'] : array();
        foreach ($properties as $name => $property) {
            if (!in_array($name, $map)) {
                $map[] = $name;
            }
        }
        if (!is_array($currentValues)) {
            $currentValues = array();
            $currentActivity =& CBPWorkflowTemplateLoader::FindActivityByName($workflowTemplate, $activityName);
            if (is_array($currentActivity['Properties'])) {
                foreach ($map as $k) {
                    if (array_key_exists($k, $currentActivity['Properties'])) {
                        if ($k == 'AuthUserId') {
                            $currentValues[strtolower($k)] = CBPHelper::UsersArrayToString('user_' . $currentActivity['Properties'][$k], $workflowTemplate, $documentType);
                        } else {
                            $currentValues[strtolower($k)] = $currentActivity['Properties'][$k];
                        }
                    } else {
                        if (!is_array($currentValues) || !array_key_exists($map[$k], $currentValues)) {
                            $currentValues[strtolower($k)] = "";
                        }
                    }
                }
            } else {
                foreach ($map as $k) {
                    $currentValues[strtolower($k)] = "";
                }
            }
        }
        if (strlen($currentValues['statusmessage']) <= 0) {
            $currentValues['statusmessage'] = Loc::getMessage('BPRA_DEFAULT_STATUS_MESSAGE');
        }
        if (strlen($currentValues["timeoutdurationtype"]) <= 0) {
            $currentValues["timeoutdurationtype"] = "s";
        }
        if ((int) $currentValues["authuserid"] <= 0) {
            $currentValues["authuserid"] = CBPHelper::UsersArrayToString('user_' . $activityData['AUTH_USER_ID'], $workflowTemplate, $documentType);
        }
        if (!empty($activityData['USE_SUBSCRIPTION'])) {
            $currentValues['usesubscription'] = $activityData['USE_SUBSCRIPTION'];
        }
        /** @var CBPDocumentService $documentService */
        $documentService = $runtime->GetService("DocumentService");
        $activityDocumentType = is_array($activityData['DOCUMENT_TYPE']) ? $activityData['DOCUMENT_TYPE'] : $documentType;
        foreach ($properties as $name => $property) {
            $required = CBPHelper::getBool($property['REQUIRED']);
            $value = !CBPHelper::isEmptyValue($currentValues[strtolower($name)]) ? $currentValues[strtolower($name)] : $property['DEFAULT'];
            ?>
			<tr>
				<td align="right" width="40%" valign="top">
					<span class="<?php 
            echo $required ? 'adm-required-field' : '';
            ?>
">
						<?php 
            echo htmlspecialcharsbx(RestActivityTable::getLocalization($property['NAME'], LANGUAGE_ID));
            ?>
:
					</span>
					<?php 
            if (isset($property['DESCRIPTION'])) {
                ?>
					<br/><?php 
                echo htmlspecialcharsbx(RestActivityTable::getLocalization($property['DESCRIPTION'], LANGUAGE_ID));
                ?>
					<?php 
            }
            ?>
				</td>
				<td width="60%">
					<?php 
            echo $documentService->getFieldInputControl($activityDocumentType, $property, array('Field' => strtolower($name), 'Form' => $formName), $value, true, false);
            ?>
				</td>
			</tr>

		<?php 
        }
        if (static::checkAdminPermissions()) {
            ?>
			<tr>
				<td align="right" width="40%" valign="top"><span class=""><?php 
            echo Loc::getMessage("BPRA_PD_USER_ID");
            ?>
:</span></td>
				<td width="60%">
					<?php 
            echo CBPDocument::ShowParameterField("user", 'authuserid', $currentValues['authuserid'], array('rows' => '1'));
            ?>
				</td>
			</tr>
		<?php 
        }
        ?>
			<tr>
//.........这里部分代码省略.........
开发者ID:k-kalashnikov,项目名称:geekcon,代码行数:101,代码来源:restactivity.php

示例12: array

 $arParams["SET_TITLE"] = $arParams["SET_TITLE"] == "N" ? "N" : "Y";
 //Turn on by default
 /********************************************************************
 					/Input params
 	********************************************************************/
 $arError = array();
 $arResult["arWorkflowState"] = CBPStateService::GetWorkflowState($arParams["ID"]);
 $arParams["DOCUMENT_ID"] = $arResult["arWorkflowState"]["DOCUMENT_ID"];
 $arParams["USER_GROUPS"] = $GLOBALS["USER"]->GetUserGroupArray();
 if (method_exists($arParams["DOCUMENT_ID"][1], "GetUserGroups")) {
     $arParams["USER_GROUPS"] = call_user_func_array(array($arParams["DOCUMENT_ID"][1], "GetUserGroups"), array(null, $arParams["DOCUMENT_ID"], $GLOBALS["USER"]->GetID()));
 }
 if (!is_array($arResult["arWorkflowState"]) || count($arResult["arWorkflowState"]) <= 0) {
     $arError[] = array("id" => "error", "text" => GetMessage("BPABL_INVALID_WF"));
 } else {
     $bCanView = CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::ViewWorkflow, $GLOBALS["USER"]->GetID(), $arResult["arWorkflowState"]["DOCUMENT_ID"], array("WorkflowId" => $arParams["ID"], "DocumentStates" => array($arParams["ID"] => $arResult["arWorkflowState"]), "UserGroups" => $arParams["USER_GROUPS"]));
     if (!$bCanView) {
         $arError[] = array("id" => "access denied", "text" => GetMessage("BPABL_NO_PERMS"));
     }
 }
 if (!empty($arError)) {
     $e = new CAdminException($arError);
     ShowError($e->GetString());
     return false;
 }
 /********************************************************************
 					Data
 	********************************************************************/
 $arResult["arWorkflowTrack"] = CBPTrackingService::DumpWorkflow($arParams["ID"]);
 /********************************************************************
 					/Data
开发者ID:vim84,项目名称:b-markt,代码行数:31,代码来源:component.php

示例13: htmlspecialcharsbx

$arResult['WORKFLOW_TEMPLATE_NAME'] = $arState["TEMPLATE_NAME"];
$runtime = CBPRuntime::GetRuntime();
$runtime->StartRuntime();
$documentService = $runtime->GetService("DocumentService");
$arResult['DOCUMENT_ICON'] = $documentService->getDocumentIcon($arResult['TASK']['PARAMETERS']['DOCUMENT_ID']);
if (empty($arResult['TASK']['DOCUMENT_NAME'])) {
    $arResult['TASK']['DOCUMENT_NAME'] = htmlspecialcharsbx($documentService->getDocumentName($arResult['TASK']['PARAMETERS']['DOCUMENT_ID']));
}
if ($arResult["ShowMode"] != "Success") {
    try {
        $documentType = $documentService->GetDocumentType($arResult["TASK"]["PARAMETERS"]["DOCUMENT_ID"]);
        if (!array_key_exists("BP_AddShowParameterInit_" . $documentType[0] . "_" . $documentType[1] . "_" . $documentType[2], $GLOBALS)) {
            $GLOBALS["BP_AddShowParameterInit_" . $documentType[0] . "_" . $documentType[1] . "_" . $documentType[2]] = 1;
            CBPDocument::AddShowParameterInit($documentType[0], "only_users", $documentType[2], $documentType[1]);
        }
        // deprecated old style
        list($arResult["TaskForm"], $arResult["TaskFormButtons"]) = CBPDocument::ShowTaskForm($arResult["TASK"], $arParams["USER_ID"], "", $_SERVER["REQUEST_METHOD"] == "POST" && $_POST["action"] == "doTask" ? $_REQUEST : null);
        // new style
        $arResult['TaskControls'] = CBPDocument::getTaskControls($arResult["TASK"]);
    } catch (Exception $e) {
        ShowError(GetMessage("BPAT_NO_ACCESS"));
        return false;
    }
}
$this->IncludeComponentTemplate();
if ($arParams["SET_TITLE"] == "Y") {
    $APPLICATION->SetTitle(GetMessage("BPAT_TITLE"));
}
if ($arParams["SET_NAV_CHAIN"] == "Y") {
    $APPLICATION->AddChainItem(GetMessage("BPAT_TITLE"));
}
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php

示例14: array

 $rsHistory->NavStart($arParams['HISTORY_COUNT'], false);
 $arResult['DB_LIST'] =& $rsHistory;
 $arResult['HISTORY'] = array();
 if ($arResult['SOCNET']) {
     $arResult['AJAX_PAGE'] = $APPLICATION->GetCurPageParam('', array('bxajaxid', 'logout'));
     $arResult['PATH_TO_USER'] = $arParams['PATH_TO_USER'];
     $arResult['SHOW_LOGIN'] = $this->GetParent()->arParams['SHOW_LOGIN'];
     $arResult['NAME_TEMPLATE'] = $this->GetParent()->arParams['NAME_TEMPLATE'];
     $arResult['PATH_TO_CONPANY_DEPARTMENT'] = $this->GetParent()->arParams['PATH_TO_CONPANY_DEPARTMENT'];
     $arResult['PATH_TO_VIDEO_CALL'] = $this->GetParent()->arParams['PATH_TO_VIDEO_CALL'];
     $arResult['PATH_TO_SONET_MESSAGES_CHAT'] = $this->GetParent()->arParams['PATH_TO_MESSAGES_CHAT'];
 }
 $arErrorsTmp = array();
 while ($arHistory = $rsHistory->GetNext()) {
     $arHistory['USER_LINK'] = '';
     $arHistoryResult = CBPDocument::GetDocumentFromHistory($arHistory['ID'], $arErrorsTmp);
     $arHistory["MODIFY_COMMENT"] = $arHistoryResult["DOCUMENT"]["MODIFY_COMMENT"];
     if (!empty($arParams['PATH_TO_USER'])) {
         $arHistory['USER_LINK'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_USER'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId, 'user_id' => $arHistory['USER_ID'])), array());
     }
     /*CBPHistoryService::GetHistoryList() returns specialchared values
     		and CWikiUtils::GetUserLogin also do htmlspecialchars*/
     foreach (array('USER_LOGIN', 'USER_NAME', 'USER_LAST_NAME', 'USER_SECOND_NAME') as $key) {
         $arHistory[$key] = CWikiUtils::htmlspecialchars_decode($arHistory[$key]);
     }
     $arHistory['USER_LOGIN'] = CWikiUtils::GetUserLogin($arHistory, $arParams["NAME_TEMPLATE"]);
     $arHistory['DISCUSSION_LINK'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_DISCUSSION'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId)), $arParams['IN_COMPLEX'] == 'Y' && $arParams['SEF_MODE'] == 'N' ? array($arParams['OPER_VAR'] => 'discussion') : array());
     $arHistory['SHOW_LINK'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_POST'], array('wiki_name' => urlencode($arParams['ELEMENT_NAME']), 'group_id' => CWikiSocnet::$iSocNetId)), array('oldid' => $arHistory['ID']));
     $arHp = array('oldid' => $arHistory['ID'], 'sessid' => bitrix_sessid());
     if ($arParams['IN_COMPLEX'] == 'Y' && $arParams['SEF_MODE'] == 'N') {
         $arHp[$arParams['OPER_VAR']] = 'history';
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例15: getData

 protected function getData()
 {
     $this->arResult['SHOW_MODE'] = 'SelectWorkflow';
     $this->arResult['TEMPLATES'] = array();
     $this->arResult['PARAMETERS_VALUES'] = array();
     $this->arResult['ERROR_MESSAGE'] = '';
     $runtime = CBPRuntime::getRuntime();
     $runtime->startRuntime();
     $this->arResult['DocumentService'] = $runtime->getService('DocumentService');
     foreach ($this->arResult['DOCUMENT_DATA'] as $nameModule => $data) {
         $workflowTemplateObject = CBPWorkflowTemplateLoader::getList(array(), array('DOCUMENT_TYPE' => $data['DOCUMENT_TYPE'], 'ACTIVE' => 'Y'), false, false, array('ID', 'NAME', 'DESCRIPTION', 'MODIFIED', 'USER_ID', 'PARAMETERS'));
         while ($workflowTemplate = $workflowTemplateObject->getNext()) {
             if (!CBPDocument::canUserOperateDocument(CBPCanUserOperateOperation::StartWorkflow, $this->getUser()->getID(), $data['DOCUMENT_ID'], array())) {
                 continue;
             }
             if ($nameModule == 'DISK') {
                 $this->arResult['TEMPLATES'][$workflowTemplate['ID']] = $workflowTemplate;
                 $this->arResult['TEMPLATES'][$workflowTemplate['ID']]['URL'] = htmlspecialcharsex($this->getApplication()->getCurPageParam('workflow_template_id=' . $workflowTemplate['ID'] . '&' . bitrix_sessid_get(), array('workflow_template_id', 'sessid')));
             } else {
                 $this->arResult['TEMPLATES_OLD'][$workflowTemplate['ID']] = $workflowTemplate;
                 $this->arResult['TEMPLATES_OLD'][$workflowTemplate['ID']]['URL'] = htmlspecialcharsex($this->getApplication()->getCurPageParam('workflow_template_id=' . $workflowTemplate['ID'] . '&old=1&' . bitrix_sessid_get(), array('workflow_template_id', 'sessid')));
             }
         }
     }
     if ($this->arParams['TEMPLATE_ID'] > 0 && strlen($this->request->getPost('CancelStartParamWorkflow')) <= 0 && (array_key_exists($this->arParams['TEMPLATE_ID'], $this->arResult['TEMPLATES']) || array_key_exists($this->arParams['TEMPLATE_ID'], $this->arResult['TEMPLATES_OLD']))) {
         if (array_key_exists($this->arParams['TEMPLATE_ID'], $this->arResult['TEMPLATES'])) {
             $templates = $this->arResult['TEMPLATES'];
             $documentParameters = $this->arResult['DOCUMENT_DATA']['DISK'];
             $this->arResult['CHECK_TEMPLATE'] = 'DISK';
         } else {
             $templates = $this->arResult['TEMPLATES_OLD'];
             $documentParameters = $this->arResult['DOCUMENT_DATA']['WEBDAV'];
             $this->arResult['CHECK_TEMPLATE'] = 'WEBDAV';
         }
         $workflowTemplate = $templates[$this->arParams['TEMPLATE_ID']];
         $arWorkflowParameters = array();
         $canStartWorkflow = false;
         if (count($workflowTemplate['PARAMETERS']) <= 0) {
             $canStartWorkflow = true;
         } elseif ($this->request->isPost() && strlen($this->request->getPost('DoStartParamWorkflow')) > 0 && check_bitrix_sessid()) {
             $errorsTemporary = array();
             $request = $this->request->getPostList()->toArray();
             foreach ($_FILES as $key => $value) {
                 if (array_key_exists('name', $value)) {
                     if (is_array($value['name'])) {
                         $keys = array_keys($value['name']);
                         for ($i = 0, $cnt = count($keys); $i < $cnt; $i++) {
                             $array = array();
                             foreach ($value as $k1 => $v1) {
                                 $array[$k1] = $v1[$keys[$i]];
                             }
                             $request[$key][] = $array;
                         }
                     } else {
                         $request[$key] = $value;
                     }
                 }
             }
             $arWorkflowParameters = CBPWorkflowTemplateLoader::checkWorkflowParameters($workflowTemplate['PARAMETERS'], $request, $documentParameters['DOCUMENT_TYPE'], $errorsTemporary);
             if (count($errorsTemporary) > 0) {
                 $canStartWorkflow = false;
                 foreach ($errorsTemporary as $e) {
                     $this->errorCollection->add(array(new Error($e['message'])));
                 }
             } else {
                 $canStartWorkflow = true;
             }
         }
         if ($canStartWorkflow) {
             $errorsTemporary = array();
             $workflowId = CBPDocument::startWorkflow($this->arParams['TEMPLATE_ID'], $documentParameters['DOCUMENT_ID'], array_merge($arWorkflowParameters, array('TargetUser' => 'user_' . intval($this->getUser()->getID()))), $errorsTemporary);
             if (count($errorsTemporary) > 0) {
                 $this->arResult['SHOW_MODE'] = 'StartWorkflowError';
                 foreach ($errorsTemporary as $e) {
                     $this->errorCollection->add(array(new Error('[' . $e['code'] . '] ' . $e['message'])));
                 }
             } else {
                 $this->arResult['SHOW_MODE'] = 'StartWorkflowSuccess';
                 if (strlen($this->arResult['back_url']) > 0) {
                     LocalRedirect(str_replace('#WF#', $workflowId, $this->request->getQuery('back_url')));
                     $this->end(true);
                 }
             }
         } else {
             $doStartParam = $this->request->isPost() && strlen($this->request->getPost('DoStartParamWorkflow') && check_bitrix_sessid()) > 0;
             $keys = array_keys($workflowTemplate['PARAMETERS']);
             foreach ($keys as $key) {
                 $value = $doStartParam ? $this->request->getQuery($key) : $workflowTemplate['PARAMETERS'][$key]['Default'];
                 if (!is_array($value)) {
                     $this->arResult['PARAMETERS_VALUES'][$key] = CBPHelper::convertParameterValues($value);
                 } else {
                     $keys1 = array_keys($value);
                     foreach ($keys1 as $key1) {
                         $this->arResult['PARAMETERS_VALUES'][$key][$key1] = CBPHelper::convertParameterValues($value[$key1]);
                     }
                 }
             }
             $this->arResult['SHOW_MODE'] = 'WorkflowParameters';
         }
         if ($this->errorCollection->hasErrors()) {
//.........这里部分代码省略.........
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:101,代码来源:class.php


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