@@ -253,6 +253,10 @@ public static function where(&$query) {
253
253
* @param $query
254
254
*/
255
255
public static function whereClauseSingle (&$ values , &$ query ) {
256
+ $ checkPermission = TRUE ;
257
+ if (!empty ($ query ->_skipPermission )) {
258
+ $ checkPermission = FALSE ;
259
+ }
256
260
list ($ name , $ op , $ value , $ grouping , $ wildcard ) = $ values ;
257
261
$ fields = array_merge (CRM_Event_BAO_Event::fields (), CRM_Event_BAO_Participant::exportableFields ());
258
262
@@ -400,7 +404,7 @@ public static function whereClauseSingle(&$values, &$query) {
400
404
}
401
405
$ query ->_where [$ grouping ][] = CRM_Contact_BAO_Query::buildClause ("$ tableName. $ name " , $ op , $ value , $ dataType );
402
406
403
- list ($ op , $ value ) = CRM_Contact_BAO_Query::buildQillForFieldValue ('CRM_Event_DAO_Participant ' , $ name , $ value , $ op );
407
+ list ($ op , $ value ) = CRM_Contact_BAO_Query::buildQillForFieldValue ('CRM_Event_DAO_Participant ' , $ name , $ value , $ op, array ( ' check_permission ' => $ checkPermission ) );
404
408
$ query ->_qill [$ grouping ][] = ts ('%1 %2 %3 ' , array (1 => $ fields [$ qillName ]['title ' ], 2 => $ op , 3 => $ value ));
405
409
$ query ->_tables ['civicrm_participant ' ] = $ query ->_whereTables ['civicrm_participant ' ] = 1 ;
406
410
return ;
@@ -425,7 +429,7 @@ public static function whereClauseSingle(&$values, &$query) {
425
429
$ query ->_where [$ grouping ][] = CRM_Contact_BAO_Query::buildClause ("$ tableName. $ name " , $ op , $ value , $ dataType );
426
430
}
427
431
428
- list ($ op , $ value ) = CRM_Contact_BAO_Query::buildQillForFieldValue ('CRM_Event_DAO_Participant ' , $ name , $ value , $ op );
432
+ list ($ op , $ value ) = CRM_Contact_BAO_Query::buildQillForFieldValue ('CRM_Event_DAO_Participant ' , $ name , $ value , $ op, array ( ' check_permission ' => $ checkPermission ) );
429
433
$ query ->_qill [$ grouping ][] = ts ('%1 %2 %3 ' , array (1 => $ fields [$ qillName ]['title ' ], 2 => $ op , 3 => $ value ));
430
434
$ query ->_tables ['civicrm_participant ' ] = $ query ->_whereTables ['civicrm_participant ' ] = 1 ;
431
435
return ;
@@ -461,7 +465,7 @@ public static function whereClauseSingle(&$values, &$query) {
461
465
if (!array_key_exists ($ qillName , $ fields )) {
462
466
break ;
463
467
}
464
- list ($ op , $ value ) = CRM_Contact_BAO_Query::buildQillForFieldValue ('CRM_Event_DAO_Event ' , $ name , $ value , $ op );
468
+ list ($ op , $ value ) = CRM_Contact_BAO_Query::buildQillForFieldValue ('CRM_Event_DAO_Event ' , $ name , $ value , $ op, array ( ' check_permission ' => $ checkPermission ) );
465
469
$ query ->_qill [$ grouping ][] = ts ('%1 %2 %3 ' , array (1 => $ fields [$ qillName ]['title ' ], 2 => $ op , 3 => $ value ));
466
470
return ;
467
471
}
0 commit comments