Code

Fast & Easy Calendar with Android app

Fast & Easy Calendar with Android app

Fast & Easy Calendar with app

A complete JavaScript calendar, with the base jQuery Fullcalendar and a PHP/MySQL backend.
Insert, update, resize, drag and drop items fast and easy with ajax calls.
- It contains a nice edit dialog for changing items with datepickers and timepickers. You can also give calendar items a custom color.
- Recurring events are possible
- Add items by clicking on a day, add moredays items by clicking and dragging your mouse, add items with a specific timerange quickly in the week- or day view by clicking and dragging your mouse
- Drop external items possible
- Users can edit several things including username and password in their profile and a settings dialog.
- Several optional fields, like location, description, phone can be set to visible in config.php.
- It supports language files, so you can add your own. The currently included languages are English, Dutch, German, Spanish, French, Norwegian, Italian, Czech and Polish.
- This calendar has the possibility to be accessed by login (users can register themselves or admin can register users) , ip or open access.
- Many config options, like dateformat as mm/dd/yy or dd/mm/yy etc….
- Automatic backup of the database. Backups are saved in the folder system/dbdump

- Touch friendly
- Import users from a Wordpress users table.
- You can install it in a subdomain of your wordpress installation and add a link into one of the website pages to the calendar.
Include events from an external table/database.

Single-user/ Multi-user
Shared calendar for all users or one calendar per user

With an Android app to easily insert items into the calendar, also offline !
You can add items without internet connection, they will be saved in your phone until you have internet connection and you can save them to the calendar.
New V2 version, with date- and timepickers and location- and description fields.


Updates are free!

NOTE: Some people seem to have trouble setting the path to the calendar. (FULLCAL_DIR in config.php) This should be the path to your personal folder on your domain with your provider. You can find it in your provider dashboard or by putting this at the top of config.php: echo getcwd();
Others known startup problems are that the paths are set incorrect in config.php and all the folders should be readable and templates_c, system and system/dbdump should be writable by everyone. Someone was having problems because some files were writable by group. The providers security didn?t allow that and an Exception (softexception) was thrown. Making it not writable for group fixed the problem.

known issue

Working on

Show events from other sources: from Exchange

TODO’s

Add an install and update function to do the sql queries for you

Updates

Update 1 (aug 2014):
fixed a bug with wordcloud, when script tags were in calendar item
updated documentation
added possibility to configure your own drag and drop items in config.php

Update 2 (oct 2014):
Fixed a bug with the passwordfield in the settings of the mobile app
Added an improved and more secure way of adding users
Users can change their userprofile and some settings now
Added Spanish language file
Added optional description-, location- and phone field, configurable in config.php
Added support for recurring events
Fields for setting the recurrence get visible when the chosen period in the datepickers is more than one week
Added some config options, e.g. admin can change the dateformat: dd/mm/yy or mm/dd/yy
Updated documentation
The calendar can stretch to screen
Mouseover ‘delete-button’ re-introduced
A loading indicator
Possibility to truncate the title to a given length
Description field in edit dialog
Confirm message before deleting an item
Recurring events
Admin can easily add users through a form

Update 3 (oct 2014):
A fix for a deprecated error with preg_replace in PHP 5.5
The timefields are hidden now when the ‘allday’ checkbox is checked on
Fixed a bug with date fields when a recurring event is opened and the dateformat is mm/dd/yy

Update 4 (jan 2015):
- Added Polish language file.
- Added search box, search results view with possibility to go to certain item in the calendar.
- Automatic backup of complete database. (make sure the folder /system/dbdump is writable, set it to 773 so that the folder is not viewable in the browser !)
- Added schedule table.
- Possibility to login with link above the calendar, so now it?s possible to let non-users see the calendar when access type is ?login?.
- Admin can login by adding ?/admin? behind the calendar url for calendar with access type ?free?.
- Fixed deprecated error (eregi).
- Added new config-options.
- Added view dialog, to view an event when not logged in.
- Config-option to determine if only admin can see the external drag and drop items.
- Added colors in listview.
- Fixed description field and color not saving on edit.
- Updated documentation.
- Fixed a bug with validation type ?email?.

