Ejemplo n.º 1
0
        if ($arr1["STATE_MODIFIED"] == $arr2["STATE_MODIFIED"]) {
            return 0;
        } elseif (strlen($arr1["STATE_MODIFIED"]) <= 0 && strlen($arr1["STATE_MODIFIED"]) > 0) {
            return -1;
        } elseif (strlen($arr1["STATE_MODIFIED"]) > 0 && strlen($arr1["STATE_MODIFIED"]) <= 0) {
            return 1;
        }
        $res1 = MakeTimeStamp($arr1["STATE_MODIFIED"]);
        $res2 = MakeTimeStamp($arr2["STATE_MODIFIED"]);
        return $res1 < $res2 ? 1 : -1;
    }
}
if (!empty($arResult["ERROR_MESSAGE"])) {
    ShowError($arResult["ERROR_MESSAGE"]);
}
CBPDocument::AddShowParameterInit($arParams["MODULE_ID"], "only_users", $arParams["DOCUMENT_TYPE"]);
$bizProcIndex = 0;
$bEmpty = true;
$bShowButtons = false;
$arDocumentStates = CBPDocument::GetDocumentStates($arParams["DOCUMENT_TYPE"], $arParams["DOCUMENT_ID"]);
$arGroups = CBPDocument::GetAllowableUserGroups($arParams["DOCUMENT_TYPE"]);
$arUsers = array();
uasort($arDocumentStates, "__bp_sort_in_template_by_modified");
?>
<div class="bizproc-page-document">

<form action="<?php 
echo POST_FORM_ACTION_URI;
?>
" method="POST" class="bizproc-form" name="start_workflow_form1" id="start_workflow_form1">
	<?php 
Ejemplo n.º 2
0
    $APPLICATION->SetTitle(str_replace("#ID#", $taskId, GetMessage("BPAT_TITLE")));
    if (strlen($errorMessage) > 0) {
        CAdminMessage::ShowMessage($errorMessage);
    }
    $runtime = CBPRuntime::GetRuntime();
    $runtime->StartRuntime();
    $documentService = $runtime->GetService("DocumentService");
    if (empty($arTask["PARAMETERS"]["DOCUMENT_ID"])) {
        CAdminMessage::ShowMessage(GetMessage('BPAT_NO_STATE'));
        $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);
    ?>
">
Ejemplo n.º 3
0
	<tr id="tr_BIZPROC_WF_STATUS">
		<td style="width:40%;"><?php 
echo GetMessage("IBEL_E_PUBLISHED");
?>
:</td>
		<td style="width:60%;"><?php 
