Ocal_XH – a CMSimple_XH Plugin

Calendar

Ocal_XH facilitates to present calendars on your website which display the occupancy of a certain location or other rental, so visitors can easily see whether the item is available on a certain date or (hourly) interval. Each calendar is only meant for a single rental; however, you can display multiple calendars on a single page. Visitors are able to switch between a calendar and a list view.

The plugin does neither provide any actual booking facilities (however, you may be able to combine it with a mail form like Advancedform_XH), nor can it be used as an event calendar, such as Calendar.

Please do read this documentation before you encounter any problems!

Important Notice

Ocal_XH couldn't be tested so far in various environments. It is a so called beta version. Use with caution!

Requirements

Ocal_XH is a plugin for CMSimple_XH. It requires CMSimple_XH ≥ 1.6 and PHP ≥ 5.2.0.

Installation

The installation is done as with many other CMSimple_XH plugins. See the CMSimple_XH wiki for further details.

  1. Backup the data on your server.
  2. Unzip the distribution on your computer.
  3. Upload the whole directory ocal/ to your server into CMSimple_XH's plugins/ directory.
  4. Set write permissions for the subdirectories css/ and languages/.

Settings

The plugin's configuration is done as with many other CMSimple_XH plugins in the website's back-end. Select Plugins → Ocal.

You can change the default settings of Ocal_XH under "Config". Hints for the options will be displayed when hovering over the help icon with your mouse.

Localization is done under "Language". You can translate the character strings to your own language (if there is no appropriate language file available), or customize them according to your needs.

The look of Ocal_XH can be customized under "Stylesheet".

Usage

To display a daily occupancy calendar on a page, use:

{{{ocal('OCCUPANCY_NAME', NUMBER_OF_MONTHS);}}}

To display an hourly occupancy calendar on a page, use:

{{{ocal_hourly('OCCUPANCY_NAME', NUMBER_OF_WEEKS);}}}

To display a daily occupancy calendar in the template, use:

<?php echo ocal('OCCUPANCY_NAME', NUMBER_OF_MONTHS);?>

To display an hourly occupancy calendar in the template, use:

<?php echo ocal_hourly('OCCUPANCY_NAME', NUMBER_OF_WEEKS);?>

OCCUPANCY_NAME is an arbitrary name, that must only consist of the letters a-z, the digits 0-9 and minus signs. NUMBER_OF_MONTHS resp. NUMBER_OF_WEEKS specifies the number of calendars that shall be displayed simultaneously.

Note that you can put an arbitrary amount of occupancy calendars on a single page, even for the same occupancy (what might make sense if you like to present a large interval, say a year, on a page, and only a small interval, say a single month, in the template).

Some examples:

{{{ocal('holiday-appartment', 12);}}}
<?php echo ocal('holiday-appartment', 1);?>
{{{ocal_hourly('rickshaw', 2);}}}
{{{ocal('rubber-raft-1', 6);}}}
{{{ocal('rubber-raft-2', 6);}}}

Administration

The administration of the occupancy calendars happens on the pages where they are displayed. When you're logged in as administrator, you'll see a toolbar where you can pick one of the available states by clicking it. Then you can click individual dates in the displayed calendars to assign them this state. When you're finished, you have to save your modifications.

Four states are available, which have the following default meanings:

If required, you can change the colors in the stylesheet and the labels in the language settings.

Note that the administration requires JavaScript and a somewhat contemporary browser (e.g. IE < 8 is not supported).

License

Ocal_XH is licensed under GPLv3.

© 2014 Christoph M. Becker

Credits

Ocal_XH is inspired by the occcal plugin of CMSimple-Styles.com. Many thanks to Jens Broecher for having this nice idea.

The plugin icon is designed by deviantdark. Many thanks for publishing the icon under LGPL.

Many thanks to the community at the CMSimple_XH forum for tips, suggestions and testing. Especially I like to thank rothom for being the first tester and hixi for suggesting the hourly calendars.

And last but not least many thanks to Peter Harteg, the "father" of CMSimple, and all developers of CMSimple_XH without whom this amazing CMS wouldn't exist.