Build a Resource Scheduling website in 3 hours with Drupal

Build your own lab scheduler!

    For the last few weeks I've been running a free lab scheduler to cover reservations for lab equipment, and out of curiosity I Googled for other schedulers online. I was quite shocked to find that some companies are charging as much as $250 just to start a scheduling website, along with a $100/year subscription fee! It's shocking to me because I built a scheduling site in just 3 hours using Drupal software, and based on the looks of the paid sites, it looks like they did exactly the same thing, but are charging through the nose for it.

    So, in the interest of helping schools and labs to save money, or in helping entrepreneurs vastly undersell the current players, I'd like to share how you can build a simple resource scheduler like the one I built here:

http://www.spacesmovement.org/ (now defunct; an updated version is located at spacesmovement.com/reservation-calendar/2)

    This took me three hours to do, using Bluehost and SimpleScripts to do the Drupal installation. Much of the time spent in those three hours was in setting user permissions and Step 4, as I had to build Drupal views from scratch. To help you out, I have included my Views code, which should make site building much shorter.

 

Step 1: Set up your website

    There are a number of cheap hosting sites out there, and many schools and universities permit building sites as a subdomain of the institution's larger website. In the latter case, your hosting costs should be minimal, and in the former case, you are still doing better than $100/year. Once you have a site, you need to go to http://drupal.org and install Drupal on your site. Paid hosting companies like Bluehost have nice installer programs like SimpleScripts that let you do this in a couple of clicks, otherwise the task can be handled by someone who has entry-level IT ability.

 

Step 2: Install these modules

On your site, go to yoursite.com/?q=admin/modules/install, and copy+paste the links to the module files for each of these modules:

http://drupal.org/project/admin_menu

http://drupal.org/project/calendar

http://drupal.org/project/ctools

http://drupal.org/project/date

http://drupal.org/project/date_ical

http://drupal.org/project/entity

http://drupal.org/project/resource_booking

http://drupal.org/project/views

http://drupal.org/project/views_bulk_operations

An alternative to the Resource Booking module is the MERCI module, which is better documented and more functional in terms of creating and categorizing resources, but isn't as good for checking availability as of the time of this writing. I would stay with Resource Booking if you are looking to schedule just a few items, and going with MERCI if you have a large number of items that are in categories, or if you have multiples of one kind of item. You can get the MERCI module here:

http://drupal.org/project/merci

Other worthwhile extra modules are Mollom, CAPTCHA, and Drupal for Facebook, as these help with setting up Facebook logins, and for catching spambots. Alternatively, you may set up your site such that no one can create an account, and all reservations are made anonymously.

http://drupal.org/project/mollom

http://drupal.org/project/captcha

http://drupal.org/project/fb

 

Step 3: Set up modules and content types

    In the Core section, disable "Overlay" and "Toolbar," and enable all of the non-core modules except for the "Chaos Tool Suite" section and the "Features" section. Under "Chaos Tool Suite," enable 'Chaos Tools' only. A few modules cannot be selected because of missing dependencies; you don't need these modules. Enable any dependent core modules (the site will ask you to do so). Useful extra core modules include Field UI, Color (lets you change theme colors), and the various field modules (you can identify them because they depend on the field module).

    The next big step is to go to admin/people/permissions, and to enable appropriate permissions for each level of user. Since you created the site, make sure that "admin" has all permissions. This is the longest part of building the site.

    With all of these modules set up, we will set up content types. Use your new Admin Menu to go to Structure -> Content Types, and add two new content types, the first is "Reservation" and the second is the name of what you want to reserve. In our case, it's "Equipment." Next, go to Structure -> Taxonomy -> Add Vocabulary via the admin menu, and give it a name like Resource Type. Once saved, click "Add Terms," and add just one term, in our case we called it "Equipment."

    Finally, we will configure fields for content types. Go to Structure -> Content Types, and click "Manage Fields" for the Reservation content type. Add a new field, pick a name, and set the Field type to "Resource Booking." The widget type will be set to its only option. Click "Save," and enter the following settings:

  • Required Field
  • Select Node Type: Equipment (Or whatever content type you created)
  • Path for resource schedule: Based on what you will set later in Step 4. We used 'reservation' without quotes.
  • Allowed Resource Types: Equipment (or whatever taxonomy term you created)
  • Defaults: don't change
  • Number of Values: unlimited

Once this is saved, go to Structure -> Content Types, and manage the fields for "Equipment." Add a term reference field (name it what you like) and use a Select List. Then enter the following settings:

  • Required Field
  • Vocabulary: Resource Type (or whatever you named the vocabulary)
  • Help Text: Tell people not to change the default setting. You can use a Field Access module if you want to get fancy and hide the field
  • Defaults: Equipment (pick the term you selected for Reservations earlier)
  • Number of Values: 1

Now you've got your site all put together! Now you just need to make everything display nicely. In order to test that your system is working nicely, go to yoursite.com/?q=node/add, and create an Equipment item and a Reservation. You will need this to test the last steps.

 

Step 4: Configure Views

    If you are new to Drupal, Views is a bear. It's powerful and makes millions of sites (like this one!) do incredible things, but the initial learning curve is a little steep. To help you out, I've included the Views code from my sample site:

reserve_calendar.txt (Right click and select "Save Link As..." to download)

    Go to yoursite.com/?q=admin/structure/views/import , and copy+paste the above code into the "Paste View Code Here" box. Give the view a name, and hit "Import." That's it! In the top right corner of the editing page you will see a dropdown menu with an 'edit view name/description' option, and in the dropdown menu you will find an option to "clone" the view. Go ahead and do that, and use the cloned view if you'd like to play around with the settings.

 

Step 5: Make the site pretty

    At this point all of the functionality is in place, and you just want the site to look good now. Drupal has a number of free themes available through its website, and you may install them by going to Appearance -> Install New Theme, and copying the link address from the theme's page on Drupal.org. After that, go to Appearance -> List to enable the theme and Appearance -> Settings -> Your Theme to change it's settings. Some themes, like MAYO, are extremely customizable without a lot of required CSS or PHP knowledge, and others like Marinelli and BlueMasters provide a fairly nice theme right out of the box.

    Lastly, you will need to go to Structure -> Blocks, and after this, Structure -> Menus in order to add links for creating Equipment and Reservations, and for viewing the calendar. You may also go to Configuration -> System -> Site Information and set one of your calendar views as the front page. In order to find the address of your calendars, go to Structure -> Views and you will see the addresses listed on the main Views page for you to copy and paste.

 

Step 6: Enjoy!

    It actually took me more time to write this tutorial than for me to actually make the site. At this point you can play around with the site to get a feel for how it works, create equipment for people to reserve, and read the documentation from the module pages if you have further questions about how they work. Also, if you have further questions or suggestions for this tutorial, feel free to ask in the forum.