X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FEvent%2FBAO%2FQuery.php;h=3e4873a60288104c4af1b55732dd770b71e3b564;hb=dbc6f6d6ef466bec4c2935cd9e2c5dbcf56a5dfb;hp=af6392201892ea181fe956709d2207234377fa83;hpb=03c24df0b528f700e6765cc18a2c14d4d70e4bdf;p=civicrm-core.git diff --git a/CRM/Event/BAO/Query.php b/CRM/Event/BAO/Query.php index af63922018..3e4873a602 100644 --- a/CRM/Event/BAO/Query.php +++ b/CRM/Event/BAO/Query.php @@ -35,6 +35,9 @@ */ class CRM_Event_BAO_Query { + /** + * @return array + */ static function &getFields() { $fields = array(); $fields = array_merge($fields, CRM_Event_DAO_Event::import()); @@ -44,6 +47,9 @@ class CRM_Event_BAO_Query { return $fields; } + /** + * @return array + */ static function &getParticipantFields() { $fields = CRM_Event_BAO_Participant::importableFields('Individual', TRUE, TRUE); return $fields; @@ -201,6 +207,9 @@ class CRM_Event_BAO_Query { } } + /** + * @param $query + */ static function where(&$query) { $grouping = NULL; foreach (array_keys($query->_params) as $id) { @@ -219,6 +228,10 @@ class CRM_Event_BAO_Query { } } + /** + * @param $values + * @param $query + */ static function whereClauseSingle(&$values, &$query) { list($name, $op, $value, $grouping, $wildcard) = $values; switch ($name) { @@ -320,7 +333,7 @@ class CRM_Event_BAO_Query { $status = $value; } - if (count($val) > 1) { + if (count($val) > 0) { $op = 'IN'; $status = "({$status})"; } @@ -334,7 +347,9 @@ class CRM_Event_BAO_Query { } } else { - $names[] = $statusTypes[$value]; + if (!empty($value)) { + $names[] = $statusTypes[$value]; + } } $query->_qill[$grouping][] = ts('Participant Status %1', array(1 => $op)) . ' ' . implode(' ' . ts('or') . ' ', $names); @@ -365,7 +380,9 @@ class CRM_Event_BAO_Query { $names = array(); foreach ($val as $id => $dontCare) { - $names[] = $roleTypes[$id]; + if (!empty($roleTypes[$id]) ) { + $names[] = $roleTypes[$id]; + } } if (!empty($names)) { @@ -445,6 +462,13 @@ class CRM_Event_BAO_Query { } } + /** + * @param $name + * @param $mode + * @param $side + * + * @return null|string + */ static function from($name, $mode, $side) { $from = NULL; switch ($name) { @@ -494,6 +518,12 @@ class CRM_Event_BAO_Query { return (isset($this->_qill)) ? $this->_qill : ""; } + /** + * @param $mode + * @param bool $includeCustomFields + * + * @return array|null + */ static function defaultReturnProperties($mode, $includeCustomFields = TRUE ) { @@ -570,7 +600,6 @@ class CRM_Event_BAO_Query { CRM_Core_Form_Date::buildDateRange($form, 'event', 1, '_start_date_low', '_end_date_high', ts('From'), FALSE); $status = CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label'); - asort($status); foreach ($status as $id => $Name) { $form->_participantStatus = &$form->addElement('checkbox', "participant_status_id[$id]", NULL, $Name); } @@ -610,8 +639,15 @@ class CRM_Event_BAO_Query { $form->setDefaults(array('participant_test' => 0)); } + /** + * @param $row + * @param $id + */ static function searchAction(&$row, $id) {} + /** + * @param $tables + */ static function tableNames(&$tables) { //add participant table if (!empty($tables['civicrm_event'])) {