*/
class CRM_Event_BAO_Query {
+ /**
+ * @return array
+ */
static function &getFields() {
$fields = array();
$fields = array_merge($fields, CRM_Event_DAO_Event::import());
return $fields;
}
+ /**
+ * @return array
+ */
static function &getParticipantFields() {
$fields = CRM_Event_BAO_Participant::importableFields('Individual', TRUE, TRUE);
return $fields;
}
}
+ /**
+ * @param $query
+ */
static function where(&$query) {
$grouping = NULL;
foreach (array_keys($query->_params) as $id) {
}
}
+ /**
+ * @param $values
+ * @param $query
+ */
static function whereClauseSingle(&$values, &$query) {
list($name, $op, $value, $grouping, $wildcard) = $values;
switch ($name) {
$status = $value;
}
- if (count($val) > 1) {
+ if (count($val) > 0) {
$op = 'IN';
$status = "({$status})";
}
}
}
else {
- $names[] = $statusTypes[$value];
+ if (!empty($value)) {
+ $names[] = $statusTypes[$value];
+ }
}
$query->_qill[$grouping][] = ts('Participant Status %1', array(1 => $op)) . ' ' . implode(' ' . ts('or') . ' ', $names);
$names = array();
foreach ($val as $id => $dontCare) {
- $names[] = $roleTypes[$id];
+ if (!empty($roleTypes[$id]) ) {
+ $names[] = $roleTypes[$id];
+ }
}
if (!empty($names)) {
}
}
+ /**
+ * @param $name
+ * @param $mode
+ * @param $side
+ *
+ * @return null|string
+ */
static function from($name, $mode, $side) {
$from = NULL;
switch ($name) {
return (isset($this->_qill)) ? $this->_qill : "";
}
+ /**
+ * @param $mode
+ * @param bool $includeCustomFields
+ *
+ * @return array|null
+ */
static function defaultReturnProperties($mode,
$includeCustomFields = TRUE
) {
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);
}
$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'])) {