Merge branch 'master' into move_event_totals_to_monitor_status
This commit is contained in:
commit
f2630b8fbc
|
@ -48,9 +48,24 @@ class EventsController extends AppController {
|
|||
$mon_options = '';
|
||||
}
|
||||
|
||||
if ( $this->request->params['named'] ) {
|
||||
$named_params = $this->request->params['named'];
|
||||
if ( $named_params ) {
|
||||
# In 1.35.13 we renamed StartTime and EndTime to StartDateTime and EndDateTime.
|
||||
# This hack renames the query string params
|
||||
foreach ( $named_params as $k=>$v ) {
|
||||
if ( false !== strpos($k, 'StartTime') ) {
|
||||
$new_k = preg_replace('/StartTime/', 'StartDateTime', $k);
|
||||
$named_params[$new_k] = $named_params[$k];
|
||||
unset($named_params[$k]);
|
||||
}
|
||||
if ( false !== strpos($k, 'EndTime') ) {
|
||||
$new_k = preg_replace('/EndTime/', 'EndDateTime', $k);
|
||||
$named_params[$new_k] = $named_params[$k];
|
||||
unset($named_params[$k]);
|
||||
}
|
||||
}
|
||||
$this->FilterComponent = $this->Components->load('Filter');
|
||||
$conditions = $this->FilterComponent->buildFilter($this->request->params['named']);
|
||||
$conditions = $this->FilterComponent->buildFilter($named_params);
|
||||
} else {
|
||||
$conditions = array();
|
||||
}
|
||||
|
|
|
@ -31,6 +31,10 @@ class Event extends AppModel {
|
|||
*/
|
||||
public $displayField = 'Name';
|
||||
|
||||
public $virtualFields = array(
|
||||
'StartTime' => 'StartDateTime',
|
||||
'EndTime' => 'EndDateTime'
|
||||
);
|
||||
|
||||
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
||||
|
||||
|
|
Loading…
Reference in New Issue