Update 5 (11 jan 2015)
- Bugfix: when admin changes a password of a user, the password of the admin was changed.
- Bugfix: the times were not saved correctly when an event was added in week or day view .
- Fixed unwanted behaviour when 2 browser tabs with both the calendar in it were opened.
- New config options: to decide if the user should see a message when adding or editing was not allowed and another option that gives the admin full control.
- Updated documentation.

Update 6 (13 jan 2015)
Fixed 2 bugs, with USERNAME in the ‘adduser’ email and the color selection was hidden in the edit dialog.

Update 7 (20 febr 2015)
Bugfix: when admin has full control and changed an event to a recurring event, the userID was lost.
Added more sentences to the language files.
Bugfix: the ?restore pattern? sometimes was visible when it shouldn?t be visible.
Added a nicer color picker and the user can change the color of all his/her events at once.
Improved the ?add user? dialog.
Added more functionality to the admin area.

Update 8 (16 mar 2015)
Changed the added colorpicker (update7) to another one (spectrum), because it was causing a bug with dragging items in week view and day view.
Added the possibility of a mouseover with event details.
Added ?other language? to the settings. This makes it easier to include a languagefile that is not yet in the calendar.
Added a scrolling timepicker which also supports AM/PM.
Added possibility to show the events in AM/PM timeformat.
Updated documentation and screenshots.
New config options.

Update 9 (26 mar 2015)
Fixed deprecated mysql_connect error
Fixed the failed admin insert query, because of duplicate mailaddress
Fixed an issue with the colorpicker (didn?t load the default color) when adding a new calendar
Fixed a validation error in my PHP form validation
Improved layout on mobile device
Fixed: the initial color went wrong on load of the edit dialog
Added posibility to ignore timezones
Added lines to language files
Added confirm dialog when deleting an item
Updated documentation
New config option: IGNORE_TIMEZONE

Update 10 (3 may 2015):
Fixed an issue with not showing mouseover of recurring events.
Added possibility to show description, location and phone in week view, day view and list view
Added config options: SHOW_DESCRIPTION_IN_WDL_VIEW, SHOW_LOCATION_IN_WDL_VIEW, SHOW_PHONE_IN_WDL_VIEW
Added sentences to language files

Update 11 (3 may 2015):
Fixed 2 issues with saving profile and eventcolor
Removed Evol colorpicker

Update 12 (9 may 2015):
Fixed bug with checkbox for Sunday not being checked.
Fixed: Items with starttime later than 22:00:00 and endtime 00:00:00 (midnight) were wrongly shifted to the next day.
Fixed issue that view dialog wasn’t opening.

Update 13 (23 juli 2015):
- Show events from your own existing table (other database). See the PDF for instructions.
- Included yearly recurring possibility, SQL update necessary, see update4.sql for existing users, for new users it’s in the complete db_for_new_users.sql.
- New config option: SHOW_LOCATION_IN_MOUSEOVER.
- Fixed issue that an item could be added when not logged in and ONLY_ADMIN_CAN_ADD_AND_EDIT was true.
- Fixed bug that in some cases it was not possible to edit an event
- Fixed issue with UTF8 encoding on search results page
- Fixed issue that just added event could not be resized immediately

Update 14 (3-8-2015):
Added url field (SQL query needed, see update5.sql)
Added SHOW_URL_FIELD,SHOW_URL_IN_MOUSEOVER, SHOW_URL_IN_WDL_VIEW in config.php
Added lines in language files

Update 15 (4-8-2015):
Fixed: an added url wasn’t clickable in weekview

Update 16 (24-8-2015):
Calendar name is now configurable.
IMPORT USERS FROM WORDPRESS TABLE: Added possibility to import users from Wordpress wp_users table. (CSV)
TOUCH FRIENDLY: Made drag & drop and daycell select working on touch devices, configurable in config.php.
Added Italian language file: langIT.js
Fixed: url wasn’t set to empty when switching events.
Fixed: when url was empty, null was visible in listview.
Fixed issue: when creating an event in monthview, allDay checkbox should be set to true initially.
Added checkbox in profile edit form to set a user active.
Updated language files
Translated login form

