Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create calendar for specific resource #10

Open
lkwetter opened this issue Jan 8, 2018 · 0 comments
Open

Unable to create calendar for specific resource #10

lkwetter opened this issue Jan 8, 2018 · 0 comments

Comments

@lkwetter
Copy link

lkwetter commented Jan 8, 2018

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'),
),
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant