GithubHelp home page GithubHelp logo

bat's Introduction

BAT

Software License Build Status Quality Score Total Downloads

BAT stands for Booking and Availability Management Tools.

It is a set of tools created by the Roomify.us team to provide a foundation through which a wide range of availability management, reservation and booking use cases can be addressed. BAT will work with a variety of CMSs and PHP Frameworks, of which the first is Drupal (check out our Drupal module).

BAT builds on our experience with Rooms, which handles the problem of bookings specifically for the accommodation for rental use case(vacation rentals, hotels, B&B, etc). With BAT we took everything we learned and build a system that will let you build an application like Rooms - or something for table booking at a restaurant, or conference room bookings, or sharing power tools with friends, or booking activities, or... well you get the idea.

BAT on its own is a booking and availability management framework - much in the same way Drupal is a content management framework or Drupal Commerce is an e-commerce framework. Our aim is to build specific solutions on top of BAT to tackle specific application domains.

Basic Concepts

Units

Units are the things that can be booked. For BAT they simply have an id, a default state (for a given event type - we will get to this later) and can define Constraints. Constraints are like extra rules about whether a specific unit is available (we get back to these as well).

For each application units will represent something concrete like hotel rooms, cars, tables, etc.

Events

Events define what value a unit has for a given time period. There can be multiple types of events and the value of the event together with the type of event will provide some meaning within an application.

For example, one set of events can denote "Availability", while another "Price". The value of events of type Availability will indicate whether a unit is available (1), unavailable (0) or booked (2) - i.e they indicate the state of a unit. The value of events of type Price could denote instead the cost per night to change the state of a unit for a given time period. So to make Unit 1 change state from available to booked for a given set of days you can retrieve all pricing events for that set of days and multiple the number of nights by the value associated with that event.

Calendar

A Calendar allows us to retrieve Events of a given type for a given set of Units as well as search over Units to see the ones that match specific event values.

You can, for example, use a Calendar to find all Units that from Jan 1 2016 to Jan 15 2016 have Availability Events that only hold value of 2 - which given our definition above - would indicate booked units.

CalendarResponse

A search using the Calendar will return a CalendarResponse - this will indicate for each unit that was involved in the search whether it is part of the included units or the excluded units together with the reason it ended up in one or the other set. This allows our applications to reason about why something didn't make the cut and display it to the end user.

Constraints

When a Calendar does a search it does it for a given time range and a valid set of values. We can identify further Constrainers either at the global level or at the Unit level. For example a specific Unit may indicate that it will only make itself available if the range search starts on a Monday, or it is of at least 7 days, etc.

The Calendar Response will hold information about which Constraint moved a Unit from the included set to the excluded set.

Valuator

A Valuator performs an operation on event values to determine the value of a Unit for a given period given a specific valuation strategy. The simplest case for hotels would be to sum up the cost per night. Our applications can define multiple valuators and refer to different EventTypes to cater for a range of valuation strategies.

Store

Store stores the value of a unit for a given moment in time. The Store goes down to minute granularity which means our Units can have a different value for each minute in time. The Store data structure is designed to quickly allows us to determine the value of a unit for a given time range and quickly change it.

Currently we support a SQLite store (used in our tests) and a DrupalStore. Additional Store support is on its way.

Install

Via Composer

$ composer require Roomify/Bat

Usage

Create a unit with ID 1, default value 1 and a minimum length of event constraint.

$constraint = new MinMaxDaysConstraint([], 5)

$unit = new Unit(1,1, array($constraint)); 

Create a Store for events of type availability and pricing, create an event for Unit 1 and save it

$state_store = new SqlLiteDBStore($this->pdo, 'availability_event', SqlDBStore::BAT_STATE);

$start_date = new \DateTime('2016-01-01 12:12');
$end_date = new \DateTime('2016-01-04 07:07');

$state_event = new Event($start_date, $end_date, $unit, 0); \\ Event value is 0 (i.e. unavailable)

$state_calendar = new Calendar(array($unit), $state_store);
$state_calendar->addEvents(array($state_event), Event::BAT_HOURLY); \\ BAT_HOURLY denotes granularity

We can then search for matching Units. In this case we are searching for all units from date $s1 to date $s2 that have events only of value 1 (Available). Given that our unit in that period also has a value of 0 our calendar will not find any matching units.

$s1 = new \DateTime('2016-01-01 00:00');
$s2 = new \DateTime('2016-01-31 12:00');

$response = $state_calendar->getMatchingUnits($s1, $s2, array(1), array());

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

bat's People

Contributors

acrollet avatar anhskohbo avatar istos avatar marcovega avatar salvoscala avatar twod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bat's Issues

Recurring Bookings for BEE

Issue Key: BAT-133
Issue Type: Epic
Created: 24/Oct/19 4:29 PM
Updated: 12/Dec/19 9:34 PM
Resolved:
Description:
Comment1:
Comment2:
Comment3:

Improve constraint manager

ConstraintManager currently uses hard-coded normalize functions to normalize multiple constraints of the same type. These should be moved into their own classes and accessed through an interface allowing other constraint normalizers to be added without having to change the constraint manager.

This will also allow us to implement different constraint normalization strategies.

Stored a tons of useless data in the minutes table

Hi,
for example a event with:
startdate: 2016-01-01 12:10
endate: 2016-01-03 12:10

will store in minute table all values for

  • 2016-01-01 h12 (this is correct because in the hour table I have -1)
  • 2016-01-01 h13 (this is wrong because I already have the value in hour table for h13)
  • 2016-01-01 h14 (this is wrong because I already have the value in hour table for h14)
  • 2016-01-01 h15 (this is wrong because I already have the value in hour table for h15)
  • 2016-01-01 h16 (this is wrong because I already have the value in hour table for h16)
    ......
  • 2016-01-01 h23 (this is wrong because I already have the value in hour table for h23)
  • 2016-01-03 h0 (this is wrong because I already have the value in hour table for h0)
  • 2016-01-03 h1 (this is wrong because I already have the value in hour table for h1)
  • 2016-01-03 h2 (this is wrong because I already have the value in hour table for h2)
    ......
  • 2016-01-03 h11 (this is wrong because I already have the value in hour table for h11)
  • 2016-01-03 h12 (this is correct because in the hour table I have -1)

Something like this will store in minute table 25 rows instead only 2 rows

the problem is into file event/EventItemizer.php, now to fix it I have added following code at line 304
unset($itemized[EventItemizer::BAT_MINUTE][$year][$month]['d' . $day]['h' . $hour]);
This line remove all useless data in minute table when the value is already stored in hour table.

Regards

Double prefix for Drupal 7 tables issue

Hello,

I faced with the following issue:

PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.fh_fh_bat_event_availability_day_state' doesn't exist: SELECT 1 AS expression
FROM 
{fh_bat_event_availability_day_state} fh_bat_event_availability_day_state
WHERE ( (unit_id = :db_condition_placeholder_0) AND (year = :db_condition_placeholder_1) AND (month = :db_condition_placeholder_2) ); Array
(
    [:db_condition_placeholder_0] => 1
    [:db_condition_placeholder_1] => 2016
    [:db_condition_placeholder_2] => 12
)
 in Roomify\Bat\Store\DrupalDBStore->storeEvent() (line 96 of /sites/all/vendor/roomify/bat/src/Store/DrupalDBStore.php).

Meaning there is a "Double prefix" issue with Drupal 7.

I attached a patch to fix it.
Could you please have a look?
Should I create a Pull Requests to fix this issue?

Roomify_Drupal_DB_prefix_issue.txt

Test security patch for 8.x

Issue Key: BAT-131
Issue Type: Task
Created: 07/Oct/19 7:59 PM
Updated: 24/Oct/19 3:58 PM
Resolved:
Description: We received the attached patch in a security issue on drupal.org. It was reported that users with 'View own' permission for bat events can view events owned by other users as well. Could you:

  • check that you can reproduce the issue
  • check that the patch fixes it and see if it needs any changes
  • update the event behat test to add a failing test that ensures that a user with that permission cannot view an event owned by another user. Please add this test in a branch and name the commit something like 'Improve tests', and don't commit the patch - We're not supposed to commit any new code until the drupal.org security team asks us too.

thanks!

Comment1:
Comment2:
Comment3:

Do not install composer

You can help me.

Les-MacBook-Pro:batmaster letrungha$ composer require Roomify/Bat
Using version ^1.1 for Roomify/Bat
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)

Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested package roomify/bat No version set (parsed as 1.0.0) is satisfiable by roomify/bat[No version set (parsed as 1.0.0)] but these conflict with your requirements or minimum-stability.

Installation failed, reverting ./composer.json to its original content.

Missing View/Edit tabs for event series events

Issue Key: BAT-141
Issue Type: Bug
Created: 11/Nov/19 10:50 PM
Updated: 12/Nov/19 8:36 PM
Resolved: 12/Nov/19 8:36 PM
Description: # When editing an event series event, there is no ‘View’ tab

When viewing an event series event, there is no ‘Edit’ tab

Comment1:
Comment2:
Comment3:

Availability for Series Bookings is not being checkout before adding bookings to cart

Issue Key: BAT-150
Issue Type: Bug
Created: 12/Dec/19 9:34 PM
Updated: 16/Dec/19 7:35 PM
Resolved: 16/Dec/19 7:35 PM
Description: To reproduce:

Enable BEE for a content type

Daily Bookings (allows bookings of 1 or more full days)

Generally Available

Enable Payments

Create a node of that content type

Create a booking for dec 19

Now create a series booking for dec 17-20

It will add it to the cart and let you check out, but will error out before completing checkout, because the 19th isn’t available

Comment1:
Comment2:
Comment3:

Non repeating events are broken

Issue Key: BAT-138
Issue Type: Bug
Created: 11/Nov/19 10:42 PM
Updated: 12/Nov/19 8:21 PM
Resolved: 12/Nov/19 8:21 PM
Description: When editing a non-repeating event, I get a WSOD because it is looking for an event series that does not exist:

Error:

Symfony\Component\Routing\Exception\InvalidParameterException: Parameter "bat_event_series" for route "entity.bat_event_series.canonical" must match "[^/]++" ("" given) to generate a corresponding URL. in Drupal\Core\Routing\UrlGenerator->doGenerate() (line 204 of /var/www/web/core/lib/Drupal/Core/Routing/UrlGenerator.php).

Link:

/admin/bat/events/event/64/edit
Comment1:
Comment2:
Comment3:

Series bookings do not work when payments are enabled

Issue Key: BAT-144
Issue Type: Bug
Created: 19/Nov/19 6:21 PM
Updated: 09/Dec/19 5:39 PM
Resolved: 09/Dec/19 5:39 PM
Description: Series bookings are not working if payments are enabled - only the first booking is added to the cart/created
Comment1: 23/Nov/19 1:00 AM;557058:7ad3cd33-98ca-446b-8be5-7d84e909e2f8;[~accountid:557058:5618d454-7c12-49db-afc2-962184518c4f]

I’m not sure if I’m missing something here - still getting only the first event added to the cart. If I book 12-1pm for three weeks in a row, and the cost is $25/hour, the cart total is $25.
Comment2:
Comment3:

Allow adding new reservations to a series

Issue Key: BAT-135
Issue Type: New Feature
Created: 28/Oct/19 4:19 PM
Updated: 23/Nov/19 1:00 AM
Resolved: 11/Nov/19 10:41 PM
Description: From the BEE module, let’s alter the event series view page:

  • Add a ‘Add reservation’ button
  • When clicked, show the BEE add reservation form, with the recurring fieldset hidden
  • when the new reservation is saved, it should reference the existing series entity

Comment1:
Comment2:
Comment3:

i have a dude

I have a large conference room and can be divided into 2, if I book the large conference room I can not reserve the 2 small and if I book a small one I can not book the large one at the same time, it is possible to do this as is currently the module ? I'm using it in drupal 8

Add recurring booking functionality to BEE

Issue Key: BAT-134
Issue Type: New Feature
Created: 28/Oct/19 4:11 PM
Updated: 09/Dec/19 5:39 PM
Resolved: 09/Dec/19 5:39 PM
Description: In a branch of the BEE module, let’s do the following:

  • Update the BEE Reservation form and BEE Reservation Webform element to allow creating repeated reservations. Let’s reuse the form element from the 'Availability' tab on BEE-enabled nodes.
  • When a series of reservations is created, create a single Bat Event Series entity and store the repetition specification on it, e.g. 'Every Wednesday from 11AM-1PM from Oct 21 2019 -> Oct 21 2020'
    ** For each booking where there is no availability, show a message: “Unable to create reservation from 11AM-1PM on Oct 28 2019, availability was not found.”
    ** redirect to the booking series entity view page if a series has been created
  • The series entity should be titled i.e. 'Reservations for {node name} Every Wednesday from 11AM-1PM from Oct 21 2019 -> Oct 21 2020'
  • Each event should reference the Booking Series entity
  • Each event should display a link to the Booking Series entity, formatted as ‘View other reservations in this series’

Comment1: 05/Nov/19 4:10 PM;557058:7ad3cd33-98ca-446b-8be5-7d84e909e2f8;[~accountid:557058:5618d454-7c12-49db-afc2-962184518c4f]

