Author Topic: External Calendar (extcal) module  (Read 2513 times)

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 558
  • Gender: Male
    • meine Homepage
External Calendar (extcal) module
« on: July 16, 2015, 02:03:35 PM »
Hi,

here the latest version of my "extcal"-Module which allows to include an external calendar (ical or caldav) smoothly into a WB page.
The latest update fixes a one-minute shift of the end time of entries (which can be displayed using the advanced options).

Martin

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 558
  • Gender: Male
    • meine Homepage
Update: External Calendar (extcal) module
« Reply #1 on: July 16, 2015, 09:57:54 PM »
Hi again,

unfortunately, fixing the one minute shift at the end of the appointments caused another problem:
Appointments which end at midnight (which logically belongs to the next day) were displayed as multiday-events.
Since there is no mean to display "24:00" o'clock on the old day, I have re-introduced the shift by one second actually,
for appointments ending at midnight (so, they are displayed as ending at 23:59:59) - all other end times are displayed correctly, as in the previous version.
In my opinion this shift of the end to one second before midnight is better than potentially displaying the event for two days (in case the end time is switched off) if it just ends at midnight.

so, the updated version is attached

Martin

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 558
  • Gender: Male
    • meine Homepage
Update: External Calendar (extcal) module
« Reply #2 on: July 22, 2015, 08:52:00 PM »
Hi,

I have another update of the extcal module:
- reoccurring dates starting before 1970 (like birthdays) were not displayed at all (thanks to Alex for reporting)
- in the backend you could comment out ical files or urls, but the web server threw warnings about these lines), this is fixed now
- The two prevoious versions  published were about how to treat entries with their end date at midnight. Should we subtract a second to make them end on the day before or not? There is a checkbox now, which lets you chose how you would like to treat that case.

Martin

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 558
  • Gender: Male
    • meine Homepage
Update: External Calendar (extcal) module
« Reply #3 on: July 29, 2015, 05:03:51 PM »
Hi,

A minor bug fix for the external calendar module:
Whole-day events (like Birthdays), were not displayed anymore on the actual day (because they have already "started" at midnight :-) )
This is fixed in 0.9.1, thanks to Alex for reporting.

Martin

Offline nibz

  • Posts: 683
  • Gender: Male
Re: External Calendar (extcal) module
« Reply #4 on: August 11, 2015, 08:08:42 PM »

Offline Shogun

  • Posts: 2
Re: External Calendar (extcal) module
« Reply #5 on: November 24, 2015, 11:47:05 PM »
I got a problem.

I get:

Parse error: syntax error, unexpected '[' in /home/campegym/public_html/wb/modules/extcal/client.php on line 73

(with nothing set up but Default Settings after install/ same when calDAV-Link is specified)

My fault?

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 558
  • Gender: Male
    • meine Homepage
Re: External Calendar (extcal) module
« Reply #6 on: November 25, 2015, 07:12:06 AM »
Hi Shogun,

Looking at the source it looks a bit like a parse error of one of the entries at the CalDav-URL. Is it a public one which you could share with me (if you prefer via private message)?
On the other hand it should not appear again when you remove the CalDav-URL from the settings. Did you clear the cache afterwards (even though that shouldn't affect the output anymore, once the URL is removed from the settings).
Which version of WB is this, which php version?

kind regards,
Martin

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 558
  • Gender: Male
    • meine Homepage
Re: External Calendar (extcal) module
« Reply #7 on: November 25, 2015, 10:06:43 AM »
correcting myself: I don't quite understand the error message you are seeing... could you verify that line 73 of client php is correct. It shoud read
Code: [Select]
                                $entry=$client->request('GET',$ICS)['body'];
My first thought was that $ICS contains something strange, but "parse error, syntax error, unexpected '[' " indicates that already before processing the content of $ICS, namely, when php hits this line of code, something goes wrong. Maybe you have changed the file by accident?

Martin

Offline Shogun

  • Posts: 2
Re: External Calendar (extcal) module
« Reply #8 on: November 25, 2015, 02:46:45 PM »
Hi there!

I am sorry but i figured it out. Due to the fact that i am the guy the ask when sth doesn´t work i am not really involved in our Website. But you asking me the PHP-Version did the trick... the installed one was to old. Now i am running 5.6.

On the other hand i get a real slow site buildup, but for now i can say i have delivered ;-) - and knowing our Website it is probably our fault.

Thanks for that really fast answer and the hint.

++


Offline Martin Hecht

  • Betatester
  • **
  • Posts: 558
  • Gender: Male
    • meine Homepage
Re: External Calendar (extcal) module
« Reply #9 on: November 25, 2015, 07:08:57 PM »
If the website is slow in general, it might be a problem of the server hardware, or a non-optimized software stack there.

However, if only pages that include the extcal-module build up very slow, that's because it needs to parse the content available at the calendar URLs. If you have disabled the internal cache of the module, re-enable it - that should give you a big boost, especially if you have lots of entries in your calendars.  You might also want to adjust the timing settings of the cache. Try to load the page a second time within the cache time.  It should be much faster, because then the calendar entries are already cached then on the web-server side.

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 558
  • Gender: Male
    • meine Homepage
Update: External Calendar (extcal) module
« Reply #10 on: January 14, 2016, 05:54:15 PM »
Hi,

here an updated version of the External Calendar Module:

- I have added the advanced option to switch off certificate validation in case the remote server uses an ssl certificate which has not been signed by a trusted authority
- another fix allows advanced authentication with a Baikal server (the module sends the user agent as a mitigation for a weakness on the  server side)

Martin

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 558
  • Gender: Male
    • meine Homepage
Update: External Calendar (extcal) module
« Reply #11 on: January 15, 2016, 04:53:19 PM »
I have fixed another minor issue in the way all-day entries are displayed when the date and time placeholders are used directly in the template for the calendar entry (in addition or instead of the {DATE} place holder).
the updated package  is attached

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 558
  • Gender: Male
    • meine Homepage
Update: External Calendar (extcal) module
« Reply #12 on: January 15, 2016, 08:26:59 PM »
since the previous version hasn't yet been downloaded, I'll add another improvement:
This one dosen't overwrite changes you have made to the css file when you upgrade the module.

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 558
  • Gender: Male
    • meine Homepage
Update: External Calendar (extcal) module
« Reply #13 on: January 22, 2016, 10:13:15 AM »
Hi,

here another minor update for the extcal-module:
- StephanLE has reported that appointments lasting several days were not properly displayed when the beginning is a day or more in the past, but the end has not yet been reached.
- I have added the version number of the current package to the header comment of each file which helps me to track changes and versions

kind regards,
Martin

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 558
  • Gender: Male
    • meine Homepage
Update: External Calendar (extcal) module
« Reply #14 on: January 27, 2016, 10:13:05 AM »
Hi,

I have improved the support for authenticated  and/or encrypted connections to the calendar servers. This latest release now supports digest authentication for get-requests as well (provided that the server supports curl - if not there is a fallback to the mechanism used previously).

Thanks to StephanLE for collaboration and for providing his test environment.

Martin

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 558
  • Gender: Male
    • meine Homepage
Update: External Calendar (extcal) module
« Reply #15 on: January 28, 2016, 10:01:52 PM »
here another update for the External Calendar Module:

I have added hooks for user functions to accomplish various adjustments. A few example functions are provided in user_functions.php
- there is one function that filters each entry parsed from the calendar, before any processing is done
- another one is called before the template variables are filled in
- a third one filters each entry just before it is printed out.

Together with the previous changes I think the module has reached a state which deserves the version number 1.0.0 :-)

Martin

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 558
  • Gender: Male
    • meine Homepage
Update: External Calendar (extcal) module
« Reply #16 on: February 02, 2016, 10:15:11 AM »
Here a minor update which contains an improved example for making urls clickable. You need to update the function in user_functions.php manually. The example code is delivered in user_functions.defa ult.php
Another minor fix: when the end time is reached, one entry was displayed too much in the previous version.

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 558
  • Gender: Male
    • meine Homepage
Update: External Calendar (extcal) module
« Reply #17 on: February 03, 2016, 02:03:00 PM »
two small fixes in this version:
- I have added an advanced option that allows to suppress calendar entries that have already ended on the same day. By default the calendar entries vanish at midnight.
- If no entries (not even passed events that have already vanished) are found in any calendar, an error message was displayed in previous versions.

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 558
  • Gender: Male
    • meine Homepage
Update: External Calendar (extcal) module
« Reply #18 on: February 04, 2016, 10:55:36 AM »
The previous version did not account for the time zone setting when evaluating the  start- and endtime of the range in which the appointments shall be displayed.
Here is a fixed version

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 558
  • Gender: Male
    • meine Homepage