echo $str_BP_PUBLISHED == "Y" ? GetMessage("MAIN_YES") : GetMessage("MAIN_NO");
?>
</td>
	</tr>
	<?
	$tabControl->EndCustomField("BIZPROC_WF_STATUS", '');

	$tabControl->BeginCustomField("BIZPROC", GetMessage("IBEL_E_TAB_BIZPROC"));

	CBPDocument::AddShowParameterInit(MODULE_ID, "only_users", DOCUMENT_TYPE);

	$bizProcIndex = 0;
	if (!isset($arDocumentStates))
	{
		$arDocumentStates = CBPDocument::GetDocumentStates(
			array(MODULE_ID, ENTITY, DOCUMENT_TYPE),
			($ID > 0) ? array(MODULE_ID, ENTITY, $ID) : null,
			"Y"
		);
	}
	foreach ($arDocumentStates as $arDocumentState)
	{
		$bizProcIndex++;
		if (strlen($arDocumentState["ID"]) > 0)
		{
Ejemplo n.º 4
0
 public function GetGUIFieldEdit($parameterDocumentType, $formName, $fieldName, $fieldValue, $arDocumentField = array(), $bAllowSelection = false)
 {
     list($moduleId, $entity, $documentType) = CBPHelper::ParseDocumentId($parameterDocumentType);
     if (strlen($moduleId) > 0) {
         CModule::IncludeModule($moduleId);
     }
     if (!is_array($arDocumentField) || count($arDocumentField) <= 0) {
         $arDocumentFields = $this->GetDocumentFields($parameterDocumentType);
         $arDocumentField = $arDocumentFields[$fieldName];
     }
     if (!array_key_exists("BP_AddShowParameterInit_" . $moduleId . "_" . $entity . "_" . $documentType, $GLOBALS)) {
         $GLOBALS["BP_AddShowParameterInit_" . $moduleId . "_" . $entity . "_" . $documentType] = 1;
         CBPDocument::AddShowParameterInit($moduleId, "only_users", $documentType, $entity);
     }
     if (class_exists($entity) && method_exists($entity, "GetGUIFieldEdit")) {
         return call_user_func_array(array($entity, "GetGUIFieldEdit"), array($documentType, $formName, $fieldName, $fieldValue, $arDocumentField, $bAllowSelection));
     }
     return CBPHelper::GetGUIFieldEdit($parameterDocumentType, $formName, $fieldName, $fieldValue, $arDocumentField, $bAllowSelection);
 }
//print_r($_POST);
function PHPToHiddens($ob, $name)
{
    if (is_array($ob)) {
        $s = "";
        foreach ($ob as $k => $v) {
            $s .= PHPToHiddens($v, $name . "[" . $k . "]");
        }
        return $s;
    }
    return '<input type="hidden" name="' . htmlspecialcharsbx($name) . '" value="' . htmlspecialcharsbx($ob) . '">';
}
echo PHPToHiddens($_POST['arWorkflowTemplate'], 'arWorkflowTemplate');
echo PHPToHiddens($_POST['arWorkflowParameters'], 'arWorkflowParameters');
echo PHPToHiddens($_POST['arWorkflowVariables'], 'arWorkflowVariables');
CBPDocument::AddShowParameterInit(MODULE_ID, "all", $_POST['document_type'], ENTITY);
echo bitrix_sessid_post();
?>
<input type="hidden" name="activity" value="<?php 
echo htmlspecialcharsbx($activityType);
?>
">
<input type="hidden" name="document_type" value="<?php 
echo htmlspecialcharsbx($document_type);
?>
">
<input type="hidden" name="id" value="<?php 
echo htmlspecialcharsbx($activityName);
?>
">
<input type="hidden" name="current_site_id" value="<?php 
Ejemplo n.º 6
0
        $editor->show($res);
        $html = ob_get_contents();
        ob_end_clean();
    }
    return $html;
}
$arTabSection = array(array("id" => "IBLOCK_SECTION_ID", "name" => $arResult["IBLOCK"]["SECTIONS_NAME"], "type" => 'list', "items" => $arResult["LIST_SECTIONS"], "params" => array("size" => 15)));
$arTabs = array(array("id" => "tab_el", "name" => $arResult["IBLOCK"]["ELEMENT_NAME"], "icon" => "", "fields" => $arTabElement), array("id" => "tab_se", "name" => $arResult["IBLOCK"]["SECTION_NAME"], "icon" => "", "fields" => $arTabSection));
$custom_html = "";
if (CModule::IncludeModule("bizproc") && $arResult["IBLOCK"]["BIZPROC"] != "N") {
    $arCurrentUserGroups = $GLOBALS["USER"]->GetUserGroupArray();
    if (!$arResult["ELEMENT_FIELDS"] || $arResult["ELEMENT_FIELDS"]["CREATED_BY"] == $GLOBALS["USER"]->GetID()) {
        $arCurrentUserGroups[] = "author";
    }
    $DOCUMENT_TYPE = "iblock_" . $arResult["IBLOCK_ID"];
    CBPDocument::AddShowParameterInit("iblock", "only_users", $DOCUMENT_TYPE);
    $arTab2Fields = array();
    $arTab2Fields[] = array("id" => "BIZPROC_WF_STATUS", "name" => GetMessage("CT_BLEE_BIZPROC_PUBLISHED"), "type" => "label", "value" => $arResult["ELEMENT_FIELDS"]["BP_PUBLISHED"] == "Y" ? GetMessage("MAIN_YES") : GetMessage("MAIN_NO"));
    $bizProcIndex = 0;
    $arDocumentStates = CBPDocument::GetDocumentStates(BizProcDocument::generateDocumentComplexType($arParams["IBLOCK_TYPE_ID"], $arResult["IBLOCK_ID"]), $arResult["ELEMENT_ID"] > 0 ? BizProcDocument::getDocumentComplexId($arParams["IBLOCK_TYPE_ID"], $arResult["ELEMENT_ID"]) : null, "Y");
    $custom_html .= '<input type="hidden" name="stop_bizproc" id="stop_bizproc" value="">';
    $runtime = CBPRuntime::GetRuntime();
    $runtime->StartRuntime();
    $documentService = $runtime->GetService("DocumentService");
    foreach ($arDocumentStates as $arDocumentState) {
        $bizProcIndex++;
        if ($arResult["ELEMENT_ID"] > 0) {
            $canViewWorkflow = CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::ViewWorkflow, $GLOBALS["USER"]->GetID(), BizProcDocument::getDocumentComplexId($arParams["IBLOCK_TYPE_ID"], $arResult["ELEMENT_ID"]), array("AllUserGroups" => $arCurrentUserGroups, "DocumentStates" => $arDocumentStates, "WorkflowId" => $arDocumentState["ID"]));
        } else {
            $canViewWorkflow = CBPDocument::CanUserOperateDocumentType(CBPCanUserOperateOperation::StartWorkflow, $GLOBALS["USER"]->GetID(), BizProcDocument::generateDocumentComplexType($arParams["IBLOCK_TYPE_ID"], $arResult["IBLOCK_ID"]), array("sectionId" => intval($arResult["SECTION_ID"]), "AllUserGroups" => $arCurrentUserGroups, "DocumentStates" => $arDocumentStates, "WorkflowId" => $arDocumentState["ID"]));
        }
Ejemplo n.º 7
0
$ar = array('inputName' => 'COMMENTS', 'inputId' => 'COMMENTS', 'height' => '180', 'content' => isset($arResult['ELEMENT']['~COMMENTS']) ? $arResult['ELEMENT']['~COMMENTS'] : '', 'bUseFileDialogs' => false, 'bFloatingToolbar' => false, 'bArisingToolbar' => false, 'bResizable' => true, 'bSaveOnBlur' => true, 'toolbarConfig' => array('Bold', 'Italic', 'Underline', 'Strike', 'BackColor', 'ForeColor', 'CreateLink', 'DeleteLink', 'InsertOrderedList', 'InsertUnorderedList', 'Outdent', 'Indent'));
$LHE = new CLightHTMLEditor();
$LHE->Show($ar);
$sVal = ob_get_contents();
ob_end_clean();
$arResult['FIELDS']['tab_1'][] = array('id' => 'COMMENTS', 'name' => GetMessage('CRM_FIELD_COMMENTS'), 'params' => array(), 'type' => 'vertical_container', 'value' => $sVal);
$arResult['FIELDS']['tab_1'][] = array('id' => 'OPENED', 'name' => GetMessage('CRM_FIELD_OPENED'), 'type' => 'vertical_checkbox', 'params' => array(), 'value' => isset($arResult['ELEMENT']['OPENED']) ? $arResult['ELEMENT']['OPENED'] : true, 'title' => GetMessage('CRM_FIELD_OPENED_TITLE'));
$arResult['FIELDS']['tab_1'][] = array('id' => 'EXPORT', 'name' => GetMessage('CRM_FIELD_EXPORT'), 'type' => 'vertical_checkbox', 'params' => array(), 'value' => isset($arResult['ELEMENT']['EXPORT']) ? $arResult['ELEMENT']['EXPORT'] : 'Y');
$arResult['FIELDS']['tab_1'][] = array('id' => 'section_additional', 'name' => GetMessage('CRM_SECTION_ADDITIONAL'), 'type' => 'section');
$arResult['FIELDS']['tab_1'][] = array('id' => 'TYPE_ID', 'name' => GetMessage('CRM_FIELD_TYPE_ID'), 'type' => 'list', 'items' => $arResult['TYPE_LIST'], 'value' => isset($arResult['ELEMENT']['TYPE_ID']) ? $arResult['ELEMENT']['TYPE_ID'] : '');
$arResult['FIELDS']['tab_1'][] = array('id' => 'ASSIGNED_BY_ID', 'componentParams' => array('NAME' => 'crm_contact_edit_resonsible', 'INPUT_NAME' => 'ASSIGNED_BY_ID', 'SEARCH_INPUT_NAME' => 'ASSIGNED_BY_NAME', 'NAME_TEMPLATE' => $arParams['NAME_TEMPLATE']), 'name' => GetMessage('CRM_FIELD_ASSIGNED_BY_ID'), 'type' => 'intranet_user_search', 'value' => isset($arResult['ELEMENT']['ASSIGNED_BY_ID']) ? $arResult['ELEMENT']['ASSIGNED_BY_ID'] : $USER->GetID());
$arResult['FIELDS']['tab_1'][] = array('id' => 'SOURCE_ID', 'name' => GetMessage('CRM_FIELD_SOURCE_ID'), 'type' => 'list', 'items' => $arResult['SOURCE_LIST'], 'value' => isset($arResult['ELEMENT']['~SOURCE_ID']) ? $arResult['ELEMENT']['~SOURCE_ID'] : '');
$arResult['FIELDS']['tab_1'][] = array('id' => 'SOURCE_DESCRIPTION', 'name' => GetMessage('CRM_FIELD_SOURCE_DESCRIPTION'), 'type' => 'textarea', 'params' => array(), 'value' => isset($arResult['ELEMENT']['SOURCE_DESCRIPTION']) ? $arResult['ELEMENT']['SOURCE_DESCRIPTION'] : '');
$CCrmUserType->AddFields($arResult['FIELDS']['tab_1'], $arResult['ELEMENT']['ID'], $arResult['FORM_ID'], $bConvert ? isset($arParams['~VARS_FROM_FORM']) && $arParams['~VARS_FROM_FORM'] === true : $varsFromForm, false, false, array('FILE_URL_TEMPLATE' => "/bitrix/components/bitrix/crm.contact.show/show_file.php?ownerId=#owner_id#&fieldName=#field_name#&fileId=#file_id#"));
if (IsModuleInstalled('bizproc')) {
    CBPDocument::AddShowParameterInit('crm', 'only_users', 'CONTACT');
    $bizProcIndex = 0;
    if (!isset($arDocumentStates)) {
        $arDocumentStates = CBPDocument::GetDocumentStates(array('crm', 'CCrmDocumentContact', 'CONTACT'), $bEdit ? array('crm', 'CCrmDocumentContact', 'CONTACT_' . $arResult['ELEMENT']['ID']) : null);
    }
    foreach ($arDocumentStates as $arDocumentState) {
        $bizProcIndex++;
        $canViewWorkflow = CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::ViewWorkflow, $USER->GetID(), array('crm', 'CCrmDocumentContact', $bEdit ? 'CONTACT_' . $arResult['ELEMENT']['ID'] : 'CONTACT_0'), array('UserGroups' => $CCrmBizProc->arCurrentUserGroups, 'DocumentStates' => $arDocumentStates, 'WorkflowId' => $arDocumentState['ID'] > 0 ? $arDocumentState['ID'] : $arDocumentState['TEMPLATE_ID'], 'CreatedBy' => $arResult['ELEMENT']['ASSIGNED_BY'], 'UserIsAdmin' => $USER->IsAdmin()));
        if (!$canViewWorkflow) {
            continue;
        }
        $arResult['FIELDS']['tab_1'][] = array('id' => 'section_bp_name_' . $bizProcIndex, 'name' => $arDocumentState['TEMPLATE_NAME'], 'type' => 'section');
        if ($arDocumentState['TEMPLATE_DESCRIPTION'] != '') {
            $arResult['FIELDS']['tab_1'][] = array('id' => 'BP_DESC_' . $bizProcIndex, 'name' => GetMessage('CRM_FIELD_BP_TEMPLATE_DESC'), 'type' => 'label', 'colspan' => true, 'value' => $arDocumentState['TEMPLATE_DESCRIPTION']);
        }
        if (!empty($arDocumentState['STATE_MODIFIED'])) {
Ejemplo n.º 8
0
                    $arParametersValues[$key] = $v;
                } else {
                    $keys1 = array_keys($v);
                    foreach ($keys1 as $key1) {
                        $arParametersValues[$key][$key1] = $v[$key1];
                    }
                }
            }
            $showMode = "WorkflowParameters";
        }
    } else {
        $showMode = "SelectWorkflow";
    }
}
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
CBPDocument::AddShowParameterInit(MODULE_ID, "only_users", $documentType[2], $documentType[1]);
if (strlen($fatalErrorMessage) > 0) {
    $APPLICATION->SetTitle(GetMessage("BPABS_ERROR"));
    CAdminMessage::ShowMessage($fatalErrorMessage);
} else {
    if (strlen($backUrl) <= 0) {
        $backUrl = CBPDocument::GetDocumentAdminPage($documentId);
    }
    $aMenu = array(array("TEXT" => GetMessage("BPABS_BACK"), "LINK" => $backUrl, "ICON" => "btn_list"));
    $context = new CAdminContextMenu($aMenu);
    $context->Show();
    $APPLICATION->SetTitle(GetMessage("BPABS_TITLE"));
    CAdminMessage::ShowMessage($errorMessage);
    if ($showMode == "StartWorkflowSuccess") {
        ?>
		<?php 
Ejemplo n.º 9
0
<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
$GLOBALS['APPLICATION']->AddHeadString('<script src="/bitrix/js/main/utils.js"></script>', true);
CBPDocument::AddShowParameterInit($arParams["DOCUMENT_TYPE"][0], "only_users", $arParams["DOCUMENT_TYPE"][2], $arParams["DOCUMENT_TYPE"][1]);
?>
<div class="bizproc-page-workflow-start">
<?php 
if (!empty($arResult["ERROR_MESSAGE"])) {
    ShowError($arResult["ERROR_MESSAGE"]);
}
if ($arResult["SHOW_MODE"] == "StartWorkflowSuccess") {
    ShowNote(str_replace("#TEMPLATE#", $arResult["TEMPLATES"][$arParams["TEMPLATE_ID"]]["NAME"], GetMessage("BPABS_MESSAGE_SUCCESS")));
} elseif ($arResult["SHOW_MODE"] == "StartWorkflowError") {
    ShowNote(str_replace("#TEMPLATE#", $arResult["TEMPLATES"][$arParams["TEMPLATE_ID"]]["NAME"], GetMessage("BPABS_MESSAGE_ERROR")));
} elseif ($arResult["SHOW_MODE"] == "WorkflowParameters") {
    ?>
<form method="post" name="start_workflow_form1" action="<?php 
    echo POST_FORM_ACTION_URI;
    ?>
" enctype="multipart/form-data">
	<input type="hidden" name="workflow_template_id" value="<?php 
    echo intval($arParams["TEMPLATE_ID"]);
    ?>
" />
	<input type="hidden" name="document_type" value="<?php 
    echo htmlspecialcharsbx($arParams["DOCUMENT_TYPE"][2]);
    ?>
" />
Ejemplo n.º 10
0
    }
}
ob_start();
$APPLICATION->IncludeComponent('bitrix:crm.product_row.list', '', $componentSettings, false, array('HIDE_ICONS' => 'Y', 'ACTIVE_COMPONENT' => 'Y'));
$sProductsHtml .= ob_get_contents();
ob_end_clean();
unset($componentSettings);
$arResult['FIELDS']['tab_1'][] = array('id' => 'PRODUCT_ROWS', 'name' => GetMessage('CRM_FIELD_PRODUCT_ROWS'), 'colspan' => true, 'type' => 'custom', 'value' => $sProductsHtml);
$arResult['FIELDS']['tab_1'][] = array('id' => 'section_additional', 'name' => GetMessage('CRM_SECTION_ADDITIONAL'), 'type' => 'section');
$icnt = count($arResult['FIELDS']['tab_1']);
$CCrmUserType->AddFields($arResult['FIELDS']['tab_1'], $arResult['ELEMENT']['ID'], $arResult['FORM_ID'], $bConvert ? isset($arParams['~VARS_FROM_FORM']) && $arParams['~VARS_FROM_FORM'] === true : $bVarsFromForm, false, false, array('FILE_URL_TEMPLATE' => "/bitrix/components/bitrix/crm.deal.show/show_file.php?ownerId=#owner_id#&fieldName=#field_name#&fileId=#file_id#"));
if (count($arResult['FIELDS']['tab_1']) == $icnt) {
    unset($arResult['FIELDS']['tab_1'][$icnt - 1]);
}
if (IsModuleInstalled('bizproc')) {
    CBPDocument::AddShowParameterInit('crm', 'only_users', 'DEAL');
    $bizProcIndex = 0;
    if (!isset($arDocumentStates)) {
        $arDocumentStates = CBPDocument::GetDocumentStates(array('crm', 'CCrmDocumentDeal', 'DEAL'), $bEdit ? array('crm', 'CCrmDocumentDeal', 'DEAL_' . $arResult['ELEMENT']['ID']) : null);
    }
    foreach ($arDocumentStates as $arDocumentState) {
        $bizProcIndex++;
        $canViewWorkflow = CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::ViewWorkflow, $USER->GetID(), array('crm', 'CCrmDocumentDeal', $bEdit ? 'DEAL_' . $arResult['ELEMENT']['ID'] : 'DEAL_0'), array('UserGroups' => $CCrmBizProc->arCurrentUserGroups, 'DocumentStates' => $arDocumentStates, 'WorkflowId' => $arDocumentState['ID'] > 0 ? $arDocumentState['ID'] : $arDocumentState['TEMPLATE_ID'], 'CreatedBy' => $arResult['ELEMENT']['ASSIGNED_BY'], 'UserIsAdmin' => $USER->IsAdmin()));
        if (!$canViewWorkflow) {
            continue;
        }
        $arResult['FIELDS']['tab_1'][] = array('id' => 'section_bp_name_' . $bizProcIndex, 'name' => $arDocumentState['TEMPLATE_NAME'], 'type' => 'section');
        if ($arDocumentState['TEMPLATE_DESCRIPTION'] != '') {
            $arResult['FIELDS']['tab_1'][] = array('id' => 'BP_DESC_' . $bizProcIndex, 'name' => GetMessage('CRM_FIELD_BP_TEMPLATE_DESC'), 'type' => 'label', 'colspan' => true, 'value' => $arDocumentState['TEMPLATE_DESCRIPTION']);
        }
        if (!empty($arDocumentState['STATE_MODIFIED'])) {
Ejemplo n.º 11
0
        $arr = array();
        foreach ($arResult["WF_STATUSES_PERMISSION"] as $key => $val) {
            if ($val == 2) {
                $arr[] = htmlspecialcharsEx($arResult["WF_STATUSES"][$key]);
            }
        }
        ?>
	<li class="wd-upload-form-propety">
		<span class="comments"><?php 
        echo count($arr) == 1 ? str_replace("#STATUS#", $arr[0], GetMessage("WD_WF_ATTENTION2")) : str_replace("#STATUS#", $arr[0], GetMessage("WD_WF_ATTENTION3"));
        ?>
</span>
	</li><?php 
    }
} elseif ($arParams["USE_BIZPROC"] == "Y") {
    CBPDocument::AddShowParameterInit("webdav", "only_users", $arParams["BIZPROC"]["DOCUMENT_TYPE"], $arParams["BIZPROC"]["ENTITY"]);
    $bizProcIndex = 0;
    $bizProcCounter = 0;
    $arDocumentStates = isset($arResult['DOCUMENT_STATES']) ? $arResult['DOCUMENT_STATES'] : array();
    if (!empty($arDocumentStates)) {
        ?>
		<li class="wd-upload-form-propety">
<?php 
        /*?>			<div class="wd-upload-form-propety-title"><?=GetMessage("WD_BP")?>:</div><?*/
        ?>
	<?php 
        foreach ($arDocumentStates as $arDocumentState) {
            $bizProcIndex++;
            $canViewWorkflow = CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::ViewWorkflow, $GLOBALS["USER"]->GetID(), $arParams["DOCUMENT_ID"], array("DocumentType" => $arParams["BIZPROC"]["DOCUMENT_TYPE"], "IBlockPermission" => $arParams["PERMISSION"], "AllUserGroups" => $arResult["CurrentUserGroups"], "DocumentStates" => $arDocumentStates, "WorkflowId" => $arDocumentState["ID"] > 0 ? $arDocumentState["ID"] : $arDocumentState["TEMPLATE_ID"]));
            if (!$canViewWorkflow || $arDocumentState['WORKFLOW_STATUS'] !== -1) {
                continue;
Ejemplo n.º 12
0
$arResult['FIELDS']['tab_1'][] = array('id' => 'ADDRESS', 'name' => GetMessage('CRM_FIELD_ADDRESS'), 'type' => 'address', 'componentParams' => array('SERVICE_URL' => '/bitrix/components/bitrix/crm.company.edit/ajax.php?siteID=' . SITE_ID . '&' . bitrix_sessid_get(), 'DATA' => array('ADDRESS' => array('NAME' => 'ADDRESS', 'IS_MULTILINE' => true, 'VALUE' => isset($arResult['ELEMENT']['~ADDRESS']) ? $arResult['ELEMENT']['~ADDRESS'] : ''), 'ADDRESS_2' => array('NAME' => 'ADDRESS_2', 'VALUE' => isset($arResult['ELEMENT']['~ADDRESS_2']) ? $arResult['ELEMENT']['~ADDRESS_2'] : ''), 'CITY' => array('NAME' => 'ADDRESS_CITY', 'VALUE' => isset($arResult['ELEMENT']['~ADDRESS_CITY']) ? $arResult['ELEMENT']['~ADDRESS_CITY'] : ''), 'REGION' => array('NAME' => 'ADDRESS_REGION', 'VALUE' => isset($arResult['ELEMENT']['~ADDRESS_REGION']) ? $arResult['ELEMENT']['~ADDRESS_REGION'] : ''), 'PROVINCE' => array('NAME' => 'ADDRESS_PROVINCE', 'VALUE' => isset($arResult['ELEMENT']['~ADDRESS_PROVINCE']) ? $arResult['ELEMENT']['~ADDRESS_PROVINCE'] : ''), 'POSTAL_CODE' => array('NAME' => 'ADDRESS_POSTAL_CODE', 'VALUE' => isset($arResult['ELEMENT']['~ADDRESS_POSTAL_CODE']) ? $arResult['ELEMENT']['~ADDRESS_POSTAL_CODE'] : ''), 'COUNTRY' => array('NAME' => 'ADDRESS_COUNTRY', 'VALUE' => isset($arResult['ELEMENT']['~ADDRESS_COUNTRY']) ? $arResult['ELEMENT']['~ADDRESS_COUNTRY'] : '', 'LOCALITY' => array('TYPE' => 'COUNTRY', 'NAME' => 'ADDRESS_COUNTRY_CODE', 'VALUE' => isset($arResult['ELEMENT']['~ADDRESS_COUNTRY_CODE']) ? $arResult['ELEMENT']['~ADDRESS_COUNTRY_CODE'] : '')))));
$arResult['FIELDS']['tab_1'][] = array('id' => 'ADDRESS_LEGAL', 'name' => GetMessage('CRM_FIELD_ADDRESS_LEGAL'), 'type' => 'address', 'componentParams' => array('SERVICE_URL' => '/bitrix/components/bitrix/crm.company.edit/ajax.php?siteID=' . SITE_ID . '&' . bitrix_sessid_get(), 'DATA' => array('ADDRESS' => array('NAME' => 'REG_ADDRESS', 'IS_MULTILINE' => true, 'VALUE' => isset($arResult['ELEMENT']['~REG_ADDRESS']) ? $arResult['ELEMENT']['~REG_ADDRESS'] : ''), 'ADDRESS_2' => array('NAME' => 'REG_ADDRESS_2', 'VALUE' => isset($arResult['ELEMENT']['~REG_ADDRESS_2']) ? $arResult['ELEMENT']['~REG_ADDRESS_2'] : ''), 'CITY' => array('NAME' => 'REG_ADDRESS_CITY', 'VALUE' => isset($arResult['ELEMENT']['~REG_ADDRESS_CITY']) ? $arResult['ELEMENT']['~REG_ADDRESS_CITY'] : ''), 'REGION' => array('NAME' => 'REG_ADDRESS_REGION', 'VALUE' => isset($arResult['ELEMENT']['~REG_ADDRESS_REGION']) ? $arResult['ELEMENT']['~REG_ADDRESS_REGION'] : ''), 'PROVINCE' => array('NAME' => 'REG_ADDRESS_PROVINCE', 'VALUE' => isset($arResult['ELEMENT']['~REG_ADDRESS_PROVINCE']) ? $arResult['ELEMENT']['~REG_ADDRESS_PROVINCE'] : ''), 'POSTAL_CODE' => array('NAME' => 'REG_ADDRESS_POSTAL_CODE', 'VALUE' => isset($arResult['ELEMENT']['~REG_ADDRESS_POSTAL_CODE']) ? $arResult['ELEMENT']['~REG_ADDRESS_POSTAL_CODE'] : ''), 'COUNTRY' => array('NAME' => 'REG_ADDRESS_COUNTRY', 'VALUE' => isset($arResult['ELEMENT']['~REG_ADDRESS_COUNTRY']) ? $arResult['ELEMENT']['~REG_ADDRESS_COUNTRY'] : '', 'LOCALITY' => array('TYPE' => 'COUNTRY', 'NAME' => 'REG_ADDRESS_COUNTRY_CODE', 'VALUE' => isset($arResult['ELEMENT']['~REG_ADDRESS_COUNTRY_CODE']) ? $arResult['ELEMENT']['~REG_ADDRESS_COUNTRY_CODE'] : '')))));
$arResult['FIELDS']['tab_1'][] = array('id' => 'BANKING_DETAILS', 'name' => GetMessage('CRM_FIELD_BANKING_DETAILS'), 'type' => 'textarea', 'params' => array(), 'value' => isset($arResult['ELEMENT']['BANKING_DETAILS']) ? $arResult['ELEMENT']['BANKING_DETAILS'] : '');
// Contacts selector
$arResult['FIELDS']['tab_1'][] = array('id' => 'section_contacts', 'name' => GetMessage('CRM_SECTION_CONTACTS'), 'type' => 'section');
if (CCrmContact::CheckReadPermission(0, $userPermissions)) {
    ob_start();
    $GLOBALS['APPLICATION']->IncludeComponent('bitrix:crm.entity.selector', '', array('ENTITY_TYPE' => 'CONTACT', 'INPUT_NAME' => 'CONTACT_ID', 'INPUT_VALUE' => isset($arResult['CONTACT_ID']) ? $arResult['CONTACT_ID'] : '', 'FORM_NAME' => $arResult['FORM_ID'], 'MULTIPLE' => 'Y'), false, array('HIDE_ICONS' => 'Y'));
    $sVal = ob_get_contents();
    ob_end_clean();
    $arResult['FIELDS']['tab_1'][] = array('id' => 'CONTACT_ID', 'name' => GetMessage('CRM_FIELD_CONTACT_ID'), 'type' => 'custom', 'wrap' => true, 'value' => $sVal);
}
$arResult['FIELDS']['tab_1'][] = array('id' => 'section_additional', 'name' => GetMessage('CRM_SECTION_ADDITIONAL'), 'type' => 'section');
$CCrmUserType->AddFields($arResult['FIELDS']['tab_1'], $arResult['ELEMENT']['ID'], $arResult['FORM_ID'], $bConvert ? isset($arParams['~VARS_FROM_FORM']) && $arParams['~VARS_FROM_FORM'] === true : $bVarsFromForm, false, false, array('FILE_URL_TEMPLATE' => "/bitrix/components/bitrix/crm.company.show/show_file.php?ownerId=#owner_id#&fieldName=#field_name#&fileId=#file_id#"));
if (IsModuleInstalled('bizproc')) {
    CBPDocument::AddShowParameterInit('crm', 'only_users', 'COMPANY');
    $bizProcIndex = 0;
    if (!isset($arDocumentStates)) {
        $arDocumentStates = CBPDocument::GetDocumentStates(array('crm', 'CCrmDocumentCompany', 'COMPANY'), $bEdit ? array('crm', 'CCrmDocumentCompany', 'COMPANY_' . $arResult['ELEMENT']['ID']) : null);
    }
    foreach ($arDocumentStates as $arDocumentState) {
        $bizProcIndex++;
        $canViewWorkflow = CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::ViewWorkflow, $USER->GetID(), array('crm', 'CCrmDocumentCompany', $bEdit ? 'COMPANY_' . $arResult['ELEMENT']['ID'] : 'COMPANY_0'), array('UserGroups' => $CCrmBizProc->arCurrentUserGroups, 'DocumentStates' => $arDocumentStates, 'WorkflowId' => $arDocumentState['ID'] > 0 ? $arDocumentState['ID'] : $arDocumentState['TEMPLATE_ID'], 'CreatedBy' => $arResult['ELEMENT']['ASSIGNED_BY'], 'UserIsAdmin' => $USER->IsAdmin()));
        if (!$canViewWorkflow) {
            continue;
        }
        $arResult['FIELDS']['tab_1'][] = array('id' => 'section_bp_name_' . $bizProcIndex, 'name' => $arDocumentState['TEMPLATE_NAME'], 'type' => 'section');
        if ($arDocumentState['TEMPLATE_DESCRIPTION'] != '') {
            $arResult['FIELDS']['tab_1'][] = array('id' => 'BP_DESC_' . $bizProcIndex, 'name' => GetMessage('CRM_FIELD_BP_TEMPLATE_DESC'), 'type' => 'label', 'colspan' => true, 'value' => $arDocumentState['TEMPLATE_DESCRIPTION']);
        }
        if (!empty($arDocumentState['STATE_MODIFIED'])) {
Ejemplo n.º 13
0
/** @var array $arResult */
/** @global CMain $APPLICATION */
/** @global CUser $USER */
/** @global CDatabase $DB */
/** @var CBitrixComponentTemplate $this */
/** @var string $templateName */
/** @var string $templateFile */
/** @var string $templateFolder */
/** @var string $componentPath */
/** @var \Bitrix\Disk\Internals\BaseComponent $component */
use Bitrix\Main\Localization\Loc;
$GLOBALS['APPLICATION']->AddHeadScript('/bitrix/js/main/utils.js');
if (isset($_GET['old'])) {
    CBPDocument::AddShowParameterInit($arResult["DOCUMENT_DATA"]["WEBDAV"]["DOCUMENT_TYPE"][0], "only_users", $arResult["DOCUMENT_DATA"]["WEBDAV"]["DOCUMENT_TYPE"][2], $arResult["DOCUMENT_DATA"]["WEBDAV"]["DOCUMENT_TYPE"][1]);
} else {
    CBPDocument::AddShowParameterInit($arResult["DOCUMENT_DATA"]["DISK"]["DOCUMENT_TYPE"][0], "only_users", $arResult["DOCUMENT_DATA"]["DISK"]["DOCUMENT_TYPE"][2], $arResult["DOCUMENT_DATA"]["DISK"]["DOCUMENT_TYPE"][1]);
}
?>
<div class="bizproc-page-workflow-start">
<?php 
if ($arResult["SHOW_MODE"] == "StartWorkflowSuccess") {
    if (!empty($arResult["TEMPLATES"][$arParams["TEMPLATE_ID"]]["NAME"])) {
        ShowNote(str_replace("#TEMPLATE#", $arResult["TEMPLATES"][$arParams["TEMPLATE_ID"]]["NAME"], Loc::getMessage("BPABS_MESSAGE_SUCCESS")));
    } else {
        ShowNote(str_replace("#TEMPLATE#", $arResult["TEMPLATES_OLD"][$arParams["TEMPLATE_ID"]]["NAME"], Loc::getMessage("BPABS_MESSAGE_SUCCESS")));
    }
} elseif ($arResult["SHOW_MODE"] == "StartWorkflowError") {
    if (!empty($arResult["TEMPLATES"][$arParams["TEMPLATE_ID"]]["NAME"])) {
        ShowNote(str_replace("#TEMPLATE#", $arResult["TEMPLATES"][$arParams["TEMPLATE_ID"]]["NAME"], Loc::getMessage("BPABS_MESSAGE_ERROR")));
    } else {
        ShowNote(str_replace("#TEMPLATE#", $arResult["TEMPLATES_OLD"][$arParams["TEMPLATE_ID"]]["NAME"], Loc::getMessage("BPABS_MESSAGE_ERROR")));