Roundcube Community Forum

 

jQuery Fullcalendar plugin (forked by rosali)

Started by horfic, March 07, 2010, 07:39:25 PM

Previous topic - Next topic

christias

Would it be possible to have a functionality like the one in:

  http://arshaw.com/js/fullcalendar/demos/selectable.html

Selecting a range of days or hours and creating a new event?

Regards,
Panagiotis

rosali

It should not be too hard to implement it. I'll put it on my Todo's.
Regards,
Rosali

chutz

#242
Hi, the new version fixes the problems I was having, it seems to be working much better. I was getting some errors in the logs like this when trying to add events:

Quote[Fri Feb 18 10:38:32 2011] [error] [client XXX.XXX.XXX.XXX] PHP Fatal error:  Call to a member function get() on a non-object in htdocs/roundcubemail-0.5.1/plugins/calendar/program/backend/database.php on line 74, referer: https://webmail/roundcube/?_task=dummy&_action=plugin.calendar

and like this when loading the ICS from Thunderbird

Quote[Fri Feb 18 11:14:07 2011] [error] [client XXX.XXX.XXX.XXX] PHP Notice:  Use of undefined constant RCMAIL_VERSION - assumed 'RCMAIL_VERSION' in htdocs/roundcubemail-0.5.1/config/main.inc.php on line 261

I managed to fix both the errors with trivial one-line changes, here is a patch:

diff -ubr calendar.orig/program/backend/database.php calendar/program/backend/database.php
--- calendar.orig/program/backend/database.php 2011-02-18 11:19:11.499822158 -0500
+++ calendar/program/backend/database.php 2011-02-18 11:19:34.958960153 -0500
@@ -71,7 +71,7 @@
             $user = $account['username'];
           }
           if(!strstr($user,'@'))
-            $user = $user . '@' . $rcmail->config->get('mail_domain');
+            $user = $user . '@' . $rcmail->config->mail_domain;
           $this->username = $user;
         }
         $uid = $id . "@" . $user;
diff -ubr /root/calendar/program/tbclient.php calendar/program/tbclient.php
--- calendar.orig/program/tbclient.php 2011-02-18 11:19:11.519821424 -0500
+++ calendar/program/tbclient.php 2011-02-18 11:19:34.978959419 -0500
@@ -19,6 +19,8 @@
   //dummy
 }
 
+define('RCMAIL_VERSION', 'dummy');
+
 include '../../../config/main.inc.php';
 
 function rcube_https_check($port=null, $use_https=true) {

rosali

Thanks! But the patch is wrong.

It must be:

+            $user = $user . '@' . $this->rcmail->config->get('mail_domain');
Regards,
Rosali

chutz

Thanks for the correction, I have fixed the code on my server.

This may be a browser issue, but the calendar doesn't work in the latest chromium beta (10.0.648.114) , when you try to load the calendar the screen is greyed out and stays that way indefinitely.

rosali

Works for me with latest chromium beta (11.0.672.2).
Regards,
Rosali

tenya

Quote from: chutz;33488but the calendar doesn't work in the latest chromium beta (10.0.648.114) , when you try to load the calendar the screen is greyed out and stays that way indefinitely.

same.... the calendar screen is greyed out, tested by Safari 5 for Mac, Firefox 3.6 for Mac, etc. (rc0.5.1+jqueryui plugin 1.8.6+Jquery Calendar plugin 2.8).

The browser's javascript error log was:

   arr[0].getTime is not a function in [path to roundcube]/plugins/calendar/program/js/calendar.jsonfeeds.js

'arr' must be an array of date objects but was null indeed. Perhaps function 'DstDetect()' in timezone.js is not working properly. Any idea?

weathermon

Hi tenya, yeah I have the same issue with it - I originally installed the Debian release for squeeze however it was out of date (v0.3) so installed v0.5 and still have the same issues with the calendar. jqueryui is the first plugin loaded followed by calendar. I'm using the bundle plugin pack. IE shows a different error to FF:


Message: Object doesn't support this property or method
Line: 11
Char: 4
Code: 0
URI: http://webmail.blah.com/plugins/calendar/program/js/calendar.jsonfeeds.js?s=1298886708

I've totally trashed and re-installed RC without success. It definitely seems like the dates aren't getting passed to the array?

rosali

Could you please help to debug it?

calendar.jsonfeeds.js:
options = options || {};
return function(start, end, callback) {
alert(typeof start)
 var arr = DstDetect(start);
alert(typeof arr[0]);

What do the 'alerts' report?
Regards,
Rosali

tenya

rosali, many thanks for your help. The 1st alert (typeof start) returned 'object', but the script was terminated before reaching at the second alert (typeof arr[0]) because "var arr = DstDetect(start);" induced the following error:

   dtDstStart is not defined in [path to calendar plugin]/program/js/timezone.js

I briefly checked function `DstDetect()' in timezone.js, and found condition 'if((dtDstDetect.getTimezoneOffset() * (-1)) == intOffset && dtDstStartHold != '')' in line 48 was not satisfied, which resulted in null dtDstStart and dtDstEnd.

Indeed if I move the following two lines:
   50: dtDstStart = new Date(dtDstStartHold);
51: dtDstEnd = new Date(dtDstDetect);
out of the "if" block in line 48 (dtDstStart and dtDstEnd are certainly set to Date objects), it worked without any error.

So please re-check whether the condition in line 48 of timezone.js is correct or not.

Thanks in advance.

rosali

Could you please post in which timezone you are?
Regards,
Rosali

tenya

#251
rosali, I'm in Japan (TZ=JST-9), and "new Date().getTimezoneOffset();" and function "TimezoneDetect(mydate)" in timezone.js returned -540 and 540, respectively.

Cheers, Tenya

rosali

I'm able to reproduce the issue. Could you please tell when daylight saving time starts/end in Tokio?
Regards,
Rosali

rosali

#253
I see, there is no daylight saving time in Tokyo ... I missed this situation!

Attached is a quick fix for calendar.jsonfeeds.js.
Regards,
Rosali

tenya

Quote from: rosali;33557I'm able to reproduce the issue. Could you please tell when daylight saving time starts/end in Tokio?

Thanks, but now we do not have DST in Japan. It would be great if you could add some options regarding DST settings (auto or neglect) in the preference.

Daylight saving time around the world - Wikipedia, the free encyclopedia

Cheers, Tenya