PBBooking Update – Feature List for 1.1.0 Update

I have not been doing too much on PBBooking over the last couple of weeks as I have been working on a new app using Python & QT.

I am putting together a final feature list for a 1.1.0 update. These are the main ones that are making it into the mix due to user feedback:

  • Configuration option to change label on treatment type – I don’t know why I didn’t think of that one earlier;
  • Back end view to display all bookings from the web web.ics file without having to subscribe to a calendar;
  • 7 day rolling view on appointments rather than current week;
  • Back end interface to implement blocked times / days;
  • Internationalization using JText;

Thanks to everyone that has given feedback so far. It’s amazing how these projects start to take on a life of their own.

If there are any other additions that you feel would make PBBooking better, please don’t hesitate to drop me a line, add a comment or post a feature request on the sourceforge tracker.

PBBooking: Block Booking Times

You know, it’s great to get money in the till, but you still want your work / life balance. Preventing people from booking appointments in times you have scheduled for a little R&R is very important!

So, let’s take a quick look at how to block times.

Firstly, blocking times in PBBooking requires that you be publishing a calendar from something like iCal our Outlook. To publish calendars to your web site, use CalDav, if your host supports it, or phpICalendar if they don’t. We use phpICalendar in our clinic.

  • In your chosen calendar create a recurring appointment in the time slot that you would like to block. For example, if you want to sleep in on Sunday morning, create a recurring appointment between 9-10am and set is as recurring on a weekly basis.
  • Publish your calendar out using your chosen method.
  • In PBBooking go to the admin interface and select calendars. Ad your published calendar to the list of calendars being sure to include the full file path to its location.
  • Turn off the alarm clock and sleep in on Sunday morning!

PBBooking currently supports recurring appointments but does not support recurring all day events, or recurrence that spans multiple treatment slots.

Download the latest copy of PBBooking from

PBBooking Update – 1.0.6_1 – Moved Standard WEB.ics file

Two new releases hot on the heels of each other. Today I had a little free time so decided to fix something that has been causing a number of users some problems.

One of the major difficulties with using pbbooking, and the source of most support emails has been the location of the default WEB.ics file.

In initial versions I left this to the discretion of the user as to where to place it. I had assumed that most users would be publishing out calendars using caldav / webdav / phpICalendar. With 20/20 hindsight this really was not the best strategy as it left a very vital section of the installation that was very ambiguous.

PBBooking is my first Joomla extension. One of the things I have realised about developing for the Joomla platform from this experience is that a successful extension needs to be a zero touch installation and wherever possible zero touch configuration. What do I mean by zero touch, a good example is the way WordPress extensions install in WordPress v3.

So how does this latest update change things?

Well, rather than relying on a user to copy the WEB.ics file somewhere convenient, the installation copies this into the component directory. A check is done when verifying if the calendar files exist to see whether or not a full path has been specified. If a full path is provided that is what is used, where just the filename is provided the extension will append the necessary file path to the Joomla components directory.

This means no more messing around for users trying to find the full path to where they have put the WEB.ics file and a seamless instal that works straight away with only minimal customisation required after that.

Something to be aware of!

It is important to understand that by putting the calendar within the component directory it will be removed during uninstall/re-install. This means it is really, really important to back up your calendar when doing an upgrade.

Head over to the sourceforge download page to download. Or, download the latest source from SVN.

PBBooking Update – Custom Fields, Configurable Messages & Block Partial Days

I’ve been really busy doing some updates on pbbooking lately so haven’t had much time to post.

