You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We schedule multiple resources and need calendars that display only one resource. In Drupal views, I was not able to access or create a relationship to the database table civicrm_booking_slot that contains the resource number for each booking, though it is referenced on line 15 of civibooking_calendar.views.inc. I needed a way to filter the data on this number.
I ended up adding the following relationship to the civicrm_booking_slot table at line 399 in civibooking_calendar.views.inc in order to create a relationship in views to the civicrm_booking_slot table.
I'm posting this so maybe it will help someone else who needs to filter by the resource being booked.
We schedule multiple resources and need calendars that display only one resource. In Drupal views, I was not able to access or create a relationship to the database table civicrm_booking_slot that contains the resource number for each booking, though it is referenced on line 15 of civibooking_calendar.views.inc. I needed a way to filter the data on this number.
I ended up adding the following relationship to the civicrm_booking_slot table at line 399 in civibooking_calendar.views.inc in order to create a relationship in views to the civicrm_booking_slot table.
I'm posting this so maybe it will help someone else who needs to filter by the resource being booked.
$data['civicrm_booking']['id'] = array(
'title' => t('Booking ID'),
'help' => t('Booking ID'),
'real field' => 'id',
'field' => array(
'handler' => 'views_handler_field_numeric',
'click sortable' => TRUE,
),
'argument' => array(
'handler' => 'views_handler_argument_numeric',
'name field' => 'id',
'numeric' => FALSE
),
'filter' => array(
'handler' => 'views_handler_filter_numeric',
'help' => t('Filter on CiviCRM Booking Primary booking ID field.'),
),
'sort' => array(
'handler' => 'views_handler_sort',
'help' => t('Sort on CiviCRM Booking Primary booking ID field.'),
),
'relationship' => array(
'handler' => 'views_handler_relationship',
'base' => 'civicrm_booking_slot',
'base field' => 'booking_id',
'title' => t('CiviCRM Slot Booking ID'),
'label' => t('CiviCRM Slot Boooking ID join'),
),
);
The text was updated successfully, but these errors were encountered: