| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
protected $_customGroupExtends = array();
protected $_baseTable = 'civicrm_contact';
- /**
- *
- */
/**
*
*/
parent::__construct();
}
+ /**
+ *
+ */
public function preProcess() {
parent::preProcess();
}
+ /**
+ *
+ */
public function select() {
parent::select();
}
- /*
+ /**
* From clause build where baseTable & fromClauses are defined
*/
public function from() {
}
}
- /*
- * Define any from clauses in use (child classes to override)
- */
/**
+ * Define any from clauses in use (child classes to override)
+ *
* @return array
*/
public function fromClauses() {
}
/**
- * @param $rows
+ * @param array $rows
*
* @return array
*/
}
/**
- * @param $rows
+ * Alter display of rows.
+ *
+ * Iterate through the rows retrieved via SQL and make changes for display purposes,
+ * such as rendering contacts as links.
+ *
+ * @param array $rows
+ * Rows generated by SQL, with an array for each row.
*/
public function alterDisplay(&$rows) {
parent::alterDisplay($rows);
// are grouped together across price sets but there may be a separate need to group
// by id so that entries in one price set are distinct from others. Not quite sure what
// to call the distinction for end users benefit
- array(
- 'price_field_value_label' => array(
- 'title' => ts('Price Field Value Label'),
- 'name' => 'label',
- ),
+ array(
+ 'price_field_value_label' => array(
+ 'title' => ts('Price Field Value Label'),
+ 'name' => 'label',
),
+ ),
),
);
}
'event_id' => array(
'title' => ts('Event'),
'default_weight' => '1',
- 'default_order' => 'ASC'
+ 'default_order' => 'ASC',
),
),
'group_bys' => array(
'filters' => array(
'id' => array(
'title' => ts('Contact ID'),
- )
- ,
+ ),
'sort_name' => array(
'title' => ts('Contact Name'),
),
'fields' => array(
'id' => array(
'title' => ts('Case ID'),
- 'required' => FALSE
+ 'required' => FALSE,
),
'subject' => array(
'title' => ts('Case Subject'),
- 'default' => TRUE
+ 'default' => TRUE,
),
'status_id' => array(
'title' => ts('Status'),
- 'default' => TRUE
+ 'default' => TRUE,
),
'case_type_id' => array(
'title' => ts('Case Type'),
- 'default' => TRUE
+ 'default' => TRUE,
),
'case_start_date' => array(
'title' => ts('Case Start Date'),
'name' => 'start_date',
- 'default' => TRUE
+ 'default' => TRUE,
),
'case_end_date' => array(
'title' => ts('Case End Date'),
'name' => 'end_date',
- 'default' => TRUE
+ 'default' => TRUE,
),
'case_duration' => array(
'name' => 'duration',
'title' => ts('Duration (Days)'),
- 'default' => FALSE
+ 'default' => FALSE,
),
'case_is_deleted' => array(
'name' => 'is_deleted',
'title' => ts('Case Deleted?'),
'default' => FALSE,
- 'type' => CRM_Utils_Type::T_INT
- )
+ 'type' => CRM_Utils_Type::T_INT,
+ ),
),
'filters' => array(
'case_start_date' => array(
'title' => ts('Case End Date'),
'operatorType' => CRM_Report_Form::OP_DATE,
'type' => CRM_Utils_Type::T_DATE,
- 'name' => 'end_date'
+ 'name' => 'end_date',
),
'case_type_id' => array(
'title' => ts('Case Type'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => $this->case_types
+ 'options' => $this->case_types,
),
'case_status_id' => array(
'title' => ts('Case Status'),
'operatorType' => CRM_Report_Form::OP_MULTISELECT,
'options' => $this->case_statuses,
- 'name' => 'status_id'
+ 'name' => 'status_id',
),
'case_is_deleted' => array(
'title' => ts('Case Deleted?'),
'operatorType' => CRM_Report_Form::OP_SELECT,
'options' => $this->deleted_labels,
'default' => 0,
- 'name' => 'is_deleted'
- )
- )
- )
+ 'name' => 'is_deleted',
+ ),
+ ),
+ ),
);
}
- /*
- * adding address fields to construct function in reports
- * @param array $options
- * Options for the report.
- * - prefix prefix to add (e.g. 'honor' when getting address details for honor contact
- * - prefix_label optional prefix lable eg. "Honoree " for front end
- * - group_by enable these fields for group by - default false
- * - order_by enable these fields for order by
- * - filters enable these fields for filtering
- * - defaults - (is this working?) values to pre-populate
- * @return array address fields for construct clause
- */
/**
- * Get address columns to add to array
+ * Get address columns to add to array.
*
* @param array $options
- * - prefix Prefix to add to table (in case of more than one instance of the table)
- * - prefix_label Label to give columns from this address table instance
- *
- * @return array address columns definition
- */
- /**
- * @param array $options
+ * Options for the report.
+ * - prefix prefix to add (e.g. 'honor' when getting address details for honor contact
+ * - prefix_label optional prefix lable eg. "Honoree " for front end
+ * - group_by enable these fields for group by - default false
+ * - order_by enable these fields for order by
+ * - filters enable these fields for filtering
+ * - defaults - (is this working?) values to pre-populate
*
* @return array
+ * address columns definition
*/
public function getAddressColumns($options = array()) {
$defaultOptions = array(
'order_by' => TRUE,
'filters' => TRUE,
'defaults' => array(
- 'country_id' => TRUE
+ 'country_id' => TRUE,
),
);
'title' => ts($options['prefix_label'] . 'Street Number'),
'type' => 1,
'default' => CRM_Utils_Array::value('street_number', $options['defaults'], FALSE),
- 'name' => 'street_number',
),
$options['prefix'] . 'street_name' => array(
'name' => 'street_name',
'title' => ts($options['prefix_label'] . 'Street Name'),
'type' => 1,
'default' => CRM_Utils_Array::value('street_name', $options['defaults'], FALSE),
- 'name' => 'street_name',
),
$options['prefix'] . 'street_unit' => array(
'name' => 'street_unit',
'title' => ts($options['prefix_label'] . 'Street Unit'),
'type' => 1,
'default' => CRM_Utils_Array::value('street_unit', $options['defaults'], FALSE),
- 'name' => 'street_unit',
),
$options['prefix'] . 'city' => array(
'title' => ts($options['prefix_label'] . 'City'),
return $addressFields;
}
- /*
- * Get Information about advertised Joins
- */
/**
+ * Get Information about advertised Joins.
+ *
* @return array
*/
public function getAvailableJoins() {
);
}
- /*
+ /**
* Add join from contact table to address. Prefix will be added to both tables
* as it's assumed you are using it to get address of a secondary contact
- */
- /**
+ *
* @param string $prefix
*/
public function joinAddressFromContact($prefix = '') {
";
}
- /*
- * Define join from line item table to participant table
+ /**
+ * Define join from line item table to participant table.
*/
public function joinParticipantFromLineItem() {
$this->_from .= " LEFT JOIN civicrm_participant {$this->_aliases['civicrm_participant']}
";
}
- /*
+ /**
* Define join from line item table to Membership table. Seems to be still via contribution
* as the entity. Have made 'inner' to restrict does that make sense?
*/
";
}
- /*
- * Define join from Participant to Contribution table
+ /**
+ * Define join from Participant to Contribution table.
*/
public function joinContributionFromParticipant() {
$this->_from .= " LEFT JOIN civicrm_participant_payment pp
";
}
- /*
- * Define join from Membership to Contribution table
+ /**
+ * Define join from Membership to Contribution table.
*/
public function joinContributionFromMembership() {
$this->_from .= " LEFT JOIN civicrm_membership_payment pp
{$this->_aliases['civicrm_event']}.is_template = 0)";
}
- /*
- * Retrieve text for financial type from pseudoconstant
- */
/**
+ * Retrieve text for financial type from pseudoconstant.
+ *
* @param $value
- * @param $row
+ * @param array $row
*
* @return string
*/
public function alterNickName($value, &$row) {
if (empty($row['civicrm_contact_id'])) {
- return;
+ return NULL;
}
$contactID = $row['civicrm_contact_id'];
return "<div id=contact-{$contactID} class='crm-entity'>
" . $value . "</span></div>";
}
- /*
- * Retrieve text for contribution type from pseudoconstant
- */
/**
+ * Retrieve text for contribution type from pseudoconstant.
+ *
* @param $value
- * @param $row
+ * @param array $row
*
* @return array|string
*/
return is_string(CRM_Contribute_PseudoConstant::financialType($value, FALSE)) ? CRM_Contribute_PseudoConstant::financialType($value, FALSE) : '';
}
- /*
- * Retrieve text for contribution status from pseudoconstant
- */
/**
+ * Retrieve text for contribution status from pseudoconstant.
+ *
* @param $value
- * @param $row
+ * @param array $row
*
* @return array
*/
return CRM_Contribute_PseudoConstant::contributionStatus($value);
}
- /*
- * Retrieve text for payment instrument from pseudoconstant
- */
/**
+ * Retrieve text for payment instrument from pseudoconstant.
+ *
* @param $value
- * @param $row
+ * @param array $row
*
* @return array
*/
/**
* @param $value
- * @param $row
+ * @param array $row
*
* @return array|string
*/
/**
* @param $value
- * @param $row
+ * @param array $row
*
* @return array|string
*/
/**
* @param $value
- * @param $row
+ * @param array $row
*
* @return array|string
*/
/**
* @param $value
- * @param $row
+ * @param array $row
* @param $selectedfield
* @param string $criteriaFieldName
*
/**
* @param $value
- * @param $row
+ * @param array $row
* @param $selectedfield
* @param string $criteriaFieldName
*
/**
* @param $value
- * @param $row
+ * @param array $row
* @param $selectedfield
* @param string $criteriaFieldName
*
/**
* @param $value
- * @param $row
+ * @param array $row
* @param string $fieldname
*
* @return mixed
*/
public function alterParticipantStatus($value) {
if (empty($value)) {
- return;
+ return NULL;
}
return CRM_Event_PseudoConstant::participantStatus($value, FALSE, 'label');
}
/**
* @param $value
*
- * @return string
+ * @return string|void
*/
public function alterParticipantRole($value) {
if (empty($value)) {
- return;
+ return NULL;
}
$roles = explode(CRM_Core_DAO::VALUE_SEPARATOR, $value);
$value = array();
$paymentInstruments = CRM_Contribute_PseudoConstant::paymentInstrument();
return $paymentInstruments[$value];
}
+
}