Update: External Calendar (extcal) module
« Reply #19 on: February 05, 2016, 03:03:24 PM »
Hi,

I was asked why calendar entries did not disappear immediately after an appointment has passed, even if the according option is unchecked in the advanced options.
One issue for sure was a bug in the previous version (it was simple to fix, just replace a single character in the source - actually I was taking the 12 hour representation instead of 24 hours so in the afternoon we always were 12 hours behind), but that's not the whole story.
That bug is fixed now, but still: What if your server's time zone is a different one than what you are displaying? If time zone shifting works correctly, it should not be a problem, but if the locale environment is broken, or if the server runs UTC time and tells you it would run GMT? Then, you are really screwed and the only solution I can think of is to add an adjustable offset to the server time inside the module. I have added an advanced option for this in the latest version.

Cheers, Martin

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 558
  • Gender: Male
    • meine Homepage
Update: External Calendar (extcal) module
« Reply #20 on: February 11, 2016, 07:47:18 PM »
Hi all,

- I have found that there was a regression in one of the prior releases: Reoccurring events that start before the unix epoch (1.1.1970), e.g. Birthdays which contain the actual date of birth, were not displayed correctly (i.e. the events before 1970 were actually all displayed (instead of the future Birthdays only). I'm not sure since which version introduced this defect, probably 0.9.6 (without having checked this in detail). This is fixed in the current version attached to this post.
- Also there is a pre-filtering now of the events. Those events which are anyway not in the range between the start date and the end date (if configured), do not reach the main loop in which user-functions are called and the final formatting is done.
- User functions can now access the settings of the current extcal section. Since user functions are common to all extcal instances on the WB installation it might be useful to check some settings in the user functions. One example might be the headlines which you might want to have in different formats depending on the formatting of the entries in this section (e.g. with div-tags on one page and with h3-tags on another one, or for some reason you might want to make sure they are not printed out if the template for the calendar entries is empty).

Martin

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 558
  • Gender: Male
    • meine Homepage
Update: External Calendar (extcal) module
« Reply #21 on: March 23, 2016, 11:52:50 AM »
- I have noticed that I had a mistake in the notation of the html special characters with acute-accents. This affected the French and a little bit the Italian language support. I have corrected this in the latest release.
- There is another fix for completely empty calendars - these should be processed silently now. Before there was a php error triggered in this case.
- I have realign the code a bit for better readability

Offline sstvmaster

  • Posts: 8
Re: External Calendar (extcal) module
« Reply #22 on: January 03, 2017, 05:52:42 PM »
Hi Martin,

is it possible to add CATEGORIES? I have a special calendar and there i need this ical field.

Happy new year

maik

Offline Martin Hecht

  • Betatester
  • **
  • Posts: 558
  • Gender: Male
    • meine Homepage
Re: External Calendar (extcal) module
« Reply #23 on: January 04, 2017, 11:35:42 AM »
Hi Maik,

Happy new year to you, too!

is it possible to add CATEGORIES? I have a special calendar and there i need this ical field.

I'll try to add it as a placeholder. The parser that I use doesn't extract this field, but I think it should be possible to access it in the raw data of the ical entry.

Offline sstvmaster

  • Posts: 8
Re: External Calendar (extcal) module
« Reply #24 on: January 04, 2017, 02:12:15 PM »
Hi,

many thanks.

Ich habe noch ein anderes Problem. Ich habe 2 Termine:
1. 27.01.2017, 2200 UTC bis 29.01.2017, 2200 UTC
2. 28.01.2017, 1200, UTC bis 29.01.2017, 1200 UTC

Im Modul wird es aber so angezeigt:
1. Datum: 27.01.2017 - 29.01.2017
    UTC: -
2. Datum: 28.01.2017 - 29.01.2017
    UTC: -

es fehlt also die Uhrzeit.

(english)

I have another problem. I have 2 dates:
1. 27.01.2017, 2200 UTC to 29.01.2017, 2200 UTC
2. 28.01.2017, 1200, UTC to 29.01.2017, 1200 UTC

In the module, however, it is displayed as follows:
1. Date: 27.01.2017 - 29.01.2017
     UTC: -
2. Date: 28.01.2017 - 29.01.2017
     UTC: -

So the time is missing.

mfg

Maik

 

postern-length