#### a LuxSoft product

# LuxCal Event calendar

### Installation Guide

#### Table of Content

1. Installation of Updates

2. New Installation

   - Requirements

   - Installation Steps

   - My Calendar doesn't Work

3. Calendar Configuration Variables

   - LuxCal Version Number and Database Credentials

   - Calendar Settings

   - Installing Automatic Periodic Functions

   - Installing a New Language

4. Managing the Calendar

   - Event Categories

   - Calendar Users

   - Calendar Database

   - CSV File Import

   - iCal File Import/Export

   - Calendar Settings

5. Embedding the Calendar in an Existing Web Page

   - Link to the Calendar

   - Embed a Mini Calendar

   - Embed the Full Calendar

   - Embed One Specific Calendar View Without Navigation Bar

#### 1. Installation of Updates

To upgrade to a new version of the LuxCal Event Calendar follow the instructions in the file "`release_notes_luxcal_xxx.html`" (where xxx indicates the release).

#### 2. New Installation

##### Requirements

For the installation of the LuxCal Event Calendar on the server of your hosting provider, you will need:

- A web accessible directory on a web server to install the LuxCal files.

- The web server should be able to run php-scripts (PHP 5.1 or higher).

- A MySQL database on the web server to store the LuxCal Event Calendar data.

##### Installation Steps

To install the LuxCal Event Calendar on the server of your hosting provider, follow the next steps:

- Create a MySQL database on the server to store the LuxCal calendar data. Ask your hosting provider if they provide a tool for you to do this.

  For later use, remember the name of the database server (host name), the database name and the username and password to access the database.

- Uncompress the downloaded LuxCal zip-file in a temporary location and upload all files and directories to a Web accessible directory on the server where you wish to install LuxCal.

- With your Web browser browse to the directory of the LuxCal installation; it should redirect you to the "install.php" script and show the Installation page.

- On the Installation page enter the database details and the administrator name, e-mail address and password and click "Install." The script will generate the necessary tables in the database and saves a file called lcaldbc.dat in the calendar's root directory with your LuxCal version number and the encrypted database credentials.

- Launch the calendar by browsing to the calendar's URL to ensure the calendar displays properly.

- Keep a backup copy of the `lcaldbc.dat` file. It contains the LuxCal version number and the encrypted parameters for the MySQL database.

##### My Calendar doesn't Work

The two most frequent problems are:

- The calendar shows a blank page. Most of the time this problem is caused by the fact that the calendar cannot connect to the MySQL database.

- When logging in as administrator, your name is not displayed at the right top of the window; instead it reads 'Public View'. This problem arises when 'sessions' are not enabled, or not working, in the PHP installation on your server. This problem also occurs when cookies are not enabled in your browser.

On the Download Page of the LuxSoft site you can download the LuxCal configuration tool which can be used to check if your LuxCal calendar installation is ready for use or to further analyse above problems.

#### 3. Calendar Configuration Variables

##### LuxCal Version Number and Database Credentials

During the LuxCal installation process a file called `lcaldbc.dat` is created and stored in the root directory of the calendar. If, when launching the calendar, the file `lcaldbc.dat` is not present in the calendar root directory, it is assumed the calendar has not yet been installed and consequently the calendar's installation script will be started.

The file `lcaldbc.dat` contains the following three lines:

1. The text "LuxCal".

2. The version number of the LuxCal installation. For example "2.7.0". This version number is used by the calendar to check if the current calendar installation is up-to-date with the installed calendar files and to determine if the upgrade script should be run.

3. The following database credentials in encrypted form:

   - `host name:` This is the name of the database server and is often called "localhost".

   - `user name:` The database user name is the user name required to connect to the database. This user name was chosen when the database was created on the server of your ISP. Note: This user name should not be confused with the admin's user name to log in to the calendar!

   - `password:` The database password is the password required to connect to the database. This password was chosen when the database was created on the server of your ISP. Note: This password should not be confused with the admin's password to log in to the calendar!

   - `database name:` This is the name of the database on the database server which will be used by the LuxCal calendar to store all its data. The calendar data is stored in the following tables: `events`, `users`, `categories` and `settings`.

   - `table prefix:` If not blank, this variable is used as a prefix for the database table names. This may be useful if you are short of databases and want to share the database with other applications, or if you want to use several separate LuxCal calendars. The prefix could for instance be `lc1_` or `db1_`, etc.

##### Calendar Settings

The calendar settings which are automatically generated during the installation process are stored in the `settings` table of the database. All settings can be changed at a later stage by the calendar administrator via the Settings page in the drop down menu on the navigation bar at the top right corner of the screen.

For those interested in technical details: The following are explanations of the PHP variables stored in the `settings` table of the database:

- `calendarTitle` is the title of the LuxCal calendar that is displayed in the header of the various calendar views.

- `calendarUrl` is the URL address of the calendar, used for notification purposes.

- `calendarEmail` is the sending e-mail address ("From") in notification emails (reminders).

- `timeZone` specifies your local time zone. See the PHP Supported Timezones for possible values. Setting the correct time zone is important for the "today" indication in the various views and when the "notification" feature is used.

- `chgEmailList` is a list with destination email addresses for calendar changes sent by the sendchg.php script. Automatic periodic functions should be installed (see below).

- `chgNofDays` specifies the number of days the sendchg.php script (see previous variable) should look back for calendar changes. If the automatic periodic functions have been installed (see below), this variable could be set to 1 (one day)

- `adminCronSum` specifies whether the calenfdar administrator will receive a summary report after the periodic functions have been executed. Automatic periodic functions should be installed (see below) and emailing cron job output should be enabled on the server.

- `details4All` if enabled: event details will be visible to the owner of the event and to all other users; if disabled: event details will only be visible to the owner of the event and to users with 'post all' rights.

- `rssFeed` if enabled: RSS feed links will be displayed in the calendar footer and will be incuded in the HTML head section.

- `eventExp` specifies the number of days after the event's due date when an event expires and will be automatically deleted (0:never). This function works via a cron job.

- `cookieExp` Number of days before a 'Remember me' cookie - set during Login - expires

- `userMenu` specifies whether the user filter is displayed in the calendar's options panel. Possible values: 0 = don't display the user filter menu, 1 = display the user filter menu.

- `catMenu` specifies whether the event category filter is displayed in the calendar's options panel. Possible values: 0 = don't display the category filter menu, 1 = display the category filter menu.

- `langMenu` specifies whether the calendar users are allowed to select their preferred user interface language the calendar's options panel. Possible values: 0 = don't display the language selection menu, 1 = display the language selection menu.

- `defaultView` indicates the initial calendar view to be displayed when the LuxCal Event Calendar is started. Possible values/views: 1 = Year, 2 = Full Month, 3 = Work Month, 4 = Full Week, 5 = Work Week, 6 = Day (today), 7 = Upcoming events and 8 = Changes.

- `language` specifies the default user interface language. Only installed languages can be specified.

- `selfReg` indicates whether users can register themselves via the Log-in page. Possible values: 0 = self-registration disabled, 1 = self-registration enabled.

