• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CBPWorkflowTemplateLoader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: processActionDefault

 protected function processActionDefault()
 {
     if ($this->storage->isEnabledBizProc()) {
         $documentData = array('DISK' => \Bitrix\Disk\BizProcDocument::generateDocumentComplexType($this->storage->getId()), 'WEBDAV' => \Bitrix\Disk\BizProcDocumentCompatible::generateDocumentComplexType($this->storage->getId()));
         if (!empty($this->arParams['FILE_ID'])) {
             $autoExecute = CBPDocumentEventType::Edit;
         } else {
             $autoExecute = CBPDocumentEventType::Create;
         }
         $this->arParams['BIZPROC_PARAMETERS'] = false;
         $this->arParams['BIZPROC_PARAMETERS_REQUIRED'] = array();
         $workflowTemplateId = '';
         foreach ($documentData as $nameModule => $data) {
             $workflowTemplateObject = CBPWorkflowTemplateLoader::getList(array(), array("DOCUMENT_TYPE" => $data, "AUTO_EXECUTE" => $autoExecute, "ACTIVE" => "Y"), false, false, array("ID", "PARAMETERS"));
             while ($workflowTemplate = $workflowTemplateObject->getNext()) {
                 if (!empty($workflowTemplate['PARAMETERS'])) {
                     foreach ($workflowTemplate['PARAMETERS'] as $parametersId => $parameters) {
                         if ($parameters['Required']) {
                             $this->arParams['BIZPROC_PARAMETERS_REQUIRED'][] = 'bizproc' . $workflowTemplate['ID'] . '_' . $parametersId;
                         }
                     }
                     $this->arParams['BIZPROC_PARAMETERS'] = true;
                 }
                 $workflowTemplateId = $workflowTemplate['ID'];
             }
         }
         $this->arParams['STATUS_START_BIZPROC'] = !empty($workflowTemplateId);
     }
     $this->arParams['STORAGE_ID'] = $this->storage->getId();
     $this->includeComponentTemplate();
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:class.php


示例2: GetLoader

 /**
  * Static method returns loader object. Singleton pattern.
  *
  * @return CBPWorkflowTemplateLoader
  */
 public static function GetLoader()
 {
     if (!isset(self::$instance)) {
         $c = __CLASS__;
         self::$instance = new $c();
     }
     return self::$instance;
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:13,代码来源:workflowtemplateloader.php


示例3: UsersArrayToStringInternal

	private static function UsersArrayToStringInternal($arUsers, $arWorkflowTemplate, $arAllowableUserGroups)
	{
		if (is_array($arUsers))
		{
			$r = array();

			$keys = array_keys($arUsers);
			foreach ($keys as $key)
				$r[$key] = self::UsersArrayToStringInternal($arUsers[$key], $arWorkflowTemplate, $arAllowableUserGroups);

			if (count($r) == 2)
			{
				$keys = array_keys($r);
				if ($keys[0] == 0 && $keys[1] == 1 && is_string($r[0]) && is_string($r[1]))
				{
					if (in_array($r[0], array("Document", "Template", "Variable", "User"))
						|| preg_match("#^A\d+_\d+_\d+_\d+$#i", $r[0])
						|| is_array($arWorkflowTemplate) && CBPWorkflowTemplateLoader::FindActivityByName($arWorkflowTemplate, $r[0]) != null
						)
					{
						return "{=".$r[0].":".$r[1]."}";
					}
				}
			}

			return implode(", ", $r);
		}
		else
		{
			if (array_key_exists(strtolower($arUsers), $arAllowableUserGroups))
				return $arAllowableUserGroups[strtolower($arUsers)];

			$userId = 0;
			if (substr($arUsers, 0, strlen("user_")) == "user_")
				$userId = intval(substr($arUsers, strlen("user_")));

			if ($userId > 0)
			{
				$db = CUser::GetList(
					($by = "LAST_NAME"),
					($order = "asc"),
					array("ID_EQUAL_EXACT" => $userId),
					array(
						"NAV_PARAMS" => false,
					)
				);

				if ($ar = $db->Fetch())
				{
					$str = CUser::FormatName(COption::GetOptionString("bizproc", "name_template", CSite::GetNameFormat(false), SITE_ID), $ar, true);
					$str = $str." [".$ar["ID"]."]";
					return str_replace(",", " ", $str);
				}
			}

			return str_replace(",", " ", $arUsers);
		}
	}
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:58,代码来源:helper.php


示例4: __wd_create_default_bp_user_and_groups

	function __wd_create_default_bp_user_and_groups($arr)
	{
		if($handle = opendir($_SERVER['DOCUMENT_ROOT'].'/'.BX_ROOT.'/modules/bizproc/templates'))
		{
			$documentType = array("webdav", "CIBlockDocumentWebdavSocnet", $arr["document_type"]);

			while(false !== ($file = readdir($handle)))
			{
				if(!is_file($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/bizproc/templates/'.$file))
				{
					continue;
				}


				$arFields = false;
				include($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/bizproc/templates/'.$file);
				if(is_array($arFields))
				{
					$arFields["DOCUMENT_TYPE"] = $documentType;
					$arFields["SYSTEM_CODE"] = $file;
					$arFields["USER_ID"]	= $GLOBALS['USER']->GetID();
					array_walk_recursive($arFields["TEMPLATE"], "__wd_replace_user_and_groups", $arr);
					if ($file == "status.php")
					{
						$arFields["AUTO_EXECUTE"] = CBPDocumentEventType::Create;
						if (!empty($arFields["PARAMETERS"]) && !empty($arFields["PARAMETERS"]["Approvers"]))
						{
							$name = "";
							if ($GLOBALS["USER"]->IsAuthorized() && $arr["owner"] == $GLOBALS["USER"]->GetID())
							{
								$name = trim($GLOBALS["USER"]->GetFirstName()." ".$GLOBALS["USER"]->GetLastName());
								$name = (empty($name) ? $GLOBALS["USER"]->GetLogin() : $name);
							}
							else
							{
								$dbUser = CUser::GetByID($arr["owner"]);
								$arUser = $dbUser->Fetch();
								$name = trim($arUser["NAME"]." ".$arUser["LAST_NAME"]);
								$name = (empty($name) ? $arUser["LOGIN"] : $name);
							}

							$arFields["PARAMETERS"]["Approvers"]["Default"] = $name.' ['.$arr["owner"].']';
						}
					}

					try
					{
						CBPWorkflowTemplateLoader::Add($arFields);
					}
					catch (Exception $e)
					{
					}
				}
			}
			closedir($handle);
		}
	}
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:57,代码来源:webdav.php


示例5: GetPropertiesDialogValues

 public static function GetPropertiesDialogValues($documentType, $activityName, &$arWorkflowTemplate, &$arWorkflowParameters, &$arWorkflowVariables, $arCurrentValues, &$arErrors)
 {
     $arErrors = array();
     $runtime = CBPRuntime::GetRuntime();
     $arProperties = array();
     $arCurrentActivity =& CBPWorkflowTemplateLoader::FindActivityByName($arWorkflowTemplate, $activityName);
     $arCurrentActivity["Properties"] = $arProperties;
     return true;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:9,代码来源:emptyblockactivity.php


示例6: GetPropertiesDialogValues

 public static function GetPropertiesDialogValues($documentType, $activityName, &$arWorkflowTemplate, &$arWorkflowParameters, &$arWorkflowVariables, $arCurrentValues, &$arErrors)
 {
     $arErrors = array();
     $runtime = CBPRuntime::GetRuntime();
     $arProperties = array("ExecuteCode" => $arCurrentValues["execute_code"]);
     $arErrors = self::ValidateProperties($arProperties, new CBPWorkflowTemplateUser(CBPWorkflowTemplateUser::CurrentUser));
     if (count($arErrors) > 0) {
         return false;
     }
     $arCurrentActivity =& CBPWorkflowTemplateLoader::FindActivityByName($arWorkflowTemplate, $activityName);
     $arCurrentActivity["Properties"] = $arProperties;
     return true;
 }
开发者ID:k-kalashnikov,项目名称:geekcon,代码行数:13,代码来源:codeactivity.php


示例7: getTemplatesIdList

 protected function getTemplatesIdList()
 {
     if (!Loader::includeModule('bizproc') || empty($this->iblockTypeId) || empty($this->iblockId)) {
         return array();
     }
     $documentType = BizprocDocument::generateDocumentComplexType($this->iblockTypeId, $this->iblockId);
     $templates = array_merge(\CBPWorkflowTemplateLoader::SearchTemplatesByDocumentType($documentType, CBPDocumentEventType::Create), \CBPWorkflowTemplateLoader::SearchTemplatesByDocumentType($documentType, CBPDocumentEventType::Edit));
     $templateData = array();
     foreach ($templates as $template) {
         $templateData[$template['ID']]['ID'] = $template['ID'];
         $templateData[$template['ID']]['NAME'] = $template['NAME'];
     }
     return $templateData;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:14,代码来源:ajax.php


示例8: GetPropertiesDialogValues

 public static function GetPropertiesDialogValues($documentType, $activityName, &$arWorkflowTemplate, &$arWorkflowParameters, &$arWorkflowVariables, $arCurrentValues, &$arErrors)
 {
     $arErrors = array();
     $runtime = CBPRuntime::GetRuntime();
     $state = strlen($arCurrentValues["target_state_name_1"]) > 0 ? $arCurrentValues["target_state_name_1"] : $arCurrentValues["target_state_name"];
     $cancelCurrentState = isset($arCurrentValues['cancel_current_state']) && $arCurrentValues['cancel_current_state'] == 'Y' ? 'Y' : 'N';
     $arProperties = array('TargetStateName' => $state, 'CancelCurrentState' => $cancelCurrentState);
     $arErrors = self::ValidateProperties($arProperties, new CBPWorkflowTemplateUser(CBPWorkflowTemplateUser::CurrentUser));
     if (count($arErrors) > 0) {
         return false;
     }
     $arCurrentActivity =& CBPWorkflowTemplateLoader::FindActivityByName($arWorkflowTemplate, $activityName);
     $arCurrentActivity["Properties"] = $arProperties;
     return true;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:15,代码来源:setstateactivity.php


示例9: HasAutoWorkflows

 public static function HasAutoWorkflows($ownerTypeID, $eventType)
 {
     if (!(IsModuleInstalled('bizproc') && CModule::IncludeModule('bizproc'))) {
         return false;
     }
     $ownerTypeID = (int) $ownerTypeID;
     $eventType = (int) $eventType;
     $docName = self::ResolveDocumentName($ownerTypeID);
     if ($docName === '') {
         return false;
     }
     $ownerTypeName = CCrmOwnerType::ResolveName($ownerTypeID);
     if ($ownerTypeName === '') {
         return false;
     }
     $ary = CBPWorkflowTemplateLoader::SearchTemplatesByDocumentType(array('crm', $docName, $ownerTypeName), $eventType);
     return !empty($ary);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:18,代码来源:crm_bizproc_helper.php


示例10: GetPropertiesDialogValues

 public static function GetPropertiesDialogValues($documentType, $activityName, &$arWorkflowTemplate, &$arWorkflowParameters, &$arWorkflowVariables, $arCurrentValues, &$arErrors)
 {
     $arErrors = array();
     $runtime = CBPRuntime::GetRuntime();
     $arProperties = array("Permission" => array(), "Rewrite" => true);
     $documentService = $runtime->GetService("DocumentService");
     $arAllowableOperations = $documentService->GetAllowableOperations($documentType);
     foreach ($arAllowableOperations as $operationKey => $operationValue) {
         $arProperties["Permission"][$operationKey] = CBPHelper::UsersStringToArray($arCurrentValues["permission_" . $operationKey], $documentType, $arErrors);
         if (count($arErrors) > 0) {
             return false;
         }
     }
     $arProperties["Rewrite"] = $arCurrentValues["rewrite"] == "Y" ? "Y" : "N";
     $arErrors = self::ValidateProperties($arProperties, new CBPWorkflowTemplateUser(CBPWorkflowTemplateUser::CurrentUser));
     if (count($arErrors) > 0) {
         return false;
     }
     $arCurrentActivity =& CBPWorkflowTemplateLoader::FindActivityByName($arWorkflowTemplate, $activityName);
     $arCurrentActivity["Properties"] = $arProperties;
     return true;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:22,代码来源:setpermissionsactivity.php


示例11: GetPropertiesDialogValues

 public static function GetPropertiesDialogValues($documentType, $activityName, &$arWorkflowTemplate, &$arWorkflowParameters, &$arWorkflowVariables, $arCurrentValues, &$arErrors)
 {
     $arErrors = array();
     $runtime = CBPRuntime::GetRuntime();
     $arMap = array("review_users" => "Users", "approve_type" => "ApproveType", "review_overdue_date" => "OverdueDate", "review_name" => "Name", "review_description" => "Description", "review_parameters" => "Parameters", "status_message" => "StatusMessage", "set_status_message" => "SetStatusMessage", "task_button_message" => "TaskButtonMessage", "comment_label_message" => "CommentLabelMessage", "show_comment" => "ShowComment", "timeout_duration" => "TimeoutDuration", "timeout_duration_type" => "TimeoutDurationType", "access_control" => "AccessControl");
     $arProperties = array();
     foreach ($arMap as $key => $value) {
         if ($key == "review_users") {
             continue;
         }
         $arProperties[$value] = $arCurrentValues[$key];
     }
     $arProperties["Users"] = CBPHelper::UsersStringToArray($arCurrentValues["review_users"], $documentType, $arErrors);
     if (count($arErrors) > 0) {
         return false;
     }
     $arErrors = self::ValidateProperties($arProperties, new CBPWorkflowTemplateUser(CBPWorkflowTemplateUser::CurrentUser));
     if (count($arErrors) > 0) {
         return false;
     }
     $arCurrentActivity =& CBPWorkflowTemplateLoader::FindActivityByName($arWorkflowTemplate, $activityName);
     $arCurrentActivity["Properties"] = $arProperties;
     return true;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:24,代码来源:reviewactivity.php


示例12: GetPropertiesDialogValues

 public static function GetPropertiesDialogValues($documentType, $activityName, &$arWorkflowTemplate, &$arWorkflowParameters, &$arWorkflowVariables, $arCurrentValues, &$arErrors)
 {
     $arErrors = array();
     $runtime = CBPRuntime::GetRuntime();
     $arProperties = array("Fields" => array());
     $documentService = $runtime->GetService("DocumentService");
     $arDocumentFields = $documentService->GetDocumentFields($documentType);
     foreach ($arDocumentFields as $fieldKey => $fieldValue) {
         if (!$fieldValue["Editable"]) {
             continue;
         }
         $arFieldErrors = array();
         $r = $documentService->GetFieldInputValue($documentType, $fieldValue, $fieldKey, $arCurrentValues, $arFieldErrors);
         if (is_array($arFieldErrors) && !empty($arFieldErrors)) {
             $arErrors = array_merge($arErrors, $arFieldErrors);
         }
         if ($fieldValue["BaseType"] == "user") {
             if ($r === "author") {
                 //HACK: We can't resolve author for new document - setup target user as author.
                 $r = "{=Template:TargetUser}";
             } elseif (is_array($r)) {
                 $qty = count($r);
                 if ($qty == 0) {
                     $r = null;
                 } elseif ($qty == 1) {
                     $r = $r[0];
                 }
             }
         }
         if ($fieldValue["Required"] && $r == null) {
             $arErrors[] = array("code" => "emptyRequiredField", "message" => str_replace("#FIELD#", $fieldValue["Name"], GetMessage("BPCDA_FIELD_REQUIED")));
         }
         if ($r != null) {
             $arProperties["Fields"][$fieldKey] = $r;
         }
     }
     if (count($arErrors) > 0) {
         return false;
     }
     $arCurrentActivity =& CBPWorkflowTemplateLoader::FindActivityByName($arWorkflowTemplate, $activityName);
     $arCurrentActivity["Properties"] = $arProperties;
     return true;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:43,代码来源:createdocumentactivity.php


示例13: GetPropertiesDialogValues

 public static function GetPropertiesDialogValues($documentType, $activityName, &$arWorkflowTemplate, &$arWorkflowParameters, &$arWorkflowVariables, $arCurrentValues, &$arErrors)
 {
     $arErrors = array();
     $runtime = CBPRuntime::GetRuntime();
     $arMap = array("sh_name" => "Name", "sh_user_id" => "UserId");
     $arProperties = array();
     foreach ($arMap as $key => $value) {
         $arProperties[$value] = $arCurrentValues[$key];
     }
     $arErrors = self::ValidateProperties($arProperties, new CBPWorkflowTemplateUser(CBPWorkflowTemplateUser::CurrentUser));
     if (count($arErrors) > 0) {
         return false;
     }
     $arCurrentActivity =& CBPWorkflowTemplateLoader::FindActivityByName($arWorkflowTemplate, $activityName);
     $arCurrentActivity["Properties"] = $arProperties;
     return true;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:17,代码来源:savehistoryactivity.php


示例14: header

        header("Pragma: public");
        echo $datum;
    }
    die;
}
if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_REQUEST['import_template'] == 'Y' && check_bitrix_sessid()) {
    $APPLICATION->RestartBuffer();
    //CUtil::DecodeUriComponent($_POST);
    $r = 0;
    $errTmp = "";
    if (is_uploaded_file($_FILES['import_template_file']['tmp_name'])) {
        $f = fopen($_FILES['import_template_file']['tmp_name'], "rb");
        $datum = fread($f, filesize($_FILES['import_template_file']['tmp_name']));
        fclose($f);
        try {
            $r = CBPWorkflowTemplateLoader::ImportTemplate($ID, array(MODULE_ID, ENTITY, $document_type), $_POST["import_template_autostart"], $_POST["import_template_name"], $_POST["import_template_description"], $datum);
        } catch (Exception $e) {
            $errTmp = $e->getMessage();
        }
    }
    ?>
	<script>
	<?php 
    if (intval($r) <= 0) {
        ?>
		alert('<?php 
        echo GetMessage("BIZPROC_WFEDIT_IMPORT_ERROR") . (strlen($errTmp) > 0 ? ": " . $errTmp : "");
        ?>
');
	<?php 
    } else {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:bizproc_workflow_edit.php


示例15: GetPropertiesDialogValues

 public static function GetPropertiesDialogValues($documentType, $activityName, &$arWorkflowTemplate, &$arWorkflowParameters, &$arWorkflowVariables, $arCurrentValues, &$arErrors)
 {
     $arErrors = array();
     $runtime = CBPRuntime::GetRuntime();
     $arMap = array("message_user_from" => "MessageUserFrom", "message_user_to" => "MessageUserTo", "message_text" => "MessageText");
     $arProperties = array();
     foreach ($arMap as $key => $value) {
         if ($key == "message_user_from" || $key == "message_user_to") {
             continue;
         }
         $arProperties[$value] = $arCurrentValues[$key];
     }
     global $USER;
     if ($USER->IsAdmin() || CModule::IncludeModule("bitrix24") && CBitrix24::IsPortalAdmin($USER->GetID())) {
         $arProperties["MessageUserFrom"] = CBPHelper::UsersStringToArray($arCurrentValues["message_user_from"], $documentType, $arErrors);
         if (count($arErrors) > 0) {
             return false;
         }
     } else {
         $arProperties["MessageUserFrom"] = "user_" . $USER->GetID();
     }
     //global $USER;
     //if (!$USER->IsAdmin())
     //	$arProperties["MessageUserFrom"] = "user_".$USER->GetID();
     $arProperties["MessageUserTo"] = CBPHelper::UsersStringToArray($arCurrentValues["message_user_to"], $documentType, $arErrors);
     if (count($arErrors) > 0) {
         return false;
     }
     $arErrors = self::ValidateProperties($arProperties, new CBPWorkflowTemplateUser(CBPWorkflowTemplateUser::CurrentUser));
     if (count($arErrors) > 0) {
         return false;
     }
     $arCurrentActivity =& CBPWorkflowTemplateLoader::FindActivityByName($arWorkflowTemplate, $activityName);
     $arCurrentActivity["Properties"] = $arProperties;
     return true;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:36,代码来源:socnetmessageactivity.php


示例16: processActionCheckDataElementCreation

 protected function processActionCheckDataElementCreation()
 {
     if ($_POST["save"] != "Y" && $_POST["changePostFormTab"] != "lists" && !check_bitrix_sessid()) {
         $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_SEAC_CONNECTION_MODULE_IBLOCK'))));
     }
     if (!Loader::IncludeModule('bizproc')) {
         $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_SEAC_CONNECTION_MODULE_BIZPROC'))));
     }
     if (!Loader::includeModule('iblock')) {
         $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_SEAC_CONNECTION_MODULE_IBLOCK'))));
     }
     $this->iblockId = intval($this->request->getPost('IBLOCK_ID'));
     $this->iblockTypeId = COption::GetOptionString("lists", "livefeed_iblock_type_id");
     $this->checkPermissionElement();
     if ($this->errorCollection->hasErrors()) {
         $this->sendJsonErrorResponse();
     }
     $templateId = intval($_POST['TEMPLATE_ID']);
     $documentType = BizprocDocument::generateDocumentComplexType(COption::GetOptionString("lists", "livefeed_iblock_type_id"), $this->iblockId);
     if (!empty($templateId)) {
         if (CModule::IncludeModule('bizproc')) {
             if (!CBPWorkflowTemplateLoader::isConstantsTuned($templateId)) {
                 $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_IS_CONSTANTS_TUNED_NEW'))));
                 $this->sendJsonErrorResponse();
             }
         }
     } else {
         if (CModule::IncludeModule("bizproc")) {
             $templateObject = CBPWorkflowTemplateLoader::getTemplatesList(array('ID' => 'DESC'), array('DOCUMENT_TYPE' => $documentType, 'AUTO_EXECUTE' => CBPDocumentEventType::Create), false, false, array('ID'));
             $template = $templateObject->fetch();
             if (!empty($template)) {
                 if (!CBPWorkflowTemplateLoader::isConstantsTuned($template["ID"])) {
                     $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_IS_CONSTANTS_TUNED_NEW'))));
                     $this->sendJsonErrorResponse();
                 }
             } else {
                 $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_NOT_BIZPROC_TEMPLATE'))));
                 $this->sendJsonErrorResponse();
             }
         }
     }
     $list = new CList($this->iblockId);
     $fields = $list->getFields();
     $elementData = array("IBLOCK_ID" => $this->iblockId, "NAME" => $_POST["NAME"]);
     $props = array();
     foreach ($fields as $fieldId => $field) {
         if ($fieldId == "PREVIEW_PICTURE" || $fieldId == "DETAIL_PICTURE") {
             $elementData[$fieldId] = $_FILES[$fieldId];
             if (isset($_POST[$fieldId . "_del"]) && $_POST[$fieldId . "_del"] == "Y") {
                 $elementData[$fieldId]["del"] = "Y";
             }
         } elseif ($fieldId == "PREVIEW_TEXT" || $fieldId == "DETAIL_TEXT") {
             if (isset($field["SETTINGS"]) && is_array($field["SETTINGS"]) && $field["SETTINGS"]["USE_EDITOR"] == "Y") {
                 $elementData[$fieldId . "_TYPE"] = "html";
             } else {
                 $elementData[$fieldId . "_TYPE"] = "text";
             }
             $elementData[$fieldId] = $_POST[$fieldId];
         } elseif ($fieldId == 'ACTIVE_FROM' || $fieldId == 'ACTIVE_TO') {
             $elementData[$fieldId] = array_shift($_POST[$fieldId]);
         } elseif ($list->is_field($fieldId)) {
             $elementData[$fieldId] = $_POST[$fieldId];
         } elseif ($field["PROPERTY_TYPE"] == "F") {
             if (isset($_POST[$fieldId . "_del"])) {
                 $deleteArray = $_POST[$fieldId . "_del"];
             } else {
                 $deleteArray = array();
             }
             $props[$field["ID"]] = array();
             $files = $this->unEscape($_FILES);
             CFile::ConvertFilesToPost($files[$fieldId], $props[$field["ID"]]);
             foreach ($props[$field["ID"]] as $fileId => $file) {
                 if (isset($deleteArray[$fileId]) && (!is_array($deleteArray[$fileId]) && $deleteArray[$fileId] == "Y" || is_array($deleteArray[$fileId]) && $deleteArray[$fileId]["VALUE"] == "Y")) {
                     if (isset($props[$field["ID"]][$fileId]["VALUE"])) {
                         $props[$field["ID"]][$fileId]["VALUE"]["del"] = "Y";
                     } else {
                         $props[$field["ID"]][$fileId]["del"] = "Y";
                     }
                 }
             }
         } elseif ($field["PROPERTY_TYPE"] == "N") {
             if (is_array($_POST[$fieldId]) && !array_key_exists("VALUE", $_POST[$fieldId])) {
                 $props[$field["ID"]] = array();
                 foreach ($_POST[$fieldId] as $key => $value) {
                     if (is_array($value)) {
                         if (strlen($value["VALUE"])) {
                             $value = str_replace(" ", "", str_replace(",", ".", $value["VALUE"]));
                             if (!is_numeric($value)) {
                                 $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_IS_VALIDATE_FIELD_ERROR', array('#NAME#' => $field['NAME'])))));
                                 $this->sendJsonErrorResponse();
                             }
                             $props[$field["ID"]][$key] = doubleval($value);
                         }
                     } else {
                         if (strlen($value)) {
                             $value = str_replace(" ", "", str_replace(",", ".", $value));
                             if (!is_numeric($value)) {
                                 $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_IS_VALIDATE_FIELD_ERROR', array('#NAME#' => $field['NAME'])))));
                                 $this->sendJsonErrorResponse();
                             }
//.........这里部分代码省略.........
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:101,代码来源:ajax.php


示例17: CreateWorkflow

 /**
  * Creates new workflow instance from the specified template.
  *
  * @param int $workflowTemplateId - ID of the workflow template
  * @param string $documentId - ID of the document
  * @param mixed $workflowParameters - Optional parameters of the created workflow instance
  * @param array|null $parentWorkflow - Parent Workflow information.
  * @return CBPWorkflow
  * @throws CBPArgumentNullException
  * @throws CBPArgumentOutOfRangeException
  * @throws Exception
  * @throws \Bitrix\Main\ArgumentNullException
  */
 public function CreateWorkflow($workflowTemplateId, $documentId, $workflowParameters = array(), $parentWorkflow = null)
 {
     $workflowTemplateId = intval($workflowTemplateId);
     if ($workflowTemplateId <= 0) {
         throw new Exception("workflowTemplateId");
     }
     $arDocumentId = CBPHelper::ParseDocumentId($documentId);
     $limit = \Bitrix\Main\Config\Option::get("bizproc", "limit_simultaneous_processes", "0");
     if (intval($limit) > 0) {
         if (CBPStateService::CountDocumentWorkflows($documentId) >= $limit) {
             throw new Exception(GetMessage("BPCGDOC_LIMIT_SIMULTANEOUS_PROCESSES", array("#NUM#" => $limit)));
         }
     }
     if (!$this->isStarted) {
         $this->StartRuntime();
     }
     $workflowId = uniqid("", true);
     if ($parentWorkflow) {
         $this->addWorkflowToChain($workflowId, $parentWorkflow);
         if ($this->checkWorkflowRecursion($workflowId, $workflowTemplateId)) {
             throw new Exception(GetMessage("BPCGDOC_WORKFLOW_RECURSION_LOCK"));
         }
     }
     $workflow = new CBPWorkflow($workflowId, $this);
     $loader = CBPWorkflowTemplateLoader::GetLoader();
     list($rootActivity, $workflowVariablesTypes, $workflowParametersTypes) = $loader->LoadWorkflow($workflowTemplateId);
     if ($rootActivity == null) {
         throw new Exception("EmptyRootActivity");
     }
     //if (!is_a($rootActivity, "IBPRootActivity"))
     //	throw new Exception("RootActivityIsNotAIBPRootActivity");
     foreach (GetModuleEvents("bizproc", "OnCreateWorkflow", true) as $arEvent) {
         ExecuteModuleEventEx($arEvent, array($workflowTemplateId, $documentId, &$workflowParameters));
     }
     $workflow->Initialize($rootActivity, $arDocumentId, $workflowParameters, $workflowVariablesTypes, $workflowParametersTypes, $workflowTemplateId);
     $starterUserId = 0;
     if (isset($workflowParameters[CBPDocument::PARAM_TAGRET_USER])) {
         $starterUserId = intval(substr($workflowParameters[CBPDocument::PARAM_TAGRET_USER], strlen("user_")));
     }
     $this->arServices["StateService"]->AddWorkflow($workflowId, $workflowTemplateId, $arDocumentId, $starterUserId);
     $this->arWorkflows[$workflowId] = $workflow;
     return $workflow;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:56,代码来源:runtime.php


示例18: Delete

 public static function Delete($id)
 {
     $loader = CBPWorkflowTemplateLoader::GetLoader();
     $loader->DeleteTemplate($id);
     self::cleanTemplateCache($id);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:6,代码来源:workflowtemplateloader.php


示例19: GetPropertiesDialogValues

 public static function GetPropertiesDialogValues($documentType, $activityName, &$arWorkflowTemplate, &$arWorkflowParameters, &$arWorkflowVariables, $arCurrentValues, &$arErrors)
 {
     $arErrors = array();
     $runtime = CBPRuntime::GetRuntime();
     $arProperties = array();
     if ($arCurrentValues["time_type_selector"] == "time") {
         if (strlen($arCurrentValues["delay_date"]) > 0 && ($d = MakeTimeStamp($arCurrentValues["delay_date"]))) {
             $arProperties["TimeoutTime"] = $d;
         } elseif (strlen($arCurrentValues["delay_date_x"]) > 0 && (preg_match('#^{=[A-Za-z0-9_]+:[A-Za-z0-9_]+}$#i', $arCurrentValues["delay_date_x"]) || substr($arCurrentValues["delay_date_x"], 0, 1) == "=")) {
             $arProperties["TimeoutTime"] = $arCurrentValues["delay_date_x"];
         }
     } else {
         $arProperties["TimeoutDuration"] = $arCurrentValues["delay_time"];
         $arProperties["TimeoutDurationType"] = $arCurrentValues["delay_type"];
     }
     $arErrors = self::ValidateProperties($arProperties, new CBPWorkflowTemplateUser(CBPWorkflowTemplateUser::CurrentUser));
     if (count($arErrors) > 0) {
         return false;
     }
     $arCurrentActivity =& CBPWorkflowTemplateLoader::FindActivityByName($arWorkflowTemplate, $activityName);
     $arCurrentActivity["Properties"] = $arProperties;
     return true;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:23,代码来源:delayactivity.php


示例20: GetPropertiesDialogValues

 public static function GetPropertiesDialogValues($documentType, $activityName, &$arWorkflowTemplate, &$arWorkflowParameters, &$arWorkflowVariables, $arCurrentValues, &$arErrors)
 {
     $arErrors = array();
     $runtime = CBPRuntime::GetRuntime();
     $arProperties = array();
     if (!isset($arCurrentValues["user_type"]) || !in_array($arCurrentValues["user_type"], array("boss", "random"))) {
         $arCurrentValues["user_type"] = "random";
     }
     $arProperties["UserType"] = $arCurrentValues["user_type"];
     if (!isset($arCurrentValues["max_level"]) || $arCurrentValues["max_level"] < 1 || $arCurrentValues["max_level"] > 10) {
         $arCurrentValues["max_level"] = 1;
     }
     $arProperties["MaxLevel"] = $arCurrentValues["max_level"];
     $arProperties["UserParameter"] = CBPHelper::UsersStringToArray($arCurrentValues["user_parameter"], $documentType, $arErrors);
     if (count($arErrors) > 0) {
         return false;
     }
     $arProperties["ReserveUserParameter"] = CBPHelper::UsersStringToArray($arCurrentValues["reserve_user_parameter"], $documentType, $arErrors);
     if (count($arErrors) > 0) {
         return false;
     }
     if (!isset($arCurrentValues["skip_absent"]) || !in_array($arCurrentValues["skip_absent"], array("Y", "N"))) {
         $arCurrentValues["skip_absent"] = "Y";
     }
     $arProperties["SkipAbsent"] = $arCurrentValues["skip_absent"];
     $arErrors = self::ValidateProperties($arProperties, new CBPWorkflowTemplateUser(CBPWorkflowTemplateUser::CurrentUser));
     if (count($arErrors) > 0) {
         return false;
     }
     $arCurrentActivity =& CBPWorkflowTemplateLoader::FindActivityByName($arWorkflowTemplate, $activityName);
     $arCurrentActivity["Properties"] = $arProperties;
     return true;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:33,代码来源:getuseractivity.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CBTxt类代码示例发布时间:2022-05-23
下一篇:
PHP CBPTXT类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap