============================
= LuxCal Development Notes =
=     produced by Roel     =
============================

=== This file lists all changes since the start of LuxCal V5.1. It contains ===
=== a short description of each change and the files affected by the change ===

Change log - version 5.1.0
==========================

New features / improvements:
01. Various files (see technical issue 01 below): Calendar pages not containing 
    forms that can affect the database content will not time out anymore when 
    a PHP session expires. This means that the calendar can stay open and unused 
    for long periods of time without "PHP session expired" messages. Only pages 
		with forms that can affect the database content will time out when the user 
    does not submit the form within the expiry time of the PHP session (24 
    minutes).
02. index.php, alert.php, ui-{lang}.php: When the user does not submit the form 
    in the Add/Edit Event window in time and the PHP session expires, to avoid 
    the loading of the calendar in the Add/Edit Event window, together with the 
    "PHP session expired" message just a "Close" button is displayed, instead of 
    a "Restart" button.
03. login.php: The log in box on the Log In page has been made slightly narrower 
    to make it also fit on a mobile phone in portrait position.
04. groups.php, toolbox.js: On the Edit User Groups page in the Edit User Group 
    form the interaction between the View and Add event categories check boxes 
    has been improved. The (un)checking of the Add check boxes have been made 
    subordinate to the (un)checking of the View check boxes.
05. accounts.php: On the User profile page, in the Change my data form a "Done" 
    button has been added to return to the calendar page after the user data has 
    been changed.
06. retrieve.php, retrievc.php, toolboxx.php, categories.php, eventform.php, 
    event.php, ai{lang}.php: The way event sub-categories are stored in the 
    calendar database has been made more flexible. The maximum number of sub-
    categories, which was four in the last calendar version, is now flexible and 
    can be selected when editing a category. It is now also possible to copy all 
    sub-categories of one category to an other category. Sub-categories present 
    in previous LuxCal versions, will be automatically converted and preserved 
    during the upgrade process to LuxCal V5.1.0.
07. month.php: In month view the full-width event title line (from the left to 
    the right margin of the day cell) is a hyper-link which can be clicked to 
    open the event report window or the edit event window and can be hovered to 
    view the pop-up box with details. In previous versions only the event title 
    text was a hyper-link.
08. toolbox.php: When on the Settings page in the "Events layout" template the 
    extra fields were included and contained an image, the image would be shown 
    on the calendar, even if on the Settings page "Show images in month view" 
    was disabled. If "Show images in month view" was enabled, the image would be 
    shown twice. This has been solved by removing images in the event title.
09. event.php, eventform1.php, retrieve.php, toolbox.php, ui-{lang}.php: In the 
    Add/Edit Event window, the "Set Repetition" overlay has a new option 
    "Rolling". A rolling event is an event that, once the start date has passed, 
    will always "roll" to the current day. When a reminder has been set for a 
    rolling event, a new reminder will be sent each day the event rolls to a 
    next day. When the user deselects "Rolling", the event will stop rolling 
    and remain fixed at the current day. Rolling events will help users who have 
    a tendency to postpone their tasks.
10. search.php, settings.php, toolboxx.php, ai-{lang}.php: The default number of 
    days to search back and the default number of days to search ahead, which 
    used to be fixed 365 days each, can now be specified on the admin's Settings 
    page.
11. cron.php, readme_cron.txt: A script, called cron.php, has been added to the 
    !luxcal-toolbox folder. When multiple calendars have been installed, this 
    script can be used to start multiple lcalcron.php scripts, using only one 
    cron job. An explanation is given in the readme_cron.txt file.
12. phpdetails.php, serverphpinfo.php, cookietest.php, phpsessiontest.php: 
    Several small stand-alone tools have been added to the !luxcal-toolbox 
    folder in the LuxCal zip-file. These tools can be used to get information 
    about your server and the PHP installation on your server.
13. settings.php: On the settings page, in the General section, the "Link to 
    parent page" can now, besides a URL, also be a path relative to the calendar 
    root folder.

Technical issues:
New features / improvements:
01. index.php, header.php, toolbox.php, login.php, styling.php, account.php: The 
    token used to validate user inputs is now only used for forms. The token 
    which was stored in a cookie (LXtkn) has moved as a hidden input to each 
    form that directly affects the database. In combination with item number 2 
    hereafter this means that only pages with these forms will time out when the 
    submission does not take place within the expiry time of the PHP session 
    (24 minutes). Surfing the calendar pages which contain no forms affecting 
    the db will not depend on PHP sessions and will therefore not time out when 
    the PHP session expires.
02. index.php, toolbox.php: The last user selections (cP, cC, cU, cG and cD) 
    were saved in a PHP session variable and, if on the Settings page Restore 
    last user selections was selected, also in a cookie. Storing variables in 
    two places is undesirable and therefore they are now always and only stored 
    in a cookie. At the initial start of the calendar these values will be used 
    if on the Settings page Restore last user selections has been selected.
03. index.php, dloader.php: The user rights (privs) were stores in a PHP session 
    variable and used by the dloader. To reduce the dependency on PHP session 
    variables, the dloader is now getting the user privileges from the database.
04. month.php, week.php, day.php, vfunctions.php: To avoid duplication of code 
    the code to produce the Side Panel in month, week and day view has moved to 
    a the new file vfunctions.php. The dw_functions have also moved to this new 
    file.
05. lcsbar.php, installation_guide.html: Like for the calendar's month, week and 
    day view, now also for the the calendar sidebar the event layout can be 
    specified via a template with keys.
06. alert.php: In the alert.php file the HTML lang tag is set to the language 
    corresponding to the ISOCODE in the active ui-{lang}.php file.
07. month.php, week.php, day.php: Regex to extract side panel info messages from 
    the file info.txt improved, so that only messages are extracted where there 
    are no other characters but spaces in front of the ~ (tilde) character of 
    the month number.
08. settings.php: On the Settings page PHP info hyper-link replaced by a button.
09. eventform1.php: The code to submit the event edit form when a new category 
    is selected has changed from onChange="document.forms['event'].submit();" to 
    onChange="this.form.submit();". Code simplification.
10. event.php, eventform1.php: When in the Add/Edit Event window a category is 
    selected for which a repetition has been specified, the "Change repetition" 
    button is suppressed. Category repetitions always overwrite.
11. toolbox.php: In the previous version, when in the event layout template, 
    between two separators one #-parameter resulted in an empty string, the 
    whole section was omitted. This has changed: now the whole section is 
    omitted when ALL #-parameters between two separators result in an empty 
    string.
12. messaging.php, settings.php, ai-{lang}.php: Since many ISPs only accept PHP 
    mails being sent from an email address hosted on the same server as the 
    calendar, the "From" field of all emails will always be the calendar email 
    address. When on the Settings page, in the section Periodic Functions the 
    "Add 'Reply To' field" has been checked, emails will contain a 'Reply to" 
    field with the event owner's email address.
13. messaging.php: Since not all ISPs accept PHP mails with a blank 'To' field 
    the 'To' field is now set to the calendar email address. In addition, to 
    make the source code of emails better readable, after each </tr> and <br> 
    tag, a crlf (\r\n) has been added.
14. header.php, display0.php: The link rel="canonical" has been removed from the 
    page header because is was not useful.
15. css.php, header.php, alert.php: Rather than passing the current calendar ID 
    in the calendar's head section via a parameter in the style sheet URL, the 
    style sheet is now getting the calendar ID directly from the LXCcid cookie.
16. settings.php, admin_guide.html, installation_guide.html: The URL for valid 
    time zones updated to https://www.php.net/manual/en/timezones.php.
17. toolboxx.php: For a new installation of the calendar the initial language 
    for the administrator is set to English. In the previous calendar version it 
    was not set and resulted in Bulgarian (first in the list).
18. index.php: To prevent session fixation attacks, the PHP session ID is 
    regenerated each time the index.php file runs. 

Bug fixes:
01. css.php: Due to an erroneous style ("body {overflow:hidden;}") the calendar 
    pages can not be scrolled on a mobile device. Solved.
02. event.php: In the Add / Edit Event window, when there are two consecutive 
    separator characters (;;) in the Send mail's "To" field, a PHP notification 
    message was shown. Solved.
03. vfunctions.php: For events in Week and Day view, falling outside the active 
    day hours, the event layout template from the Settings page was not used and 
    always resulted in: start time followed by event title.
04. css.php: When the Help window overflowed and the content was scrolled up, 
    the overflow part did not have the correct background color.