Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

CRM/Booking/BAO/Query.php: fix CiviCRM 5.47+ compatibility #197

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions CRM/Booking/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ function &getFields() {
* @return void
* @access public
*/
function select(&$query) {
if( CRM_Contact_BAO_Query::componentPresent($query->_returnProperties, 'booking_')) {
$fields = $this->getFields();
static function select(&$query) {
if (CRM_Contact_BAO_Query::componentPresent($query->_returnProperties, 'booking_')) {
$fields = self::getFields();
foreach ($fields as $fldName => $params) {
if (CRM_Utils_Array::value($fldName, $query->_returnProperties)) {
$query->_select[$fldName] = "{$params['where']} as $fldName";
Expand Down Expand Up @@ -134,7 +134,7 @@ function select(&$query) {
}
}

function where(&$query) {
static function where(&$query) {
$grouping = NULL;
foreach (array_keys($query->_params) as $id) {
if (!CRM_Utils_Array::value(0, $query->_params[$id])) {
Expand All @@ -149,7 +149,7 @@ function where(&$query) {
}
}

function whereClauseSingle(&$values, &$query) {
static function whereClauseSingle(&$values, &$query) {
$fields = $this->getFields();
list($name, $op, $value, $grouping, $wildcard) = $values;
$strtolower = function_exists('mb_strtolower') ? 'mb_strtolower' : 'strtolower';
Expand Down Expand Up @@ -267,7 +267,7 @@ function whereClauseSingle(&$values, &$query) {
}
}

function from($name, $mode, $side) {
static function from($name, $mode, $side) {
$from = NULL;
switch ($name) {
case 'civicrm_booking':
Expand Down Expand Up @@ -300,7 +300,7 @@ function qill() {
return (isset($this->_qill)) ? $this->_qill : "";
}

static function defaultReturnProperties() {
static function defaultReturnProperties($mode = NULL) {
$properties = array(
'contact_type' => 1,
'contact_sub_type' => 1,
Expand All @@ -320,8 +320,6 @@ static function defaultReturnProperties() {
}

static function buildSearchForm(&$form) {


$form->add('text', 'booking_po_no', E::ts('Purchase Order Number'));

$resourceTypes = CRM_Booking_BAO_Resource::getResourceTypes();
Expand Down
3 changes: 1 addition & 2 deletions info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
<version>1.5.3</version>
<develStage>stable</develStage>
<compatibility>
<ver>4.6</ver>
<ver>4.7</ver>
<ver>5.47</ver>
</compatibility>
<comments></comments>
<civix>
Expand Down