本文整理汇总了PHP中CCrmStatus::GetStatusList方法的典型用法代码示例。如果您正苦于以下问题:PHP CCrmStatus::GetStatusList方法的具体用法?PHP CCrmStatus::GetStatusList怎么用?PHP CCrmStatus::GetStatusList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCrmStatus
的用法示例。
在下文中一共展示了CCrmStatus::GetStatusList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetPropertiesDialog
public static function GetPropertiesDialog($documentType, $activityName, $arWorkflowTemplate, $arWorkflowParameters, $arWorkflowVariables, $arCurrentValues = null, $formName = '')
{
if (!CModule::IncludeModule('crm')) {
return false;
}
$runtime = CBPRuntime::GetRuntime();
$arMap = array('EventType' => 'event_type', 'EventText' => 'event_text');
if (!is_array($arWorkflowParameters)) {
$arWorkflowParameters = array();
}
if (!is_array($arWorkflowVariables)) {
$arWorkflowVariables = array();
}
if (!is_array($arCurrentValues)) {
$arCurrentActivity =& CBPWorkflowTemplateLoader::FindActivityByName($arWorkflowTemplate, $activityName);
if (is_array($arCurrentActivity['Properties'])) {
foreach ($arMap as $k => $v) {
if (array_key_exists($k, $arCurrentActivity['Properties'])) {
$arCurrentValues[$arMap[$k]] = $arCurrentActivity['Properties'][$k];
} else {
$arCurrentValues[$arMap[$k]] = '';
}
}
} else {
foreach ($arMap as $k => $v) {
$arCurrentValues[$arMap[$k]] = '';
}
}
}
return $runtime->ExecuteResourceFile(__FILE__, 'properties_dialog.php', array('arCurrentValues' => $arCurrentValues, 'arTypes' => CCrmStatus::GetStatusList('EVENT_TYPE'), 'formName' => $formName));
}
示例2: PrepareDocument
public static function PrepareDocument(array &$arFields)
{
$stuses = CCrmStatus::GetStatusList('STATUS');
$statusID = isset($arFields['STATUS_ID']) ? $arFields['STATUS_ID'] : '';
$arFields['STATUS_ID_PRINTABLE'] = $statusID !== '' && isset($stuses[$statusID]) ? $stuses[$statusID] : '';
$arFields['FULL_ADDRESS'] = Bitrix\Crm\Format\LeadAddressFormatter::format($arFields, array('SEPARATOR' => Bitrix\Crm\Format\AddressSeparator::Comma));
}
示例3: GetAdminListEditHTML
function GetAdminListEditHTML($arUserField, $arHtmlControl)
{
$ar = CCrmStatus::GetStatusList($arUserField['SETTINGS']['ENTITY_TYPE']);
foreach ($ar as $key => $name) {
$arr['reference'][] = $name;
$arr['reference_id'][] = $key;
}
return SelectBoxFromArray($arHtmlControl['NAME'], $arr, $arHtmlControl['VALUE']);
}
示例4: GetStatusList
protected static function GetStatusList()
{
$ar = CCrmStatus::GetStatusList('STATUS');
$CXMLCreatorR = new CXMLCreator('CHOISES');
foreach ($ar as $key => $value) {
$CXMLCreator = new CXMLCreator('CHOISE', true);
$CXMLCreator->setAttribute('id', $key);
$CXMLCreator->setData($value);
$CXMLCreatorR->addChild($CXMLCreator);
}
return $CXMLCreatorR;
}
示例5: initializeDemoData
/**
* @return array
*/
public function initializeDemoData(array $data)
{
if (!(isset($data['items']) && is_array($data['items']))) {
return $data;
}
$stages = \CCrmStatus::GetStatusList('DEAL_STAGE');
foreach ($data['items'] as &$item) {
$stageID = isset($item['ID']) ? $item['ID'] : '';
if ($stageID !== '' && isset($stages[$stageID])) {
$item['NAME'] = $stages[$stageID];
}
}
unset($item);
return $data;
}
示例6: installDefault
public static function installDefault()
{
$items = array();
$langIDs = self::getAllLangIDs();
foreach ($langIDs as $langID) {
IncludeModuleLangFile(__FILE__, $langID);
$s = trim(GetMessage('CRM_HONORIFIC_DEFAULT'));
if ($s === '' || $s === '-') {
//Skip stub
continue;
}
$slugs = explode('|', $s);
$slugCount = count($slugs);
for ($i = 0; $i < $slugCount; $i++) {
$ary = explode(';', $slugs[$i]);
$count = count($ary);
if ($count >= 2) {
$name = trim($ary[1]);
$statusID = trim($ary[0]);
} else {
$name = trim($ary[0]);
$statusID = '';
}
if ($statusID === '') {
$statusID = 'HNR_' . strtoupper($langID) . '_' . ($i + 1);
}
if ($name === '' || isset($items[$statusID])) {
continue;
}
$items[$statusID] = array('STATUS_ID' => $statusID, 'NAME' => $name, 'SORT' => ($i + 1) * 10, 'SYSTEM' => 'N');
}
}
$statusEntity = new \CCrmStatus('HONORIFIC');
$presentItems = \CCrmStatus::GetStatusList('HONORIFIC');
foreach ($items as $item) {
if (!isset($presentItems[$item['STATUS_ID']])) {
$statusEntity->Add($item);
}
}
}
示例7: CCrmUserType
$CCrmUserType = new CCrmUserType($USER_FIELD_MANAGER, CCrmDeal::$sUFEntityID);
$arResult['STAGE_LIST'] = CCrmStatus::GetStatusListEx('DEAL_STAGE');
$arResult['CURRENCY_LIST'] = CCrmCurrencyHelper::PrepareListItems();
$arResult['FILTER'] = array();
$arResult['GRID_ID'] = 'CRM_DEAL_FUNNEL';
if (!$bInternal) {
$arResult['FILTER2LOGIC'] = array();
ob_start();
$GLOBALS['APPLICATION']->IncludeComponent('bitrix:crm.entity.selector', '', array('ENTITY_TYPE' => 'CONTACT', 'INPUT_NAME' => 'CONTACT_ID', 'INPUT_VALUE' => isset($_REQUEST['CONTACT_ID']) ? intval($_REQUEST['CONTACT_ID']) : '', 'FORM_NAME' => $arResult['GRID_ID'], 'MULTIPLE' => 'N', 'FILTER' => true), false, array('HIDE_ICONS' => 'Y'));
$sValContact = ob_get_contents();
ob_end_clean();
ob_start();
$GLOBALS['APPLICATION']->IncludeComponent('bitrix:crm.entity.selector', '', array('ENTITY_TYPE' => 'COMPANY', 'INPUT_NAME' => 'COMPANY_ID', 'INPUT_VALUE' => isset($_REQUEST['COMPANY_ID']) ? intval($_REQUEST['COMPANY_ID']) : '', 'FORM_NAME' => $arResult['GRID_ID'], 'MULTIPLE' => 'N', 'FILTER' => true), false, array('HIDE_ICONS' => 'Y'));
$sValCompany = ob_get_contents();
ob_end_clean();
$arResult['FILTER'] = array(array('id' => 'OPPORTUNITY', 'name' => GetMessage('CRM_COLUMN_OPPORTUNITY'), 'type' => 'number'), array('id' => 'CURRENCY_ID', 'name' => GetMessage('CRM_COLUMN_CURRENCY_ID'), 'type' => 'list', 'items' => array('' => '') + CCrmCurrencyHelper::PrepareListItems()), array('id' => 'PROBABILITY', 'name' => GetMessage('CRM_COLUMN_PROBABILITY'), 'type' => 'number'), array('id' => 'CLOSED', 'name' => GetMessage('CRM_COLUMN_CLOSED'), 'type' => 'list', 'items' => array('' => '', 'Y' => GetMessage('MAIN_YES'), 'N' => GetMessage('MAIN_NO'))), array('id' => 'TYPE_ID', 'name' => GetMessage('CRM_COLUMN_TYPE_ID'), 'default' => 'Y', 'type' => 'list', 'items' => array('' => '') + CCrmStatus::GetStatusList('DEAL_TYPE')), array('id' => 'BEGINDATE', 'name' => GetMessage('CRM_COLUMN_BEGINDATE'), 'type' => 'date'), array('id' => 'CLOSEDATE', 'name' => GetMessage('CRM_COLUMN_CLOSEDATE'), 'type' => 'date'), array('id' => 'DATE_CREATE', 'name' => GetMessage('CRM_COLUMN_DATE_CREATE'), 'default' => 'Y', 'type' => 'date'), array('id' => 'DATE_MODIFY', 'name' => GetMessage('CRM_COLUMN_DATE_MODIFY'), 'default' => 'Y', 'type' => 'date'), array('id' => 'MODIFY_BY_ID', 'name' => GetMessage('CRM_COLUMN_MODIFY_BY'), 'enable_settings' => false, 'type' => 'user'), array('id' => 'ASSIGNED_BY_ID', 'name' => GetMessage('CRM_COLUMN_ASSIGNED_BY'), 'default' => 'Y', 'enable_settings' => false, 'type' => 'user'), array('id' => 'CONTACT_ID', 'name' => GetMessage('CRM_COLUMN_CONTACT_LIST'), 'type' => 'custom', 'value' => $sValContact), array('id' => 'COMPANY_ID', 'name' => GetMessage('CRM_COLUMN_COMPANY_LIST'), 'type' => 'custom', 'value' => $sValCompany));
$CCrmUserType->ListAddFilterFields($arResult['FILTER'], $arResult['FILTER2LOGIC'], $arResult['GRID_ID']);
$arResult['FILTER_PRESETS'] = array('filter_week' => array('name' => GetMessage('CRM_PRESET_WEEK'), 'fields' => array('DATE_MODIFY_datesel' => 'week')), 'filter_week_prev' => array('name' => GetMessage('CRM_PRESET_WEEK_PREV'), 'fields' => array('DATE_MODIFY_datesel' => 'week_ago')), 'filter_month' => array('name' => GetMessage('CRM_PRESET_MONTH'), 'fields' => array('DATE_MODIFY_datesel' => 'month')), 'filter_month_prev' => array('name' => GetMessage('CRM_PRESET_MONTH_PREV'), 'fields' => array('DATE_MODIFY_datesel' => 'month_ago')), 'filter_my_week' => array('name' => GetMessage('CRM_PRESET_MY_WEEK'), 'fields' => array('DATE_MODIFY_datesel' => 'week', "ASSIGNED_BY_ID" => __format_user4search(), "ASSIGNED_BY_ID[]" => $GLOBALS['USER']->GetID())), 'filter_my_week_ago' => array('name' => GetMessage('CRM_PRESET_MY_WEEK_AGO'), 'fields' => array('DATE_MODIFY_datesel' => 'week_ago', "ASSIGNED_BY_ID" => __format_user4search(), "ASSIGNED_BY_ID[]" => $GLOBALS['USER']->GetID())));
}
if ($arParams['USE_AMCHARTS']) {
$arResult['HEADERS'] = array(array('id' => 'TITLE', 'name' => GetMessage('CRM_COLUMN_TITLE'), 'sort' => false, 'default' => true, 'editable' => false), array('id' => 'PROCENT', 'name' => GetMessage('CRM_COLUMN_PROCENT'), 'sort' => false, 'default' => true, 'editable' => false, 'align' => 'right'), array('id' => 'COUNT_FUNNEL', 'name' => GetMessage('CRM_COLUMN_COUNT'), 'sort' => false, 'default' => true, 'editable' => false, 'align' => 'right'));
} else {
$arResult['HEADERS'] = array(array('id' => 'FUNNEL', 'name' => GetMessage('CRM_COLUMN_FUNNEL'), 'sort' => false, 'default' => false, 'editable' => false, 'align' => 'center'), array('id' => 'TITLE', 'name' => GetMessage('CRM_COLUMN_TITLE'), 'sort' => false, 'default' => true, 'editable' => false), array('id' => 'PROCENT', 'name' => GetMessage('CRM_COLUMN_PROCENT'), 'sort' => false, 'default' => true, 'editable' => false, 'align' => 'right'), array('id' => 'COUNT_FUNNEL', 'name' => GetMessage('CRM_COLUMN_COUNT'), 'sort' => false, 'default' => true, 'editable' => false, 'align' => 'right'));
}
$i = 0;
foreach ($arResult['CURRENCY_LIST'] as $k => $v) {
$arResult['HEADERS'][] = array('id' => $k, 'name' => GetMessage('CRM_COLUMN_SUMM', array('#CURRENCY#' => htmlspecialcharsbx($v))), 'sort' => false, 'default' => $i == 0, 'editable' => false, 'align' => 'right');
$i++;
}
$CGridOptions = new CCrmGridOptions($arResult['GRID_ID']);
if (isset($_REQUEST['clear_filter']) && $_REQUEST['clear_filter'] == 'Y') {
示例8: htmlspecialcharsbx
</span>
<span id="<?php
echo htmlspecialcharsbx($addContactButtonID);
?>
" class="bx-crm-edit-crm-entity-add"><?php
echo htmlspecialcharsbx(GetMessage('interface_form_add_btn_contact'));
?>
</span>
</span>
<?php
}
?>
<!--</div>-->
</div><?php
$dialogSettings['CONTACT'] = array('addButtonName' => GetMessage('interface_form_add_dialog_btn_add'), 'cancelButtonName' => GetMessage('interface_form_cancel'), 'title' => GetMessage('interface_form_add_contact_dlg_title'), 'lastNameTitle' => GetMessage('interface_form_add_contact_fld_last_name'), 'nameTitle' => GetMessage('interface_form_add_contact_fld_name'), 'secondNameTitle' => GetMessage('interface_form_add_contact_fld_second_name'), 'emailTitle' => GetMessage('interface_form_add_contact_fld_email'), 'phoneTitle' => GetMessage('interface_form_add_contact_fld_phone'), 'exportTitle' => GetMessage('interface_form_add_contact_fld_export'));
$dialogSettings['COMPANY'] = array('addButtonName' => GetMessage('interface_form_add_dialog_btn_add'), 'cancelButtonName' => GetMessage('interface_form_cancel'), 'title' => GetMessage('interface_form_add_company_dlg_title'), 'titleTitle' => GetMessage('interface_form_add_company_fld_title_name'), 'companyTypeTitle' => GetMessage('interface_form_add_conpany_fld_company_type'), 'industryTitle' => GetMessage('interface_form_add_company_fld_industry'), 'emailTitle' => GetMessage('interface_form_add_conpany_fld_email'), 'phoneTitle' => GetMessage('interface_form_add_company_fld_phone'), 'companyTypeItems' => CCrmEntitySelectorHelper::PrepareListItems(CCrmStatus::GetStatusList('COMPANY_TYPE')), 'industryItems' => CCrmEntitySelectorHelper::PrepareListItems(CCrmStatus::GetStatusList('INDUSTRY')));
?>
<script type="text/javascript">
BX.ready(
function()
{
var entitySelectorId = CRM.Set(
BX('<?php
echo CUtil::JSEscape($changeButtonID);
?>
'),
'<?php
echo CUtil::JSEscape($selectorID);
?>
',
'',
示例9: BuildSearchCard
public static function BuildSearchCard($arQuote, $bReindex = false)
{
$arStatuses = array();
$arSite = array();
$sEntityType = 'QUOTE';
$sTitle = 'TITLE';
$sNumber = 'QUOTE_NUMBER';
$arSearchableFields = array('DATE_CREATE' => GetMessage('CRM_QUOTE_SEARCH_FIELD_DATE_CREATE'), 'STATUS_ID' => GetMessage('CRM_QUOTE_SEARCH_FIELD_STATUS_ID'), 'BEGINDATE' => GetMessage('CRM_QUOTE_SEARCH_FIELD_BEGINDATE'), 'CLOSEDATE' => GetMessage('CRM_QUOTE_SEARCH_FIELD_CLOSEDATE'), 'OPPORTUNITY' => GetMessage('CRM_QUOTE_SEARCH_FIELD_OPPORTUNITY'), 'COMMENTS' => GetMessage('CRM_QUOTE_SEARCH_FIELD_COMMENTS'), 'CLIENT_TITLE' => GetMessage('CRM_QUOTE_SEARCH_FIELD_CLIENT_TITLE'), 'CLIENT_ADDR' => GetMessage('CRM_QUOTE_SEARCH_FIELD_CLIENT_ADDR'), 'CLIENT_CONTACT' => GetMessage('CRM_QUOTE_SEARCH_FIELD_CLIENT_CONTACT'), 'CLIENT_EMAIL' => GetMessage('CRM_QUOTE_SEARCH_FIELD_CLIENT_EMAIL'), 'CLIENT_PHONE' => GetMessage('CRM_QUOTE_SEARCH_FIELD_CLIENT_PHONE'), 'CLIENT_TP_ID' => GetMessage('CRM_QUOTE_SEARCH_FIELD_TP_ID'), 'CLIENT_TPA_ID' => GetMessage('CRM_QUOTE_SEARCH_FIELD_TPA_ID'));
$sBody = $arQuote[$sNumber] . ', ' . $arQuote[$sTitle] . "\n";
$arField2status = array('STATUS_ID' => 'QUOTE_STATUS');
$site = new CSite();
foreach (array_keys($arSearchableFields) as $k) {
if (!isset($arQuote[$k])) {
continue;
}
$v = $arQuote[$k];
if ($k === 'COMMENTS') {
$v = CSearch::KillTags($v);
}
$v = trim($v);
if ($k === 'DATE_CREATE' || $k === 'BEGINDATE' || $k === 'CLOSEDATE') {
$dateFormatShort = $site->GetDateFormat('SHORT');
if (!CheckDateTime($v, $dateFormatShort)) {
$v = ConvertTimeStamp(strtotime($v), 'SHORT');
}
if (CheckDateTime($v, $dateFormatShort)) {
$v = FormatDate('SHORT', MakeTimeStamp($v, $dateFormatShort));
} else {
$v = null;
}
}
if (isset($arField2status[$k])) {
if (!isset($arStatuses[$k])) {
$arStatuses[$k] = CCrmStatus::GetStatusList($arField2status[$k]);
}
$v = $arStatuses[$k][$v];
}
if ($k === 'OPPORTUNITY') {
$v = number_format(doubleval($v), 2, '.', '');
}
if (!empty($v) && (!is_numeric($v) || $k === 'OPPORTUNITY') && $v != 'N' && $v != 'Y') {
$sBody .= $arSearchableFields[$k] . ": {$v}\n";
}
}
if (isset($arQuote['ASSIGNED_BY_NAME']) && !empty($arQuote['ASSIGNED_BY_NAME']) || isset($arQuote['ASSIGNED_BY_LAST_NAME']) && !empty($arQuote['ASSIGNED_BY_LAST_NAME']) || isset($arQuote['ASSIGNED_BY_SECOND_NAME']) && !empty($arQuote['ASSIGNED_BY_SECOND_NAME'])) {
$responsibleInfo = CUser::FormatName($site->GetNameFormat(null, $arQuote['LID']), array('LOGIN' => '', 'NAME' => isset($arQuote['ASSIGNED_BY_NAME']) ? $arQuote['ASSIGNED_BY_NAME'] : '', 'LAST_NAME' => isset($arQuote['ASSIGNED_BY_LAST_NAME']) ? $arQuote['ASSIGNED_BY_LAST_NAME'] : '', 'SECOND_NAME' => isset($arQuote['ASSIGNED_BY_SECOND_NAME']) ? $arQuote['ASSIGNED_BY_SECOND_NAME'] : ''), false, false);
if (isset($arQuote['ASSIGNED_BY_EMAIL']) && !empty($arQuote['ASSIGNED_BY_EMAIL'])) {
$responsibleInfo .= ', ' . $arQuote['ASSIGNED_BY_EMAIL'];
}
if (isset($arQuote['ASSIGNED_BY_WORK_POSITION']) && !empty($arQuote['ASSIGNED_BY_WORK_POSITION'])) {
$responsibleInfo .= ', ' . $arQuote['ASSIGNED_BY_WORK_POSITION'];
}
if (!empty($responsibleInfo) && !is_numeric($responsibleInfo) && $responsibleInfo != 'N' && $responsibleInfo != 'Y') {
$sBody .= GetMessage('CRM_QUOTE_SEARCH_FIELD_ASSIGNED_BY_INFO') . ": {$responsibleInfo}\n";
}
}
$sDetailURL = CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_' . strtolower($sEntityType) . '_show'), array(strtolower($sEntityType) . '_id' => $arQuote['ID']));
$_arAttr = CCrmPerms::GetEntityAttr($sEntityType, $arQuote['ID']);
if (empty($arSite)) {
$by = "sort";
$order = "asc";
$rsSite = $site->GetList($by, $order);
while ($_arSite = $rsSite->Fetch()) {
$arSite[] = $_arSite['ID'];
}
}
unset($site);
$sattr_d = '';
$sattr_s = '';
$sattr_u = '';
$sattr_o = '';
$sattr2 = '';
$arAttr = array();
if (!isset($_arAttr[$arQuote['ID']])) {
$_arAttr[$arQuote['ID']] = array();
}
$arAttr[] = $sEntityType;
// for perm X
foreach ($_arAttr[$arQuote['ID']] as $_s) {
if ($_s[0] == 'U') {
$sattr_u = $_s;
} else {
if ($_s[0] == 'D') {
$sattr_d = $_s;
} else {
if ($_s[0] == 'S') {
$sattr_s = $_s;
} else {
if ($_s[0] == 'O') {
$sattr_o = $_s;
}
}
}
}
$arAttr[] = $sEntityType . '_' . $_s;
}
$sattr = $sEntityType . '_' . $sattr_u;
if (!empty($sattr_d)) {
$sattr .= '_' . $sattr_d;
$arAttr[] = $sattr;
//.........这里部分代码省略.........
示例10: PrepareEntityInfo
private static function PrepareEntityInfo($typeID, $ID, &$arRes, $options = null)
{
$enableEditUrl = is_array($options) && isset($options['ENABLE_EDIT_URL']) && $options['ENABLE_EDIT_URL'] === true;
switch ($typeID) {
case self::Lead:
$treatAsContact = false;
$treatAsCompany = false;
if (is_array($options)) {
$treatAsContact = isset($options['TREAT_AS_CONTACT']) && $options['TREAT_AS_CONTACT'];
$treatAsCompany = isset($options['TREAT_AS_COMPANY']) && $options['TREAT_AS_COMPANY'];
}
if ($treatAsContact) {
$result = array('TITLE' => CCrmLead::PrepareFormattedName($arRes), 'LEGEND' => isset($arRes['TITLE']) ? $arRes['TITLE'] : '');
} elseif ($treatAsCompany) {
$result = array('TITLE' => isset($arRes['COMPANY_TITLE']) ? $arRes['COMPANY_TITLE'] : '', 'LEGEND' => isset($arRes['TITLE']) ? $arRes['TITLE'] : '');
} else {
$result = array('TITLE' => isset($arRes['TITLE']) ? $arRes['TITLE'] : '', 'LEGEND' => CCrmLead::PrepareFormattedName($arRes));
}
$result['RESPONSIBLE_ID'] = isset($arRes['ASSIGNED_BY_ID']) ? intval($arRes['ASSIGNED_BY_ID']) : 0;
$result['IMAGE_FILE_ID'] = 0;
$result['SHOW_URL'] = CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_lead_show'), array('lead_id' => $ID));
if ($enableEditUrl) {
$result['EDIT_URL'] = CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_lead_edit'), array('lead_id' => $ID));
}
return $result;
case self::Contact:
$result = array('TITLE' => CCrmContact::PrepareFormattedName($arRes), 'LEGEND' => isset($arRes['COMPANY_TITLE']) ? $arRes['COMPANY_TITLE'] : '', 'RESPONSIBLE_ID' => isset($arRes['ASSIGNED_BY_ID']) ? intval($arRes['ASSIGNED_BY_ID']) : 0, 'IMAGE_FILE_ID' => isset($arRes['PHOTO']) ? intval($arRes['PHOTO']) : 0, 'SHOW_URL' => CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_contact_show'), array('contact_id' => $ID)));
if ($enableEditUrl) {
$result['EDIT_URL'] = CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_contact_edit'), array('contact_id' => $ID));
}
return $result;
case self::Company:
if (self::$COMPANY_TYPE === null) {
self::$COMPANY_TYPE = CCrmStatus::GetStatusList('COMPANY_TYPE');
}
if (self::$COMPANY_INDUSTRY === null) {
self::$COMPANY_INDUSTRY = CCrmStatus::GetStatusList('INDUSTRY');
}
$legendParts = array();
$typeID = isset($arRes['COMPANY_TYPE']) ? $arRes['COMPANY_TYPE'] : '';
if ($typeID !== '' && isset(self::$COMPANY_TYPE[$typeID])) {
$legendParts[] = self::$COMPANY_TYPE[$typeID];
}
$industryID = isset($arRes['INDUSTRY']) ? $arRes['INDUSTRY'] : '';
if ($industryID !== '' && isset(self::$COMPANY_INDUSTRY[$industryID])) {
$legendParts[] = self::$COMPANY_INDUSTRY[$industryID];
}
$result = array('TITLE' => isset($arRes['TITLE']) ? $arRes['TITLE'] : '', 'LEGEND' => !empty($legendParts) ? implode(', ', $legendParts) : '', 'RESPONSIBLE_ID' => isset($arRes['ASSIGNED_BY_ID']) ? intval($arRes['ASSIGNED_BY_ID']) : 0, 'IMAGE_FILE_ID' => isset($arRes['LOGO']) ? intval($arRes['LOGO']) : 0, 'SHOW_URL' => CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_company_show'), array('company_id' => $ID)));
if ($enableEditUrl) {
$result['EDIT_URL'] = CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_company_edit'), array('company_id' => $ID));
}
return $result;
case self::Deal:
$result = array('TITLE' => isset($arRes['TITLE']) ? $arRes['TITLE'] : '', 'LEGEND' => '', 'RESPONSIBLE_ID' => isset($arRes['ASSIGNED_BY_ID']) ? intval($arRes['ASSIGNED_BY_ID']) : 0, 'IMAGE_FILE_ID' => 0, 'SHOW_URL' => CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_deal_show'), array('deal_id' => $ID)));
if ($enableEditUrl) {
$result['EDIT_URL'] = CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_deal_edit'), array('deal_id' => $ID));
}
return $result;
case self::Invoice:
$result = array('TITLE' => isset($arRes['ORDER_TOPIC']) ? $arRes['ORDER_TOPIC'] : '', 'LEGEND' => '', 'RESPONSIBLE_ID' => isset($arRes['RESPONSIBLE_ID']) ? intval($arRes['RESPONSIBLE_ID']) : 0, 'IMAGE_FILE_ID' => 0, 'SHOW_URL' => CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_invoice_show'), array('invoice_id' => $ID)));
if ($enableEditUrl) {
$result['EDIT_URL'] = CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_invoice_edit'), array('invoice_id' => $ID));
}
return $result;
case self::Quote:
$result = array('TITLE' => isset($arRes['TITLE']) ? $arRes['TITLE'] : '', 'LEGEND' => '', 'RESPONSIBLE_ID' => isset($arRes['ASSIGNED_BY_ID']) ? intval($arRes['ASSIGNED_BY_ID']) : 0, 'IMAGE_FILE_ID' => 0, 'SHOW_URL' => CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_quote_show'), array('quote_id' => $ID)));
if ($enableEditUrl) {
$result['EDIT_URL'] = CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_quote_edit'), array('quote_id' => $ID));
}
return $result;
}
return null;
}
示例11: array
return;
}
}
}
$arResult['BACK_URL'] = $arParams['PATH_TO_DEAL_LIST'];
$arResult['STAGE_LIST'] = array();
$arResult['~STAGE_LIST'] = CCrmStatus::GetStatusList('DEAL_STAGE');
foreach ($arResult['~STAGE_LIST'] as $sStatusId => $sStatusTitle) {
if ($userPermissions->GetPermType('DEAL', $bEdit ? 'WRITE' : 'ADD', array('STAGE_ID' . $sStatusId)) > BX_CRM_PERM_NONE) {
$arResult['STAGE_LIST'][$sStatusId] = $sStatusTitle;
}
}
$arResult['STATE_LIST'] = CCrmStatus::GetStatusList('DEAL_STATE');
$arResult['TYPE_LIST'] = CCrmStatus::GetStatusList('DEAL_TYPE');
$arResult['CURRENCY_LIST'] = CCrmCurrencyHelper::PrepareListItems();
$arResult['EVENT_LIST'] = CCrmStatus::GetStatusList('EVENT_TYPE');
$arResult['EDIT'] = $bEdit;
$arResult['FIELDS'] = array();
$APPLICATION->AddHeadScript($this->GetPath() . '/sale.js');
if (!$bEdit) {
$dbSalesList = CCrmExternalSale::GetList(array("NAME" => "ASC", "SERVER" => "ASC"), array("ACTIVE" => "Y"));
$arSalesList = array();
while ($arSale = $dbSalesList->GetNext()) {
$arSalesList[$arSale["ID"]] = $arSale["NAME"] != "" ? $arSale["NAME"] : $arSale["SERVER"];
}
$salesListCount = count($arSalesList);
if ($salesListCount > 0) {
$strCreateOrderHtml = '<script type="text/javascript">var extSaleGetRemoteFormLocal = {"PRINT":"' . GetMessage("CRM_EXT_SALE_DEJ_PRINT") . '","SAVE":"' . GetMessage("CRM_EXT_SALE_DEJ_SAVE") . '","ORDER":"' . GetMessage("CRM_EXT_SALE_DEJ_ORDER") . '","CLOSE":"' . GetMessage("CRM_EXT_SALE_DEJ_CLOSE") . '"};</script>' . '<input type="hidden" name="SYNC_ORDER_ID" id="ID_SYNC_ORDER_ID" value="" />' . '<input type="hidden" name="SYNC_ORDER_FORM_NAME" id="ID_SYNC_ORDER_FORM_NAME" value="form_' . htmlspecialcharsbx($arResult['FORM_ID']) . '" />';
$strCreateOrderHtml .= '<script type="text/javascript">' . 'function DoChangeExternalSaleId(val)' . '{' . ' var frm = document.forms[document.getElementById("ID_SYNC_ORDER_FORM_NAME").value];' . ' if (frm)' . ' {' . ' var l = frm.getElementsByTagName(\'*\');' . ' for (var i in l)' . ' {' . ' var el = l[i];' . ' if (el && el.type && (el.getAttribute("sale_order_marker") != null || el.type == "submit"))' . ' el.disabled = val;' . ' }' . ' }' . ' var contactSelectorId = "' . CUtil::JSEscape($arResult['FORM_ID']) . '_CONTACT_ID";' . ' var companySelectorId = "' . CUtil::JSEscape($arResult['FORM_ID']) . '_COMPANY_ID";' . ' if(typeof(BX.CrmEntityEditor.items[contactSelectorId]) !== "undefined")' . ' BX.CrmEntityEditor.items[contactSelectorId].setReadOnly(val);' . ' if(typeof(BX.CrmEntityEditor.items[companySelectorId]) !== "undefined")' . ' BX.CrmEntityEditor.items[companySelectorId].setReadOnly(val);' . ' var b = document.getElementById("ID_EXTERNAL_SALE_CREATE_BTN1");' . ' if (b)' . ' b.style.display = (val ? "" : "none");' . ' BX.CrmProductEditor.getDefault().setReadOnly(val);' . '}' . '</script>';
$strCreateOrderHtml .= '<input type="checkbox" name="DO_USE_EXTERNAL_SALE" id="ID_DO_USE_EXTERNAL_SALE" value="Y" onclick="DoChangeExternalSaleId(this.checked)">';
$strCreateOrderHtmlSelect = '';
示例12: ShowError
}
return;
} else {
ShowError(GetMessage('CRM_DELETE_ERROR'));
return;
}
}
$arResult['BACK_URL'] = !empty($arResult['QUOTE_REFERER']) ? $arResult['QUOTE_REFERER'] : $arParams['PATH_TO_QUOTE_LIST'];
$arResult['STATUS_LIST'] = array();
$arResult['~STATUS_LIST'] = CCrmStatus::GetStatusList('QUOTE_STATUS');
foreach ($arResult['~STATUS_LIST'] as $sStatusId => $sStatusTitle) {
if ($CCrmQuote->cPerms->GetPermType('QUOTE', $bEdit ? 'WRITE' : 'ADD', array('STATUS_ID' . $sStatusId)) > BX_CRM_PERM_NONE) {
$arResult['STATUS_LIST'][$sStatusId] = $sStatusTitle;
}
}
$arResult['TYPE_LIST'] = CCrmStatus::GetStatusList('QUOTE_TYPE');
$arResult['CURRENCY_LIST'] = CCrmCurrencyHelper::PrepareListItems();
$arResult['EDIT'] = $bEdit;
$arResult['FIELDS'] = array();
$arResult['FIELDS']['tab_1'][] = array('id' => 'section_quote_info', 'name' => GetMessage('CRM_SECTION_QUOTE_INFO'), 'type' => 'section');
$quoteNumberField = array('id' => 'QUOTE_NUMBER', 'name' => GetMessage('CRM_QUOTE_FIELD_QUOTE_NUMBER'), 'params' => array('size' => 100), 'value' => isset($arResult['ELEMENT']['~QUOTE_NUMBER']) ? $arResult['ELEMENT']['~QUOTE_NUMBER'] : '', 'type' => 'text', 'visible' => $bEdit);
$arResult['FIELDS']['tab_1'][] = $quoteNumberField;
$arResult['FIELDS']['tab_1'][] = array('id' => 'TITLE', 'name' => GetMessage('CRM_QUOTE_FIELD_TITLE_QUOTE'), 'params' => array('size' => 50), 'value' => isset($arResult['ELEMENT']['~TITLE']) ? $arResult['ELEMENT']['~TITLE'] : '', 'type' => 'text');
$arResult['FIELDS']['tab_1'][] = array('id' => 'STATUS_ID', 'name' => GetMessage('CRM_QUOTE_FIELD_STATUS_ID'), 'items' => $arResult['STATUS_LIST'], 'params' => array('sale_order_marker' => 'Y'), 'type' => 'list', 'value' => isset($arResult['ELEMENT']['STATUS_ID']) ? $arResult['ELEMENT']['STATUS_ID'] : '');
$currencyID = CCrmCurrency::GetBaseCurrencyID();
if (isset($arResult['ELEMENT']['CURRENCY_ID']) && $arResult['ELEMENT']['CURRENCY_ID'] !== '') {
$currencyID = $arResult['ELEMENT']['CURRENCY_ID'];
}
$arResult['FIELDS']['tab_1'][] = array('id' => 'CURRENCY_ID', 'name' => GetMessage('CRM_QUOTE_FIELD_CURRENCY_ID'), 'type' => 'list', 'params' => array('sale_order_marker' => 'Y'), 'items' => $arResult['CURRENCY_LIST'], 'value' => $currencyID);
$arResult['FIELDS']['tab_1'][] = array('id' => 'OPPORTUNITY', 'name' => GetMessage('CRM_QUOTE_FIELD_OPPORTUNITY'), 'params' => array('size' => 21, 'sale_order_marker' => 'Y'), 'value' => isset($arResult['ELEMENT']['OPPORTUNITY']) ? $arResult['ELEMENT']['OPPORTUNITY'] : '', 'type' => 'text');
$arResult['RESPONSIBLE_SELECTOR_PARAMS'] = array('NAME' => 'crm_quote_edit_resonsible', 'INPUT_NAME' => 'ASSIGNED_BY_ID', 'SEARCH_INPUT_NAME' => 'ASSIGNED_BY_NAME', 'NAME_TEMPLATE' => $arParams['NAME_TEMPLATE']);
示例13: array
$rsContacts = CCrmContact::GetList(array(), array('ID' => $contactID), array('FULL_NAME'), 1);
$arContact = $rsContacts->Fetch();
if ($arContact) {
$arResult['PHONE_GROUPS'][] = array('TITLE' => $arContact['FULL_NAME'], 'PHONES' => __CrmEventGetPhones('CONTACT', $contactID));
}
}
$companyID = isset($arRes['COMPANY_ID']) ? intval($arRes['COMPANY_ID']) : 0;
if ($companyID > 0) {
$rsCompanies = CCrmCompany::GetList(array(), array('ID' => $companyID), array('TITLE'), 1);
$arCompany = $rsCompanies->Fetch();
if ($arCompany) {
$arResult['PHONE_GROUPS'][] = array('TITLE' => $arCompany['TITLE'], 'PHONES' => __CrmEventGetPhones('COMPANY', $companyID));
}
}
}
}
break;
}
$arResult['EVENT_TYPE'] = array();
$arEventType = CCrmStatus::GetStatusList('EVENT_TYPE');
foreach ($arEventType as $key => $value) {
if ($arResult['ENTITY_TYPE'] !== 'QUOTE' || !($key === 'PHONE' || $key === 'MESSAGE')) {
$arResult['EVENT_TYPE']['REFERENCE'][] = $value;
$arResult['EVENT_TYPE']['REFERENCE_ID'][] = $key;
}
}
}
if ($arParams['EVENT_TYPE'] === 'PHONE') {
$this->__templateName = 'phone';
}
$this->IncludeComponentTemplate();
示例14: ShowError
} else {
ShowError($arResult['ERROR_MESSAGE']);
return;
}
} else {
ShowError(GetMessage('CRM_DELETE_ERROR'));
return;
}
}
}
}
$arResult['FORM_ID'] = !empty($arParams['FORM_ID']) ? $arParams['FORM_ID'] : 'CRM_CONTACT_EDIT_V12';
$arResult['GRID_ID'] = 'CRM_CONTACT_LIST_V12';
$arResult['BACK_URL'] = $arParams['PATH_TO_CONTACT_LIST'];
$arResult['SOURCE_LIST'] = CCrmStatus::GetStatusList('SOURCE');
$arResult['TYPE_LIST'] = CCrmStatus::GetStatusList('CONTACT_TYPE');
$arResult['EDIT'] = $isEditMode;
$arResult['IS_COPY'] = $isCopyMode;
$arResult['DUPLICATE_CONTROL'] = array();
$enableDupControl = $arResult['DUPLICATE_CONTROL']['ENABLED'] = !$isEditMode && \Bitrix\Crm\Integrity\DuplicateControl::isControlEnabledFor(CCrmOwnerType::Contact);
$arResult['FIELDS'] = array();
$arResult['FIELDS']['tab_1'][] = array('id' => 'section_contact_info', 'name' => GetMessage('CRM_SECTION_CONTACT_INFO2'), 'type' => 'section');
$lastNameID = $arResult['FORM_ID'] . '_LAST_NAME';
$lastNameCaptionID = $arResult['FORM_ID'] . '_LAST_NAME_CAP';
if ($enableDupControl) {
$arResult['DUPLICATE_CONTROL']['LAST_NAME_ID'] = $lastNameID;
$arResult['DUPLICATE_CONTROL']['LAST_NAME_CAPTION_ID'] = $lastNameCaptionID;
}
$arResult['FIELDS']['tab_1'][] = array('id' => 'LAST_NAME', 'name' => GetMessage('CRM_FIELD_LAST_NAME'), 'nameWrapper' => $lastNameCaptionID, 'params' => array('id' => $lastNameID, 'size' => 50), 'type' => 'text', 'value' => isset($arResult['ELEMENT']['~LAST_NAME']) ? $arResult['ELEMENT']['~LAST_NAME'] : '', 'required' => true);
$nameID = $arResult['FORM_ID'] . '_NAME';
$nameCaptionID = $arResult['FORM_ID'] . '_NAME_CAP';
示例15: isset
$arParams['CONTACT_SHOW_URL_TEMPLATE'] = isset($arParams['CONTACT_SHOW_URL_TEMPLATE']) ? $arParams['CONTACT_SHOW_URL_TEMPLATE'] : '';
$arParams['INVOICE_STATUS_SELECTOR_URL_TEMPLATE'] = isset($arParams['INVOICE_STATUS_SELECTOR_URL_TEMPLATE']) ? $arParams['INVOICE_STATUS_SELECTOR_URL_TEMPLATE'] : '';
$arParams['USER_PROFILE_URL_TEMPLATE'] = isset($arParams['USER_PROFILE_URL_TEMPLATE']) ? $arParams['USER_PROFILE_URL_TEMPLATE'] : '';
$entityID = $arParams['ENTITY_ID'] = isset($arParams['ENTITY_ID']) ? intval($arParams['ENTITY_ID']) : 0;
if ($entityID <= 0 && isset($_REQUEST['invoice_id'])) {
$entityID = $arParams['ENTITY_ID'] = intval($_REQUEST['invoice_id']);
}
$arResult['ENTITY_ID'] = $entityID;
$arParams['NAME_TEMPLATE'] = empty($arParams['NAME_TEMPLATE']) ? CSite::GetNameFormat(false) : str_replace(array('#NOBR#', '#/NOBR#'), array('', ''), $arParams['NAME_TEMPLATE']);
$arResult['USER_ID'] = CCrmSecurityHelper::GetCurrentUserID();
$uid = isset($arParams['UID']) ? $arParams['UID'] : '';
if ($uid === '') {
$uid = 'mobile_crm_invoice_view';
}
$uid = $arResult['UID'] = $arParams['UID'];
$arResult['STATUS_LIST'] = CCrmStatus::GetStatusList('INVOICE_STATUS');
//$arResult['TYPE_LIST'] = CCrmStatus::GetStatusList('DEAL_TYPE');
$arResult['CURRENCY_LIST'] = CCrmCurrencyHelper::PrepareListItems();
$serviceURLTemplate = $arParams["SERVICE_URL_TEMPLATE"] ? $arParams["SERVICE_URL_TEMPLATE"] : '#SITE_DIR#bitrix/components/bitrix/mobile.crm.invoice.edit/ajax.php?site_id=#SITE#&sessid=#SID#';
$arResult['SERVICE_URL'] = CComponentEngine::makePathFromTemplate($serviceURLTemplate, array('SID' => bitrix_sessid()));
// CONTEXT_ID -->
$contextID = isset($arParams['CONTEXT_ID']) ? $arParams['CONTEXT_ID'] : '';
if ($contextID === '' && isset($_REQUEST['context_id'])) {
$contextID = $_REQUEST['context_id'];
}
if ($contextID === '') {
$contextID = "{$uid}_{$entityID}";
}
$arResult['CONTEXT_ID'] = $arParams['CONTEXT_ID'] = $contextID;
//<-- CONTEXT_ID
$dbFields = CCrmInvoice::GetList(array(), array('ID' => $entityID));