本文整理匯總了PHP中CCrmStatus::GetStatus方法的典型用法代碼示例。如果您正苦於以下問題:PHP CCrmStatus::GetStatus方法的具體用法?PHP CCrmStatus::GetStatus怎麽用?PHP CCrmStatus::GetStatus使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CCrmStatus
的用法示例。
在下文中一共展示了CCrmStatus::GetStatus方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: GetStatusList
private static function GetStatusList($id)
{
if (!isset(self::$STATUSES[$id])) {
self::$STATUSES[$id] = CCrmStatus::GetStatus($id);
}
return self::$STATUSES[$id];
}
示例2: GetList
function GetList($arUserField)
{
$rsStatus = false;
if (CModule::IncludeModule('crm')) {
$arList = array();
$arStatuses = CCrmStatus::GetStatus($arUserField['SETTINGS']['ENTITY_TYPE']);
foreach ($arStatuses as $arStatus) {
$arList[] = array('ID' => $arStatus['STATUS_ID'], 'VALUE' => $arStatus['NAME']);
}
$rsStatus = new CDBResult();
$rsStatus->InitFromArray($arList);
}
return $rsStatus;
}
示例3: showField
public function showField($arField, $arUF = array())
{
$strResult = "";
switch ($arField["FORMAT"]) {
case "LEAD_PROGRESS":
if (!empty($arField["VALUE"])) {
$strResult .= "#row_begin#";
$strResult .= "#cell_begin_left#";
$strResult .= $arField["TITLE"] . ":";
$strResult .= "#cell_end#";
$strResult .= "#cell_begin_right#";
$strResult .= '<span class="crm-feed-info-text-padding crm-feed-info-bar-cont">';
$strResult .= CCrmViewHelper::RenderLeadStatusControl(array('ENTITY_TYPE_NAME' => CCrmOwnerType::Lead, 'REGISTER_SETTINGS' => true, 'PREFIX' => "", 'ENTITY_ID' => CCrmLiveFeedEntity::Lead, 'CURRENT_ID' => $arField["VALUE"], 'READ_ONLY' => true));
$strResult .= '</span>';
$strResult .= "#cell_end#";
$strResult .= "#row_end#";
}
break;
case "DEAL_PROGRESS":
if (!empty($arField["VALUE"])) {
$strResult .= "#row_begin#";
$strResult .= "#cell_begin_left#";
$strResult .= $arField["TITLE"] . ":";
$strResult .= "#cell_end#";
$strResult .= "#cell_begin_right#";
$strResult .= '<span class="crm-feed-info-text-padding crm-feed-info-bar-cont">';
$strResult .= CCrmViewHelper::RenderDealStageControl(array('ENTITY_TYPE_NAME' => CCrmOwnerType::Deal, 'REGISTER_SETTINGS' => true, 'PREFIX' => "", 'ENTITY_ID' => CCrmLiveFeedEntity::Deal, 'CURRENT_ID' => $arField["VALUE"], 'READ_ONLY' => true));
$strResult .= '</span>';
$strResult .= "#cell_end#";
$strResult .= "#row_end#";
}
break;
case "INVOICE_PROGRESS":
if (!empty($arField["VALUE"])) {
$strResult .= "#row_begin#";
$strResult .= "#cell_begin_left#";
$strResult .= $arField["TITLE"] . ":";
$strResult .= "#cell_end#";
$strResult .= "#cell_begin_right#";
$strResult .= '<span class="crm-feed-info-text-padding crm-feed-info-bar-cont">';
$strResult .= CCrmViewHelper::RenderInvoiceStatusControl(array('ENTITY_TYPE_NAME' => CCrmOwnerType::Invoice, 'REGISTER_SETTINGS' => true, 'PREFIX' => "", 'ENTITY_ID' => CCrmLiveFeedEntity::Invoice, 'CURRENT_ID' => $arField["VALUE"], 'READ_ONLY' => true));
$strResult .= "</span>";
$strResult .= "#cell_end#";
$strResult .= "#row_end#";
}
break;
case "LEAD_STATUS":
$infos = CCrmStatus::GetStatus('STATUS');
if (!empty($arField["VALUE"]) && array_key_exists($arField["VALUE"], $infos)) {
$strResult .= "#row_begin#";
$strResult .= "#cell_begin_left#";
$strResult .= $arField["TITLE"] . ":";
$strResult .= "#cell_end#";
$strResult .= "#cell_begin_right#";
$strResult .= '<span class="crm-feed-info-text-padding">';
$strResult .= $infos[$arField["VALUE"]]["NAME"];
$strResult .= "</span>";
$strResult .= "#cell_end#";
$strResult .= "#row_end#";
}
break;
case "PERSON_NAME":
if (is_array($arField["VALUE"])) {
$strResult .= "#row_begin#";
$strResult .= "#cell_begin_left#";
$strResult .= $arField["TITLE"] . ":";
$strResult .= "#cell_end#";
$strResult .= "#cell_begin_right#";
$strResult .= '<span class="crm-feed-info-text-padding">';
$strResult .= CUser::FormatName(CSite::GetNameFormat(), $arField["VALUE"]);
$strResult .= "</span>";
$strResult .= "#cell_end#";
$strResult .= "#row_end#";
}
break;
case "PERSON_ID":
if (intval($arField["VALUE"]) > 0) {
$dbUser = CUser::GetByID(intval($arField["VALUE"]));
if ($arUser = $dbUser->GetNext()) {
$strResult .= "#row_begin#";
$strResult .= "#cell_begin_left#";
$strResult .= $arField["TITLE"] . ":";
$strResult .= "#cell_end#";
$strResult .= "#cell_begin_right#";
if ($arUser["PERSONAL_PHOTO"] > 0) {
$arFileTmp = CFile::ResizeImageGet($arUser["PERSONAL_PHOTO"], array('width' => 39, 'height' => 39), BX_RESIZE_IMAGE_EXACT, false);
}
$strUser = "";
$strUser .= '<div class="feed-com-avatar crm-feed-company-avatar">';
if (is_array($arFileTmp) && isset($arFileTmp['src'])) {
if (strlen($this->params["PATH_TO_USER"]) > 0) {
$strUser .= '<a target="_blank" href="' . str_replace(array("#user_id#", "#USER_ID#"), intval($arField["VALUE"]), $this->params["PATH_TO_USER"]) . '"><img src="' . $arFileTmp['src'] . '" alt=""/></a>';
} else {
$strUser .= '<img src="' . $arFileTmp['src'] . '" alt=""/>';
}
}
$strUser .= '</div>';
if (strlen($this->params["PATH_TO_USER"]) > 0) {
$strUser .= '<a class="crm-detail-info-resp-name" target="_blank" href="' . str_replace(array("#user_id#", "#USER_ID#"), intval($arField["VALUE"]), $this->params["PATH_TO_USER"]) . '">' . CUser::FormatName(CSite::GetNameFormat(), $arUser, true, false) . '</a>';
} else {
//.........這裏部分代碼省略.........
示例4: GetStatusSort
public static function GetStatusSort($statusID)
{
$statusID = strval($statusID);
if ($statusID === '') {
return -1;
}
if (!self::$QUOTE_STATUSES) {
self::$QUOTE_STATUSES = CCrmStatus::GetStatus('QUOTE_STATUS');
}
$info = isset(self::$QUOTE_STATUSES[$statusID]) ? self::$QUOTE_STATUSES[$statusID] : null;
return is_array($info) && isset($info['SORT']) ? intval($info['SORT']) : -1;
}
示例5: getCurrencyName
protected static function getCurrencyName($ID, $htmlEncode = false)
{
$currency = CCrmCurrency::GetByID($ID);
if ($currency) {
return $currency['FULL_NAME'];
}
// Old style (for compatibility only)
$statuses = CCrmStatus::GetStatus('CURRENCY');
$name = array_key_exists($ID, $statuses) ? $statuses[$ID]['NAME'] : $ID;
return $htmlEncode ? htmlspecialcharsbx($name) : $name;
}
示例6: EnsureStatusesLoaded
public static function EnsureStatusesLoaded()
{
if (self::$LEAD_STATUSES === null) {
$bFinished = $bFailed = false;
$statuses = CCrmStatus::GetStatus('STATUS');
self::$LEAD_STATUSES = $statuses;
$statusesWork = $statusesSuccess = $statusesFailed = $statusesFinished = array();
foreach ($statuses as $statuInfo) {
if (!$bFinished && $statuInfo['STATUS_ID'] === 'CONVERTED') {
$statusesSuccess[] = $statuInfo['STATUS_ID'];
$bFinished = true;
}
if (!$bFailed && $statuInfo['STATUS_ID'] === 'JUNK') {
$bFailed = true;
}
if ($bFinished) {
$statusesFinished[] = $statuInfo['STATUS_ID'];
} else {
$statusesWork[] = $statuInfo['STATUS_ID'];
}
if ($bFailed) {
$statusesFailed[] = $statuInfo['STATUS_ID'];
}
}
self::$LEAD_STATUSES_BY_GROUP['WORK'] = $statusesWork;
self::$LEAD_STATUSES_BY_GROUP['SUCCESS'] = $statusesSuccess;
self::$LEAD_STATUSES_BY_GROUP['FAILED'] = $statusesFailed;
self::$LEAD_STATUSES_BY_GROUP['FINISHED'] = $statusesFinished;
}
}
示例7: GetMessage
<input type="button" value="..." onclick="BPAShowSelector('id_deal_id', 'int');" />
</td>
</tr>
<tr>
<td align="right" width="40%"><?php
echo GetMessage("CPAD_CSP_STAGE");
?>
:</td>
<td width="60%">
<select name="stage">
<option value=""><?php
echo GetMessage("CPAD_CSP_STAGE_N");
?>
</option>
<?
$stages = CCrmStatus::GetStatus('DEAL_STAGE');
foreach ($stages as $stageId => $stage)
{
$s = CCrmDeal::GetStageSemantics($stageId);
if ($s != 'process')
continue;
?><option value="<?php
echo $stageId;
?>
"<?php
echo $arCurrentValues["stage"] == $stageId ? " selected" : "";
?>
><?php
echo str_replace("#NAME#", $stage['NAME'], GetMessage("CPAD_CSP_STAGE_P"));
?>
</option><?
示例8: isset
if ($uid === '') {
$uid = 'mobile_crm_invoice_edit';
}
$arResult['UID'] = $arParams['UID'] = $uid;
$userID = $arResult['USER_ID'] = CCrmSecurityHelper::GetCurrentUserID();
// 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
$arResult['STATUS_LIST'] = CCrmStatus::GetStatus('INVOICE_STATUS');
$personTypes = $arResult['PERSON_TYPES'] = CCrmPaySystem::getPersonTypeIDs();
// '' - NO TAXES
// 'VAT' - VAT ONLY
// 'EXT' - EXTENDED MODE WITH CUSTOM TAXES
$taxMode = $arResult['TAX_MODE'] = CCrmTax::isVatMode() ? 'VAT' : (CCrmTax::isTaxMode() ? 'EXT' : '');
$companyID = 0;
$contactID = 0;
$dealID = 0;
$dealCurrencyID = '';
$personTypeID = 0;
$paySystemID = 0;
$properties = array();
$currencyID = CCrmInvoice::GetCurrencyID();
$arFields = null;
if ($entityID === 0) {
示例9: SetStatus
public function SetStatus($ID, $statusID, $statusParams = false, $options = array())
{
global $USER;
if (!CModule::IncludeModule('sale')) {
return false;
}
$currentUserId = 0;
if (isset($USER) && (get_class($USER) === 'CUser' || $USER instanceof CUser)) {
$currentUserId = $USER->GetID();
}
$result = true;
if (!self::$INVOICE_STATUSES) {
self::$INVOICE_STATUSES = CCrmStatus::GetStatus('INVOICE_STATUS');
}
if (!is_array(self::$INVOICE_STATUSES) || count(self::$INVOICE_STATUSES) <= 2 || !array_key_exists('P', self::$INVOICE_STATUSES) || !array_key_exists('D', self::$INVOICE_STATUSES) || self::$INVOICE_STATUSES['P']['SORT'] >= self::$INVOICE_STATUSES['D']['SORT']) {
$result = false;
}
if ($result) {
$CSaleOrder = new CSaleOrder();
// get current state
if (!($arOrder = CSaleOrder::GetByID($ID))) {
$result = false;
}
if ($result) {
$curPay = $arOrder['PAYED'];
$curCancel = $arOrder['CANCELED'];
$curMarked = $arOrder['MARKED'];
$curStatusID = $arOrder['STATUS_ID'];
$pay = $cancel = 'N';
$marked = isset($statusParams['REASON_MARKED']) || isset($statusParams['DATE_MARKED']) ? 'Y' : 'N';
if (self::$INVOICE_STATUSES[$statusID]['SORT'] >= self::$INVOICE_STATUSES['P']['SORT']) {
$pay = 'Y';
}
if (self::$INVOICE_STATUSES[$statusID]['SORT'] >= self::$INVOICE_STATUSES['D']['SORT']) {
$pay = 'N';
$cancel = 'Y';
}
if ($curPay != $pay) {
$result = $CSaleOrder->PayOrder($ID, $pay, true, true, 0, array('NOT_CHANGE_STATUS' => 'Y'));
}
if ($result && $curCancel != $cancel) {
$result = $CSaleOrder->CancelOrder($ID, $cancel);
}
if ($result && $marked === 'Y') {
$result = $CSaleOrder->SetMark($ID, isset($statusParams['REASON_MARKED']) ? $statusParams['REASON_MARKED'] : '', $currentUserId);
}
if ($result) {
$arUpdate = array();
if (isset($statusParams['DATE_MARKED'])) {
$arUpdate['DATE_MARKED'] = $statusParams['DATE_MARKED'];
}
if ($pay === 'Y') {
if (isset($statusParams['PAY_VOUCHER_NUM'])) {
$arUpdate['PAY_VOUCHER_NUM'] = $statusParams['PAY_VOUCHER_NUM'];
}
if (isset($statusParams['PAY_VOUCHER_DATE'])) {
$arUpdate['PAY_VOUCHER_DATE'] = $statusParams['PAY_VOUCHER_DATE'];
}
}
if (count($arUpdate) > 0) {
$result = self::Update($ID, $arUpdate);
}
unset($arUpdate);
}
if ($result && $curStatusID != $statusID) {
$result = $CSaleOrder->StatusOrder($ID, $statusID) === $ID;
}
}
}
if ($result && is_array($options) && isset($options['SYNCHRONIZE_LIVE_FEED']) && $options['SYNCHRONIZE_LIVE_FEED']) {
self::SynchronizeLiveFeedEvent($ID, array('PROCESS_PARENTS' => false, 'REFRESH_DATE' => true));
}
return $result;
}
示例10: GetDataForPopup
public static function GetDataForPopup($callId, $phone, $userId = 0)
{
if (strlen($phone) <= 0 || !CModule::IncludeModule('crm')) {
return false;
}
if ($userId > 0) {
$findParams = array('USER_ID' => $userId);
} else {
$findParams = array('ENABLE_EXTENDED_MODE' => false);
}
$crm = CCrmSipHelper::findByPhoneNumber((string) $phone, $findParams);
if ($crm) {
$dealStatuses = CCrmStatus::GetStatus('DEAL_STAGE');
$entity = '';
$entityData = array();
$entities = array();
$arResult = array('FOUND' => 'Y', 'CONTACT' => array(), 'COMPANY' => array(), 'ACTIVITIES' => array(), 'DEALS' => array(), 'RESPONSIBILITY' => array());
if (isset($crm['CONTACT'])) {
$entity = 'CONTACT';
$entityData = $crm[$entity][0];
$arResult['CONTACT'] = array('NAME' => $entityData['FORMATTED_NAME'], 'POST' => $entityData['POST'], 'PHOTO' => '');
if (intval($entityData['PHOTO']) > 0) {
$arPhoto = CFile::ResizeImageGet($entityData['PHOTO'], array('width' => 37, 'height' => 37), BX_RESIZE_IMAGE_EXACT, false, false, true);
$arResult['CONTACT']['PHOTO'] = $arPhoto['src'];
}
$arResult['COMPANY'] = $entityData['COMPANY_TITLE'];
} else {
if (isset($crm['LEAD'])) {
$entity = 'LEAD';
$entityData = $crm[$entity][0];
$arResult['CONTACT'] = array('NAME' => !empty($entityData['FORMATTED_NAME']) ? $entityData['FORMATTED_NAME'] : $entityData['TITLE'], 'POST' => $entityData['POST'], 'PHOTO' => '');
$arResult['COMPANY'] = $entityData['COMPANY_TITLE'];
} else {
if (isset($crm['COMPANY'])) {
$entity = 'COMPANY';
$entityData = $crm[$entity][0];
$arResult['COMPANY'] = $entityData['TITLE'];
}
}
}
if ($entityData['ASSIGNED_BY_ID'] > 0) {
$ar = Bitrix\Main\UserTable::getById($entityData['ASSIGNED_BY_ID']);
if ($user = $ar->fetch()) {
$arPhoto = CFile::ResizeImageGet($user['PERSONAL_PHOTO'], array('width' => 37, 'height' => 37), BX_RESIZE_IMAGE_EXACT, false, false, true);
$arResult['RESPONSIBILITY'] = array('ID' => $user['ID'], 'NAME' => CUser::FormatName(CSite::GetNameFormat(false), $user, true, false), 'PHOTO' => $arPhoto ? $arPhoto['src'] : '', 'POST' => $user['WORK_POSITION']);
}
}
if (isset($entityData['SHOW_URL'])) {
$arResult['SHOW_URL'] = $entityData['SHOW_URL'];
}
if (isset($entityData['ACTIVITY_LIST_URL'])) {
$arResult['ACTIVITY_URL'] = $entityData['ACTIVITY_LIST_URL'];
}
if (isset($entityData['INVOICE_LIST_URL'])) {
$arResult['INVOICE_URL'] = $entityData['INVOICE_LIST_URL'];
}
if (isset($entityData['DEAL_LIST_URL'])) {
$arResult['DEAL_URL'] = $entityData['DEAL_LIST_URL'];
}
$activityId = CCrmActivity::GetIDByOrigin('VI_' . $callId);
if ($activityId) {
$arResult['CURRENT_CALL_URL'] = CCrmOwnerType::GetEditUrl(CCrmOwnerType::Activity, $activityId);
if ($arResult['CURRENT_CALL_URL'] !== '') {
$arResult['CURRENT_CALL_URL'] = CCrmUrlUtil::AddUrlParams($arResult['CURRENT_CALL_URL'], array("disable_storage_edit" => 'Y'));
}
}
if (isset($crm['CONTACT']) && isset($crm['COMPANY'])) {
$entities = array('CONTACT', 'COMPANY', 'LEAD');
} else {
if (isset($crm['CONTACT']) && isset($crm['LEAD']) && !isset($crm['COMPANY'])) {
$entities = array('CONTACT', 'LEAD');
} else {
if (isset($crm['LEAD']) && isset($crm['COMPANY']) && !isset($crm['CONTACT'])) {
$entities = array('LEAD', 'COMPANY');
} else {
$entities = array($entity);
}
}
}
foreach ($entities as $entity) {
if (isset($crm[$entity][0]['ACTIVITIES'])) {
foreach ($crm[$entity][0]['ACTIVITIES'] as $activity) {
if ($activity['ID'] == $activityId) {
continue;
}
$overdue = 'N';
if (strlen($activity['DEADLINE']) > 0 && MakeTimeStamp($activity['DEADLINE']) < time()) {
$overdue = 'Y';
}
$arResult['ACTIVITIES'][] = array('TITLE' => $activity['SUBJECT'], 'DATE' => strlen($activity['DEADLINE']) > 0 ? $activity['DEADLINE'] : $activity['END_TIME'], 'OVERDUE' => $overdue, 'URL' => $activity['SHOW_URL']);
}
}
if (isset($crm[$entity][0]['DEALS'])) {
foreach ($crm[$entity][0]['DEALS'] as $deal) {
$arResult['DEALS'][] = array('TITLE' => $deal['TITLE'], 'STAGE' => $dealStatuses[$deal['STAGE_ID']]['NAME'], 'URL' => $deal['SHOW_URL']);
}
}
}
} else {
$arResult = array('FOUND' => 'N');
//.........這裏部分代碼省略.........
示例11: RenderProgressBar
public static function RenderProgressBar($params)
{
$entityTypeID = isset($params['ENTITY_TYPE_ID']) ? intval($params['ENTITY_TYPE_ID']) : 0;
//$entityTypeName = CCrmOwnerType::ResolveName($entityTypeID);
$infos = isset($params['INFOS']) ? $params['INFOS'] : null;
if (!is_array($infos) || empty($infos)) {
if ($entityTypeID === CCrmOwnerType::Lead) {
if (!self::$LEAD_STATUSES) {
self::$LEAD_STATUSES = CCrmStatus::GetStatus('STATUS');
}
$infos = self::$LEAD_STATUSES;
} elseif ($entityTypeID === CCrmOwnerType::Deal) {
if (!self::$DEAL_STAGES) {
self::$DEAL_STAGES = CCrmStatus::GetStatus('DEAL_STAGE');
}
$infos = self::$DEAL_STAGES;
} elseif ($entityTypeID === CCrmOwnerType::Invoice) {
if (!self::$INVOICE_STATUSES) {
self::$INVOICE_STATUSES = CCrmStatus::GetStatus('INVOICE_STATUS');
}
$infos = self::$INVOICE_STATUSES;
}
}
if (!is_array($infos) || empty($infos)) {
return;
}
$currentInfo = null;
$currentID = isset($params['CURRENT_ID']) ? $params['CURRENT_ID'] : '';
if ($currentID !== '' && isset($infos[$currentID])) {
$currentInfo = $infos[$currentID];
}
$currentSort = is_array($currentInfo) && isset($currentInfo['SORT']) ? intval($currentInfo['SORT']) : -1;
$finalID = isset($params['FINAL_ID']) ? $params['FINAL_ID'] : '';
if ($finalID === '') {
if ($entityTypeID === CCrmOwnerType::Lead) {
$finalID = 'CONVERTED';
} elseif ($entityTypeID === CCrmOwnerType::Deal) {
$finalID = 'WON';
} elseif ($entityTypeID === CCrmOwnerType::Invoice) {
$finalID = 'P';
}
}
$finalInfo = null;
if ($finalID !== '' && isset($infos[$finalID])) {
$finalInfo = $infos[$finalID];
}
$finalSort = is_array($finalInfo) && isset($finalInfo['SORT']) ? intval($finalInfo['SORT']) : -1;
$layout = isset($params['LAYOUT']) ? strtolower($params['LAYOUT']) : 'small';
$wrapperClass = "crm-list-stage-bar-{$layout}";
if ($currentSort === $finalSort) {
$wrapperClass .= ' crm-list-stage-end-good';
} elseif ($currentSort > $finalSort) {
$wrapperClass .= ' crm-list-stage-end-bad';
}
//$prefix = isset($params['PREFIX']) ? $params['PREFIX'] : '';
//$entityID = isset($params['ENTITY_ID']) ? intval($params['ENTITY_ID']) : 0;
//$controlID = $entityTypeName !== '' && $entityID > 0
// ? "{$prefix}{$entityTypeName}_{$entityID}" : uniqid($prefix);
$wrapperID = isset($params['WRAPPER_ID']) ? $params['WRAPPER_ID'] : '';
$tableClass = "crm-list-stage-bar-table-{$layout}";
echo '<div class="', $wrapperClass, '" style="width:89%;"', $wrapperID !== '' ? ' id="' . htmlspecialcharsbx($wrapperID) . '"' : '', '><table class="', $tableClass, '"><tbody><tr>';
foreach ($infos as &$info) {
$ID = isset($info['STATUS_ID']) ? $info['STATUS_ID'] : '';
$sort = isset($info['SORT']) ? intval($info['SORT']) : 0;
if ($sort > $finalSort) {
break;
}
echo '<td class="crm-list-stage-bar-part', $sort <= $currentSort ? ' crm-list-stage-passed' : '', '">', '<div class="crm-list-stage-bar-block" data-progress-step-id="' . htmlspecialcharsbx(strtolower($ID)) . '"><div class="crm-list-stage-bar-btn"></div></div>', '<input class="crm-list-stage-bar-block-sort" type="hidden" value="', $sort, '" />', '</td>';
}
unset($info);
echo '</tr></tbody></table></div>';
}
示例12: ShowError
}
if (!CCrmPerms::IsAccessEnabled()) {
ShowError(GetMessage('CRM_PERMISSION_DENIED'));
return;
}
$typeID = isset($arParams['TYPE_ID']) ? $arParams['TYPE_ID'] : '';
if ($typeID === '' && isset($_REQUEST['type_id'])) {
$typeID = $_REQUEST['type_id'];
}
$typeID = strtoupper(trim($typeID));
if ($typeID === '') {
ShowError(GetMessage('M_CRM_STATUS_LIST_TYPE_ID_UNDEFINED'));
return;
}
$arResult['TYPE_ID'] = $typeID;
$mode = isset($arParams['MODE']) ? $arParams['MODE'] : '';
if ($mode === '' && isset($_REQUEST['mode'])) {
$mode = $_REQUEST['mode'];
}
$mode = strtoupper(trim($mode));
$arResult['MODE'] = $arParams['MODE'] = $mode;
$contextID = isset($arParams['CONTEXT_ID']) ? $arParams['CONTEXT_ID'] : '';
if ($contextID === '' && isset($_REQUEST['context_id'])) {
$contextID = $_REQUEST['context_id'];
}
$arResult['CONTEXT_ID'] = $arParams['CONTEXT_ID'] = $contextID;
$UID = isset($arParams['UID']) ? $arParams['UID'] : '';
$UID = $UID === '' ? 'mobile_crm_status_list_' . strtolower($typeID) : str_replace('#TYPE_ID#', strtolower($typeID), $UID);
$arResult['UID'] = $arParams['UID'] = $UID;
$arResult['ITEMS'] = CCrmStatus::GetStatus($typeID);
$this->IncludeComponentTemplate();
示例13: RenderQuoteStatusSettings
public static function RenderQuoteStatusSettings()
{
if (!self::$QUOTE_STATUSES) {
self::$QUOTE_STATUSES = CCrmStatus::GetStatus('QUOTE_STATUS');
}
$result = array();
$isTresholdPassed = false;
foreach (self::$QUOTE_STATUSES as &$status) {
$info = array('id' => $status['STATUS_ID'], 'name' => $status['NAME'], 'sort' => intval($status['SORT']));
if ($status['STATUS_ID'] === 'APPROVED') {
$isTresholdPassed = true;
$info['semantics'] = 'success';
$info['hint'] = GetMessage('CRM_QUOTE_STATUS_MANAGER_APPROVED_STEP_HINT');
} elseif ($status['STATUS_ID'] === 'DECLAINED') {
$info['semantics'] = 'failure';
} elseif (!$isTresholdPassed) {
$info['semantics'] = 'process';
} else {
$info['semantics'] = 'apology';
}
$result[] = $info;
}
unset($status);
$messages = array('dialogTitle' => GetMessage('CRM_QUOTE_STATUS_MANAGER_DLG_TTL'), 'failureTitle' => GetMessage('CRM_QUOTE_STATUS_MANAGER_FAILURE_TTL'), 'selectorTitle' => GetMessage('CRM_QUOTE_STATUS_MANAGER_SELECTOR_TTL'));
return '<script type="text/javascript">' . 'BX.ready(function(){ if(typeof(BX.CrmQuoteStatusManager) === "undefined") return; BX.CrmQuoteStatusManager.infos = ' . CUtil::PhpToJSObject($result) . '; BX.CrmQuoteStatusManager.messages = ' . CUtil::PhpToJSObject($messages) . '; });' . '</script>';
}
示例14: elseif
// Pay system does not changed
$resolvedPaySystemID = $paySystemID;
} elseif (!empty($paySystems)) {
// Take first pay system
$resolvedPaySystemID = array_shift(array_keys($paySystems));
}
// CURRENCY_ID -->
$currencyID = isset($data['CURRENCY_ID']) ? $data['CURRENCY_ID'] : '';
if ($currencyID === '') {
$currencyID = CCrmInvoice::GetCurrencyID();
}
//<-- CURRENCY_ID
// STATUS_ID -->
$statusID = isset($data['STATUS_ID']) ? $data['STATUS_ID'] : '';
if ($statusID === '') {
$statusList = CCrmStatus::GetStatus('INVOICE_STATUS');
if (!empty($statusList)) {
$statusID = array_shift(array_keys($statusList));
}
}
if ($statusID === '') {
__CrmMobileInvoiceEditEndResonse(array('ERROR' => GetMessage('CRM_INVOICE_STATUS_IS_NOT_ASSIGNED')));
}
//<-- STATUS_ID
// PRODUCT_ROWS -->
$productRows = isset($data['PRODUCT_ROWS']) && is_array($data['PRODUCT_ROWS']) ? $data['PRODUCT_ROWS'] : array();
if (!empty($productRows)) {
$productIDs = array();
foreach ($productRows as $productRowKey => &$productRow) {
$productID = intval($productRow['PRODUCT_ID']);
if ($productID > 0) {