Bookings is a Radiant Extension that provides a SOAP connection to a Resmark reservation server and displays a list of locations, associated activities, start/end dates, and number of guests in an “Expedia”-like widget for booking trips. Form values in the widget are submitted to the Resmark reservation server, and the user is directed to the organization’s reservation server to complete the transaction.
- Populates a select box of all available locations
- Selecting a location populates a select box of activities for that location via AJAX
- Field for start date, end date, and number of guests
- Submitting the form takes the user to the Resmark reservation system to complete the transaction
On first load, the SOAP response will be cached to a file at db/getLocationsForUrl.xml. This cache will live for 24 hours before being recreated. The cached response speeds up load time, and ensures that a user will be presented with search options even if the Resmark server is unresponsive.
- haml
- jrails, jquery, jquery-ui javascript libraries
- Resmark web services account
- Radiant share_layouts extension, http://github.com/radiant/radiant-share-layouts-extension
Install the extension:
git clone git://github.com/scullygroup/radiant-bookings.git vender/extensions/bookings
Run the migration and update tasks:
rake radiant:extensions:bookings:migrate
rake radiant:extensions:bookings:update
Insert the following near the top of your environment.rb file:
USERNAME = 'myresmarkusername'
PASSWORD = '123abc123abc123abc123abc'
HOST = 'reservations.mydomain.com'
Note that you must have a valid username and password for accessing the Resmark Web Services.
Be sure to reference the required javascripts and stylesheets in your layout:
<link rel="stylesheet" type="text/css" href="http://jquery-ui.googlecode.com/svn/tags/latest/themes/base/jquery.ui.all.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js" type="text/javascript"></script>
<script src="/javascripts/jrails.js" type="text/javascript"></script>
<script src="http://jqueryui.com/latest/ui/ui.datepicker.js" type="text/javascript"></script>
<script src="/javascripts/bookings.js" type="text/javascript"></script>
Wherever you want to place the booking widget, insert the following radius tag:
<r:bookings />
Copyright © 2009 Scully Group, released under the MIT License