Version 1.0.6 has just hit the web. To download head over to my sourceforge page. This version has a couple of really cool additions:

  • ability to block partial days – in the initial release if you wanted to make a web booking for the same day, too bad! My wife and I use this in our clinic and didn’t want people just walking into the clinic without notice. But, some people did.

    The configuration section now has an option for block_same_day. Set to 1 to to prevent people form being able to book on the current day or 0 to allow them to book any time that has not already past;
  • as of mid version 1.0.5 users now have the ability to create custom messages for the calendar and the create screens. This might be used to give a little more information, or to remind people they must give a valid email address for validation;
  • my favourite mod for the system and thanks to a user for suggesting this one – custom fields! You can now define the fields that you want to appear on the capture and subsequently included in your entry in the diary. Just go in to to Custom Fields to define. At this stage only text_area is supported. If there’s enough interest I may implement checkboxes and radios.

    Customisation of the fields is relatively straight forward. Enter the field name, as you would like it to appear on the capture screen, the type and the size. The variable name field holds the value that will be used to snag the variable contents from the URL. Don’t stress about this too much, just make sure it is unique and contains alpha numerics with no spaces.

Donations?

Just a reminder that pbbooking is open source and you are free to use without any fees or licensing etc. etc. If you find my software useful and would like to donate please support one of my favourite charities, the East Africa Mission Orphanage. You know, sometimes it is hard to think about life without internet and computers.

So You Wanna Synch Mailchimp and ZenCart?

So you’ve got a great e-com site going using Zencart and you’ve got customers registering every day. Zencart’s a good shopping cart but it’s a pretty crappy mailing list manager. So how do you keep your Zencart customer database in synch with your Mailchimp database without hacking the core code ie. create_account.php?

The Zencart team recently included notifiers and observers in a re-write. Using an observer makes an ideal solution to this particular dilemma.

First of all, head over to Mailchimp and pick up their PHP wrapper MCAPI.class.php. For want of a better place to put it just dump it into your Zencart install at includes/classes/observers/ while you won’t modify this file directly you will use it pretty shortly.

Now, create a new class in includes/classes/observers/ called class.subscriber.php this is the one that will send the subscription off to Mailchimp. The source code for this is below.

[sourcecode]
<?php
class subscriber extends base {

function subscriber() {
$this->attach($this, array(‘NOTIFY_MODULE_CREATE_ACCOUNT_ADDED_CUSTOMER_RECORD’));
}

function update(&$callingClass, $notifier, $paramsArray) {

require_once ‘MCAPI.class.php’;

$api = new MCAPI;
$listId = ‘yourlistidhere’;

$my_email = $paramsArray['customers_email_address'];
$merge_vars = array(‘FNAME’=>$paramsArray['customers_firstname'], ‘LNAME’=>$paramsArray['customers_lastname'],
‘MMERGE6′=>date_format(date_create(),’Ymd’),
‘INTERESTS’=>”);

$retval = $api->listSubscribe( $listId, $my_email, $merge_vars,’html’,false);

}
}

?>
[/sourcecode]

In short, we are listening out for the NOTIFY_MODULE_CREATE_ACCOUNT_ADDED_CUSTOMER_RECORD notification and hooking our class onto this. While I though the NOTIFY_MODULE_CREATE_ACCOUNT_SUCCESS would be a more logical notification this seemed to get called before the account had been written to the dbase and before the customer had been assigned an ID.

While the official Zencart spec says that $paramsArray is still a future placeholder, on my installation of Zencart the NOTIFY_MODULE_CREATE_ACCOUNT_ADDED_CUSTOMER_RECORD notification did also pass the $paramsArray with relevant info.

Once this class has been created we need to splice this into the autoloader chain. This is really quite easy. Go to /includes/autoloaders/ and create a file config.subscriber.php. This only has the two lines used to hook your new class into the application. Source code is below.

[sourcecode]

<?php

$autoLoadConfig0[] = array(‘autoType’=>’class’,
‘loadFile’=> ‘observers/class.subscriber.php’);
$autoLoadConfig90[] = array(‘autoType’=>’classInstantiate’,
‘className’=>’subscriber’,
‘objectName’=>’subscriber’);
?>

[/sourcecode]

Sit back and watch your mailing list grow. It’s all kept in synch and you can have the best of both worlds! The best shopping cart and the best mailing list management provider.