X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FReport%2FForm%2FContribute%2FTopDonor.php;h=25297045f1ac476566f6e312972481bde8ec3757;hb=16e2e80cfacf49c5fcd1c47cb77ed35593aa0323;hp=e79f3d25a044dc2d87783ac3376e32e3aa8162eb;hpb=1a676f190f24b5633b76b90a7dda95f2cc5b4dce;p=civicrm-core.git diff --git a/CRM/Report/Form/Contribute/TopDonor.php b/CRM/Report/Form/Contribute/TopDonor.php index e79f3d25a0..25297045f1 100644 --- a/CRM/Report/Form/Contribute/TopDonor.php +++ b/CRM/Report/Form/Contribute/TopDonor.php @@ -2,9 +2,9 @@ /* +--------------------------------------------------------------------+ - | CiviCRM version 4.4 | + | CiviCRM version 4.5 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2013 | + | Copyright CiviCRM LLC (c) 2004-2014 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -29,7 +29,7 @@ /** * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2013 + * @copyright CiviCRM LLC (c) 2004-2014 * $Id$ * */ @@ -45,6 +45,12 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form { 'pieChart' => 'Pie Chart', ); + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array( 'civicrm_contact' => @@ -160,24 +166,9 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form { ), 'grouping' => 'phone-fields', ), - 'civicrm_group' => - array( - 'dao' => 'CRM_Contact_DAO_GroupContact', - 'alias' => 'cgroup', - 'filters' => - array( - 'gid' => - array( - 'name' => 'group_id', - 'title' => ts('Group'), - 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'group' => TRUE, - 'options' => CRM_Core_PseudoConstant::group(), - ), - ), - ), ); + $this->_groupFilter = TRUE; $this->_tagFilter = TRUE; $this->_currencyColumn = 'civicrm_contribution_currency'; parent::__construct(); @@ -240,6 +231,13 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form { $this->_select = " SELECT * FROM ( SELECT " . implode(', ', $select) . " "; } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ static function formRule($fields, $files, $self) { $errors = array(); @@ -374,6 +372,9 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form { $this->endPostProcess($rows); } + /** + * @param $groupID + */ function add2group($groupID) { if (is_numeric($groupID)) { @@ -394,9 +395,17 @@ ORDER BY civicrm_contribution_total_amount_sum DESC } } + /** + * @param int $rowCount + */ function limit($rowCount = CRM_Report_Form::ROW_COUNT_LIMIT) { // lets do the pager if in html mode $this->_limit = NULL; + + // CRM-14115, over-ride row count if rowCount is specified in URL + if ($this->_dashBoardRowCount) { + $rowCount = $this->_dashBoardRowCount; + } if ($this->_outputMode == 'html' || $this->_outputMode == 'group') { //replace only first occurence of SELECT $this->_select = preg_replace('/SELECT/', 'SELECT SQL_CALC_FOUND_ROWS ', $this->_select, 1); @@ -422,6 +431,9 @@ ORDER BY civicrm_contribution_total_amount_sum DESC } } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows