Git Product home page Git Product logo

oc-reservations-plugin's Introduction

Reservations plugin for OctoberCMS

Build Status Codacy Code Coverage License

Provide reservation form with reservations management. You should also check related plugin: backend calendar.

Key features:

  • reservations have coloured statuses, bulk actions and fulltext search to save your time
  • nice and clean dashboard widget
  • reservations export with status filtering
  • reservation can be created directly from the backend
  • returning customers function

Technical features:

  • shipped with translations and covered by unit tests
  • reservation form has CSRF protection and multiple bots submissions protection
  • reservation form has AJAX sending and also non-JS fallback
  • overloadable data seeding for statuses

No other plugin dependencies. Tested with the latest stable OctoberCMS build 420 (with Laravel 5.5).

Installation

  1. Install plugin VojtaSvoboda.Reservations
  2. Insert reservation form component to your page. Be sure you have jQuery loaded!

Returning Customers

Plugin allow you to mark returning customers:

  • set amount of previous reservations at Backend > Settings > Reservations > Reservations
  • at reservations listing, click at the list settings (the hamburger at the right corner) and check Returning
  • it shows star at customers with more then non-canceled reservations

Admin confirmation

By default, plugin sends confirmation email to customer. But you can also turn on sending confirmation to different user (your customer, system administrator, etc). Follow these steps to turn this feature on:

  • set admin email and name at Backend > Settings > Reservations > Reservations at Admin confirmation tab
  • turn the admin confirmation by switch
  • system will send special template 'reservation-admin', so feel free edit content of template at Backend > Settings > Mail > Mail templates

Backend calendar

Looking for backend calendar to see your reservations visually? Take a look at backend calendar plugin.

Public facade

You can use plugin's facade vojtasvoboda.reservations.facade with some public methods as follows:

$facade = App::make('vojtasvoboda.reservations.facade');
$facade->storeReservation(array $data);
$facade->getReservations();
$facede->getActiveReservations();
$facade->getReservedDates();
$facade->getReservationsByInterval(\Carbon\Carbon $from, \Carbon\Carbon $to);
$facade->isDateAvailable(\Carbon\Carbon $date);

Configuration

You can find some plugin configuration at the CMS backend (datetime format, reservation length, time slot length, etc). But you can also set some values at plugin's config file. Config values are used when Settings value can not be found (and also because of backward compatibility with users using older version of plugin).

When you want to override default plugin's config.php, which is placed at plugin's folder /config, just create file:

/config/vojtasvoboda/reservations/config.php

And override values you want to change. Example of this file:

<?php return [
    'formats' => [
        'date' => 'd.m.Y H:i:s',
    ],
];

Override seeding

For override seeding just copy seed files from plugin's folder /updates/sources and copy them to:

/resources/vojtasvoboda/reservations/updates/sources/

For example:

/resources/vojtasvoboda/reservations/updates/sources/statuses.yaml

This file will be load with first migration, or you can force refreshing migrations with this command:

php artisan plugin:refresh VojtaSvoboda.Reservations

Unit tests

Just run phpunit in the plugin directory. For running plugin's unit tests with project tests, add this to your project phpunit.xml file:

<testsuites>
    <testsuite name="Reservation Tests">
        <directory>./plugins/vojtasvoboda/reservations/tests</directory>
    </testsuite>
</testsuites>

Receiving "Class 'PluginTestCase' not found" error? Just type composer dumpautoload at your project root.

TODO

  • Checkbox for disabling injecting assets to the components.
  • Move date validation from facade to the model (it should works also when creating reservation from backend)
  • Automatically load statuses for reservations listing/filtration.
  • Assets concatenation.
  • Log history of reservation changes.
  • Make bulk reservation status change in one SQL query.
  • Order by returning flag without SQL exception.
  • Translate statuses at backend.
  • Translations with Translate trait.
  • Can send iCal link in the e-mail.
  • Show only future dates in datepicker.
  • Load only future reservations to the datepicker to show reserved slots.
  • Reservations reminder by email/SMS, before reservation
  • Own function (callback) for generating next reservation number.
  • Sends confirmation email when admin confirms the reservation.

Feel free to send pull request!

Contributing

Please send Pull Request to the master branch. Please add also unit tests and make sure all unit tests are green.

License

Reservations plugin is open-sourced software licensed under the MIT license same as OctoberCMS platform.

oc-reservations-plugin's People

Contributors

avanosch avatar bogandix avatar damsfx avatar leftees avatar ne-ray avatar victor-vanherpt avatar vojtasvoboda avatar

Stargazers

 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

oc-reservations-plugin's Issues

Hours per day?

Is there an option to set different opening hours per day or even multiple hours per day, e.g., to allow for opening for lunch, free time and then for dinner.

Count reservations in one time interval

example: I have 2 room for reservation, but now one time interval we have one reservation.
This issue conflict with your Reservations Units plugin (may be).
This case hard do (1 hour interval, 2 hours lenght, 2 count ):
1 reservation start 2017-05-15 10:00 (to 12:00)
2 reservation start 2017-05-15 11:00 (to 13:00)
We have empty 1 reservation from 2017-05-15 12:00 (to 13:00).

What do you think about this issue?

Different time length for each units

Issue related to ReservationsUnits plugin:

Would it possible to have different time length for each unit.

unit1: 15min
unit2: 45min
unit3: 30min
unit4: 15min

Date and Time Select Dropdown issue

I'm experiencing something I put the reservation component on a page and the date and time pickers are all showing without using the input option. I can get them to not show by removing the "ID" for the inputs. I even tried it on a page with on Jquery and the framework extras. I've removed the id=" " from date and time inputs and changed to text input. any kinda help available or suggestions.

Multiple lengths

Hi,

I have a use case where I have two lengths for the reservations, either 45 minutes or 75 minutes.
Is there a way I could have user selected what length they would like and reserve based on length?

French for picker

Hi,

Great plugin.

To activate french translation in the picker (front), you need add in vojtasvoboda/reservations/components/ReservationForm.php (l 28) :
'fr' => 'fr_FR',

Thanks

Change default routes?

Helo,
Could you tell me how can i change default routes?
admin/vojtasvoboda/reservations/reservations -> i want to make it admin/vojtasvoboda/reservations/rv, but didnt find where

Predefined date values.

Hello,
I`m trying to using your plugin with another one.
First i have a date in Event plugin like this: ```

{{ 'vojtasvoboda.reservations::lang.reservation.date'|trans }}
```

In frontend its working like a charm date show the proper way dd/mm/yyyy. But when try to proceed to time slots they are still disabled and can`t chose a time.

I try to change reservationform.js but my knowledge is not enough for this :

var reservationform = function($) {
    var $datePicker = $("#date").pickadate({
        format: datepicker_format(dateFormat),
        min: "0",
        disable: get_work_days(disableDays, firstDay),
        firstDay: firstDay,
    });

    var $timePicker = $("#time").pickatime({
        format: datepicker_format(timeFormat),
        min: convertTimeToArray(startWork),
        max: convertTimeToArray(finishWork),
        interval: timeInterval,
    });

    $datePicker.on('change', function () {
        if (this.get()) {
            $timePicker.pickatime('open');

        } else {
            $timePicker.pickatime('close');
        }

        loadBookedTimes(new Date(context.select));
    });
};

and in a function loadBookedTimes(date) just change: var selectedDate = $("#date").val();.

If anyone can help me for this will be so gratefull. Im trying to pass the date (dd/mm/yyyy) from another plugin to this (to be Predefined and not changable by users).

Enhance form with cart ?

Hello, I'd like to enhance your great plugin to add a kind of cart to be collected in a regular shop.
I can use your calendar to limit the collects per time slot, but how could I insert a cart system or a form for ordering ?
Were should I modify the code for this ?
Thanks

Insert reservation form component

Hi Vojta,

I have installed the plugin, and tried to import the component on the contact page, but the form does not render.

{% component 'reservationForm' %}

I have jquery installed and everything needed. How can i fix this?

Plugin not working

Hi,

I have just added this plugin to my project and its not working. Its not showing in my backend menu, nor in my updates and plugins list of plugins however it has installed. If i go to the the plugins menu i can VojtaSvoboda.TwigExtensions but that's it. If i go to the actual pluging directory i can see vojtasvoboda reservationscalendar. From the backend if i click Reservations -> reservationscalendar I get an error "Unable to find the specified settings."

Whats going on here?

Method [validateReservation] does not exist

Hello!
When I try to make a reservation either from the frontend or from the backend I get this error:
Method [validateReservation] does not exist. "On line 1140 of /Applications/MAMP/htdocs/october/vendor/laravel/framework/src/Illuminate/Validation/Validator.php
Can you help me with this?
Thanks!

Exclude dates

Is it possible to exclude certain days without having to create a reservation for every available interval-slot on that specific date? Maybe something with a custom length? In that case I can exclude for example Christmas and holidays?

Missing pickers

Hi!

It's necessary to install pickers manually?
image

jQuery is loaded, and there are no errors.

10pm - 2am reservation / time bug

scenario:
location opens late at 10pm and closes 4am

bug:
timepicker not showing options

reason:
function: if time start is after time end -> but that's the case in ovrnight-reservation


additonal bug:
in component label for "time" is set for: name, street, email

Approval

Is there a way to send mail on approval

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.