本文整理汇总了PHP中CBPWorkflowTemplateLoader::FindActivityByName方法的典型用法代码示例。如果您正苦于以下问题:PHP CBPWorkflowTemplateLoader::FindActivityByName方法的具体用法?PHP CBPWorkflowTemplateLoader::FindActivityByName怎么用?PHP CBPWorkflowTemplateLoader::FindActivityByName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBPWorkflowTemplateLoader
的用法示例。
在下文中一共展示了CBPWorkflowTemplateLoader::FindActivityByName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}
示例8: GetPropertiesDialogValues
public static function GetPropertiesDialogValues($documentType, $activityName, &$arWorkflowTemplate, &$arWorkflowParameters, &$arWorkflowVariables, $arCurrentValues, &$arErrors)
{
$arErrors = array();
$arMap = array("group_name" => "GroupName", "owner_id" => "OwnerId", "users" => "Users");
$arProperties = array();
foreach ($arMap as $key => $value) {
if ($key == "owner_id" || $key == "users") {
continue;
}
$arProperties[$value] = $arCurrentValues[$key];
}
$arProperties["OwnerId"] = CBPHelper::UsersStringToArray($arCurrentValues["owner_id"], $documentType, $arErrors);
if (count($arErrors) > 0) {
return false;
}
$arProperties["Users"] = CBPHelper::UsersStringToArray($arCurrentValues["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;
}
示例9: GetPropertiesDialogValues
public static function GetPropertiesDialogValues($documentType, $activityName, &$arWorkflowTemplate, &$arWorkflowParameters, &$arWorkflowVariables, $arCurrentValues, &$arErrors)
{
$arErrors = array();
$runtime = CBPRuntime::GetRuntime();
$arProperties = array("FieldValue" => array());
$documentService = $runtime->GetService("DocumentService");
$arNewFieldsMap = array();
if (array_key_exists("new_field_name", $arCurrentValues) && is_array($arCurrentValues["new_field_name"])) {
$arNewFieldKeys = array_keys($arCurrentValues["new_field_name"]);
foreach ($arNewFieldKeys as $k) {
$code = trim($arCurrentValues["new_field_code"][$k]);
//if (!array_key_exists($code, $arCurrentValues))
// continue;
$arFieldsTmp = array("name" => $arCurrentValues["new_field_name"][$k], "code" => $code, "type" => $arCurrentValues["new_field_type"][$k], "multiple" => $arCurrentValues["new_field_mult"][$k], "required" => $arCurrentValues["new_field_req"][$k], "options" => $arCurrentValues["new_field_options"][$k]);
$newCode = $documentService->AddDocumentField($documentType, $arFieldsTmp);
$arNewFieldsMap[$newCode] = $code;
}
}
$arDocumentFields = $documentService->GetDocumentFields($documentType);
foreach ($arDocumentFields as $fieldKey => $fieldValue) {
if (!$fieldValue["Editable"]) {
continue;
}
$fieldKey1 = array_key_exists($fieldKey, $arNewFieldsMap) ? $arNewFieldsMap[$fieldKey] : $fieldKey;
$arErrors = array();
$r = $documentService->GetFieldInputValue($documentType, $fieldValue, $fieldKey1, $arCurrentValues, $arErrors);
if (!is_null($r)) {
$arProperties["FieldValue"][$fieldKey] = $r;
}
}
$arErrors = self::ValidateProperties($arProperties, new CBPWorkflowTemplateUser(CBPWorkflowTemplateUser::CurrentUser));
if (count($arErrors) > 0) {
return false;
}
$arCurrentActivity =& CBPWorkflowTemplateLoader::FindActivityByName($arWorkflowTemplate, $activityName);
$arCurrentActivity["Properties"] = $arProperties;
return true;
}
示例10: 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;
}
示例11: GetPropertiesDialogValues
public static function GetPropertiesDialogValues($documentType, $activityName, &$arWorkflowTemplate, &$arWorkflowParameters, &$arWorkflowVariables, $arCurrentValues, &$arErrors)
{
$arErrors = array();
$arMap = array("owner_id" => "OwnerId", "users_to" => "UsersTo", "post_title" => "PostTitle", "post_message" => "PostMessage", 'post_message_type' => "PostMessageType", 'post_site' => "PostSite");
$arProperties = array();
foreach ($arMap as $key => $value) {
if ($key == "owner_id" || $key == "users_to") {
continue;
}
$arProperties[$value] = $arCurrentValues[$key];
}
if (strlen($arProperties["PostSite"]) <= 0) {
$arProperties["PostSite"] = $arCurrentValues["post_site_x"];
}
$arProperties["OwnerId"] = CBPHelper::UsersStringToArray($arCurrentValues["owner_id"], $documentType, $arErrors);
if (count($arErrors) > 0) {
return false;
}
$arProperties["UsersTo"] = CBPHelper::UsersStringToArray($arCurrentValues["users_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;
}
示例12: GetPropertiesDialogValues
//.........这里部分代码省略.........
if (CModule::IncludeModule("socialnetwork")) {
$db = CSocNetGroup::GetList(array("NAME" => "ASC"), array("ACTIVE" => "Y"), false, false, array("ID", "NAME"));
while ($ar = $db->GetNext()) {
$arGroups[$ar["ID"]] = "[" . $ar["ID"] . "]" . $ar["NAME"];
}
}
$arDF = self::__GetFields();
foreach (static::$arAllowedTasksFieldNames as $field) {
$r = null;
if (in_array($field, array("CREATED_BY", "RESPONSIBLE_ID", "ACCOMPLICES", "AUDITORS"))) {
$value = $arCurrentValues[$field];
if (strlen($value) > 0) {
$arErrorsTmp = array();
$r = CBPHelper::UsersStringToArray($value, $documentType, $arErrorsTmp);
if (count($arErrorsTmp) > 0) {
$arErrors = array_merge($arErrors, $arErrorsTmp);
}
}
} elseif (array_key_exists($field, $arCurrentValues) || array_key_exists($field . "_text", $arCurrentValues)) {
$arValue = array();
if (array_key_exists($field, $arCurrentValues)) {
$arValue = $arCurrentValues[$field];
if (!is_array($arValue) || is_array($arValue) && CBPHelper::IsAssociativeArray($arValue)) {
$arValue = array($arValue);
}
}
if (array_key_exists($field . "_text", $arCurrentValues)) {
$arValue[] = $arCurrentValues[$field . "_text"];
}
foreach ($arValue as $value) {
$value = trim($value);
if (!preg_match("#^\\{=[a-z0-9_]+:[a-z0-9_]+\\}\$#i", $value) && substr($value, 0, 1) !== "=") {
if ($field == "PRIORITY") {
if (strlen($value) <= 0) {
$value = null;
}
if ($value != null && !array_key_exists($value, $arTaskPriority)) {
$value = null;
$arErrors[] = array("code" => "ErrorValue", "message" => "Priority is empty", "parameter" => $field);
}
} elseif ($field == "GROUP_ID") {
if (strlen($value) <= 0) {
$value = null;
}
if ($value != null && !array_key_exists($value, $arGroups)) {
$value = null;
$arErrors[] = array("code" => "ErrorValue", "message" => "Group is empty", "parameter" => $field);
}
} elseif (in_array($field, array("ALLOW_CHANGE_DEADLINE", "TASK_CONTROL", "ADD_IN_REPORT", 'ALLOW_TIME_TRACKING'))) {
if (strtoupper($value) == "Y" || $value === true || $value . "!" == "1!") {
$value = "Y";
} elseif (strtoupper($value) == "N" || $value === false || $value . "!" == "0!") {
$value = "N";
} else {
$value = null;
}
} else {
if (!is_array($value) && strlen($value) <= 0) {
$value = null;
}
}
}
if ($value != null) {
$r[] = $value;
}
}
}
$r_orig = $r;
if (!in_array($field, array("ACCOMPLICES", "AUDITORS"))) {
if (count($r) > 0) {
$r = $r[0];
} else {
$r = null;
}
}
if (in_array($field, array("TITLE", "CREATED_BY", "RESPONSIBLE_ID")) && ($r == null || is_array($r) && count($r) <= 0)) {
$arErrors[] = array("code" => "emptyRequiredField", "message" => str_replace("#FIELD#", $arDF[$field]["Name"], GetMessage("BPCDA_FIELD_REQUIED")));
}
$arProperties["Fields"][$field] = $r;
if (array_key_exists($field . "_text", $arCurrentValues) && isset($r_orig[1])) {
$arProperties["Fields"][$field . '_text'] = $r_orig[1];
}
}
$arUserFields = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFields("TASKS_TASK", 0, LANGUAGE_ID);
foreach ($arUserFields as $field) {
$r = $arCurrentValues[$field["FIELD_NAME"]];
if ($field["MULTIPLE"] == "Y" && (!$r || is_array($r) && count($r) <= 0)) {
$arErrors[] = array("code" => "emptyRequiredField", "message" => str_replace("#FIELD#", $field["EDIT_FORM_LABEL"], GetMessage("BPCDA_FIELD_REQUIED")));
}
$arProperties["Fields"][$field["FIELD_NAME"]] = $r;
}
$arProperties["HoldToClose"] = strtoupper($arCurrentValues["HOLD_TO_CLOSE"]) == "Y" ? true : false;
$arProperties["AUTO_LINK_TO_CRM_ENTITY"] = strtoupper($arCurrentValues["AUTO_LINK_TO_CRM_ENTITY"]) == "Y" ? true : false;
if (count($arErrors) > 0) {
return false;
}
$arCurrentActivity =& CBPWorkflowTemplateLoader::FindActivityByName($arWorkflowTemplate, $activityName);
$arCurrentActivity["Properties"] = $arProperties;
return true;
}
示例13: 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;
}
示例14: GetPropertiesDialogValues
public static function GetPropertiesDialogValues($documentType, $activityName, &$arWorkflowTemplate, &$arWorkflowParameters, &$arWorkflowVariables, $arCurrentValues, &$arErrors)
{
$arErrors = Array();
$runtime = CBPRuntime::GetRuntime();
$arProperties = array();
$arProperties["DealId"] = $arCurrentValues["deal_id"];
$arProperties["WaitForState"] = $arCurrentValues["stage"];
$arErrors = self::ValidateProperties($arProperties, new CBPWorkflowTemplateUser(CBPWorkflowTemplateUser::CurrentUser));
if (count($arErrors) > 0)
return false;
$arCurrentActivity = &CBPWorkflowTemplateLoader::FindActivityByName($arWorkflowTemplate, $activityName);
$arCurrentActivity["Properties"] = $arProperties;
return true;
}
示例15: GetPropertiesDialogValues
public static function GetPropertiesDialogValues($documentType, $activityName, &$arWorkflowTemplate, &$arWorkflowParameters, &$arWorkflowVariables, $arCurrentValues, &$arErrors)
{
$arErrors = array();
$runtime = CBPRuntime::GetRuntime();
$arMap = array("absence_user" => "AbsenceUser", "absence_name" => "AbsenceName", "absence_desrc" => "AbsenceDesrc", "absence_from" => "AbsenceFrom", "absence_to" => "AbsenceTo", "absence_state" => "AbsenceState", "absence_finish_state" => "AbsenceFinishState", "absence_type" => "AbsenceType");
$arProperties = array();
foreach ($arMap as $key => $value) {
if ($key == "absence_user") {
continue;
}
$arProperties[$value] = $arCurrentValues[$key];
}
$arProperties["AbsenceUser"] = CBPHelper::UsersStringToArray($arCurrentValues["absence_user"], $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;
}