Update 17 (19-9-2015):
Added Android app v2. New things are the date- and time pickers and location- and description field.
Added Czech language
3 new config options, to determine which day is first day of week, whether weekend is visible, which hour should be scrolled to initially and which hour should be first visible hour: FIRSTDAY_OF_WEEK, SHOW_WEEKENDS, FIRST_SCROLL_HOUR, MIN_VISIBLE_TIME
Fixed: translation of login form was missing the language
Fixed: when updating an event in some cases the color was reset to calendars default color.
Fixed: deleting an admin didn’t work.
Fixed: long events that are more days than 2 months where not showed in a certain month when start date was before the beginning of the month and the end date was after the end of the month.
Tweak: The dates are not automatically set anymore when the ‘error in dates’ error is not triggered.
When you have an existing database with a table that has also the name ‘users’, you can define another name for the calendar’s users table. Do this in /model/users.class.php, /model/settings.class.php and /lib/utils.class.php.

Update 18 (4-10-2015):
Added possibility to disable automatic database backup.
Added possibility to upload and attach files to events, SQL update and 2 config options added: SHOW_FILE_UPLOAD, MAX_EVENT_FILE_UPLOAD, don’t forget to add a writable folder: ‘uploads’.
Updated screenshots
Fixed: when showAMPM set to true and timepicker dateformat is dd/mm/yy, the startdate and enddate is incorrect after updating an event.

Update 19 (30-11-2015):
Execute the update-queries in update_7.sql
Added to recurring options: daily – every x days and weekly – every x weeks.
Changed the name of an id: interval_day_div changed to interval_week_choice_div
Starting a recurring event is now more logical, with a checkbox.
Added possibility to make fields required for the edit dialog. You can set the options in configs/config.php (DESCRIPTION_FIELD_REQUIRED, LOCATION_FIELD_REQUIRED, PHONE_FIELD_REQUIRED, URL_FIELD_REQUIRED)
Fixed: Office files couldn’t be opened after uploading. Fixed: file extension was undefined right after upload.

Update 20 (23-2-2016):
Update8.sql
Optimized schedule.
Added possibility to unable editing an event by two users at the same time. (new config-option: SAVE_CURRENT_EDITING)
Fixed: first day of week, first scroll hour and min visible time were not working.
Changed possible values for SCHEDULE_SQLDUMP to ‘day’, ‘hour’ or ‘never’.
Added lines to language files

Update 21 (27-4-2016):
Fixed: when changing the number of ? every x weeks? of a weekly recurring event, the updating was not correct.
Added possibility to create night-shifts
Added icons on events for recurring and night-shift
Added lines to languagefiles
Added config-option: MAX_VISIBLE_TIME
Fixed: $obj_db was undefined in 2 functions in user.class.php

Update 22 (29-6-2016):
new config-option: SHOW_ONLY_TITLE_WHEN_NOT_LOGGED_IN
translated several words

Update 23 ( 19-9-2016 ) Fixed: In php 7 it is not allowed to have a constructor with same name as the name of the class. Fixed: start date and end date where always set to today when adding an item from the mobile app. Tweak: removed transparency when 2 or more events where at the same time.

Latest Fullcalendar has support for limiting the amount of events visible in 1 day and a plus to show the rest of the events on that day, i will try to build that in, only i have to start from scratch, because Fullcalendar 2.x is completely different…

I am using the mobile app for 3 years now as a sort of logbook. You can add items for yesterday, today or tomorrow. I will add a datepicker , so users can also choose to pick a date.



When you install an update don’t copy everything. It’s not necessary to update config.db.php.
You can check config.php to see if there are new config options.

And don’t forget to make the folder ‘templates_c’, system and uploads writable:
for linux this would be:
$> chown nobody:nobody smarty/templates_c
$> chmod 775 smarty/templates_c

In some cases a cache folder is also needed:
$> mkdir smarty/cache
$> chown nobody:nobody smarty/cache
$> chmod 775 smarty/cache

Clean coding

All my applications are MVC. I don’t do that ugly HTML in PHP files like many do, or even Javascript in PHP files, like some here do …
All forms are validated for correct user input and only then passed to the database
Documentation, SQL included
by
by
by
by
by
by