Exemplo n.º 1
0
 /**
  * @return array Array of arrays
  */
 public static function getPresets()
 {
     self::includeModuleFile();
     $result = array(array('entity' => \CCrmOwnerType::DealName, 'title' => GetMessage('CRM_DEAL_SUM_STAT_PRESET_OVERALL_COUNT'), 'name' => self::TYPE_NAME . '::OVERALL_COUNT', 'source' => self::TYPE_NAME, 'select' => array('name' => 'COUNT', 'aggregate' => 'COUNT'), 'context' => DataContext::ENTITY), array('entity' => \CCrmOwnerType::DealName, 'title' => GetMessage('CRM_DEAL_SUM_STAT_PRESET_OVERALL_SUM'), 'name' => self::TYPE_NAME . '::OVERALL_SUM', 'source' => self::TYPE_NAME, 'select' => array('name' => 'SUM_TOTAL', 'aggregate' => 'SUM'), 'format' => array('isCurrency' => 'Y', 'enableDecimals' => 'N'), 'context' => DataContext::FUND));
     $bindingInfos = DealSumStatisticEntry::getBindingInfos();
     foreach ($bindingInfos as $bindingInfo) {
         $result[] = array('entity' => \CCrmOwnerType::DealName, 'title' => $bindingInfo['TITLE'], 'name' => self::TYPE_NAME . '::' . $bindingInfo['SLOT_NAME'], 'source' => self::TYPE_NAME, 'select' => array('name' => $bindingInfo['SLOT_NAME'], 'aggregate' => 'SUM'), 'format' => array('isCurrency' => 'Y', 'enableDecimals' => 'N'), 'context' => DataContext::FUND);
     }
     return $result;
 }
Exemplo n.º 2
0
 /**
  * @param int $ownerTypeID Owner type ID (see: \CCrmOwnerType).
  * @return array
  */
 public static function prepareBuilderData($ownerTypeID)
 {
     $result = array();
     if ($ownerTypeID === \CCrmOwnerType::Deal) {
         if (Main\Config\Option::get('crm', '~CRM_REBUILD_DEAL_STATISTICS', 'N', false) !== 'Y') {
             $result[] = DealSumStatisticEntry::prepareBuilderData();
         } else {
             self::includeModuleFile();
             $result[] = array('ID' => 'DEAL_ALL', 'ACTIVE' => true, 'MESSAGE' => GetMessage('CRM_STAT_MGR_REBUILD_STATISTICS'), 'SETTINGS' => array('TITLE' => GetMessage('CRM_STAT_MGR_REBUILD_STATISTICS_DLG_TITLE'), 'SUMMARY' => GetMessage('CRM_STAT_MGR_REBUILD_STATISTICS_DLG_SUMMARY'), 'ACTION' => 'REBUILD_STATISTICS', 'URL' => '/bitrix/components/bitrix/crm.deal.list/list.ajax.php?' . bitrix_sessid_get()));
         }
     }
     return $result;
 }