Looks like a good start 🙂

Looks like we’re missing:

Each event should reference the Booking Series entity

Each event should display a link to the Booking Series entity, formatted as ‘View other reservations in this series’

When creating a reservation:

For each booking where there is no availability, show a message: “Unable to create reservation from 11AM-1PM on Oct 28 2019, availability was not found.”

(I’m seeing “No available units.”)

Comment2: 08/Nov/19 7:42 PM;557058:7ad3cd33-98ca-446b-8be5-7d84e909e2f8;[~accountid:557058:5618d454-7c12-49db-afc2-962184518c4f]

This is looking awesome! Just a few more things missing:

Looks like you haven’t exported the view for event series? (($variables['content']['events'] = views_embed_view('event_series', ‘events', $event_series->id());) – I’m not seeing the view in the code

There’s an edge case where if the first event in a series is unavailable, it will not book any of the rest. If checking for series availability, and the first event is unavailable, go ahead and check availability/book any of the rest of the times that are available.

Comment3:

[BEE WEBFORM] Allow users to select which room (node) to book for a BEE enabled webform

Issue Key: BAT-151
Issue Type: Task
Created: 11/Jan/20 12:16 AM
Updated: 28/Jan/20 6:41 PM
Resolved: 28/Jan/20 6:41 PM
Description: Currently the BEE WEbform element is configured to make a Content type bookable, and the user cannot select what node is booked. (first available unit(s) are booked)

The ticket is to do the following:
When creating a webform submission, allow the user to:

After user enters start/end dates, show a drop down of available nodes. The dropdown should be disabled until valid dates are entered. Whichever node is selected is what is reserved. If Capacity is enabled on the webform, the dropdown should be disabled until both dates and capacity are entered, then show available nodes in the dropdown.

Comment1: 16/Jan/20 5:40 PM;557058:7ad3cd33-98ca-446b-8be5-7d84e909e2f8;[~accountid:557058:5618d454-7c12-49db-afc2-962184518c4f]

This is a good start 🙂

A few changes:

The ‘This event repeats’ section should come before the node dropdown

Once dates are selected in the form, and/or the ‘this event repeats’ is filled in, check for available nodes (with enough capacity, if that is selected).

If there are nodes available, show them in the select list

If there are no nodes available, show a message to the user ‘There are no units available for the selected date/time(s)’

BUG: The availability check is currently showing all nodes for the selected content type, if any are available, it should only show the specific node(s) that actually have availability

BUG: The event created is NOT being created for the selected node, it should be created for the specific node that is selected. (This is probably related to capacity?)

Comment2: 21/Jan/20 8:06 PM;557058:7ad3cd33-98ca-446b-8be5-7d84e909e2f8;[~accountid:557058:5618d454-7c12-49db-afc2-962184518c4f]

After actually using this, I’m afraid that I chose a bad approach. Let’s simplify it:

Disable submitting the webform until a node is selected

When the webform is loaded, show a button ‘Check for available nodes’ above the ‘Node’ dropdown/select field

When the button is clicked, validate the form

Ensure that both dates are fully filled out

If the Webform uses capacity, ensure that a capacity has been entered

If the ‘Event Repeats’ is checked, ensure that ‘Repeat Frequency’ and ‘Repeat until’ are both selected

If validation passes, do the availability check (include all event series dates)

If there are available nodes

Enable the ‘Node’ dropdown so that the user can select a node

Once a node is selected, enable the webform submission button

If there are NO available nodes

Show the user a message “There are no available nodes for the selected date/time(s). Please change your selections and try again.”

Comment3:

Recurring events

It would be really useful to be able to make events recurring weekly, monthly, on the 3rd Thursday of every month, etc. We have meeting rooms that would really benefit from this kind of flexibility.

Why forced Event value is integer.

I still don't understand all the concepts of BAT ('cause my English is not good so much).

As you say "Events define what value a unit has for a given time period". It's could be Price of Room in a time period.

But I see in this line: https://github.com/Roomify/bat/blob/master/src/Event/AbstractEvent.php#L65, value of Event forced is integer type. What if I have a float number in this case:

In: 05/03/2017-10/03/2017 Price of Room is: 99.99$/night?

BTW, thanks for great project!

Problem with events startdate and enddate different month

We have a problem when startdate of an event and enddate have different month, the event is saved with one day less.
In order to solve it, we have changed the line 169 of Eventitemizer.php, instead this:

$dayrange = new \DatePeriod(new \DateTime($date->format("Y-n-1")), $dayinterval, $this->event->getEndDate());

to this:

$dayrange = new \DatePeriod(new \DateTime($date->format("Y-n-1")), $dayinterval, new \DateTime($this->event->getEndDate()->format("Y-n-j 23:59:59")));

With that the problem is solved, is it wrong??

Repeating events should include the end date, if applicable

Issue Key: BAT-139
Issue Type: Bug
Created: 11/Nov/19 10:44 PM
Updated: 12/Nov/19 8:40 PM
Resolved: 12/Nov/19 4:19 PM
Description: weekly repeating events should include an event on the 'repeat until' date, if it is the correct day of the week

To reproduce:

Create an event series for Nov 21 9-10am, repeating weekly, set ‘Repeat until’ to Dec 12

(Assuming all dates/times are available) Events will be created on Nov 21, Nov 28, and Dec 5, but not on Dec 12

If the ‘repeat until’ date is 1 wk from the previous created event, an event should be created on that date as well.

Comment1:
Comment2:
Comment3:

[BEE] add more information to commerce line items

Issue Key: BAT-128
Issue Type: Task
Created: 06/Aug/19 5:08 PM
Updated: 07/Jan/20 6:09 PM
Resolved:
Description: When adding bookings to the cart, let's update the line item description to include more information, such as unit name, booked dates/times, etc. We can use the line item description in rooms as a guide.
Comment1: 07/Jan/20 6:08 PM;557058:7ad3cd33-98ca-446b-8be5-7d84e909e2f8;Updating this ticket with a comment to say that Nicolo says this isn’t possible - Commerce changes the line item label automagically, so anything we added would be overwritten
Comment2:
Comment3:

Change event granularity to smaller increments of time

Currently, the event granularity is either Daily or Hourly. For meeting rooms, it would be helpful to have greater control over the granularity, such as adding 15 minute increments for setup time (total meeting time: 1 hour and 15 minutes), or 30 minutes for shorter meetings.

bat schema issues when site has translation enabled

Issue Key: BAT-137
Issue Type: Bug
Created: 05/Nov/19 3:30 PM
Updated: 17/Jan/20 5:09 PM
Resolved: 17/Jan/20 5:09 PM
Description: [https://www.drupal.org/project/bat/issues/3077907|https://www.drupal.org/project/bat/issues/3077907]

This issue only happens on sites with translation enabled. To reproduce
Install the Umami example profile in default Drupal 8
Install bat
Try to create a bat_unit type (this may not be the only entity with issues.

Looks like we're missing schema related to translations?

This module will probably be helpful in figuring out what’s missing: [https://www.drupal.org/project/config_inspector|https://www.drupal.org/project/config_inspector]
Comment1: 17/Jan/20 4:44 PM;557058:7ad3cd33-98ca-446b-8be5-7d84e909e2f8;[~accountid:557058:5618d454-7c12-49db-afc2-962184518c4f]

Can you please update the issue on [drupal.org|http://drupal.org] with the status of the fix? Is it in dev now?
Comment2: 17/Jan/20 4:48 PM;557058:5618d454-7c12-49db-afc2-962184518c4f;[~accountid:557058:7ad3cd33-98ca-446b-8be5-7d84e909e2f8] Yes, is in dev
Comment3:

Call to a member function getDefaultValue() on a non-object

I got below error when admin tries to add the property. Kindly help me how to fix this issue

Fatal error: Call to a member function getDefaultValue() on a non-object in /var/www/html/seken-dev/sites/all/vendor/roomify/bat/src/Calendar/AbstractCalendar.php on line 251

'Add Reservation' does not work when payments are enabled

Issue Key: BAT-148
Issue Type: Bug
Created: 09/Dec/19 5:39 PM
Updated: 12/Dec/19 8:49 PM
Resolved: 12/Dec/19 8:49 PM
Description: To reproduce:

Create a content type, enable BEE and enable payments

Add a series event reservation

View the series event entity (e.g. l/admin/bat/events/event_series/3)

Click on ‘Add reservation’

Add an event and complete checkout

The event is created, but it does not reference the event series

Comment1: 11/Dec/19 12:08 AM;557058:7ad3cd33-98ca-446b-8be5-7d84e909e2f8;[~accountid:557058:5618d454-7c12-49db-afc2-962184518c4f]

Getting Error: Call to a member function id() on null in bee_preprocess_bat_event_series() (line 1410 now when I try to view/edit an event series (daily bookings, generally available, payments enabled)
Comment2:
Comment3:

Allow deleting remaining events in an event series

Issue Key: BAT-147
Issue Type: Task
Created: 05/Dec/19 3:55 PM
Updated: 09/Dec/19 5:39 PM
Resolved: 05/Dec/19 10:21 PM
Description: h2. Edit event modal:

Add a link to the edit event modal: ‘Delete remaining events in this series’

On click, show a confirmation message: 'the following events will be deleted, are you sure you want to do this?

On confirmation:

delete any events that are in the future

IF none of the events have happened yet, also delete the event series entity

h2. Edit event series entity:

Show two buttons when editing an event series entity:

‘Delete Event Series’

On click, show a confirmation message: 'the following events will be deleted

The following events will no longer be connected Are you sure you want to do this?

On confirmation:

delete any events that are in the future

delete the event series entity

‘Delete remaining events in this series’

On click, show a confirmation message: 'the following events will be deleted

Are you sure you want to do this?

On confirmation:

delete any events that are in the future

DO NOT delete the event series entity

Comment1: 06/Dec/19 9:23 PM;557058:7ad3cd33-98ca-446b-8be5-7d84e909e2f8;[~accountid:557058:5618d454-7c12-49db-afc2-962184518c4f]

Looking awesome, there’s just one more small thing needed that I forgot to specify. When deleting an event series entity, if there are events that are in the past that reference that event series, delete the references as well.
Comment2:
Comment3:

Drupal 9 compatibility for BAT/BEE

Issue Key: BAT-154
Issue Type: New Feature
Created: 24/Jun/20 12:34 AM
Updated: 25/Jun/20 11:22 PM
Resolved:
Description: Please spend some time and test bat & bee with drupal 9 and make any changes necessary while retaining compatibility with d8.8. We don't need a 9.x branch, cf. https://www.drupal.org/docs/updating-drupal/how-to-prepare-your-drupal-7-or-8-site-for-drupal-9/preparing-drupalorg
Comment1: 24/Jun/20 4:49 PM;557058:5618d454-7c12-49db-afc2-962184518c4f;[https://www.drupal.org/project/services/issues/3154535|https://www.drupal.org/project/services/issues/3154535]
Comment2: 25/Jun/20 11:22 PM;557058:6023b735-a9a1-4569-8ba5-19759f061283;[~accountid:557058:5618d454-7c12-49db-afc2-962184518c4f] I got BEE installed on a d9 test site, and was able to enable a content type for BEE bookings. (hourly) When I visit the node page, the calendar does not work, and I get this error:

{noformat}Error: Call to undefined method Drupal\services\Controller\Services::entityManager() in Drupal\services\Controller\Services->processRequest() (line 47 of /var/www/drupalvm/web/modules/contrib/services/src/Controller/Services.php)
#0 [internal function]: Drupal\services\Controller\Services->processRequest(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch), 'bat_api', 'unit_index:cale...')
#1 /var/www/drupalvm/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#2 /var/www/drupalvm/web/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}()
#3 /var/www/drupalvm/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#4 /var/www/drupalvm/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#5 /var/www/drupalvm/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}()
#6 /var/www/drupalvm/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#7 /var/www/drupalvm/web/modules/contrib/bat_api/src/StackMiddleware/BatApiMiddleware.php(42): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#8 /var/www/drupalvm/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Drupal\bat_api\StackMiddleware\BatApiMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#9 /var/www/drupalvm/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#10 /var/www/drupalvm/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#11 /var/www/drupalvm/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#12 /var/www/drupalvm/web/modules/contrib/services/src/StackMiddleware/FormatSetter.php(44): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#13 /var/www/drupalvm/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\services\StackMiddleware\FormatSetter->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 /var/www/drupalvm/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 /var/www/drupalvm/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /var/www/drupalvm/web/core/lib/Drupal/Core/DrupalKernel.php(705): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /var/www/drupalvm/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#18 {main}
{noformat}

If I go to /node/1/add-reservation, I get this error:

{noformat}Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "commerce_cart.cart_manager". in Drupal\Component\DependencyInjection\Container->get() (line 151 of /var/www/drupalvm/web/core/lib/Drupal/Component/DependencyInjection/Container.php).
{noformat}
Comment3:

Allow editing an event series

Issue Key: BAT-143
Issue Type: Task
Created: 11/Nov/19 10:54 PM
Updated: 23/Nov/19 1:00 AM
Resolved: 23/Nov/19 1:00 AM
Description: On the edit page for an event series:

(i.e. admin/bat/events/event_series/<event_series_event_id>/edit)

Add a button below the RRULE field: ‘Edit repeating rule’

On submit, open the repeating event form in a modal (or new page, whichever is easier), prefilled with the existing rule and start date/time

Submit button ‘Update this event series’

Check availability for the updated dates/times

Show a message to the user with a list of any events that will be deleted (only events still in the future that do not match the new dates/times), any events that will be added, and any events for the new dates/times that are not available, and do not already exist in the series

Message for unavailable dates/times is 'the updated time - is not available for <a href=”link to booking”> '

Ask them to confirm that they want to continue

On submit, delete/add events as needed

Cancel button ‘Cancel’

Close the modal or redirect to admin/bat/events/event_series/<event_series_event_id>/edit

Comment1:
Comment2:
Comment3:

Bee webform <-> Business Rules module integration

Issue Key: BAT-136
Issue Type: Improvement
Created: 28/Oct/19 4:28 PM
Updated: 12/Nov/19 8:40 PM
Resolved: 12/Nov/19 8:40 PM
Description: Goal: allow copying data from webform submission fields into event entities using the [business rules|https://www.drupal.org/project/business_rules] module. We should be able to:

  • Add a ‘Primary Contact’ text field and ‘Number of Guests’ integer field to a BAT event type
  • Create a webform with a BEE reservation element and ‘Primary Contact’ and ‘Number of Guests’ fields
  • Create a business rule that iterates events created from the webform and copies the field values

To be able to do this, we need business rules to be able to iterate events created by the Bee Webform element. So, let’s store created BAT event IDs on webform submissions created with an attached bee webform element.

Comment1: 28/Oct/19 4:46 PM;557058:6023b735-a9a1-4569-8ba5-19759f061283;[~accountid:557058:5618d454-7c12-49db-afc2-962184518c4f] can you start by spending up to 2 hours on storing the created event IDs and creating a business rule that gets the created event IDs? Let me know if you run into trouble.

This should be done after the other tasks on BAT-133.
Comment2: 11/Nov/19 10:40 PM;557058:7ad3cd33-98ca-446b-8be5-7d84e909e2f8;[~accountid:557058:5618d454-7c12-49db-afc2-962184518c4f]

This is looking great. The only thing that we really still need here is to add a dependency on the token module to the bee_webform module – I didn’t realize token isn’t in core and that took me a little while to figure out… 😛
Comment3:

How I search

Hi, I'm writing a Hotel Booking for WordPress. And thanks god I found this package. Seem it's help me so much.

But my idea is when user create a room, it's always available to book.

I wonder if BAT can do getMatchingUnits without pass events?

Convert Data fields to UNIX Timestamp

The events fields are using 'Date' fields instead of using an int UNIX Timestamp field. What's the main reason for this? It goes against Drupal's standard of fields.

Still trying to use your module and it's going pretty decently.

Series bookings are not respecting availability settings when availability is 'Periodically available'

Issue Key: BAT-149
Issue Type: Bug
Created: 09/Dec/19 5:40 PM
Updated: 06/Jan/20 11:42 PM
Resolved:
Description: To reproduce:

Create a content type

Enable BEE - set availability type to ‘Periodically Available’

Without setting any times as available, try to create a reservation

You will get an error: “No available units.”

Now try to add that same reservation, but as an event series

The reservations will be made, even though there are no available times

Comment1: 06/Jan/20 11:42 PM;557058:7ad3cd33-98ca-446b-8be5-7d84e909e2f8;we need something on bat to understand which states are available for events series and which not

now all not Blocking states are available

and all Blocking states are not available
Comment2:
Comment3:

[RFA] performance issues on search with many properties

Issue Key: BAT-130
Issue Type: Task
Created: 20/Sep/19 7:17 PM
Updated: 23/Sep/19 4:26 PM
Resolved: 23/Sep/19 4:26 PM
Description: There is an attached DB with about 160 hotels, 900 types and 900 units. The user says:

| This is search request /availability-search?bat_start_date=2019-09-21&bat_end_date=2019-09-22&location=0&group_size=0
| This is devel module report Executed 16734 queries in 3778.23 ms. Queries exceeding 5 ms are highlighted. Page execution time was 61012.49 ms.

Let's see if we can reduce the number of queries, perhaps by adding a default pager? Please don't spend more than an hour on this, this is very low priority.
Comment1:
Comment2:
Comment3:

BAT Calendar Reference activation problem

I am playing around with drupal booking and availability functionality and of course you guys are leading the way...

I encountered three issues in getting the Bat project installed.
The first two are not strictly Bat issues but others might be assisted by improving the documentation.
#1 Documentation - If installing via Composer one must allow Development level stability

I had difficulties installing the BAT php library using the instructions:
composer require roomify/bat
Effectively, composer could not find a "stable" version to install.
I had to change my composer.json file to allow dev versions:
"minimum-stability": "dev",
"require": {
"drush/drush": "dev-master",
"roomify/bat": "@dev"
}
}
#2 Documentation - Other required Drupal modules

I am on Drupal 7.41 and had an issue when enabling the modules.
First off there were a couple of dependencies that had to be installed:
search_api, facetapi, fullcalendar, views_megarow, views_bulk_operations
#3 Issue enabling BAT Calendar Reference.

I got errors indicating reference problems in the following file.
sites/all/modules/bat/modules/bat_calendar_reference/bat_calendar_reference.module

There were three errors in total. Each time I commented out the seemingly offensive code as follows.
I have not yet properly used the project to understand the implications of my hack. The module has been sucessfully enabled.

I commented out the problematic lines to force it to enable.
lines 386 - 390
// if (is_array($field['settings']['referenceable_unit_types'])) {
// if (!empty(array_filter($field['settings']['referenceable_unit_types']))) {
// $query->condition('u.type_id', array_filter($field['settings']['referenceable_unit_types']), 'IN');
// }
// }

line 485 - 489
// if (is_array($field['settings']['referenceable_event_types'])) {
// if (!empty(array_filter($field['settings']['referenceable_event_types']))) {
// $query->condition('u.id', array_filter($field['settings']['referenceable_event_types']), 'IN');
// }
// }

lines 579 - 581
if (is_array($field['settings']['referenceable_event_types'])) {
// if (!empty(array_filter($field['settings']['referenceable_event_types']))) {
// $query->condition('u.type_id', array_filter($field['settings']['referenceable_event_types']), 'IN');
// }
}

Hourly support

It doesn't look like there is out of the box hourly support. Would BAT be a good fit to build around if I needed to build in an hourly unit?

Add the Label of the entity being booked to the reservation form

Issue Key: BAT-146
Issue Type: Task
Created: 05/Dec/19 3:55 PM
Updated: 12/Dec/19 8:48 PM
Resolved: 12/Dec/19 8:48 PM
Description: Please change the reservation form to show the title/label of the entity (node or webform) being booked - example in screenshot
Comment1:
Comment2:
Comment3:

Event series link is missing when editing an event from the calendar

Issue Key: BAT-140
Issue Type: Bug
Created: 11/Nov/19 10:49 PM
Updated: 12/Nov/19 8:35 PM
Resolved: 12/Nov/19 8:35 PM
Description: The ‘[View other reservations in this series|http://sitealert.docksal/admin/bat/events/event_series/14]’ link is missing when editing an event from the calendar

To reproduce:

/node/1/availability

Click on an event (that is part of a series) in the calendar

the ‘[View other reservations in this series|http://sitealert.docksal/admin/bat/events/event_series/14]’ link is missing

Comment1:
Comment2:
Comment3:

Create 'BAT Event Series' module

Issue Key: BAT-132
Issue Type: New Feature
Created: 24/Oct/19 4:29 PM
Updated: 11/Nov/19 10:42 PM
Resolved:
Description: In a new branch, let’s create a bat_event_series module. It should have the following fields:

  • label
  • rrule (text, no length limit)

When the entity is viewed, it should show:

  • label
  • human-readable description of the [RRULE|https://icalendar.org/iCalendar-RFC-5545/3-8-5-3-recurrence-rule.html]
  • a list of events referencing the series entity in ascending start date, filtered to future events by default. Let’s use a view to provide this:
    ** ajax enabled
    ** paged, 10 events at a time
    ** exposed filter to choose between upcoming and past events

When the entity is edited, it should show a form with the repeating event spec pre-filled. If a user saves changes, it should show a confirm step with the text “Update all upcoming events in this series?”. When the user confirms, we should iterate all upcoming events in the series:

  • if a unit of the same type is available for the updated date/time, change the event time (and/or unit)
  • if not, display a message: “Unfortunately we could not update the event from to .” The “event from to ” text should be linked to the event.

When deleting a series, show a confirmation message, asking if the user is sure they want to delete the series and all remaining bookings, showing a list of the remaining bookings. If the user confirms, all future events in the series should be deleted, along with the series.
Comment1:
Comment2:
Comment3:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.