From: Eileen McNaughton Date: Sat, 24 May 2014 01:32:12 +0000 (+1200) Subject: CRM/Report add missing comment blocks X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=74cf455104dd27da381c64cb69ef7ebc4707db0b;p=civicrm-core.git CRM/Report add missing comment blocks --- diff --git a/CRM/Report/BAO/Hook.php b/CRM/Report/BAO/Hook.php index b8d69b8eb2..068e9c973c 100644 --- a/CRM/Report/BAO/Hook.php +++ b/CRM/Report/BAO/Hook.php @@ -35,7 +35,7 @@ /** * Report hooks that allow extending a particular report. - * Example: Adding new tables to log reports + * Example: Adding new tables to log reports */ class CRM_Report_BAO_Hook { @@ -72,19 +72,29 @@ class CRM_Report_BAO_Hook { return $this->_queryObjects; } + /** + * @param $reportObj + * @param $logTables + */ public function alterLogTables(&$reportObj, &$logTables) { foreach (self::getSearchQueryObjects() as $obj) { $obj->alterLogTables($reportObj, $logTables); } } + /** + * @param $reportObj + * @param $table + * + * @return array + */ public function logDiffClause(&$reportObj, $table) { $contactIdClause = $join = ''; foreach (self::getSearchQueryObjects() as $obj) { list($cidClause, $joinClause) = $obj->logDiffClause($reportObj, $table); - if ($joinClause) + if ($joinClause) $join .= $joinClause; - if ($cidClause) + if ($cidClause) $contactIdClause .= $cidClause; } return array($contactIdClause, $join); diff --git a/CRM/Report/BAO/HookInterface.php b/CRM/Report/BAO/HookInterface.php index 5e0351194b..883549a235 100644 --- a/CRM/Report/BAO/HookInterface.php +++ b/CRM/Report/BAO/HookInterface.php @@ -38,10 +38,22 @@ */ class CRM_Report_BAO_HookInterface { + /** + * @param $reportObj + * @param $logTables + * + * @return null + */ public function alterLogTables(&$reportObj, &$logTables) { return NULL; } - public function logDiffClause(&$reportObj, $table) { + + /** + * @param $reportObj + * @param $table + * + * @return array + */public function logDiffClause(&$reportObj, $table) { return array(); } } diff --git a/CRM/Report/BAO/ReportInstance.php b/CRM/Report/BAO/ReportInstance.php index b612a78f4a..02d2da192f 100644 --- a/CRM/Report/BAO/ReportInstance.php +++ b/CRM/Report/BAO/ReportInstance.php @@ -241,6 +241,12 @@ class CRM_Report_BAO_ReportInstance extends CRM_Report_DAO_ReportInstance { return $dao->delete(); } + /** + * @param $params + * @param $defaults + * + * @return CRM_Report_DAO_ReportInstance|null + */ static function retrieve($params, &$defaults) { $instance = new CRM_Report_DAO_ReportInstance(); $instance->copyValues($params); diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index 28509d5b05..ad47a690a9 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -632,6 +632,11 @@ class CRM_Report_Form extends CRM_Core_Form { } } + /** + * @param bool $freeze + * + * @return array + */ function setDefaultValues($freeze = TRUE) { $freezeGroup = array(); @@ -762,6 +767,12 @@ class CRM_Report_Form extends CRM_Core_Form { return $this->_defaults; } + /** + * @param $group + * @param $grpFieldName + * + * @return bool + */ function getElementFromGroup($group, $grpFieldName) { $eleObj = $this->getElement($group); foreach ($eleObj->_elements as $index => $obj) { @@ -1131,6 +1142,12 @@ class CRM_Report_Form extends CRM_Core_Form { // a formrule function to ensure that fields selected in group_by // (if any) should only be the ones present in display/select fields criteria; // note: works if and only if any custom field selected in group_by. + /** + * @param $fields + * @param array $ignoreFields + * + * @return array + */ function customDataFormRule($fields, $ignoreFields = array( )) { $errors = array(); if (!empty($this->_customGroupExtends) && $this->_customGroupGroupBy && !empty($fields['group_bys'])) { @@ -1158,6 +1175,12 @@ class CRM_Report_Form extends CRM_Core_Form { // Note: $fieldName param allows inheriting class to build operationPairs // specific to a field. + /** + * @param string $type + * @param null $fieldName + * + * @return array + */ function getOperationPair($type = "string", $fieldName = NULL) { // FIXME: At some point we should move these key-val pairs // to option_group and option_value table. @@ -1263,6 +1286,11 @@ class CRM_Report_Form extends CRM_Core_Form { } } + /** + * @param string $operator + * + * @return string + */ function getSQLOperator($operator = "like") { switch ($operator) { case 'eq': @@ -1305,6 +1333,15 @@ class CRM_Report_Form extends CRM_Core_Form { } } + /** + * @param $field + * @param $op + * @param $value + * @param $min + * @param $max + * + * @return null|string + */ function whereClause(&$field, $op, $value, $min, $max ) { @@ -1462,6 +1499,17 @@ class CRM_Report_Form extends CRM_Core_Form { return $clause; } + /** + * @param $fieldName + * @param $relative + * @param $from + * @param $to + * @param null $type + * @param null $fromTime + * @param null $toTime + * + * @return null|string + */ function dateClause($fieldName, $relative, $from, $to, $type = NULL, $fromTime = NULL, $toTime = NULL ) { @@ -1520,6 +1568,15 @@ class CRM_Report_Form extends CRM_Core_Form { return NULL; } + /** + * @param $relative + * @param $from + * @param $to + * @param null $fromtime + * @param null $totime + * + * @return array + */ function getFromTo($relative, $from, $to, $fromtime = NULL, $totime = NULL) { if (empty($totime)) { $totime = '235959'; @@ -1537,10 +1594,16 @@ class CRM_Report_Form extends CRM_Core_Form { return array($from, $to); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows } + /** + * @param $rows + */ function alterCustomDataDisplay(&$rows) { // custom code to alter rows having custom values if (empty($this->_customGroupExtends)) { @@ -1601,6 +1664,13 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND } } + /** + * @param $value + * @param $customField + * @param $fieldValueMap + * + * @return float|string + */ function formatCustomValues($value, $customField, $fieldValueMap) { if (CRM_Utils_System::isNull($value)) { return; @@ -1721,6 +1791,9 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND return $retValue; } + /** + * @param $rows + */ function removeDuplicates(&$rows) { if (empty($this->_noRepeats)) { return; @@ -1740,6 +1813,11 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND } } + /** + * @param $row + * @param $fields + * @param bool $subtotal + */ function fixSubTotalDisplay(&$row, $fields, $subtotal = TRUE) { foreach ($row as $colName => $colVal) { if (in_array($colName, $fields)) { @@ -1757,6 +1835,11 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND } } + /** + * @param $rows + * + * @return bool + */ function grandTotal(&$rows) { if (!$this->_rollup || ($this->_rollup == '') || ($this->_limit && count($rows) >= self::ROW_COUNT_LIMIT) @@ -1781,6 +1864,10 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND return TRUE; } + /** + * @param $rows + * @param bool $pager + */ function formatDisplay(&$rows, $pager = TRUE) { // set pager based on if any limit was applied in the query. if ($pager) { @@ -1825,6 +1912,9 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND $this->alterCustomDataDisplay($rows); } + /** + * @param $rows + */ function buildChart(&$rows) { // override this method for building charts. } @@ -1986,6 +2076,14 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND $this->_select = "SELECT " . implode(', ', $select) . " "; } + /** + * @param $tableName + * @param $tableKey + * @param $fieldName + * @param $field + * + * @return bool + */ function selectClause(&$tableName, $tableKey, &$fieldName, &$field) { return FALSE; } @@ -2169,6 +2267,11 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND } + /** + * @param bool $applyLimit + * + * @return string + */ function buildQuery($applyLimit = TRUE) { $this->select(); $this->from(); @@ -2278,6 +2381,9 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND $this->assign('sections', $this->_sections); } + /** + * @return array + */ function unselectedSectionColumns() { $selectColumns = array(); foreach ($this->_columns as $tableName => $table) { @@ -2299,6 +2405,10 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND } } + /** + * @param $sql + * @param $rows + */ function buildRows($sql, &$rows) { $dao = CRM_Core_DAO::executeQuery($sql); if (!is_array($rows)) { @@ -2397,6 +2507,9 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND // use this method to modify $this->_columnHeaders } + /** + * @param $rows + */ function doTemplateAssignment(&$rows) { $this->assign_by_ref('columnHeaders', $this->_columnHeaders); $this->assign_by_ref('rows', $rows); @@ -2404,6 +2517,11 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND } // override this method to build your own statistics + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = array(); @@ -2422,6 +2540,10 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND return $statistics; } + /** + * @param $statistics + * @param $count + */ function countStat(&$statistics, $count) { $statistics['counts']['rowCount'] = array('title' => ts('Row(s) Listed'), 'value' => $count, @@ -2434,6 +2556,9 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND } } + /** + * @param $statistics + */ function groupByStat(&$statistics) { if (!empty($this->_params['group_bys']) && is_array($this->_params['group_bys']) && @@ -2454,6 +2579,9 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND } } + /** + * @param $statistics + */ function filterStat(&$statistics) { foreach ($this->_columns as $tableName => $table) { if (array_key_exists('filters', $table)) { @@ -2538,6 +2666,9 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND } } + /** + * @param null $rows + */ function endPostProcess(&$rows = NULL) { if ( $this->_storeResultSet ) { $this->_resultSet = $rows; @@ -2644,6 +2775,9 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND $this->_storeResultSet = TRUE; } + /** + * @return bool + */ function getResultSet() { return $this->_resultSet; } @@ -2652,6 +2786,15 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND * Get Template file name - use default form template if a specific one has not been set up for this report * */ + /** + * Use the form name to create the tpl file name + * + * @return string + * @access public + */ + /** + * @return string + */ function getTemplateFileName(){ $defaultTpl = parent::getTemplateFileName(); $template = CRM_Core_Smarty::singleton(); @@ -2666,6 +2809,9 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND * * Although this function is super-short it is useful to keep separate so it can be over-ridden by report classes. */ + /** + * @return string + */ function compileContent(){ $templateFile = $this->getHookedTemplateFileName(); return $this->_formValues['report_header'] . CRM_Core_Form::$_template->fetch($templateFile) . $this->_formValues['report_footer']; @@ -2694,6 +2840,9 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND $this->endPostProcess($rows); } + /** + * @param int $rowCount + */ function limit($rowCount = self::ROW_COUNT_LIMIT) { // lets do the pager if in html mode $this->_limit = NULL; @@ -2737,6 +2886,9 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND } } + /** + * @param int $rowCount + */ function setPager($rowCount = self::ROW_COUNT_LIMIT) { // CRM-14115, over-ride row count if rowCount is specified in URL @@ -2762,6 +2914,13 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND } } + /** + * @param $field + * @param $value + * @param $op + * + * @return string + */ function whereGroupClause($field, $value, $op) { $smartGroupQuery = ""; @@ -2800,6 +2959,13 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND {$smartGroupQuery} ) "; } + /** + * @param $field + * @param $value + * @param $op + * + * @return string + */ function whereTagClause($field, $value, $op) { // not using left join in query because if any contact // belongs to more than one tag, results duplicate @@ -2816,10 +2982,17 @@ WHERE cg.extends IN ('" . implode("','", $this->_customGroupExtends) . "') AND WHERE entity_table = 'civicrm_contact' AND {$clause} ) "; } + /** + * @param string $tableAlias + */ function buildACLClause($tableAlias = 'contact_a') { list($this->_aclFrom, $this->_aclWhere) = CRM_Contact_BAO_Contact_Permission::cacheClause($tableAlias); } + /** + * @param bool $addFields + * @param array $permCustomGroupIds + */ function addCustomDataToColumns($addFields = TRUE, $permCustomGroupIds = array()) { if (empty($this->_customGroupExtends)) { return; @@ -3026,6 +3199,11 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a } } + /** + * @param $prop + * + * @return bool + */ function isFieldSelected($prop) { if (empty($prop)) { return FALSE; @@ -3353,6 +3531,15 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a /* * Do AlterDisplay processing on Address Fields */ + /** + * @param $row + * @param $rows + * @param $rowNum + * @param $baseUrl + * @param $urltxt + * + * @return bool + */ function alterDisplayAddressFields(&$row, &$rows, &$rowNum, $baseUrl, $urltxt) { $criteriaQueryParams = CRM_Report_Utils_Report::getPreviewCriteriaQueryParams($this->_defaults, $this->_params); $entryFound = FALSE; @@ -3411,6 +3598,11 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a /* * Adjusts dates passed in to YEAR() for fiscal year. */ + /** + * @param $fieldName + * + * @return string + */ function fiscalYearOffset($fieldName) { $config = CRM_Core_Config::singleton(); $fy = $config->fiscalYearStart; @@ -3509,6 +3701,9 @@ LEFT JOIN civicrm_contact {$field['alias']} ON {$field['alias']}.id = {$this->_a } + /** + * @param $groupID + */ function add2group($groupID) { if (is_numeric($groupID) && isset($this->_aliases['civicrm_contact'])) { $select = "SELECT DISTINCT {$this->_aliases['civicrm_contact']}.id AS addtogroup_contact_id, "; diff --git a/CRM/Report/Form/Activity.php b/CRM/Report/Form/Activity.php index 017165dd4d..63b70e7df6 100644 --- a/CRM/Report/Form/Activity.php +++ b/CRM/Report/Form/Activity.php @@ -41,6 +41,12 @@ class CRM_Report_Form_Activity extends CRM_Report_Form { protected $_nonDisplayFields = array(); + /** + * + */ + /** + * + */ function __construct() { // There could be multiple contacts. We not clear on which contact id to display. // Lets hide it for now. @@ -305,6 +311,9 @@ class CRM_Report_Form_Activity extends CRM_Report_Form { parent::__construct(); } + /** + * @param null $recordType + */ function select($recordType = NULL) { if (!array_key_exists("contact_{$recordType}", $this->_params['fields']) && $recordType != 'final') { $this->_nonDisplayFields[] = "civicrm_contact_contact_{$recordType}"; @@ -375,6 +384,9 @@ class CRM_Report_Form_Activity extends CRM_Report_Form { } } + /** + * @param $recordType + */ function from($recordType) { $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); $assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts); @@ -440,6 +452,9 @@ class CRM_Report_Form_Activity extends CRM_Report_Form { $this->addAddressFromClause(); } + /** + * @param null $recordType + */ function where($recordType = NULL) { $this->_where = " WHERE {$this->_aliases['civicrm_activity']}.is_test = 0 AND {$this->_aliases['civicrm_activity']}.is_deleted = 0 AND @@ -517,6 +532,9 @@ class CRM_Report_Form_Activity extends CRM_Report_Form { $this->_groupBy = "GROUP BY {$this->_aliases['civicrm_activity']}.id"; } + /** + * @param string $tableAlias + */ function buildACLClause($tableAlias = 'contact_a') { //override for ACL( Since Contact may be source //contact/assignee or target also it may be null ) @@ -543,6 +561,11 @@ class CRM_Report_Form_Activity extends CRM_Report_Form { $this->_aclWhere = NULL; } + /** + * @param $groupID + * + * @throws Exception + */ function add2group($groupID) { if (CRM_Utils_Array::value("contact_target_op", $this->_params) == 'nll') { CRM_Core_Error::fatal(ts('Current filter criteria didn\'t have any target contact to add to group')); @@ -660,6 +683,9 @@ GROUP BY civicrm_activity_id {$this->_having} {$this->_orderBy} {$this->_limit}" $this->endPostProcess($rows); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows diff --git a/CRM/Report/Form/ActivitySummary.php b/CRM/Report/Form/ActivitySummary.php index 51e2704657..f77c374758 100644 --- a/CRM/Report/Form/ActivitySummary.php +++ b/CRM/Report/Form/ActivitySummary.php @@ -38,6 +38,12 @@ class CRM_Report_Form_ActivitySummary extends CRM_Report_Form { protected $_emailField = FALSE; protected $_phoneField = FALSE; + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array( 'civicrm_contact' => @@ -425,6 +431,13 @@ class CRM_Report_Form_ActivitySummary extends CRM_Report_Form { } } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ function formRule($fields, $files, $self) { $errors = array(); $contactFields = array('sort_name', 'email', 'phone'); @@ -462,6 +475,9 @@ class CRM_Report_Form_ActivitySummary extends CRM_Report_Form { parent::postProcess(); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows diff --git a/CRM/Report/Form/Campaign/SurveyDetails.php b/CRM/Report/Form/Campaign/SurveyDetails.php index 3e76040799..970d1a084e 100644 --- a/CRM/Report/Form/Campaign/SurveyDetails.php +++ b/CRM/Report/Form/Campaign/SurveyDetails.php @@ -47,6 +47,12 @@ class CRM_Report_Form_Campaign_SurveyDetails extends CRM_Report_Form { private static $_surveyRespondentStatus; + /** + * + */ + /** + * + */ function __construct() { //filter options for survey activity status. $responseStatus = array('' => '- Any -'); @@ -497,6 +503,9 @@ class CRM_Report_Form_Campaign_SurveyDetails extends CRM_Report_Form { } + /** + * @return bool|mixed|null|string + */ private function _surveyCoverSheet() { $coverSheet = NULL; $surveyIds = CRM_Utils_Array::value('survey_id_value', $this->_params); @@ -569,6 +578,9 @@ INNER JOIN civicrm_option_value val ON ( val.option_group_id = survey.result_id return $coverSheet; } + /** + * @param $rows + */ function alterDisplay(&$rows) { //format the survey result data. @@ -634,6 +646,9 @@ INNER JOIN civicrm_option_value val ON ( val.option_group_id = survey.result_id } } + /** + * @param $rows + */ private function _formatSurveyResult(&$rows) { $surveyIds = CRM_Utils_Array::value('survey_id_value', $this->_params); if (CRM_Utils_System::isNull($surveyIds) || empty($this->_params['fields']['result']) || @@ -681,6 +696,9 @@ INNER JOIN civicrm_survey survey ON ( survey.result_id = grp.id ) } } + /** + * @param $rows + */ private function _formatSurveyResponseData(&$rows) { $surveyIds = CRM_Utils_Array::value('survey_id_value', $this->_params); if (CRM_Utils_System::isNull($surveyIds) || empty($this->_params['fields']['survey_response'])) { diff --git a/CRM/Report/Form/Case/Demographics.php b/CRM/Report/Form/Case/Demographics.php index 44129bab74..a24a644514 100644 --- a/CRM/Report/Form/Case/Demographics.php +++ b/CRM/Report/Form/Case/Demographics.php @@ -40,6 +40,13 @@ class CRM_Report_Form_Case_Demographics extends CRM_Report_Form { protected $_emailField = FALSE; protected $_phoneField = FALSE; + + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array( 'civicrm_contact' => @@ -270,6 +277,13 @@ where (cg.extends='Contact' OR cg.extends='Individual' OR cg.extends_entity_colu $this->_select = "SELECT " . implode(', ', $select) . " "; } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ static function formRule($fields, $files, $self) { $errors = $grouping = array(); return $errors; @@ -383,6 +397,9 @@ where (cg.extends='Contact' OR cg.extends='Individual' OR cg.extends_entity_colu $this->endPostProcess($rows); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; @@ -443,6 +460,12 @@ where (cg.extends='Contact' OR cg.extends='Individual' OR cg.extends_entity_colu } } + /** + * @param $fname + * @param $val + * + * @return null|string + */ function getCustomFieldLabel($fname, $val) { $query = " SELECT v.label diff --git a/CRM/Report/Form/Case/Detail.php b/CRM/Report/Form/Case/Detail.php index ffa06b609a..2086460920 100644 --- a/CRM/Report/Form/Case/Detail.php +++ b/CRM/Report/Form/Case/Detail.php @@ -54,6 +54,12 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { protected $_caseDetailExtra = array( ); + /** + * + */ + /** + * + */ function __construct() { $this->case_statuses = CRM_Case_PseudoConstant::caseStatus(); $this->case_types = CRM_Case_PseudoConstant::caseType(); @@ -458,6 +464,11 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { $this->_groupBy = " GROUP BY {$this->_aliases['civicrm_case']}.id"; } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = parent::statistics($rows); @@ -562,6 +573,9 @@ class CRM_Report_Form_Case_Detail extends CRM_Report_Form { } } + /** + * @param $rows + */ function alterDisplay(&$rows) { $entryFound = FALSE; $activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE); diff --git a/CRM/Report/Form/Case/Summary.php b/CRM/Report/Form/Case/Summary.php index e41ba63909..e9188f1927 100644 --- a/CRM/Report/Form/Case/Summary.php +++ b/CRM/Report/Form/Case/Summary.php @@ -37,6 +37,13 @@ class CRM_Report_Form_Case_Summary extends CRM_Report_Form { protected $_summary = NULL; protected $_relField = FALSE; + + /** + * + */ + /** + * + */ function __construct() { $this->case_types = CRM_Case_PseudoConstant::caseType(); $this->case_statuses = CRM_Case_PseudoConstant::caseStatus(); @@ -201,6 +208,13 @@ class CRM_Report_Form_Case_Summary extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ static function formRule($fields, $files, $self) { $errors = $grouping = array(); if (empty($fields['relationship_type_id_value']) && (array_key_exists('sort_name', $fields['fields']) || array_key_exists('label_b_a', $fields['fields']))) { @@ -310,6 +324,9 @@ inner join civicrm_contact $c2 on ${c2}.id=${ccc}.contact_id $this->endPostProcess($rows); } + /** + * @param $rows + */ function alterDisplay(&$rows) { $entryFound = FALSE; foreach ($rows as $rowNum => $row) { diff --git a/CRM/Report/Form/Case/TimeSpent.php b/CRM/Report/Form/Case/TimeSpent.php index b1fa6236a0..af5e2bc840 100644 --- a/CRM/Report/Form/Case/TimeSpent.php +++ b/CRM/Report/Form/Case/TimeSpent.php @@ -34,6 +34,12 @@ * */ class CRM_Report_Form_Case_TimeSpent extends CRM_Report_Form { + /** + * + */ + /** + * + */ function __construct() { $this->activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE); @@ -304,6 +310,13 @@ GROUP BY {$this->_aliases['civicrm_contact']}.id, parent::postProcess(); } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ static function formRule($fields, $files, $self) { $errors = array(); if (!empty($fields['group_bys']) && @@ -315,6 +328,9 @@ GROUP BY {$this->_aliases['civicrm_contact']}.id, return $errors; } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows diff --git a/CRM/Report/Form/Contact/CurrentEmployer.php b/CRM/Report/Form/Contact/CurrentEmployer.php index 4625386211..a74bc6e720 100644 --- a/CRM/Report/Form/Contact/CurrentEmployer.php +++ b/CRM/Report/Form/Contact/CurrentEmployer.php @@ -42,6 +42,12 @@ class CRM_Report_Form_Contact_CurrentEmployer extends CRM_Report_Form { public $_drilldownReport = array('contact/detail' => 'Link to Detail Report'); + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array( @@ -299,6 +305,9 @@ FROM civicrm_contact {$this->_aliases['civicrm_contact']} parent::postProcess(); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $checkList = array(); diff --git a/CRM/Report/Form/Contact/Detail.php b/CRM/Report/Form/Contact/Detail.php index 2f54ce752c..c36a1c58c8 100644 --- a/CRM/Report/Form/Contact/Detail.php +++ b/CRM/Report/Form/Contact/Detail.php @@ -40,6 +40,12 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { protected $_customGroupExtends = array( 'Contact', 'Individual', 'Household', 'Organization'); + /** + * + */ + /** + * + */ function __construct() { $this->_autoIncludeIndexedFieldsAsOrderBys = 1; $this->_columns = array( @@ -371,7 +377,7 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { 'dao' => 'CRM_Core_DAO_Phone', 'fields' => array( - 'phone' => NULL, + 'phone' => NULL, 'phone_ext' => array( 'title' => ts('Phone Extension') @@ -443,6 +449,13 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ static function formRule($fields, $files, $self) { $errors = array(); return $errors; @@ -598,6 +611,9 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { $this->_where .= " GROUP BY {$this->_aliases['civicrm_contact']}.id "; } + /** + * @return array + */ function clauseComponent() { $selectedContacts = implode(',', $this->_contactSelected); $contribution = $membership = $participant = NULL; @@ -734,6 +750,11 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { return $rows; } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = array(); @@ -749,11 +770,17 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { } //Override to set limit is 10 + /** + * @param int $rowCount + */ function limit($rowCount = self::ROW_COUNT_LIMIT) { parent::limit($rowCount); } //Override to set pager with limit is 10 + /** + * @param int $rowCount + */ function setPager($rowCount = self::ROW_COUNT_LIMIT) { parent::setPager($rowCount); } @@ -800,6 +827,9 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { $this->endPostProcess(); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows @@ -838,6 +868,9 @@ class CRM_Report_Form_Contact_Detail extends CRM_Report_Form { } } + /** + * @param $componentRows + */ function alterComponentDisplay(&$componentRows) { // custom code to alter rows $activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE); diff --git a/CRM/Report/Form/Contact/Log.php b/CRM/Report/Form/Contact/Log.php index f2bfea0ca2..678ba313c7 100644 --- a/CRM/Report/Form/Contact/Log.php +++ b/CRM/Report/Form/Contact/Log.php @@ -36,6 +36,13 @@ class CRM_Report_Form_Contact_Log extends CRM_Report_Form { protected $_summary = NULL; + + /** + * + */ + /** + * + */ function __construct() { $this->activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE); @@ -171,6 +178,13 @@ class CRM_Report_Form_Contact_Log extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ static function formRule($fields, $files, $self) { $errors = $grouping = array(); return $errors; @@ -233,6 +247,9 @@ ORDER BY {$this->_aliases['civicrm_log']}.modified_date DESC, {$this->_aliases[' "; } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Contact/LoggingDetail.php b/CRM/Report/Form/Contact/LoggingDetail.php index 643c053fa1..e6f5bec9a6 100644 --- a/CRM/Report/Form/Contact/LoggingDetail.php +++ b/CRM/Report/Form/Contact/LoggingDetail.php @@ -34,6 +34,9 @@ * */ class CRM_Report_Form_Contact_LoggingDetail extends CRM_Logging_ReportDetail { + /** + * + */ function __construct() { $logging = new CRM_Logging_Schema; $this->tables[] = 'civicrm_contact'; diff --git a/CRM/Report/Form/Contact/LoggingSummary.php b/CRM/Report/Form/Contact/LoggingSummary.php index ce553a0d2f..54112c960c 100644 --- a/CRM/Report/Form/Contact/LoggingSummary.php +++ b/CRM/Report/Form/Contact/LoggingSummary.php @@ -33,6 +33,9 @@ * */ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { + /** + * + */ function __construct() { parent::__construct(); @@ -154,6 +157,9 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { ); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // cache for id → is_deleted mapping $isDeleted = array(); @@ -228,6 +234,9 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { $rows = $newRows; } + /** + * @param null $logTable + */ function from( $logTable = null ) { static $entity = null; if ( $logTable ) { diff --git a/CRM/Report/Form/Contact/Relationship.php b/CRM/Report/Form/Contact/Relationship.php index cf255964a7..e915ee4036 100644 --- a/CRM/Report/Form/Contact/Relationship.php +++ b/CRM/Report/Form/Contact/Relationship.php @@ -44,6 +44,12 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { 'Relationship'); public $_drilldownReport = array('contact/detail' => 'Link to Detail Report'); + /** + * + */ + /** + * + */ function __construct() { $contact_type = CRM_Contact_BAO_ContactType::getSelectElements(FALSE, TRUE, '_'); @@ -155,12 +161,12 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { 'alias' => 'phone_a', 'fields' => array( - 'phone_a' => + 'phone_a' => array( 'title' => ts('Phone (Contact A)'), 'name' => 'phone', ), - 'phone_ext_a' => + 'phone_ext_a' => array( 'title' => ts('Phone Ext (Contact A)'), 'name' => 'phone_ext', @@ -174,12 +180,12 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { 'alias' => 'phone_b', 'fields' => array( - 'phone_b' => + 'phone_b' => array( 'title' => ts('Phone (Contact B)'), 'name' => 'phone' ), - 'phone_ext_b' => + 'phone_ext_b' => array( 'title' => ts('Phone Ext (Contact B)'), 'name' => 'phone_ext' @@ -508,6 +514,11 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { } } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = parent::statistics($rows); @@ -592,6 +603,9 @@ class CRM_Report_Form_Contact_Relationship extends CRM_Report_Form { $this->endPostProcess($rows); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Contact/Summary.php b/CRM/Report/Form/Contact/Summary.php index 2132662f51..e8bc442e93 100644 --- a/CRM/Report/Form/Contact/Summary.php +++ b/CRM/Report/Form/Contact/Summary.php @@ -46,6 +46,12 @@ class CRM_Report_Form_Contact_Summary extends CRM_Report_Form { public $_drilldownReport = array('contact/detail' => 'Link to Detail Report'); + /** + * + */ + /** + * + */ function __construct() { $this->_autoIncludeIndexedFieldsAsOrderBys = 1; $this->_columns = array( @@ -182,7 +188,7 @@ class CRM_Report_Form_Contact_Summary extends CRM_Report_Form { 'dao' => 'CRM_Core_DAO_Phone', 'fields' => array( - 'phone' => NULL, + 'phone' => NULL, 'phone_ext' => array( 'title' => ts('Phone Extension') @@ -246,6 +252,13 @@ class CRM_Report_Form_Contact_Summary extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ static function formRule($fields, $files, $self) { $errors = $grouping = array(); return $errors; @@ -297,6 +310,9 @@ class CRM_Report_Form_Contact_Summary extends CRM_Report_Form { $this->endPostProcess($rows); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Contribute/Bookkeeping.php b/CRM/Report/Form/Contribute/Bookkeeping.php index 541e5abadc..4070d5b3d7 100644 --- a/CRM/Report/Form/Contribute/Bookkeeping.php +++ b/CRM/Report/Form/Contribute/Bookkeeping.php @@ -43,6 +43,12 @@ class CRM_Report_Form_Contribute_Bookkeeping extends CRM_Report_Form { protected $_customGroupExtends = array( 'Membership'); + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array( 'civicrm_contact' => @@ -442,6 +448,11 @@ class CRM_Report_Form_Contribute_Bookkeeping extends CRM_Report_Form { parent::postProcess(); } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = parent::statistics($rows); @@ -477,6 +488,9 @@ class CRM_Report_Form_Contribute_Bookkeeping extends CRM_Report_Form { return $statistics; } + /** + * @param $rows + */ function alterDisplay(&$rows) { $contributionTypes = CRM_Contribute_PseudoConstant::financialType(); $paymentInstruments = CRM_Contribute_PseudoConstant::paymentInstrument(); diff --git a/CRM/Report/Form/Contribute/Detail.php b/CRM/Report/Form/Contribute/Detail.php index 010c4bf9cd..63688fb672 100644 --- a/CRM/Report/Form/Contribute/Detail.php +++ b/CRM/Report/Form/Contribute/Detail.php @@ -44,6 +44,12 @@ class CRM_Report_Form_Contribute_Detail extends CRM_Report_Form { protected $_customGroupExtends = array( 'Contribution'); + /** + * + */ + /** + * + */ function __construct() { // Check if CiviCampaign is a) enabled and b) has active campaigns @@ -384,6 +390,9 @@ class CRM_Report_Form_Contribute_Detail extends CRM_Report_Form { } } + /** + * @param bool $softcredit + */ function from($softcredit = FALSE) { $this->_from = " FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom} @@ -457,6 +466,11 @@ class CRM_Report_Form_Contribute_Detail extends CRM_Report_Form { $this->_groupBy = " GROUP BY {$this->_aliases['civicrm_contact']}.id, {$this->_aliases['civicrm_contribution']}.id "; } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = parent::statistics($rows); @@ -620,6 +634,9 @@ UNION ALL $this->endPostProcess($rows); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $checkList = array(); diff --git a/CRM/Report/Form/Contribute/History.php b/CRM/Report/Form/Contribute/History.php index d1c4581d67..c5ff8b0f29 100644 --- a/CRM/Report/Form/Contribute/History.php +++ b/CRM/Report/Form/Contribute/History.php @@ -50,6 +50,13 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { protected $_yearStatisticsFrom = ''; protected $_yearStatisticsTo = ''; + + /** + * + */ + /** + * + */ function __construct() { $yearsInPast = 4; $date = CRM_Core_SelectValues::date('custom', NULL, $yearsInPast, 0); @@ -440,15 +447,26 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { } //Override to set limit is 10 + /** + * @param int $rowCount + */ function limit($rowCount = self::ROW_COUNT_LIMIT) { parent::limit($rowCount); } //Override to set pager with limit is 10 + /** + * @param int $rowCount + */ function setPager($rowCount = self::ROW_COUNT_LIMIT) { parent::setPager($rowCount); } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = parent::statistics($rows); $count = 0; @@ -470,6 +488,13 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { return $statistics; } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ static function formRule($fields, $files, $self) { $errors = array(); if (!empty($fields['this_year_value']) && !empty($fields['other_year_value']) && @@ -516,6 +541,9 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { } } + /** + * @param $rows + */ function buildRows(&$rows) { $contactIds = array(); @@ -604,6 +632,11 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { } } + /** + * @param $contactIds + * + * @return array + */ function buildContributionRows($contactIds) { $rows = array(); if (empty($contactIds)) { @@ -647,6 +680,11 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { return $rows; } + /** + * @param $contactIds + * + * @return array + */ function buildRelationshipRows($contactIds) { $relationshipRows = $relatedContactIds = array(); if (empty($contactIds)) { @@ -685,6 +723,12 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { } // Override "This Year" $op options + /** + * @param string $type + * @param null $fieldName + * + * @return array + */ function getOperationPair($type = "string", $fieldName = NULL) { if ($fieldName == 'this_year' || $fieldName == 'other_year') { return array('calendar' => ts('Is Calendar Year'), 'fiscal' => ts('Fiscal Year Starting')); @@ -692,6 +736,9 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { return parent::getOperationPair($type, $fieldName); } + /** + * @param $rows + */ function alterDisplay(&$rows) { if (empty($rows)) { return; diff --git a/CRM/Report/Form/Contribute/HouseholdSummary.php b/CRM/Report/Form/Contribute/HouseholdSummary.php index 29174c6324..3a8b7978be 100644 --- a/CRM/Report/Form/Contribute/HouseholdSummary.php +++ b/CRM/Report/Form/Contribute/HouseholdSummary.php @@ -43,6 +43,12 @@ class CRM_Report_Form_Contribute_HouseholdSummary extends CRM_Report_Form { protected $_summary = NULL; + /** + * + */ + /** + * + */ function __construct() { self::validRelationships(); @@ -333,6 +339,11 @@ class CRM_Report_Form_Contribute_HouseholdSummary extends CRM_Report_Form { $this->_orderBy = " ORDER BY {$this->_aliases['civicrm_contact_household']}.household_name, {$this->_aliases['civicrm_relationship']}.$this->householdContact, {$this->_aliases['civicrm_contact']}.sort_name, {$this->_aliases['civicrm_relationship']}.$this->otherContact"; } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = parent::statistics($rows); @@ -400,6 +411,9 @@ class CRM_Report_Form_Contribute_HouseholdSummary extends CRM_Report_Form { } } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $type = substr($this->_params['relationship_type_id_value'], -3); diff --git a/CRM/Report/Form/Contribute/LoggingDetail.php b/CRM/Report/Form/Contribute/LoggingDetail.php index 4e975bd3a1..acf862cb3e 100644 --- a/CRM/Report/Form/Contribute/LoggingDetail.php +++ b/CRM/Report/Form/Contribute/LoggingDetail.php @@ -34,6 +34,9 @@ * */ class CRM_Report_Form_Contribute_LoggingDetail extends CRM_Logging_ReportDetail { + /** + * + */ function __construct() { $logging = new CRM_Logging_Schema; $this->tables[] = 'civicrm_contribution'; diff --git a/CRM/Report/Form/Contribute/LoggingSummary.php b/CRM/Report/Form/Contribute/LoggingSummary.php index 6b7a7e79b5..e3aa257a1c 100644 --- a/CRM/Report/Form/Contribute/LoggingSummary.php +++ b/CRM/Report/Form/Contribute/LoggingSummary.php @@ -34,6 +34,9 @@ * */ class CRM_Report_Form_Contribute_LoggingSummary extends CRM_Logging_ReportSummary { + /** + * + */ function __construct() { $this->_columns = array( 'civicrm_contact_altered_contact' => array( @@ -172,6 +175,9 @@ class CRM_Report_Form_Contribute_LoggingSummary extends CRM_Logging_ReportSummar parent::__construct(); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // cache for id → is_deleted mapping $isDeleted = array(); diff --git a/CRM/Report/Form/Contribute/Lybunt.php b/CRM/Report/Form/Contribute/Lybunt.php index 6c79aa00e8..ccd06d2b2d 100644 --- a/CRM/Report/Form/Contribute/Lybunt.php +++ b/CRM/Report/Form/Contribute/Lybunt.php @@ -46,6 +46,12 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { protected $lifeTime_from = NULL; protected $lifeTime_where = NULL; + /** + * + */ + /** + * + */ function __construct() { $yearsInPast = 10; $yearsInFuture = 1; @@ -336,6 +342,11 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { $this->assign('chartSupported', TRUE); } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = parent::statistics($rows); if (!empty($rows)) { @@ -429,6 +440,9 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { $this->endPostProcess($rows); } + /** + * @param $rows + */ function buildChart(&$rows) { $graphRows = array(); @@ -458,6 +472,9 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { } } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; @@ -495,6 +512,12 @@ class CRM_Report_Form_Contribute_Lybunt extends CRM_Report_Form { } // Override "This Year" $op options + /** + * @param string $type + * @param null $fieldName + * + * @return array + */ function getOperationPair($type = "string", $fieldName = NULL) { if ($fieldName == 'yid') { return array('calendar' => ts('Is Calendar Year'), 'fiscal' => ts('Fiscal Year Starting')); diff --git a/CRM/Report/Form/Contribute/OrganizationSummary.php b/CRM/Report/Form/Contribute/OrganizationSummary.php index 0a26113376..8e3463896a 100644 --- a/CRM/Report/Form/Contribute/OrganizationSummary.php +++ b/CRM/Report/Form/Contribute/OrganizationSummary.php @@ -43,6 +43,12 @@ class CRM_Report_Form_Contribute_OrganizationSummary extends CRM_Report_Form { protected $_summary = NULL; + /** + * + */ + /** + * + */ function __construct() { self::validRelationships(); $config = CRM_Core_Config::singleton(); @@ -334,6 +340,11 @@ class CRM_Report_Form_Contribute_OrganizationSummary extends CRM_Report_Form { $this->_orderBy = " ORDER BY {$this->_aliases['civicrm_contact_organization']}.organization_name, {$this->_aliases['civicrm_relationship']}.$this->orgContact, {$this->_aliases['civicrm_contact']}.sort_name, {$this->_aliases['civicrm_relationship']}.$this->otherContact"; } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = parent::statistics($rows); @@ -401,6 +412,9 @@ class CRM_Report_Form_Contribute_OrganizationSummary extends CRM_Report_Form { } } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $type = substr($this->_params['relationship_type_id_value'], -3); diff --git a/CRM/Report/Form/Contribute/PCP.php b/CRM/Report/Form/Contribute/PCP.php index 8f6211e53f..890f9f0169 100644 --- a/CRM/Report/Form/Contribute/PCP.php +++ b/CRM/Report/Form/Contribute/PCP.php @@ -34,6 +34,12 @@ * */ class CRM_Report_Form_Contribute_PCP extends CRM_Report_Form { + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array( 'civicrm_contact' => @@ -271,6 +277,11 @@ LEFT JOIN civicrm_contribution_page {$this->_aliases['civicrm_contribution_page' } } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = parent::statistics($rows); @@ -303,6 +314,10 @@ LEFT JOIN civicrm_contribution_page {$this->_aliases['civicrm_contribution_page' ); return $statistics; } + + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Contribute/Repeat.php b/CRM/Report/Form/Contribute/Repeat.php index ebdc3c243d..35bec198ba 100644 --- a/CRM/Report/Form/Contribute/Repeat.php +++ b/CRM/Report/Form/Contribute/Repeat.php @@ -38,6 +38,12 @@ class CRM_Report_Form_Contribute_Repeat extends CRM_Report_Form { public $_drilldownReport = array('contribute/detail' => 'Link to Detail Report'); + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array( 'civicrm_contact' => @@ -264,6 +270,11 @@ contribution_civireport2.total_amount_sum as contribution2_total_amount_sum', parent::preProcess(); } + /** + * @param bool $freeze + * + * @return array + */ function setDefaultValues($freeze = TRUE) { return parent::setDefaultValues($freeze); } @@ -308,6 +319,9 @@ contribution_civireport2.total_amount_sum as contribution2_total_amount_sum', $this->_select = "SELECT " . implode(', ', $select) . " "; } + /** + * @param bool $tableCol + */ function groupBy($tableCol = FALSE) { $this->_groupBy = ""; if (!empty($this->_params['group_bys']) && is_array($this->_params['group_bys'])) { @@ -366,6 +380,11 @@ LEFT JOIN civicrm_temp_civireport_repeat2 {$this->_aliases['civicrm_contribution ON $fromAlias.$fromCol = {$this->_aliases['civicrm_contribution']}2.$contriCol"; } + /** + * @param string $replaceAliasWith + * + * @return mixed|string + */ function whereContribution($replaceAliasWith = 'contribution1') { $clauses = array("is_test" => "{$this->_aliases['civicrm_contribution']}.is_test = 0"); @@ -453,6 +472,13 @@ LEFT JOIN civicrm_temp_civireport_repeat2 {$this->_aliases['civicrm_contribution $this->_where = !empty($clauses) ? "WHERE " . implode(' AND ', $clauses) : ''; } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ function formRule($fields, $files, $self) { $errors = $checkDate = $errorCount = array(); @@ -604,6 +630,11 @@ LEFT JOIN civicrm_temp_civireport_repeat2 {$this->_aliases['civicrm_contribution return $errors; } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = parent::statistics($rows); @@ -891,6 +922,9 @@ currency varchar(3) $this->endPostProcess($rows); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows list($from1, $to1) = $this->getFromTo(CRM_Utils_Array::value("receive_date1_relative", $this->_params), diff --git a/CRM/Report/Form/Contribute/SoftCredit.php b/CRM/Report/Form/Contribute/SoftCredit.php index d1e5927318..e2982572ca 100644 --- a/CRM/Report/Form/Contribute/SoftCredit.php +++ b/CRM/Report/Form/Contribute/SoftCredit.php @@ -45,6 +45,12 @@ class CRM_Report_Form_Contribute_SoftCredit extends CRM_Report_Form { ); public $_drilldownReport = array('contribute/detail' => 'Link to Detail Report'); + /** + * + */ + /** + * + */ function __construct() { // Check if CiviCampaign is a) enabled and b) has active campaigns @@ -341,6 +347,13 @@ class CRM_Report_Form_Contribute_SoftCredit extends CRM_Report_Form { $this->_select = 'SELECT ' . implode(', ', $select) . ' '; } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ static function formRule($fields, $files, $self) { $errors = $grouping = array(); return $errors; @@ -417,6 +430,11 @@ GROUP BY {$this->_aliases['civicrm_contribution_soft']}.contact_id, constituentn $this->_where .= " AND {$this->_aliases['civicrm_contribution']}.is_test = 0 "; } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = parent::statistics($rows); @@ -484,6 +502,9 @@ GROUP BY {$this->_aliases['civicrm_contribution']}.currency $this->endPostProcess($rows); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows diff --git a/CRM/Report/Form/Contribute/Summary.php b/CRM/Report/Form/Contribute/Summary.php index a62121e6e0..f0412b4e2d 100644 --- a/CRM/Report/Form/Contribute/Summary.php +++ b/CRM/Report/Form/Contribute/Summary.php @@ -45,6 +45,12 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { public $_drilldownReport = array('contribute/detail' => 'Link to Detail Report'); + /** + * + */ + /** + * + */ function __construct() { // Check if CiviCampaign is a) enabled and b) has active campaigns @@ -299,6 +305,11 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { parent::preProcess(); } + /** + * @param bool $freeze + * + * @return array + */ function setDefaultValues($freeze = TRUE) { return parent::setDefaultValues($freeze); } @@ -405,6 +416,13 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ static function formRule($fields, $files, $self) { $errors = $grouping = array(); //check for searching combination of dispaly columns and @@ -521,6 +539,11 @@ class CRM_Report_Form_Contribute_Summary extends CRM_Report_Form { } } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = parent::statistics($rows); @@ -598,6 +621,9 @@ ROUND(AVG({$this->_aliases['civicrm_contribution_soft']}.amount), 2) as civicrm_ parent::postProcess(); } + /** + * @param $rows + */ function buildChart(&$rows) { $graphRows = array(); @@ -643,6 +669,9 @@ ROUND(AVG({$this->_aliases['civicrm_contribution_soft']}.amount), 2) as civicrm_ } } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Contribute/Sybunt.php b/CRM/Report/Form/Contribute/Sybunt.php index c5bd773404..928aee0d32 100644 --- a/CRM/Report/Form/Contribute/Sybunt.php +++ b/CRM/Report/Form/Contribute/Sybunt.php @@ -43,6 +43,12 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { protected $_add2groupSupported = FALSE; + /** + * + */ + /** + * + */ function __construct() { $yearsInPast = 10; $yearsInFuture = 1; @@ -261,7 +267,7 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { function from() { - $this->_from = " + $this->_from = " FROM civicrm_contribution {$this->_aliases['civicrm_contribution']} INNER JOIN civicrm_contact {$this->_aliases['civicrm_contact']} ON {$this->_aliases['civicrm_contact']}.id = {$this->_aliases['civicrm_contribution']}.contact_id @@ -337,6 +343,11 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { $this->_groupBy = "Group BY {$this->_aliases['civicrm_contribution']}.contact_id, " . self::fiscalYearOffset($this->_aliases['civicrm_contribution'] . '.receive_date') . " WITH ROLLUP "; } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = parent::statistics($rows); @@ -436,6 +447,9 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { $this->endPostProcess($rows); } + /** + * @param $rows + */ function buildChart(&$rows) { $graphRows = array(); $count = 0; @@ -471,6 +485,9 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { } } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; @@ -508,6 +525,12 @@ class CRM_Report_Form_Contribute_Sybunt extends CRM_Report_Form { } // Override "This Year" $op options + /** + * @param string $type + * @param null $fieldName + * + * @return array + */ function getOperationPair($type = "string", $fieldName = NULL) { if ($fieldName == 'yid') { return array('calendar' => ts('Is Calendar Year'), 'fiscal' => ts('Fiscal Year Starting')); diff --git a/CRM/Report/Form/Contribute/TopDonor.php b/CRM/Report/Form/Contribute/TopDonor.php index 51e71dce26..8ac8208546 100644 --- a/CRM/Report/Form/Contribute/TopDonor.php +++ b/CRM/Report/Form/Contribute/TopDonor.php @@ -45,6 +45,12 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form { 'pieChart' => 'Pie Chart', ); + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array( 'civicrm_contact' => @@ -240,6 +246,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 +387,9 @@ class CRM_Report_Form_Contribute_TopDonor extends CRM_Report_Form { $this->endPostProcess($rows); } + /** + * @param $groupID + */ function add2group($groupID) { if (is_numeric($groupID)) { @@ -394,10 +410,13 @@ 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; @@ -427,6 +446,9 @@ ORDER BY civicrm_contribution_total_amount_sum DESC } } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows diff --git a/CRM/Report/Form/Event/Income.php b/CRM/Report/Form/Event/Income.php index 326f03bc7c..0f6323c053 100644 --- a/CRM/Report/Form/Event/Income.php +++ b/CRM/Report/Form/Event/Income.php @@ -41,6 +41,12 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { protected $_add2groupSupported = FALSE; + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array( @@ -67,6 +73,9 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { parent::preProcess(); } + /** + * @param $eventIDs + */ function buildEventReport($eventIDs) { $this->assign('events', $eventIDs); @@ -255,6 +264,11 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { $this->assign('statistics', $this->statistics($eventIDs)); } + /** + * @param $eventIDs + * + * @return array + */ function statistics(&$eventIDs) { $statistics = array(); $count = count($eventIDs); @@ -266,6 +280,9 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { return $statistics; } + /** + * @param int $rowCount + */ function limit($rowCount = self::ROW_COUNT_LIMIT) { parent::limit($rowCount); @@ -280,6 +297,9 @@ class CRM_Report_Form_Event_Income extends CRM_Report_Form_Event { $this->_limit = ($pageId - 1) * self::ROW_COUNT_LIMIT; } + /** + * @param int $rowCount + */ function setPager($rowCount = self::ROW_COUNT_LIMIT) { $params = array( 'total' => $this->_rowsFound, diff --git a/CRM/Report/Form/Event/IncomeCountSummary.php b/CRM/Report/Form/Event/IncomeCountSummary.php index 9fcceb0f48..5a04c1c7b0 100644 --- a/CRM/Report/Form/Event/IncomeCountSummary.php +++ b/CRM/Report/Form/Event/IncomeCountSummary.php @@ -49,6 +49,12 @@ class CRM_Report_Form_Event_IncomeCountSummary extends CRM_Report_Form_Event { public $_drilldownReport = array('event/participantlist' => 'Link to Detail Report'); + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array( @@ -245,6 +251,11 @@ class CRM_Report_Form_Event_IncomeCountSummary extends CRM_Report_Form_Event { $this->_where = "WHERE " . implode(' AND ', $clauses); } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = parent::statistics($rows); $select = " @@ -333,6 +344,9 @@ class CRM_Report_Form_Event_IncomeCountSummary extends CRM_Report_Form_Event { $this->endPostProcess($rows); } + /** + * @param $rows + */ function buildChart(&$rows) { $this->_interval = 'events'; @@ -371,6 +385,9 @@ class CRM_Report_Form_Event_IncomeCountSummary extends CRM_Report_Form_Event { } } + /** + * @param $rows + */ function alterDisplay(&$rows) { if (is_array($rows)) { diff --git a/CRM/Report/Form/Event/ParticipantListCount.php b/CRM/Report/Form/Event/ParticipantListCount.php index 06daf4293c..c837659f76 100644 --- a/CRM/Report/Form/Event/ParticipantListCount.php +++ b/CRM/Report/Form/Event/ParticipantListCount.php @@ -44,6 +44,13 @@ class CRM_Report_Form_Event_ParticipantListCount extends CRM_Report_Form_Event { ); public $_drilldownReport = array('event/income' => 'Link to Detail Report'); + + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array( 'civicrm_contact' => @@ -285,6 +292,11 @@ class CRM_Report_Form_Event_ParticipantListCount extends CRM_Report_Form_Event { } //Add The statistics + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = parent::statistics($rows); @@ -363,6 +375,13 @@ class CRM_Report_Form_Event_ParticipantListCount extends CRM_Report_Form_Event { $this->_select = "SELECT " . implode(', ', $select) . " "; } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ static function formRule($fields, $files, $self) { $errors = $grouping = array(); return $errors; @@ -446,6 +465,9 @@ class CRM_Report_Form_Event_ParticipantListCount extends CRM_Report_Form_Event { $this->endPostProcess($rows); } + /** + * @param $rows + */ function alterDisplay(&$rows) { $entryFound = FALSE; diff --git a/CRM/Report/Form/Event/ParticipantListing.php b/CRM/Report/Form/Event/ParticipantListing.php index 93dfdd58dc..eb1840c446 100644 --- a/CRM/Report/Form/Event/ParticipantListing.php +++ b/CRM/Report/Form/Event/ParticipantListing.php @@ -46,6 +46,12 @@ class CRM_Report_Form_Event_ParticipantListing extends CRM_Report_Form_Event { public $_drilldownReport = array('event/income' => 'Link to Detail Report'); + /** + * + */ + /** + * + */ function __construct() { $this->_autoIncludeIndexedFieldsAsOrderBys = 1; @@ -396,6 +402,9 @@ class CRM_Report_Form_Event_ParticipantListing extends CRM_Report_Form_Event { parent::__construct(); } + /** + * @return array + */ function getPriceLevels() { $query = " SELECT DISTINCT cv.label, cv.id @@ -460,6 +469,13 @@ GROUP BY cv.label $this->_select = "SELECT " . implode(', ', $select) . " "; } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ static function formRule($fields, $files, $self) { $errors = $grouping = array(); return $errors; @@ -585,6 +601,9 @@ GROUP BY cv.label $this->endPostProcess($rows); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows diff --git a/CRM/Report/Form/Event/Summary.php b/CRM/Report/Form/Event/Summary.php index a18aedb096..e93de00af5 100644 --- a/CRM/Report/Form/Event/Summary.php +++ b/CRM/Report/Form/Event/Summary.php @@ -49,6 +49,12 @@ class CRM_Report_Form_Event_Summary extends CRM_Report_Form_Event { 'Event'); public $_drilldownReport = array('event/income' => 'Link to Detail Report'); + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array( @@ -173,6 +179,9 @@ class CRM_Report_Form_Event_Summary extends CRM_Report_Form_Event { } //get participants information for events + /** + * @return array + */ function participantInfo() { $statusType1 = CRM_Event_PseudoConstant::participantStatus(NULL, 'is_counted = 1'); @@ -319,6 +328,9 @@ class CRM_Report_Form_Event_Summary extends CRM_Report_Form_Event { $this->endPostProcess($rows); } + /** + * @param $rows + */ function buildChart(&$rows) { $this->_interval = 'events'; $countEvent = NULL; @@ -354,6 +366,9 @@ class CRM_Report_Form_Event_Summary extends CRM_Report_Form_Event { } } + /** + * @param $rows + */ function alterDisplay(&$rows) { if (is_array($rows)) { diff --git a/CRM/Report/Form/Extended.php b/CRM/Report/Form/Extended.php index 670ed73a0a..355a5eb1a6 100644 --- a/CRM/Report/Form/Extended.php +++ b/CRM/Report/Form/Extended.php @@ -42,6 +42,12 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { protected $_customGroupExtends = array(); protected $_baseTable = 'civicrm_contact'; + /** + * + */ + /** + * + */ function __construct() { parent::__construct(); } @@ -76,6 +82,9 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /* * Define any from clauses in use (child classes to override) */ + /** + * @return array + */ function fromClauses() { return array(); } @@ -100,6 +109,11 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { parent::orderBy(); } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { return parent::statistics($rows); } @@ -111,6 +125,9 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { parent::postProcess(); } + /** + * @param $rows + */ function alterDisplay(&$rows) { parent::alterDisplay($rows); @@ -149,6 +166,9 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { } } + /** + * @return array + */ function getLineItemColumns() { return array( 'civicrm_line_item' => @@ -202,6 +222,9 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { ); } + /** + * @return array + */ function getPriceFieldValueColumns() { return array( 'civicrm_price_field_value' => @@ -243,6 +266,9 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { ); } + /** + * @return array + */ function getPriceFieldColumns() { return array( 'civicrm_price_field' => @@ -282,6 +308,9 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { ); } + /** + * @return array + */ function getParticipantColumns() { static $_events = array(); if (!isset($_events['all'])) { @@ -350,6 +379,9 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { ); } + /** + * @return array + */ function getMembershipColumns() { return array( 'civicrm_membership' => array( @@ -389,6 +421,9 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { ); } + /** + * @return array + */ function getMembershipTypeColumns() { return array( 'civicrm_membership_type' => array( @@ -407,6 +442,9 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { ); } + /** + * @return array + */ function getEventColumns() { return array( 'civicrm_event' => array( @@ -462,6 +500,9 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { ); } + /** + * @return array + */ function getContributionColumns() { return array( 'civicrm_contribution' => @@ -538,6 +579,9 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { ); } + /** + * @return array + */ function getContactColumns() { return array( 'civicrm_contact' => array( @@ -583,6 +627,9 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { ); } + /** + * @return array + */ function getCaseColumns() { return array( 'civicrm_case' => array( @@ -674,6 +721,18 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { * - defaults - (is this working?) values to pre-populate * @return array address fields for construct clause */ + /** + * 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 + * + * @return array + */ function getAddressColumns($options = array()) { $defaultOptions = array( 'prefix' => '', @@ -873,6 +932,9 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { /* * Get Information about advertised Joins */ + /** + * @return array + */ function getAvailableJoins() { return array( 'priceFieldValue_from_lineItem' => array( @@ -962,6 +1024,9 @@ class CRM_Report_Form_Extended extends CRM_Report_Form { * 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 + */ function joinAddressFromContact( $prefix = '') { $this->_from .= " LEFT JOIN civicrm_address {$this->_aliases[$prefix . 'civicrm_address']} ON {$this->_aliases[$prefix . 'civicrm_address']}.contact_id = {$this->_aliases[$prefix . 'civicrm_contact']}.id"; @@ -1169,6 +1234,12 @@ WHERE line_item_civireport.id IS NOT NULL /* * Retrieve text for financial type from pseudoconstant */ + /** + * @param $value + * @param $row + * + * @return string + */ function alterNickName($value, &$row) { if(empty($row['civicrm_contact_id'])){ return; @@ -1182,6 +1253,12 @@ WHERE line_item_civireport.id IS NOT NULL /* * Retrieve text for contribution type from pseudoconstant */ + /** + * @param $value + * @param $row + * + * @return array|string + */ function alterContributionType($value, &$row) { return is_string(CRM_Contribute_PseudoConstant::financialType($value, FALSE)) ? CRM_Contribute_PseudoConstant::financialType($value, FALSE) : ''; } @@ -1189,6 +1266,12 @@ WHERE line_item_civireport.id IS NOT NULL /* * Retrieve text for contribution status from pseudoconstant */ + /** + * @param $value + * @param $row + * + * @return array + */ function alterContributionStatus($value, &$row) { return CRM_Contribute_PseudoConstant::contributionStatus($value); } @@ -1196,22 +1279,54 @@ WHERE line_item_civireport.id IS NOT NULL /* * Retrieve text for payment instrument from pseudoconstant */ + /** + * @param $value + * @param $row + * + * @return array + */ function alterEventType($value, &$row) { return CRM_Event_PseudoConstant::eventType($value); } + /** + * @param $value + * @param $row + * + * @return array|string + */ function alterEventID($value, &$row) { return is_string(CRM_Event_PseudoConstant::event($value, FALSE)) ? CRM_Event_PseudoConstant::event($value, FALSE) : ''; } + /** + * @param $value + * @param $row + * + * @return array|string + */ function alterMembershipTypeID($value, &$row) { return is_string(CRM_Member_PseudoConstant::membershipType($value, FALSE)) ? CRM_Member_PseudoConstant::membershipType($value, FALSE) : ''; } + /** + * @param $value + * @param $row + * + * @return array|string + */ function alterMembershipStatusID($value, &$row) { return is_string(CRM_Member_PseudoConstant::membershipStatus($value, FALSE)) ? CRM_Member_PseudoConstant::membershipStatus($value, FALSE) : ''; } + /** + * @param $value + * @param $row + * @param $selectedfield + * @param $criteriaFieldName + * + * @return array + */ function alterCountryID($value, &$row, $selectedfield, $criteriaFieldName) { $url = CRM_Utils_System::url(CRM_Utils_System::currentPath(), "reset=1&force=1&{$criteriaFieldName}_op=in&{$criteriaFieldName}_value={$value}", $this->_absoluteUrl); $row[$selectedfield . '_link'] = $url; @@ -1222,6 +1337,14 @@ WHERE line_item_civireport.id IS NOT NULL } } + /** + * @param $value + * @param $row + * @param $selectedfield + * @param $criteriaFieldName + * + * @return array + */ function alterCountyID($value, &$row,$selectedfield, $criteriaFieldName) { $url = CRM_Utils_System::url(CRM_Utils_System::currentPath(), "reset=1&force=1&{$criteriaFieldName}_op=in&{$criteriaFieldName}_value={$value}", $this->_absoluteUrl); $row[$selectedfield . '_link'] = $url; @@ -1232,6 +1355,14 @@ WHERE line_item_civireport.id IS NOT NULL } } + /** + * @param $value + * @param $row + * @param $selectedfield + * @param $criteriaFieldName + * + * @return array + */ function alterStateProvinceID($value, &$row, $selectedfield, $criteriaFieldName) { $url = CRM_Utils_System::url(CRM_Utils_System::currentPath(), "reset=1&force=1&{$criteriaFieldName}_op=in&{$criteriaFieldName}_value={$value}", $this->_absoluteUrl); $row[$selectedfield . '_link'] = $url; @@ -1243,11 +1374,23 @@ WHERE line_item_civireport.id IS NOT NULL } } + /** + * @param $value + * @param $row + * @param $fieldname + * + * @return mixed + */ function alterContactID($value, &$row, $fieldname) { $row[$fieldname . '_link'] = CRM_Utils_System::url("civicrm/contact/view", 'reset=1&cid=' . $value, $this->_absoluteUrl); return $value; } + /** + * @param $value + * + * @return array + */ function alterParticipantStatus($value) { if (empty($value)) { return; @@ -1255,6 +1398,11 @@ WHERE line_item_civireport.id IS NOT NULL return CRM_Event_PseudoConstant::participantStatus($value, FALSE, 'label'); } + /** + * @param $value + * + * @return string + */ function alterParticipantRole($value) { if (empty($value)) { return; @@ -1267,6 +1415,11 @@ WHERE line_item_civireport.id IS NOT NULL return implode(', ', $value); } + /** + * @param $value + * + * @return mixed + */ function alterPaymentType($value) { $paymentInstruments = CRM_Contribute_PseudoConstant::paymentInstrument(); return $paymentInstruments[$value]; diff --git a/CRM/Report/Form/Grant/Detail.php b/CRM/Report/Form/Grant/Detail.php index 60ced07f94..13e626f2b6 100644 --- a/CRM/Report/Form/Grant/Detail.php +++ b/CRM/Report/Form/Grant/Detail.php @@ -40,6 +40,12 @@ class CRM_Report_Form_Grant_Detail extends CRM_Report_Form { protected $_customGroupExtends = array( 'Grant'); + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array( 'civicrm_contact' => @@ -339,6 +345,9 @@ class CRM_Report_Form_Grant_Detail extends CRM_Report_Form { } } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Grant/Statistics.php b/CRM/Report/Form/Grant/Statistics.php index af534fac25..0fae03ddfb 100644 --- a/CRM/Report/Form/Grant/Statistics.php +++ b/CRM/Report/Form/Grant/Statistics.php @@ -40,6 +40,13 @@ class CRM_Report_Form_Grant_Statistics extends CRM_Report_Form { protected $_customGroupExtends = array('Grant'); protected $_add2groupSupported = FALSE; + + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array( 'civicrm_grant' => @@ -372,6 +379,9 @@ WHERE {$this->_aliases['civicrm_grant']}.amount_total IS NOT NULL $this->endPostProcess($rows); } + /** + * @param $rows + */ function alterDisplay(&$rows) { $totalStatistics = $grantStatistics = array(); $totalStatistics = parent::statistics($rows); @@ -538,6 +548,14 @@ SELECT COUNT({$this->_aliases['civicrm_grant']}.id) as count , } } + /** + * @param $grantStatistics + * @param $fieldValue + * @param $values + * @param $awardedGrants + * @param $awardedGrantsAmount + * @param bool $customData + */ static function getStatistics(&$grantStatistics, $fieldValue, $values, $awardedGrants, $awardedGrantsAmount, $customData = FALSE ) { @@ -550,7 +568,7 @@ SELECT COUNT({$this->_aliases['civicrm_grant']}.id) as count , if (!$customData) { - if (!isset($grantStatistics['value'][$fieldValue]['currency'][$currency]) + if (!isset($grantStatistics['value'][$fieldValue]['currency'][$currency]) || !isset($grantStatistics['value'][$fieldValue]['currency'][$currency]['value'])) { $grantStatistics['value'][$fieldValue]['currency'][$currency]['value'] = 0; } @@ -563,10 +581,10 @@ SELECT COUNT({$this->_aliases['civicrm_grant']}.id) as count , $grantStatistics['value'][$fieldValue]['percentage'] = round(($grantStatistics['value'][$fieldValue]['count'] / $awardedGrants) * 100); } else { - if (!isset($grantStatistics['value'][$fieldValue]['unassigned_currency'][$currency]) + if (!isset($grantStatistics['value'][$fieldValue]['unassigned_currency'][$currency]) || !isset($grantStatistics['value'][$fieldValue]['unassigned_currency'][$currency]['value'])) { $grantStatistics['value'][$fieldValue]['unassigned_currency'][$currency]['value'] = 0; - } + } $grantStatistics['value'][$fieldValue]['unassigned_currency'][$currency]['value'] += $values['civicrm_grant_amount_total']; $grantStatistics['value'][$fieldValue]['unassigned_currency'][$currency]['percentage'] = round(($grantStatistics['value'][$fieldValue]['unassigned_currency'][$currency]['value'] / $awardedGrantsAmount) * 100); $grantStatistics['value'][$fieldValue]['unassigned_count']++; diff --git a/CRM/Report/Form/Instance.php b/CRM/Report/Form/Instance.php index f0e2a40231..8d8d011ccd 100644 --- a/CRM/Report/Form/Instance.php +++ b/CRM/Report/Form/Instance.php @@ -34,6 +34,9 @@ */ class CRM_Report_Form_Instance { + /** + * @param $form + */ static function buildForm(&$form) { // we should not build form elements in dashlet mode if ($form->_section) { @@ -80,15 +83,15 @@ class CRM_Report_Form_Instance { ts('CC'), $attributes['email_subject'] ); - + $form->add('text', 'row_count', ts('Limit Dashboard Results'), array('maxlength' => 64, 'size' => 5 - ) + ) ); - + $form->add('textarea', 'report_header', ts('Report Header'), @@ -172,6 +175,13 @@ class CRM_Report_Form_Instance { $form->addFormRule(array('CRM_Report_Form_Instance', 'formRule'), $form); } + /** + * @param $fields + * @param $errors + * @param $self + * + * @return array|bool + */ static function formRule($fields, $errors, $self) { $buttonName = $self->controller->getButtonName(); $selfButtonName = $self->getVar('_instanceButtonName'); @@ -187,6 +197,10 @@ class CRM_Report_Form_Instance { return empty($errors) ? TRUE : $errors; } + /** + * @param $form + * @param $defaults + */ static function setDefaultValues(&$form, &$defaults) { // we should not build form elements in dashlet mode if ($form->_section) { @@ -249,6 +263,10 @@ class CRM_Report_Form_Instance { } } + /** + * @param $form + * @param bool $redirect + */ static function postProcess(&$form, $redirect = TRUE) { $params = $form->getVar('_params'); $instanceID = $form->getVar('_id'); diff --git a/CRM/Report/Form/Mailing/Bounce.php b/CRM/Report/Form/Mailing/Bounce.php index 19ae44b12d..830606b70a 100644 --- a/CRM/Report/Form/Mailing/Bounce.php +++ b/CRM/Report/Form/Mailing/Bounce.php @@ -52,6 +52,12 @@ class CRM_Report_Form_Mailing_Bounce extends CRM_Report_Form { 'pieChart' => 'Pie Chart', ); + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array(); @@ -247,6 +253,13 @@ class CRM_Report_Form_Mailing_Bounce extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ static function formRule($fields, $files, $self) { $errors = $grouping = array(); return $errors; @@ -312,6 +325,9 @@ class CRM_Report_Form_Mailing_Bounce extends CRM_Report_Form { $this->endPostProcess($rows); } + /** + * @param $rows + */ function buildChart(&$rows) { if (empty($rows)) { return; @@ -332,6 +348,9 @@ class CRM_Report_Form_Mailing_Bounce extends CRM_Report_Form { $this->assign('chartType', $this->_params['charts']); } + /** + * @return array + */ function bounce_type() { $data = array('' => '--Please Select--'); @@ -347,6 +366,9 @@ class CRM_Report_Form_Mailing_Bounce extends CRM_Report_Form { return $data; } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Mailing/Clicks.php b/CRM/Report/Form/Mailing/Clicks.php index 90a4de8cae..1c8e2c9577 100644 --- a/CRM/Report/Form/Mailing/Clicks.php +++ b/CRM/Report/Form/Mailing/Clicks.php @@ -49,6 +49,12 @@ class CRM_Report_Form_Mailing_Clicks extends CRM_Report_Form { 'pieChart' => 'Pie Chart', ); + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array(); @@ -208,6 +214,13 @@ class CRM_Report_Form_Mailing_Clicks extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ static function formRule($fields, $files, $self) { $errors = $grouping = array(); return $errors; @@ -273,6 +286,9 @@ class CRM_Report_Form_Mailing_Clicks extends CRM_Report_Form { $this->endPostProcess($rows); } + /** + * @param $rows + */ function buildChart(&$rows) { if (empty($rows)) { return; @@ -293,6 +309,9 @@ class CRM_Report_Form_Mailing_Clicks extends CRM_Report_Form { $this->assign('chartType', $this->_params['charts']); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Mailing/Detail.php b/CRM/Report/Form/Mailing/Detail.php index f72ce98538..735f23aebd 100644 --- a/CRM/Report/Form/Mailing/Detail.php +++ b/CRM/Report/Form/Mailing/Detail.php @@ -37,6 +37,12 @@ class CRM_Report_Form_Mailing_Detail extends CRM_Report_Form { protected $_exposeContactID = FALSE; + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array(); @@ -441,6 +447,9 @@ class CRM_Report_Form_Mailing_Detail extends CRM_Report_Form { $this->_where .= " AND {$this->_aliases['civicrm_mailing']}.sms_provider_id IS NULL"; } + /** + * @return array + */ function mailingList() { $data = array(); @@ -455,6 +464,9 @@ class CRM_Report_Form_Mailing_Detail extends CRM_Report_Form { return $data; } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Mailing/Opened.php b/CRM/Report/Form/Mailing/Opened.php index 9862a40648..f5286a0c5a 100644 --- a/CRM/Report/Form/Mailing/Opened.php +++ b/CRM/Report/Form/Mailing/Opened.php @@ -49,6 +49,12 @@ class CRM_Report_Form_Mailing_Opened extends CRM_Report_Form { 'pieChart' => 'Pie Chart', ); + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array(); @@ -199,6 +205,13 @@ class CRM_Report_Form_Mailing_Opened extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ static function formRule($fields, $files, $self) { $errors = $grouping = array(); return $errors; @@ -261,6 +274,9 @@ class CRM_Report_Form_Mailing_Opened extends CRM_Report_Form { $this->endPostProcess($rows); } + /** + * @param $rows + */ function buildChart(&$rows) { if (empty($rows)) { return; @@ -281,6 +297,9 @@ class CRM_Report_Form_Mailing_Opened extends CRM_Report_Form { $this->assign('chartType', $this->_params['charts']); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Mailing/Summary.php b/CRM/Report/Form/Mailing/Summary.php index 199ee5f782..4727235f59 100644 --- a/CRM/Report/Form/Mailing/Summary.php +++ b/CRM/Report/Form/Mailing/Summary.php @@ -53,6 +53,12 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { public $campaignEnabled = False; + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array(); @@ -250,6 +256,9 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { parent::__construct(); } + /** + * @return array + */ function mailing_select() { $data = array(); @@ -433,6 +442,9 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { $this->endPostProcess($rows); } + /** + * @return array + */ static function getChartCriteria() { return array('count' => array('civicrm_mailing_event_delivered_delivered_count' => ts('Delivered'), 'civicrm_mailing_event_bounce_bounce_count' => ts('Bounce'), @@ -449,6 +461,13 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { ); } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ function formRule($fields, $files, $self) { $errors = array(); @@ -472,6 +491,9 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { return $errors; } + /** + * @param $rows + */ function buildChart(&$rows) { if (empty($rows)) { return; @@ -532,6 +554,9 @@ class CRM_Report_Form_Mailing_Summary extends CRM_Report_Form { $this->assign('chartType', $this->_params['charts']); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Member/ContributionDetail.php b/CRM/Report/Form/Member/ContributionDetail.php index 0200f13ec0..eb132f8926 100644 --- a/CRM/Report/Form/Member/ContributionDetail.php +++ b/CRM/Report/Form/Member/ContributionDetail.php @@ -44,6 +44,12 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form { protected $_customGroupExtends = array( 'Contribution', 'Membership'); + /** + * + */ + /** + * + */ function __construct() { $config = CRM_Core_Config::singleton(); $campaignEnabled = in_array('CiviCampaign', $config->enableComponents); @@ -552,6 +558,9 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form { } } + /** + * @param bool $applyLimit + */ function tempTable($applyLimit = TRUE) { // create temp table with contact ids,contribtuion id,membership id $dropTempTable = 'DROP TABLE IF EXISTS civireport_membership_contribution_detail'; @@ -576,6 +585,11 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form { CRM_Core_DAO::executeQuery($fillTemp); } + /** + * @param bool $applyLimit + * + * @return string + */ function buildQuery($applyLimit = TRUE) { $this->select(); //create temp table to be used as base table @@ -611,6 +625,11 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form { } } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = parent::statistics($rows); @@ -646,6 +665,9 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form { parent::postProcess(); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $checkList = array(); diff --git a/CRM/Report/Form/Member/Detail.php b/CRM/Report/Form/Member/Detail.php index e82a189154..f1e0f8dd49 100644 --- a/CRM/Report/Form/Member/Detail.php +++ b/CRM/Report/Form/Member/Detail.php @@ -47,6 +47,12 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { protected $_customGroupExtends = array('Membership', 'Contribution'); protected $_customGroupGroupBy = FALSE; + /** + * + */ + /** + * + */ function __construct() { // Check if CiviCampaign is a) enabled and b) has active campaigns @@ -415,6 +421,9 @@ class CRM_Report_Form_Member_Detail extends CRM_Report_Form { $this->endPostProcess($rows); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Member/Lapse.php b/CRM/Report/Form/Member/Lapse.php index 9b197d94f0..1b4a8067a6 100644 --- a/CRM/Report/Form/Member/Lapse.php +++ b/CRM/Report/Form/Member/Lapse.php @@ -43,6 +43,12 @@ class CRM_Report_Form_Member_Lapse extends CRM_Report_Form { 'Membership'); public $_drilldownReport = array('member/detail' => 'Link to Detail Report'); + /** + * + */ + /** + * + */ function __construct() { // Check if CiviCampaign is a) enabled and b) has active campaigns @@ -253,6 +259,13 @@ class CRM_Report_Form_Member_Lapse extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ static function formRule($fields, $files, $self) { $errors = $grouping = array(); //check for searching combination of dispaly columns and @@ -380,6 +393,9 @@ class CRM_Report_Form_Member_Lapse extends CRM_Report_Form { $this->endPostProcess($rows); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Member/Summary.php b/CRM/Report/Form/Member/Summary.php index 886f564eea..1d63923cc6 100644 --- a/CRM/Report/Form/Member/Summary.php +++ b/CRM/Report/Form/Member/Summary.php @@ -47,6 +47,12 @@ class CRM_Report_Form_Member_Summary extends CRM_Report_Form { protected $_customGroupGroupBy = FALSE; public $_drilldownReport = array('member/detail' => 'Link to Detail Report'); + /** + * + */ + /** + * + */ function __construct() { // UI for selecting columns to appear in the report list @@ -346,7 +352,7 @@ class CRM_Report_Form_Member_Summary extends CRM_Report_Form { // end of from function where() { - $this->_whereClauses[] = "{$this->_aliases['civicrm_membership']}.is_test = 0 AND + $this->_whereClauses[] = "{$this->_aliases['civicrm_membership']}.is_test = 0 AND {$this->_aliases['civicrm_contact']}.is_deleted = 0"; parent::where(); } @@ -390,6 +396,11 @@ class CRM_Report_Form_Member_Summary extends CRM_Report_Form { } } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = parent::statistics($rows); $select = " @@ -445,6 +456,9 @@ GROUP BY {$this->_aliases['civicrm_contribution']}.currency parent::postProcess(); } + /** + * @param $rows + */ function buildChart(&$rows) { $graphRows = array(); $count = 0; @@ -518,6 +532,9 @@ GROUP BY {$this->_aliases['civicrm_contribution']}.currency $this->assign('chartType', $this->_params['charts']); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Membership/Summary.php b/CRM/Report/Form/Membership/Summary.php index 6af59c05fd..d75056a672 100644 --- a/CRM/Report/Form/Membership/Summary.php +++ b/CRM/Report/Form/Membership/Summary.php @@ -43,6 +43,12 @@ class CRM_Report_Form_Membership_Summary extends CRM_Report_Form { 'pieChart' => 'Pie Chart', ); + /** + * + */ + /** + * + */ function __construct() { // UI for selecting columns to appear in the report list // array conatining the columns, group_bys and filters build and provided to Form @@ -160,6 +166,9 @@ class CRM_Report_Form_Membership_Summary extends CRM_Report_Form { parent::preProcess(); } + /** + * @return array + */ function setDefaultValues() { return parent::setDefaultValues(); } @@ -189,6 +198,13 @@ class CRM_Report_Form_Membership_Summary extends CRM_Report_Form { $this->_select = "SELECT " . implode(', ', $select) . " "; } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ static function formRule($fields, $files, $self) { $errors = $grouping = array(); //check for searching combination of dispaly columns and @@ -262,6 +278,11 @@ LEFT JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']} } } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = array(); $statistics[] = array('title' => ts('Row(s) Listed'), @@ -356,6 +377,9 @@ LEFT JOIN civicrm_contribution {$this->_aliases['civicrm_contribution']} parent::endPostProcess(); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Pledge/Detail.php b/CRM/Report/Form/Pledge/Detail.php index f61b04867c..cae2305b56 100644 --- a/CRM/Report/Form/Pledge/Detail.php +++ b/CRM/Report/Form/Pledge/Detail.php @@ -52,6 +52,13 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form { 'Pledge', 'Individual' ); + + /** + * + */ + /** + * + */ function __construct() { $this->_pledgeStatuses = CRM_Contribute_PseudoConstant::contributionStatus(); // Check if CiviCampaign is a) enabled and b) has active campaigns @@ -237,6 +244,14 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form { /* * If we are retrieving total paid we need to define the inclusion of pledge_payment */ + /** + * @param $tableName + * @param $tableKey + * @param $fieldName + * @param $field + * + * @return bool|string + */ function selectClause(&$tableName, $tableKey, &$fieldName, &$field) { if($fieldName == 'total_paid'){ $this->_totalPaid = TRUE; // add pledge_payment join @@ -294,6 +309,11 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form { } } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = parent::statistics($rows); //regenerate the from field without extra left join on pledge payments @@ -514,6 +534,9 @@ class CRM_Report_Form_Pledge_Detail extends CRM_Report_Form { $this->endPostProcess($rows); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Pledge/Pbnp.php b/CRM/Report/Form/Pledge/Pbnp.php index 19a4b055a4..e38337b9b4 100644 --- a/CRM/Report/Form/Pledge/Pbnp.php +++ b/CRM/Report/Form/Pledge/Pbnp.php @@ -43,6 +43,12 @@ class CRM_Report_Form_Pledge_Pbnp extends CRM_Report_Form { protected $_customGroupExtends = array( 'Pledge'); + /** + * + */ + /** + * + */ function __construct() { // Check if CiviCampaign is a) enabled and b) has active campaigns @@ -294,6 +300,9 @@ class CRM_Report_Form_Pledge_Pbnp extends CRM_Report_Form { parent::PostProcess(); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Pledge/Summary.php b/CRM/Report/Form/Pledge/Summary.php index 0ef6922495..24d68697bd 100644 --- a/CRM/Report/Form/Pledge/Summary.php +++ b/CRM/Report/Form/Pledge/Summary.php @@ -42,6 +42,12 @@ class CRM_Report_Form_Pledge_Summary extends CRM_Report_Form { protected $_addressField = FALSE; protected $_emailField = FALSE; + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array( 'civicrm_contact' => @@ -296,6 +302,11 @@ class CRM_Report_Form_Pledge_Summary extends CRM_Report_Form { } } + /** + * @param $rows + * + * @return array + */ function statistics(&$rows) { $statistics = parent::statistics($rows); @@ -386,6 +397,9 @@ class CRM_Report_Form_Pledge_Summary extends CRM_Report_Form { parent::postProcess(); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Form/Register.php b/CRM/Report/Form/Register.php index 9efed0726d..116863a73c 100644 --- a/CRM/Report/Form/Register.php +++ b/CRM/Report/Form/Register.php @@ -55,6 +55,18 @@ class CRM_Report_Form_Register extends CRM_Core_Form { $instanceInfo = array(); } + /** + * This virtual function is used to set the default values of + * various form elements + * + * access public + * + * @return array reference to the array of default values + * + */ + /** + * @return array + */ function setDefaultValues() { $defaults = array(); if ($this->_action & CRM_Core_Action::DELETE) { @@ -126,6 +138,13 @@ class CRM_Report_Form_Register extends CRM_Core_Form { $this->addFormRule(array('CRM_Report_Form_Register', 'formRule'), $this); } + /** + * @param $fields + * @param $files + * @param $self + * + * @return array + */ static function formRule($fields, $files, $self) { $errors = array(); $dupeClass = FALSE; diff --git a/CRM/Report/Form/Walklist/Walklist.php b/CRM/Report/Form/Walklist/Walklist.php index 48eb1e2161..a88e4b7dce 100644 --- a/CRM/Report/Form/Walklist/Walklist.php +++ b/CRM/Report/Form/Walklist/Walklist.php @@ -48,6 +48,12 @@ class CRM_Report_Form_Walklist_Walklist extends CRM_Report_Form { 'Contact', 'Individual', 'Household', 'Organization' ); + /** + * + */ + /** + * + */ function __construct() { $this->_columns = array( 'civicrm_contact' => @@ -240,6 +246,9 @@ FROM civicrm_contact {$this->_aliases['civicrm_contact']} {$this->_aclFrom parent::postProcess(); } + /** + * @param $rows + */ function alterDisplay(&$rows) { // custom code to alter rows $entryFound = FALSE; diff --git a/CRM/Report/Info.php b/CRM/Report/Info.php index 6c119a7cfc..901458705e 100644 --- a/CRM/Report/Info.php +++ b/CRM/Report/Info.php @@ -41,6 +41,18 @@ class CRM_Report_Info extends CRM_Core_Component_Info { protected $keyword = 'report'; // docs inherited from interface + /** + * Provides base information about the component. + * Needs to be implemented in component's information + * class. + * + * @return array collection of required component settings + * @access public + * + */ + /** + * @return array + */ public function getInfo() { return array( 'name' => 'CiviReport', @@ -53,40 +65,120 @@ class CRM_Report_Info extends CRM_Core_Component_Info { // docs inherited from interface + /** + * Provides permissions that are used by component. + * Needs to be implemented in component's information + * class. + * + * NOTE: if using conditionally permission return, + * implementation of $getAllUnconditionally is required. + * + * @param bool $getAllUnconditionally + * + * @return array|null collection of permissions, null if none + * @access public + */ + /** + * @param bool $getAllUnconditionally + * + * @return array|null + */ public function getPermissions($getAllUnconditionally = FALSE) { return array('access CiviReport', 'access Report Criteria', 'administer reserved reports', 'administer Reports'); } // docs inherited from interface + /** + * Provides information about user dashboard element + * offered by this component. + * + * @return array|null collection of required dashboard settings, + * null if no element offered + * @access public + * + */ + /** + * @return array|null + */ public function getUserDashboardElement() { // no dashboard element for this component return NULL; } + /** + * Provides component's user dashboard page object. + * + * @return mixed component's User Dashboard applet object + * @access public + * + */ + /** + * @return mixed + */ public function getUserDashboardObject() { // no dashboard element for this component return NULL; } // docs inherited from interface + /** + * Provides information about user dashboard element + * offered by this component. + * + * @return array|null collection of required dashboard settings, + * null if no element offered + * @access public + * + */ + /** + * @return array|null + */ public function registerTab() { // this component doesn't use contact record tabs return NULL; } // docs inherited from interface + /** + * Provides information about advanced search pane + * offered by this component. + * + * @return array|null collection of required pane settings, + * null if no element offered + * @access public + * + */ + /** + * @return array|null + */ public function registerAdvancedSearchPane() { // this component doesn't use advanced search return NULL; } // docs inherited from interface + /** + * Provides potential activity types that this + * component might want to register in activity history. + * Needs to be implemented in component's information + * class. + * + * @return array|null collection of activity types + * @access public + * + */ + /** + * @return array|null + */ public function getActivityTypes() { return NULL; } // add shortcut to Create New + /** + * @param $shortCuts + */ public function creatNewShortcut(&$shortCuts) {} } diff --git a/CRM/Report/Page/List.php b/CRM/Report/Page/List.php index 4c8de87110..734cc54188 100644 --- a/CRM/Report/Page/List.php +++ b/CRM/Report/Page/List.php @@ -39,6 +39,9 @@ */ class CRM_Report_Page_List extends CRM_Core_Page { + /** + * @return array + */ public static function &info() { $sql = " SELECT v.id, v.value, v.label, v.description, v.component_id, diff --git a/CRM/Report/Page/TemplateList.php b/CRM/Report/Page/TemplateList.php index bb2494cb9a..2eac142299 100644 --- a/CRM/Report/Page/TemplateList.php +++ b/CRM/Report/Page/TemplateList.php @@ -39,6 +39,12 @@ */ class CRM_Report_Page_TemplateList extends CRM_Core_Page { + /** + * @param null $compID + * @param null $grouping + * + * @return array + */ public static function &info($compID = NULL, $grouping = NULL) { $all = CRM_Utils_Request::retrieve('all', 'Boolean', CRM_Core_DAO::$_nullObject, FALSE, NULL, 'GET' diff --git a/CRM/Report/Utils/Get.php b/CRM/Report/Utils/Get.php index b8b4fd61e2..cad6f333e7 100644 --- a/CRM/Report/Utils/Get.php +++ b/CRM/Report/Utils/Get.php @@ -35,6 +35,12 @@ */ class CRM_Report_Utils_Get { + /** + * @param $name + * @param $type + * + * @return mixed|null + */ static function getTypedValue($name, $type) { $value = CRM_Utils_Array::value($name, $_GET); if ($value === NULL) { @@ -46,6 +52,11 @@ class CRM_Report_Utils_Get { ); } + /** + * @param $fieldName + * @param $field + * @param $defaults + */ static function dateParam($fieldName, &$field, &$defaults) { // type = 12 (datetime) is not recognized by Utils_Type::escape() method, // and therefore the below hack @@ -84,6 +95,11 @@ class CRM_Report_Utils_Get { } } + /** + * @param $fieldName + * @param $field + * @param $defaults + */ static function stringParam($fieldName, &$field, &$defaults) { $fieldOP = CRM_Utils_Array::value("{$fieldName}_op", $_GET, 'like'); @@ -117,6 +133,11 @@ class CRM_Report_Utils_Get { } } + /** + * @param $fieldName + * @param $field + * @param $defaults + */ static function intParam($fieldName, &$field, &$defaults) { $fieldOP = CRM_Utils_Array::value("{$fieldName}_op", $_GET, 'eq'); @@ -168,6 +189,9 @@ class CRM_Report_Utils_Get { } } + /** + * @param $defaults + */ static function processChart(&$defaults) { $chartType = CRM_Utils_Array::value("charts", $_GET); if (in_array($chartType, array( @@ -176,6 +200,10 @@ class CRM_Report_Utils_Get { } } + /** + * @param $fieldGrp + * @param $defaults + */ static function processFilter(&$fieldGrp, &$defaults) { // process only filters for now foreach ($fieldGrp as $tableName => $fields) { @@ -202,6 +230,9 @@ class CRM_Report_Utils_Get { } //unset default filters + /** + * @param $defaults + */ static function unsetFilters(&$defaults) { static $unsetFlag = TRUE; if ($unsetFlag) { @@ -219,6 +250,10 @@ class CRM_Report_Utils_Get { } } + /** + * @param $fieldGrp + * @param $defaults + */ static function processGroupBy(&$fieldGrp, &$defaults) { // process only group_bys for now $flag = FALSE; @@ -243,6 +278,10 @@ class CRM_Report_Utils_Get { } } + /** + * @param $reportFields + * @param $defaults + */ static function processFields(&$reportFields, &$defaults) { //add filters from url if (is_array($reportFields)) { diff --git a/CRM/Report/Utils/Report.php b/CRM/Report/Utils/Report.php index 5ff5769c59..d2685183c1 100644 --- a/CRM/Report/Utils/Report.php +++ b/CRM/Report/Utils/Report.php @@ -35,6 +35,11 @@ */ class CRM_Report_Utils_Report { + /** + * @param null $instanceID + * + * @return null|string + */ static function getValueFromUrl($instanceID = NULL) { if ($instanceID) { $optionVal = CRM_Core_DAO::getFieldValue('CRM_Report_DAO_ReportInstance', @@ -57,6 +62,11 @@ class CRM_Report_Utils_Report { return $optionVal; } + /** + * @param null $instanceID + * + * @return array|bool + */ static function getValueIDFromUrl($instanceID = NULL) { $optionVal = self::getValueFromUrl($instanceID); @@ -68,6 +78,11 @@ class CRM_Report_Utils_Report { return FALSE; } + /** + * @param $optionVal + * + * @return mixed + */ static function getInstanceIDForValue($optionVal) { static $valId = array(); @@ -82,6 +97,11 @@ WHERE report_id = %1"; return $valId[$optionVal]; } + /** + * @param null $path + * + * @return mixed + */ static function getInstanceIDForPath($path = NULL) { static $valId = array(); @@ -99,6 +119,15 @@ WHERE TRIM(BOTH '/' FROM CONCAT(report_id, '/', name)) = %1"; return CRM_Utils_Array::value($path, $valId); } + /** + * @param $urlValue + * @param string $query + * @param bool $absolute + * @param null $instanceID + * @param array $drilldownReport + * + * @return bool|string + */ static function getNextUrl($urlValue, $query = 'reset=1', $absolute = FALSE, $instanceID = NULL, $drilldownReport = array()) { if ($instanceID) { $drilldownInstanceID = false; @@ -125,6 +154,11 @@ WHERE TRIM(BOTH '/' FROM CONCAT(report_id, '/', name)) = %1"; } // get instance count for a template + /** + * @param $optionVal + * + * @return int|null|string + */ static function getInstanceCount($optionVal) { if (empty($optionVal)) return 0; @@ -138,6 +172,14 @@ WHERE inst.report_id = %1"; return $count; } + /** + * @param $fileContent + * @param null $instanceID + * @param string $outputMode + * @param array $attachments + * + * @return bool + */ static function mailReport($fileContent, $instanceID = NULL, $outputMode = 'html', $attachments = array( )) { if (!$instanceID) { @@ -173,6 +215,10 @@ WHERE inst.report_id = %1"; return CRM_Utils_Mail::send($params); } + /** + * @param $form + * @param $rows + */ static function export2csv(&$form, &$rows) { //Mark as a CSV file. header('Content-Type: text/csv'); @@ -246,6 +292,9 @@ WHERE inst.report_id = %1"; return $csv; } + /** + * @return mixed + */ static function getInstanceID() { $config = CRM_Core_Config::singleton(); @@ -260,6 +309,9 @@ WHERE inst.report_id = %1"; } } + /** + * @return string + */ static function getInstancePath() { $config = CRM_Core_Config::singleton(); $arg = explode('/', $_GET[$config->userFrameworkURLVar]); @@ -273,6 +325,11 @@ WHERE inst.report_id = %1"; } } + /** + * @param $instanceId + * + * @return bool + */ static function isInstancePermissioned($instanceId) { if (!$instanceId) { return TRUE; @@ -332,6 +389,11 @@ WHERE inst.report_id = %1"; return TRUE; } + /** + * @param $params + * + * @return array + */ static function processReport($params) { $instanceId = CRM_Utils_Array::value('instanceId', $params); @@ -471,6 +533,11 @@ WHERE inst.report_id = %1"; return $query_string; } + /** + * @param $reportUrl + * + * @return mixed + */ static function getInstanceList($reportUrl) { static $instanceDetails = array();