- `selfRegPrivs` specifies the access rights for self-registered users. Possible values: 1 = view, 2 = post self (post events and edit own events), 3 = post all (post events and edit own and other user's events).

- `selfRegNot` indicates whether a notification should be sent to the admin when a user has self-registered. Possible values: 0 = disabled, 1 = enabled.

- `maxNoLogin` indicates after how many 'no-login' days a user account should be automatically deleted. Possible values: 0 = never delete a user account, 1 - 365 = number of days. Automatic periodic functions should be installed (see below).

- `miniCalView` indicates the calendar view for the LuxCal mini calendar. Possible values/views: 1 = Full Month, 2 = Work Month, 3 = Full Week, 4 = Work Week.

- `miniCalPost` indicates whether events can be added, edited and deleted via the mini calendar without opening the full calendar. Possible values: 0 = posting of events disabled, 1 = posting of events enabled. The default value is 0.

- `yearStart` specifies the start month in year view (1-12 or 0, 0: current month)'.

- `colsToShow` specifies the number of months to show per row in year view'.

- `rowsToShow` specifies the number of 4-months rows to show in year view. The default value is 4.

- `weeksToShow` specifies the number of weeks to show in month view. The value 0 has a special meaning and will result in the display of just one single full month. The default value is 10.

- `workWeekDays` is a string of numbers which specify which days of the week to show in work month view and work week view. Valid day numbers are: 1 = Monday, 2 = Tuesday, ... , 7 = Sunday.

- `lookaheadDays` specifies the number of days to look ahead in upcoming view, todo list and RSS feeds. The default value is 14 (two weeks).

- `dwStartHour` specifies the start of the full time block on the day and week views. The default value is 6 (corresponding to 6:00am). This parameter helps to avoid wasting space for the nightly hours, where normally no, or very few, events are planned.

- `dwEndHour` specifies the end of the full time block on the day and week views. The default value is 18 (corresponding to 18.00/6:00pm). This parameter helps to avoid wasting space for the nightly hours, where maybe no, or very few, events are planned.

- `dwTimeSlot` specifies the time slot size (in minutes) in day/week view. Together with the `dwStartHour` (see above) this value determines the number of rows in day/week view.

- `dwTsHeight` specifies the time slot display height (in number of pixels) in day/week view.

- `weekNumber` specifies whether week numbers should be displayed in the various calendar views. Possible values: 0 = no week numbers displayed, 1 = week number displayed. The default value is 1.

- `showAdEd` specifies whether the date/user added/edited of an event should be shown in the hoverbox in the various views, in the Upcoming Events view, in the Changes view and in email notification messages.

- `showCatName` specifies whether the event category name should be displayed for the events in various views (0: no, 1: yes)

- `showLinkInMV` specifies whether URL-links, specified in the description field of the events, should be shown in month view (0: no, 1: yes)

- `eventColor` specifies whether events should be displayed with the event owner color, or with the event category color (0: owner color, 1: category color)

- `dateFormat` specifies the format of event dates in the calendar views and input fields. Possible values/formats: 1 = dd-mm-yyyy, 2 = mm-dd-yyyy, 3 = yyyy-mm-dd.

- `dateUSorEU` specifies the format of dates and times in the calendar headers on the user interface. Possible values: 0 = US style user interface, 1 = European (general) style user interface.

- `dateSep` specifies the date separator for dates in the calendar views and input fields. Possible separators: dot ( . ), slash ( / ) and hyphen ( - ).

- `time24` specifies the format of event times in the calendar views and input fields. Possible values/formats: 0 = 12-hour am/pm format, 1 = 24-hour format.

- `weekStart` specifies the first day of the week. Possible values: 0 = Sunday, 1 = Monday.

##### 3.1 Installing Automatic Periodic Functions

The following automatic periodical functions are available:

- Email notification messages for event due dates
- Daily email messages with calendar changes
- Automatic deletion of expired events
- Automatic deletion of expired (unused) user accounts

To make the automatic periodical functions work, a cron job needs to be created on the server (or on an external server), which executes the file `lcalcron.php`, in the root directory of the calendar, daily at approx. 2:00am. For cron job details see the header of the `lcalcron.php` file.

If you are not familiar with cron jobs, ask your hosting provider for help.

###### - The Email Notification Feature

For events entered in the calendar the user can choose to receive an email reminder (notification) one or several days before the event is due. When chosen, for recurring events (e.g. birthdays) an email notification will be sent to the user the selected number of days before each occurrence of the event. Imagine: never forget to buy flowers for your (girl)friend's birthday anymore!

###### - Receiving Calendar Changes by Email

In a multi-user environment it could be useful to be aware of changes being applied to the calendar content, i.e. a list with events added, edited and deleted. Such a list can be called up via the options panel. It is however also possible to have a list with changes automatically sent daily to one or more email addresses.

Via the Settings page the administrator can specify the number of days to look back for changes and a list with email addresses. If the number of days to look back for changes is set to 0 (zero), no emails with changes will be sent.

###### - Automatic Deletion of Expired Events

Events which due date has past can automatically be deleted. Via the Settings page the administrator can specify the number of days after an event's due date when an event will automatically be deleted. If the number of days is set to 0 (zero), no events will be deleted.

Note: deleted events are flagged "deleted"; definitively removing deleted events from the database is done via the admin's Database page.

###### - Automatic Deletion of Expired (unused) User Accounts

The account of users who have not logged in during a certain number of days can automatically be deleted. Via the Settings page the administrator can specify the number of 'no login' days after which the user account will be deleted. If the number of 'no login' days is set to 0 (zero), no user accounts will be deleted.

This function can be particularly useful when users are allowed to self-register (this feature can be switched on/off on the admin's Settings page).

##### 3.2 Installing a New Language

= Note: in the following text the part {language} (including the braces) of the file names represents the name of the relevant language. =

A new language for the user interface of the LuxCal calendar can be installed as follows:

- Download and unzip the desired language pack from the LuxSoft site.

  If your language pack is not available:

  - translate the files `lang/ai-english.php` and `lang/ui-english.php` (translate the texts to the right of the => signs) and save the files with the names `ai-{newlang}.php` and `ui-{newlang}.php` respectively.
    Use character encoding utf-8 without BOM (see note below).

  - translate the file `lang/ug-english.php` (leave the html tags unchanged) and save it with the name `ug-{newlang}.php`.
    Use character encoding utf-8 without BOM (see note below).

- upload the files `ai-{newlang}.php`, `ui-{newlang}.php` and `ug-{newlang}.php` to the `lang/` directory on the server.

- on the Settings page (see Calendar Configuration Settings in Section 4 below), change the user interface language in the Calendar Settings to the new language.

- if the user interface language menu is displayed in the calendar's options panel, the new installed language will automatically be added to the menu.

IMPORTANT NOTE: When using special characters (e.g. accents) in the language files, the ui and ug files can best be saved with character encoding: `utf-8 without BOM` (BOM = Byte Order Mark). If your text editor does not support `utf-8 without BOM`, you can download and use Notepad++ (Notepad++ on Sourceforge).

#### 4. Managing the Calendar

Managing the LuxCal calendar is the responsibility of the calendar administrator, who has all calendar access rights.

In order to define users, to set up categories for the calendar, to change configuration settings and to add events, you must select Log In in the navigation bar at the top right corner of the screen. Enter the administrator name or email address and password you specified during the installation, and log in. On the right side of the navigation bar the administrator drop down menu will be displayed.

##### Event Categories

A good place to start in managing your calendar is to create a number of categories for your events, each with its own color. Adding categories with different colors - though not required - will greatly enhance the views of the calendar. Categories can be for example: meeting, important, holiday, birthday, etc.

The initial installation has only one category which is named "no cat". To manage categories, select Categories in the administrator drop down menu. This takes you to a page with a list of all categories where you can add new categories and edit or delete current categories.

When adding / editing events the defined categories can be selected from a pull down list. The order in which categories are displayed in the pull down list is determined by the Sequence field on the Categories page.

The field Repeat can be used to pre-define recurring events. A category "birthday" or "anniversary" can be set to repeat every year. If a repeat value is specified, all events defined in this category will repeat as specified. The repeat value specified here will overrule possible user 'repeat' settings.

The checkbox "Public" can be unchecked to exclude certain event categories from being viewed by the "Public User" and from the RSS feeds.

One or two check marks can be activated which will be displayed in front of the event title for all events in this category. The user can use these check marks to flag events, for example, as "approved" or "completed"

The fields Text Color and Background define the colors used to display events in the calendar assigned to this category.

##### Calendar Users

The Users menu in the navigation bar allows the calendar administrator to add and edit users, their rights for using LuxCal and their user interface language. There are two main areas that can be edited, i.e. the name / e-mail address / password area and the access rights area. Possible access rights are: "View", "Post Own", "Post All" and "Admin". It is important to use a valid email address for each user to be able to receive email notifications of due dates of events. For each user the default user-interface language can be specified. Whenever a user logs in, the user-interface language will be set to this language.

The initial installation has two users defined. One is the Public Access user, who initially has "view" access and the other is the calendar administrator, with the administrator name, email address and password specified during the installation. The administrator has all access rights.

Unless the calendar administrator has given "View" access to Public Access users, users must log in to use the calendar using their name or email address and password. Depending on the type of user, a user can have different access rights which can be set by the calendar administrator.

If the administrator has enabled, on the Settings page, user self-registration, users can register themselves via the Login page. Self-registered users have the access rights specified by the administrator on the Settings page.

##### Calendar Database

The Database menu in the navigation bar allows the calendar administrator to start the following functions:

- check and repair the database.

  This function checks the 'event' table and the 'dates' table of the database on inconsistencies and, when found, repairs the inconsistencies. The number of inconsistencies found is indicated for each table.

- compact database

  During normal use of the calendar, when deleting events, the event records are not physically deleted from the database, but are marked as 'deleted'. They can still be used in views and reports; for example in the Changes view. The compact database function permanently removes events from the database which have been marked as 'deleted' longer 30 days ago. Thereafter all tables are compressed to free unused space and to reduce database overhead.

- backup database

  This function creates a backup of the structure and contents of all database tables in the `files/` directory. The file name is `cal-backup-yyyymmdd-hhmmss.sql` (where 'yyyymmdd' = year, month, and day, and hhmmss = hour, minutes and seconds). The file type is `.sql` and the created file can directly be used to re-create the database tables structure and contents, for instance by importing the file in the phpMyAdmin tool which is available on the server of most web hosts.

##### CSV File Import

CSV (Comma Separated Values) text files with event data can be imported into the LuxCal calendar. This function can for instance be used to import a CSV file with event data exported by MS Outlook. The dialogue to import CSV files is opened by selecting CSV Import from the admin drop-down menu in the navigation bar.

The CSV file contains one line per event and each line contains a number of fields each separated by a comma (or any other unique character). The order of the fields in each line of the CSV file is: title, venue, category id, date, end date, start time, end time and description. The first line of the CSV file is ignored by the import function and can be used for column descriptions (default in MS Outlook exports).

Sample CSV files - with different date/time formats - can be found in the `files/` directory of the LuxCal Calendar installation and have the file extension ".csv".

##### iCal File Import/Export

Events from iCalendar files can be imported into the LuxCal calendar. The content of the iCal file to be imported must meet the [RFC5545 standard] of the Internet Engineering Task Force. The LuxCal calendar can also export events into an iCal file which can be downloaded by the calendar administrator. The dialogue to import/export iCal files is opened by selecting iCal Import / iCal export from the admin drop-down menu in the navigation bar.

This function can for instance be used to back up the events of your LuxCal calendar, or to exchange events with other calendars, e.g. to import public holidays available in iCal format on the internet. Please note that some LuxCal event fields are not supported in the iCal format (e.g. private event, notify, email addresses) and consequently are not copied to the iCal file. Some iCal event repetition rules are not supported by the LuxCal calendar; these events will be displayed and earmarked as such, but will not be added to the calendar.

Various sample iCal files can be found in the `files/` directory of the LuxCal Calendar installation and have the file extension ".ics".

##### Calendar Settings

The Settings page in the administrator's menu on the navigation bar can be used to easily change the calendar's configuration settings which are stored in the `settings` table of the database (see section 3 above). These settings, for instance, define the calendar title, the time zone, the language file to be used for the user interface, the default initial view when the calendar is started, the number of weeks/months displayed in the various views, the date and time format, etc.

IMPORTANT: Currently the TimeZone is set to "Europe/Amsterdam". If you are in a different time zone, change the TimeZone to your local time zone. See the PHP Supported Timezones for possible values.

#### 5. Embedding the Calendar in an Existing Web Page

To use the calendar on an other web site, the following possibilities are available:

- link to the calendar's URL, which will open the calendar in a new page.

- embed a mini calendar, which can be used to view events and - if enabled by the admin - add, edit and delete events.

- embed the full calendar with navigation bar, which the visitor can use to change the options the calendar.

- embed one specific calendar view without navigation bar. The visitor cannot change the options of the calendar

##### Link to the Calendar

To link to the LuxCal calendar in an existing web page and open it in a new window, the following HTML code can be used:
`<a href="http://www.mycalsite.xx/luxcal/" target="_blank">Go To My Calendar</a>`.

##### Embed a Mini Calendar

A mini calendar with a (minimum) width of 160px can be embedded in your web site. An example is shown on the LuxCal Demo page of the LuxSoft web site. The mini calendar can be displayed in an inline frame (iframe) using the following HTML code:

`<iframe class="lcmini" id="lbl-lcmini" src="http://www.mysite.xx/luxcal/lcmini.php" width="210px" height="233" scrolling="no"></iframe>`

Via the CSS styles, the class `lcmini` can be used to position and define the style of the iframe containing the mini calendar.

The height of the mini calendar varies depending on the month to display (4, 5 or 6 weeks) and therefore the following JavaScript code, which dynamically adjusts the height of the iframe, must be added to the `<head>` section of the parent web page:

`<script type="text/javascript">
function setHeight(newHeight){var plus=(document.all)?8:0; document.getElementById('lcmini').style.height=newHeight+plus+'px';}
</script>`
Please note: Automatic adjusting of the iframe height only works if the calendar is located in the same domain as the parent page. If not, the iframe height is set to cope with displaying 6 weeks.

##### Embed the Full Calendar

To embed the full LuxCal calendar in an existing web page, an inline frame (iframe) can be used. This can for example be done with the following HTML code:
`<iframe class="luxCal" src="http://www.mysite.xx/luxcal/?cP=2" width="80%" height="800px"></iframe>`.
With parameter `cP` the default view can be set (e.g. year: `cP=1`, month: `cP=2`, . . . ,upcoming: `cP=5`)
Via the CSS styles, the class `luxCal` can be used to position the iframe at the desired location and to set the width and height to fit your needs.

##### Embed One Specific Calendar View without Navigation Bar

To embed the LuxCal calendar without navigation bar, the parameter `hdr=0` should be added to the URL as follows:
`<iframe src="http://www.mysite.xx/luxcal/?hdr=0&cP=2" width="80%" height="800"></iframe>`.

The visitor will not be able to navigate the calendar and select other views. The following parameters can be added to select the view to display and the user-interface language:

- `cP` to set the view (e.g. year: `cP=1`, month: `cP=2`, . . . ,upcoming: `cP=5`)
- `cL` to set the user-interface language (e.g. French: `cL=Francais`). The specified language must be present in the `lang/` directory)

For example the HTML code to show the Upcoming Events page without navigation bar, in the French language looks as follows:
`<iframe src="http://www.mysite.xx/luxcal/?hdr=0&cP=5&cL=Francais" width="80%" height="800"></iframe>`.

Via the CSS styles the iframe can be positioned at the desired location and the width and height can be set to fit your needs.

Important:
The parameter `hdr=0` is remembered via the PHP session mechanism; this means that if you access the embedded calendar without navigation bar, then thereafter, when accessing your normal (not-embedded) calendar when your session is still active (max. one hour) you will also see no navigation bar. This can be solved by adding the parameter `hdr=1` to the URL of your normal calendar.

design 2012 - powered by Lux Soft