This is the latest update of easyBlue 20151201
I am starting a new thread on easyBlue to consolidate what has been learned from this previous thread
This build adds some code to improve the date picker on the front end. Now, when selecting disabled dates the notice that there are no available appointments for that time slot appears.
Many updates were made without numbering. That can be confusing. Instructions were scattered throughout the thread and difficult to follow for some. This will hopefully make it clear.
Contents:
1. What it is
2. Features
3. Installation instructions
4. Issues
What it is
easyBlue 20151201 is my modification of Easy!Appointments 1.1 beta by A.Tselegidis <
alextse...@gmail.com>. This is a work in progress done by an armature programmer who’s day job is psychotherapy. Use at your own risk. easyBlue adds some useful features to EA. Easy!Appointments 1.1 is a beta. It is not complete. Do not try to install this unless you have first had 1.0 up and running. Do not try to make a fresh installation of EA from this build. Remember 1.1 is in beta phase. There are some problems with Composer. Do not bother with that. This build works pretty well but there are likely problems with it too. Let me know and I will keep improving it.
Features
Recurring appointments
Recurring appointments are supported through Google Calendar Sync. The sync with Google Calendar is modified to accurately reflect creation of recurring appointments in Google Calendar. So, if a client creates an appointment the provider can modify that appointment in Google Calendar to be recurring and EA will reflect that. Modifications that you may want to play with: The default sync time period is set to 60 days out. Things you need to know about this:
- In order for EA fields to sync with Google Calendar I have added them to the notes section delimitted as numbers by barrels “| |” One number represents the customer and the other represents the service. This should not ever be deleted. You can use the notes field as always but leave the delimited numbers at the end of the notes.
- Unavailable days no longer have a default “unavailable” title. This is to allow for the name of the client and service when recurring appointments sync back.
- To adjust the sync period go to libraries/google_sync.php line 301 and change 60 to what ever you want. The longer the period the longer the sync time.
- When creating recurring events in google calendar, if the first appointment in the cycle was created in EA, that hash will be changed when the recurring cycle starts. So, if a person uses the email to edit that appointment it will appear to be gone and they will not be able to edit it. So, to work around that, In google calendar, I make a duplicate appointment for the next available time slot and then create the recurring appointment sequence. They will only get a google notice of the addition. The reminders will work fine with this.
- If you make a recurring appointment in Google Calendar, you need to manually sync in EA for the change to be reflected in EA.
Waiting List
A waiting list feature: Clients can register for a waiting list to be informed of openings in the next 60days. They remain on the waiting list for 30 days. To use this feature you must set up a cron job to launch this nightly. I will describe how to set up the cron job in the instructions section.
Automatic Sync of Google Calendar
This is done by Cron Job (see instructions below). The code was modified to allow cron to sync the Google calendar as often as you need. I sync nightly. This is set through making a cron job as described in the instructions.
ICS File Attachment
Appointments are sent out with an ICS file attached. In outlook this will automattically add an appointment to the calendar of the customer. Also it will be deleted from the calendar when deleted in EA as well. In Google it is not fully functioning because EA uses PHPmailer which will only allow one or the other formats. I selected to favor outlook because EA allows a customer to select to add to their calendar when they book. Unfortunately Google calendar users cannot get the automatic deleations. So, in the future I will try to migrate EA over to another mailer system that will better accommodate all calendar systems.
Sunday-Saturday format
All calendars are changed to Sunday-Saturday format
USA Time Formatting The date and time is set to Month/Day/Year and AM/PM on the front end but not on the back end. I ran in to too many conflicts on the back end, so I have kept it the way it is.
60 Min Default Time Period for Appointments
The default appointment time period is 60min with 30min padding allowing scheduling on the hour or half only. Modifications:
If you want to make changes regarding the default structure back to every 15 min: All that is done in /application/controllers/appointments.php lines 478-498.
For example Alex's default 15 min interval code is:
if ($minutes % 15 != 0) { // Change the start hour of the current space in order to be
// on of the following: 00, 15, 30, 45.
if ($minutes < 15) {
$start_hour->setTime($start_hour->format('H'), 15);
} else if ($minutes < 30) {
$start_hour->setTime($start_hour->format('H'), 30);
} else if ($minutes < 45) {
$start_hour->setTime($start_hour->format('H'), 45);
} else {
$start_hour->setTime($start_hour->format('H') + 1, 00);
}
}
$current_hour = $start_hour;
$diff = $current_hour->diff($end_hour);
while (($diff->h * 60 + $diff->i) >= intval($_POST['service_duration'])) {
$available_hours[] = $current_hour->format('H:i');
$current_hour->add(new DateInterval("PT15M"));
$diff = $current_hour->diff($end_hour);
Highlight Available Days and Disable Unavailable Days
The date picker blocks out days that are filled making it easier for clients to find open days. The default period for booking is 60 days. To modify the default booking period:
- Default 60 day view: assets/js/frontend_book.js, line 29,
- AND application/controllers/appointments.php, line 489, and 408
Cellphone Messaging Support
There is a field for selecting a cell carrier . This allows for sending text message reminders of upcoming appointments. If a sell carrier is not selected, only a email reminder is sent. In order to use you need to manually add the database as described in the instructions.
Reminder Messages Sent Out Daily
This is set up through cronjob and the days out for reminder can be edited in \application\controllers\cli\reminders.php line 28.
How to install
First install 1.0 and have it working with the database, providers, services, and working plan. There are problems with composer. So just setup 1.0 and make sure that you're able to to run ea. I would schedule an appointment. Make sure that you get the email telling you that you scheduled an appointment. I be sure that you can cancel an appointment by clicking the link in the email. I would also set up Google Sync if you plan to use it . That would indicate that you have set it all up appropriately in 1.0.
Update the database
To add a `id_cellcarrier` column to `ea_users` table for text messaging to work:
ALTER TABLE `ea_users` ADD `id_cellcarrier` BIGINT(20) NOT NULL AFTER `id_roles`;
Add an ea_cellcarrier table to the database:
CREATE TABLE `YourEasyAppointmentsDB`.`ea_cellcarrier` ( `id` INT(11) NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), `cellco` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,`cellurl` VARCHAR(30) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL)
to fill the ea_cellcarrier table with data (check to be sure that these extensions are correct and useful in your area. Google cell phone URLs or check numbers with
http://www.freecarrierlookup.com/ or similar) :
INSERT INTO `YourEasyAppointmentsDB`.`ea_cellcarrier` (`id`, `cellco`, `cellurl`) VALUES ('1', 'AT&T', '@txt.att.net'), ('12', 'Alltel', '@message.alltel.com'), ('13', 'Ptel', '@ptel.com'), ('14', 'Suncom', '@tms.suncom.com'), When all of that is done, rename the folder something like easy appointment old. Do not delete the database because you will be using it with the new insulation. Then layer on an installation of easy appointments using the 1.1 files. Name the new ea
folder your old folders name. Copy the information you have in your configuration file to the config file in 1.1 and that should do it.
Add Cron Jobs
Reminders, Daily Google Sync, and Waiting list all require a cron job to be set up in your crontab file. This is located in different places depending on your server. Mine is in /etc/crontab. My edits look something like this:
0 22 * * * php /<path to easy appointmtnes>/index.php cli/waitinglist30 7 * * * php /<path to easy appointmtnes>/index.php cli/reminders
30 23 * * * php /<path to easy appointmtnes>/index.php google/sync3
This sends out a waiging list notice at 10:00 pm (0 22) and appointment reminders at 7:30 am (30 7) and syncs google calendar at 11:30 pm (30 23). One thing worth noting, if you are not used to crontab, sometimes php needs to be the full path to the php binary (e.g. /usr/bin/php). Sometimes spaces need to be tabs to work. Sometimes you need to use "root /usr/bin/php". So if you are using this and you are not getting the cronjob firing mess with these items.
Issues
The following issues apply:
- If you disconnect the sync from google calendar and reconnect you will have duplicate appointments loaded into the calendar, most with "unavailable" subject lines but not all. The most effective thing to do in this case is to go into phpMyAdmin and drop all the duplicates formed on the date of the reconnection. I found this out the hard way. I accidentally disconnected the google sync and reconnected. Clients complained of getting two reminders, one saying unavailable. Watch out. I a code could be added to correct for this. That is down the line. This fix is easy enough for me.
- In the EA backend, Full Calendar View, only appointments created in EA are visible, the appointments created by Google calendar (recurring appointments) are not. This is not a problem in day or week view. I think this would be easy to change. It would be nice if the client appointments created in Google Calendar were a different color than the Unavailable spots.
- I blacked out some days for vacation time. However, recurring appointments were also posted on that week. I neglected to delete them. As a result appointment reminders were sent out for them one day (I caught it at that point). So, be sure to delete appointments on your vacation time or you will have a bunch of disappointed and frustrated clients. It would be nice to add a code that would block reminders where ever there is a concurrent vacation block.