Esempio n. 1
0
 /** 
  * returns the column headers as an array of tuples: 
  * (name, sortName (key to the sort array)) 
  * 
  * @param string $action the action being performed 
  * @param enum   $output what should the result set include (web/email/csv) 
  * 
  * @return array the column headers that need to be displayed 
  * @access public 
  */
 public function &getColumnHeaders($action = null, $output = null)
 {
     if (!isset(self::$_columnHeaders)) {
         self::$_columnHeaders = array(array('name' => ts('Amount'), 'sort' => 'total_amount', 'direction' => CRM_Utils_Sort::DONTCARE), array('name' => ts('Type'), 'sort' => 'contribution_type_id', 'direction' => CRM_Utils_Sort::DONTCARE), array('name' => ts('Source'), 'sort' => 'contribution_source', 'direction' => CRM_Utils_Sort::DONTCARE), array('name' => ts('Received'), 'sort' => 'receive_date', 'direction' => CRM_Utils_Sort::DESCENDING), array('name' => ts('Thank-you Sent'), 'sort' => 'thankyou_date', 'direction' => CRM_Utils_Sort::DONTCARE), array('name' => ts('Status'), 'sort' => 'contribution_status_id', 'direction' => CRM_Utils_Sort::DONTCARE), array('name' => ts('Premium'), 'sort' => 'product_name', 'direction' => CRM_Utils_Sort::DONTCARE), array('desc' => ts('Actions')));
         if (!$this->_single) {
             $pre = array(array('desc' => ts('Contact Type')), array('name' => ts('Name'), 'sort' => 'sort_name', 'direction' => CRM_Utils_Sort::DONTCARE));
             self::$_columnHeaders = array_merge($pre, self::$_columnHeaders);
         }
     }
     return self::$_columnHeaders;
 }
Esempio n. 2
0
 /**
  * Returns the column headers as an array of tuples:
  * (name, sortName (key to the sort array))
  *
  * @param string $action
  *   The action being performed.
  * @param string $output
  *   What should the result set include (web/email/csv).
  *
  * @return array
  *   the column headers that need to be displayed
  */
 public function &getColumnHeaders($action = NULL, $output = NULL)
 {
     $pre = array();
     self::$_columnHeaders = array(array('name' => $this->_includeSoftCredits ? ts('Contribution Amount') : ts('Amount'), 'sort' => 'total_amount', 'direction' => CRM_Utils_Sort::DONTCARE));
     if ($this->_includeSoftCredits) {
         self::$_columnHeaders = array_merge(self::$_columnHeaders, array(array('name' => ts('Soft Credit Amount'), 'sort' => 'contribution_soft_credit_amount', 'direction' => CRM_Utils_Sort::DONTCARE)));
     }
     self::$_columnHeaders = array_merge(self::$_columnHeaders, array(array('name' => ts('Type'), 'sort' => 'financial_type', 'direction' => CRM_Utils_Sort::DONTCARE), array('name' => ts('Source'), 'sort' => 'contribution_source', 'direction' => CRM_Utils_Sort::DONTCARE), array('name' => ts('Received'), 'sort' => 'receive_date', 'direction' => CRM_Utils_Sort::DESCENDING), array('name' => ts('Thank-you Sent'), 'sort' => 'thankyou_date', 'direction' => CRM_Utils_Sort::DONTCARE), array('name' => ts('Status'), 'sort' => 'contribution_status', 'direction' => CRM_Utils_Sort::DONTCARE), array('name' => ts('Premium'), 'sort' => 'product_name', 'direction' => CRM_Utils_Sort::DONTCARE)));
     if (!$this->_single) {
         $pre = array(array('name' => ts('Name'), 'sort' => 'sort_name', 'direction' => CRM_Utils_Sort::DONTCARE));
     }
     self::$_columnHeaders = array_merge($pre, self::$_columnHeaders);
     if ($this->_includeSoftCredits) {
         self::$_columnHeaders = array_merge(self::$_columnHeaders, array(array('name' => ts('Soft Credit For'), 'sort' => 'contribution_soft_credit_name', 'direction' => CRM_Utils_Sort::DONTCARE), array('name' => ts('Soft Credit Type'), 'sort' => 'contribution_soft_credit_type', 'direction' => CRM_Utils_Sort::ASCENDING)));
     }
     self::$_columnHeaders = array_merge(self::$_columnHeaders, array(array('desc' => ts('Actions'))));
     CRM_Core_Smarty::singleton()->assign('softCreditColumns', $this->_includeSoftCredits);
     return self::$_columnHeaders;
 }