Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: Lazlo on January 25, 2010, 08:22:50 AM

Title: jQuery Weekcalendar plugin (deprecated)
Post by: Lazlo on January 25, 2010, 08:22:50 AM
I am writing a jQuery Calendar plugin for Roundcube. It is still alpha.

Some features:
    *  full week calendar
    * add/edit/remove events
    * and more...
    * localization
    * configuration under Settings

For more info and download: RoundCube Calendar (http://rc-calendar.lazlo.me/)

Feedback, translations and feature request are welcome!
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on January 25, 2010, 08:49:54 AM
As mentioned in the Webcalendar thread, nice work.

But please adjust the layout. There is no need to have space on the left hand side and to get a scrollbar. Test it with my wrapper plugin!
Title: jQuery Weekcalendar plugin (deprecated)
Post by: Lazlo on January 25, 2010, 09:01:16 AM
I fixed the scrollbar, check the screenshot (Firefox 3.5).

EDIT: And the calendar is full width now (in BETA release)
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on January 25, 2010, 09:14:17 AM
Thanks, looks fine. Did you update the .zip?
Title: jQuery Weekcalendar plugin (deprecated)
Post by: Lazlo on January 25, 2010, 09:18:40 AM
Not yet, will update it soon.
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on January 25, 2010, 09:21:30 AM
Keep on your hard work. I like this much more than my Webcalendar interface!

What I would need to deprecate Webcalender plugin is:

(*) Import/Export (iCal)
(*) Event reminders (Cron Job)
(*) Implementation of Google Calendar API (not supported by Webcalendar but on my - now stopped - ToDo's)
(*) MiniCal (to implement at bottom of folder list)

Just my 5 cents ;)
Title: jQuery Weekcalendar plugin (deprecated)
Post by: Lazlo on January 25, 2010, 09:36:11 AM
I updated the zips.

I'm working on the import and export of iCalendar files (searching for a good PHP iCal parser lib)

Added the rest to the todo.
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on January 25, 2010, 09:44:35 AM
Perhaps you find something here;

iCal - PHP Classes (http://www.phpclasses.org/search.html?words=iCal&restrict)[0]=C&restrict[1]=R&restrict[2]=B&restrict[3]=V&restrict[4]=D&forums=F&go_search=1&advanced=1

That's my favorit php classes repository!
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on January 25, 2010, 09:44:50 AM
Perhaps you find something here:

http://www.phpclasses.org/search.html?words=iCal&restrict[0]=C&restrict[1]=R&restrict[2]=B&restrict[3]=V&restrict[4]=D&forums=F&go_search=1&advanced=1

That's my favorit php classes repository!
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on January 25, 2010, 10:47:02 AM
#1- You have an error in the mysql.sql script:

CONSTRAINT `user_id_fk_events` FOREIGN KEY (`user_id`)  [replace old stuff with that]

#2- I'm still not satisfied with the positioning ... why this left-hand space of about 200px? Do you plan a navigation bar there?
Title: jQuery Weekcalendar plugin (deprecated)
Post by: Lazlo on January 25, 2010, 10:50:10 AM
Quote from: rosali;24876
#1- You have an error in the mysql.sql script:

CONSTRAINT `user_id_fk_events` FOREIGN KEY (`user_id`)  [replace old stuff with that]

#2- I'm still not satisfied with the positioning ... why this left space of about 200px?


#1 Fixed

#2 There is no left space, which version did you download? Check the screenshot on RoundCube Calendar (http://rc-calendar.lazlo.me/)
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on January 25, 2010, 10:55:09 AM
I've downloaded the current .zip and see:

Code: [Select]

#calendar {
  width: 900px;
  height: 200px;
  margin-top: 40px;
  margin-left: 160px; <---- why that?
}
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on January 25, 2010, 10:57:07 AM
Forget it ... Damned caching issue.

--> Implement no caching headers at your project site as long the site is updated frequently.
--> Add a download script with "time()" as $_GET.
Title: jQuery Weekcalendar plugin (deprecated)
Post by: Lazlo on January 25, 2010, 10:57:53 AM
Mm, refresh your browsercache. My zip says:
#calendar {
  width: 100%;
  margin-top: 40px;

}
Title: jQuery Weekcalendar plugin (deprecated)
Post by: oldschool on January 25, 2010, 11:58:12 AM
Niiiice... will have a try!
Thanx!!!



Rgds.
Title: jQuery Weekcalendar plugin (deprecated)
Post by: Gaia on January 25, 2010, 03:55:23 PM
I seem to be having some issues running the MySQL:

#1005 - Can't create table './roundcube/events.frm' (errno: 150)

I had simply done a copy/paste of the .sql file into the roundcube database via phpMyAdmin.

Anyone else run into this or have any tips for me?

Thanks!
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on January 26, 2010, 08:34:46 AM
@ Gaia: The bundled sql script has an error; see my previous post.
Title: jQuery Weekcalendar plugin (deprecated)
Post by: corbosman on January 26, 2010, 09:04:15 AM
Very cool, thanks for doing this work.
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on January 26, 2010, 03:45:38 PM
I did some work on the plugin:

#1- Updated SQL script
#2- Worked on the localization
  (*) saved files UTF-8 encoded
  (*) nearly completed (see below)
#3- Styled the modal dialog box
#4- Improved settings by using select boxes (I had to rename date_formats because there was a conflict with my moreuserinfo plugin)

_____________
Remaining:

#1- I'm too stupid to find a way to localize modal dialog buttons cancel|delete|save when adding/editing an event.
#2- css does not play nice with IE7
#3- public $task = 'mail|settings'; should be removed -> blocks navigation to cal from addressbook
Title: jQuery Weekcalendar plugin (deprecated)
Post by: corbosman on January 26, 2010, 03:50:37 PM
Have a look at my compose_address plugin, it's got a localized modal window.
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on January 26, 2010, 04:09:08 PM
Cor or Lazlo,

could you please take this job? I'm not good on jquery etc. ... I'll start to code the switch_calendar plugin ...
Title: jQuery Weekcalendar plugin (deprecated)
Post by: corbosman on January 26, 2010, 05:56:29 PM
Im heading for a diving expedition to Dominica (sperm whales) tomorrow, but i'll be back in a week. I'll check the discussion and see how its going :)
Title: jQuery Weekcalendar plugin (deprecated)
Post by: Lazlo on January 27, 2010, 02:49:17 PM
I created a subversion repository to simplify things.

PM your GitHub username to gain commit access.

(http://github.com/LazloNL/roundcube-calendar/)
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on January 27, 2010, 03:43:44 PM
Lazlo,

I have solved all things. It is your plugin. But to avoid wasting time I suggest to wait 2-3 day until I come up with my stuff ... Currently I'm implementing a datepicker to navigate weeks picked up by date (creating far in future events is a pain currently ...).

Localization etc. is completed. I had to take care to remove/recode stuff which conflicts with other favorit plugins like keyboard_shortcuts which use also jquery dialog ...

The code project is a good idea. Wait and decide if you agree with my modifications. Then we should decide which version is the starting point for a release candidate ;)

The Roundcube community was waiting for this plugin ... and it should be a runner!
Title: jQuery Weekcalendar plugin (deprecated)
Post by: Lazlo on January 27, 2010, 03:50:18 PM
I will wait, I have some exams coming so I will not be working on the plugin this week.

BTW, it is not my plugin, it is Open Source. That makes it ours. :P
Title: jQuery Weekcalendar plugin (deprecated)
Post by: Erendur on January 28, 2010, 06:06:21 PM
Hello,

first nice new calender plugin. One of the features I really miss on the TODO-List is the month view and day view. Fullcalendar(JQuery) (http://arshaw.com/fullcalendar/) supports already these features. Maybe it is easier to use this version as the jquery week calendar where "month" and "day" view must be implemented. Fullcalendar also provides a google calender extension (http://arshaw.com/fullcalendar/docs/google_calendar/).

Another needed feature is the synchronisation between Thunderbird/Sunbird iCal calender application. Maybe it can be included with the import/export iCal feature.
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on January 29, 2010, 09:16:30 AM
@ Erendur
I agree. But let us first finish the weekcalendar. In most parts this will be a good framework for the full calendar.

@ Lazlo
Are you interested in coding the framework for fullcalendar? It looks like you are much better than me when it comes to jquery! I would contribute your framework like I did with weekcalendar.

I have finished my work on your calendar plugin and will upload the result today evening.

Major changes:
#1 Renamed it to weekcalendar (avoid conflicts with fullcalendar later).
#2 Save events in Database in GMT time and consider Roundcube Timezone settings when returning events to client (your way caused problems when client and server are in different timezones).
#3 Datepicker to make navigation into weeks far in future easier.
#4 Separated jquery stuff into a new plugin "jquery" (Reason: I use jquery-ui in serveral other plugins. To have the stuff centralized makes maintenance easier).
#5 Finished localization

Still missing:
#1 A basic print feature
#2 A message while weekcalendar is loading

I don't think we should add more features and spend our time for coding on fullcalendar.

You can check my results at RoundCube Webmail :: Welcome to RoundCube Webmail (http://mail4us.net) (Notice: The duplicate Calendar icon will disappear as soon I've coded the calendar switch plugin).

I think it is a release candidate now.
Title: jQuery Weekcalendar plugin (deprecated)
Post by: Lazlo on January 29, 2010, 11:07:06 AM
The fullcalendar is in basic the same jQuery script. I will replace the weekCalendar with the fullcalendar.

The datepicker doesn't work for me, if you select a day it works, but if you change month or year nothing happens.
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on January 29, 2010, 11:54:08 AM
I think this is the intended datepicker behavior. First change month/year and then select a day. This should navigate to the week where the day is. Doesn't it?
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on January 29, 2010, 12:51:02 PM
Please find attached the current development version. Please don't miss to register "jquery" plugin.

If you going to implement fullcalendar just search files for "weekcalendar" and replace with "fullcalendar".

I need opions for timezone handling:

#1 - The database is GMT - that's ok
#2 - If Roundcube timezone is not "auto" then js timezone and Roundcube timezone are different
#3- If Roundcube offset is -5 and a user adds an event 12:00 the event is created at 7:00 - technically ok but could be confusing.
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on January 29, 2010, 01:09:26 PM
solved

use that:
Code: [Select]

  function get_events()
  {
    $rcmail = rcmail::get_instance();

    $tz = isset($_SESSION['timezone']) ? $_SESSION['timezone'] : date('Z')/3600;
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on January 29, 2010, 01:23:52 PM
I've noticed a bug:

#1- First view of weekcalendar
#2- Edit event -> times are not selected (0:00 start)
#3- Add a new event
#4- Edit event -> times selection is ok

I'll stop working on it now and wait for your feedback (mailto myroundcube at mail4us.net) ;)
Title: jQuery Weekcalendar plugin (deprecated)
Post by: Lazlo on January 29, 2010, 01:31:43 PM
Do you have a diff of the changes? Otherwise I have to rename everything.

Don't see the point of moving jquery weekCalendar into the jQuery plugin since it is online used bij the calendar, jquery-ui could be used by other plugins.

That bug doesn't exist in the previous version.
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on January 29, 2010, 02:55:24 PM
No, I don't have a diff. IMO, things like "plugin.new_event" shouldn't be used. They may conflict with other plugins.

Move those two files belonging to weekcalendar back if you prefer it. My point of view was to have all jquery third party stuff in the jquery plugin. Shoudn't we use "fullcalender"?

Regarding the event update bug ... where the hell I've introduced it :(
Title: jQuery Weekcalendar plugin (deprecated)
Post by: Lazlo on January 29, 2010, 03:12:00 PM
I received a patch to abstract all the backoffice related stuff to a backend. That makes it less complicated to add support to other backends than a database.

I really prefer diffs because I get patches from everywhere and otherwise I can't merge them.
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on January 30, 2010, 02:04:45 AM
OK, I make diffs in future.

I have fixed the "edit event" bug. For some odd reason I have a gap of 10 milliseconds between startTime.getTime() and calEvent.start.getTime().

This problem exists in your beta version too ( IE7 / 8 ).

Fix calendar.js
Code: [Select]

   function setupStartAndEndTimeFields($startTimeField, $endTimeField, calEvent, timeslotTimes) {

      for (var i = 0; i < timeslotTimes.length; i++) {
         var startTime = timeslotTimes[i].start;
         var endTime = timeslotTimes[i].end;
         var startSelected = &quot;&quot;;
         
         //alert(abs(startTime.getTime() - calEvent.start.getTime()))
                         
         if (Math.abs(startTime.getTime() - calEvent.start.getTime()) < 1000) { // 1 second tolerance
            startSelected = &quot;selected=\&quot;selected\&quot;&quot;;
         }
         var endSelected = &quot;&quot;;
         if (Math.abs(endTime.getTime() - calEvent.end.getTime()) < 1000) { // 1 second tolerance
            endSelected = &quot;selected=\&quot;selected\&quot;&quot;;
         }
         $startTimeField.append(&quot;<option value=\&quot;&quot; + startTime + &quot;\&quot; &quot; + startSelected + &quot;>&quot; + timeslotTimes[i].startFormatted + &quot;</option>&quot;);
         $endTimeField.append(&quot;<option value=\&quot;&quot; + endTime + &quot;\&quot; &quot; + endSelected + &quot;>&quot; + timeslotTimes[i].endFormatted + &quot;</option>&quot;);

      }
      $endTimeOptions = $endTimeField.find(&quot;option&quot;);
      $startTimeField.trigger(&quot;change&quot;);
   }



I attach a .zip of the plugin (weekcalendar is reverted to calendar) and a patch against your beta.
Title: jQuery Weekcalendar plugin (deprecated)
Post by: Lazlo on January 30, 2010, 03:34:18 AM
Thanks, great work rosali.
Title: just a couple thoughts
Post by: mmaraghy on January 30, 2010, 02:10:56 PM
Lazo & Rosali - great work and glad to see the cooperation.

I think the full calendar implementation would be great!

Some features that would be nice with the full calendar implementation:
  1.  year change (for future dates while still in month view)
  2.  recurring events (for birthdays, etc)
  3.  expanded event data (title, location, description, tags, categories, etc)
  4.  shared and multiple calendars
  5.  event search

Just thinking out loud. Keep up the good work.
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on January 31, 2010, 08:28:17 AM
Great thoughts ... but recurring events have to be implemented by fullcalendar develolper. I don't see a way to implement it by the plugin interface. Do you see a way, Lazlo?

Year change could be done, IMO (FullCalendar Documentation - gotoDate (http://arshaw.com/fullcalendar/docs/current_date/gotoDate/)).

I'm not sure about expanded event data ... I think that's also a todo for fullcalendar devs.

A search feature and shared/multiple calendars could be implemented. But be patient. First of all the framework has to be coded and Lazlo stated this will take some time ...
Title: jQuery Weekcalendar plugin (deprecated)
Post by: Lazlo on February 01, 2010, 07:38:41 AM
Quote from: rosali;25042
Great thoughts ... but recurring events have to be implemented by fullcalendar develolper. I don't see a way to implement it by the plugin interface. Do you see a way, Lazlo?


It is possible and on the TODO list but there are other things with a higher priority.
Because a recurring event has a starting date and is a daily/weekly/monthly or yearly event (following RFC 5545) you can loop through all the recurring events and check if it is exactly a number of days/weeks/monts/years later than the start time.
Title: jQuery Weekcalendar plugin (deprecated)
Post by: lacri on February 02, 2010, 09:23:26 AM
many thanks rosali and lazlo
i have fix some little issues with scrollbar and update events
here is my modified calendar.js

one issue is since RC 3226 RC using jquery 1.4 with jquery 1.4 drag and drop and resizing events dont work.

my workaround search in rcube_template.php to
$this->include_script('jquery-1.4.min.js');and replace with
if($task == 'dummy')
            $this->include_script('jquery-1.3.min.js');
        else
            $this->include_script('jquery-1.4.min.js');you need for this jquery-1.3.min.js
i cant fix this in jquery 1.4 im not a javascript expert

i hope this help a little bit
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on February 02, 2010, 09:28:36 AM
Lacri, I don't see your modified calendar.js ... Very good that you pointed out the jquery version issue. I was just digging around why drag/drop resizing stopped working.
Title: jQuery Weekcalendar plugin (deprecated)
Post by: lacri on February 02, 2010, 11:24:23 AM
ohhh upload quota exceeded ;)
i have now attached the calendar.js to my original post
Title: jQuery Weekcalendar plugin (deprecated)
Post by: lacri on February 03, 2010, 10:52:24 AM
@lazlo and rosali here is a little patch to fix some little issues with updating events resizing and drag and drop and two little display issues with scrollbar and timeslot size.
Title: calendar plugin install - mysql script error
Post by: Scarabaeus on February 06, 2010, 06:03:30 PM
when trying to execute the mysql script for the 'calendar' plug in, this portion of the script
Code: [Select]
ALTER TABLE `events`
  ADD CONSTRAINT `events_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE;
produces this error
Code: [Select]
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ADD CONSTRAINT `events_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user' at line 1This is on MySQL 5.1.9-2. I have checked the manual and I don't see the problem. But then I don't talk MySQL (just a user).
I cut/paste from the script file provided, into Phpmyadmin.
I also entered it from a command line with the same results.

Does anyone see the syntax error?

Thanks,
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on February 07, 2010, 01:45:35 AM
Issue 44 - myroundcube - Can't create MySQL Table - Project Hosting on Google Code (http://code.google.com/p/myroundcube/issues/detail?id=44)
Title: jQuery Weekcalendar plugin (deprecated)
Post by: Lazlo on February 07, 2010, 05:52:58 AM
MySQL bug: MySQL Bugs: #46293: Conditional comments not working in FOREIGN KEY definition (http://bugs.mysql.com/bug.php?id=46293)
Title: jQuery Weekcalendar plugin (deprecated)
Post by: bagu on February 07, 2010, 08:18:33 AM
Do you think that a google calendar sync is possible ?

Because if it's possible and made, with extended contact and group in adress book...Many people (me include) have no benefit to keep microsoft outlook.

EDIt : i just see it on todo list. Great...I will work on french localization

Code: [Select]
$labels = array();
$labels['calendar'] = 'Calendrier';
$labels['24_hour'] = 'Utiliser le format 24 heures';
$labels['timeslots'] = 'Intervalle de temps par heure';
$labels['time_seperator'] = 'à';
$labels['date_format'] = 'Format de la date';

In utf-8 because if not, you must replace :
Code: [Select]
$labels['time_seperator'] = 'à';
by
Code: [Select]
$labels['time_seperator'] = 'à';
But there is missing translation in files because when creatinf event, everything is in english and there is no translation available for it.
Title: calendar plugin install - mysql script error
Post by: Scarabaeus on February 07, 2010, 10:24:59 AM
Appreciate the assistance.
Again, I'm not fluent in MySQL. So while your links may reveal something obvious to others, I am having difficulty piecing it together.

@ Lazlo -
I am having a difficult time understanding how your link applies to my problem. If it has to do with the use of comments as described in the link; I don't have any comments in my command line that is producing the error.
Or are you implying that the 'CONSTRAINT' should be part of the 'CREATE' command and not have the 'ALTER TABLE' command?

@ rosali -
While I realize your link references a problem with 'google_contacts', I'm trying to see how the 'fix' in that link is different syntactically from what I have in my "ALTER TABLE' statement. From what is mention in the link, what I have IS the fix and shouldn't produce the error I have been getting.

OR it may be something else, in both cases, that I'm blind too.

Again, thanks for the help.
Title: jQuery Weekcalendar plugin (deprecated)
Post by: Lazlo on February 07, 2010, 04:49:18 PM
Quote from: bagu;25275
Do you think that a google calendar sync is possible ?


I will release a new version in a couple of weeks based on jQuery fullcalendar which has GCal support. It also has a new backend structure which makes it possible to write a backend for the Google Calendar API.
Title: jQuery Weekcalendar plugin (deprecated)
Post by: bagu on February 07, 2010, 04:50:29 PM
I can't wait ^^

If there is more locales, i will translate it.
Title: jQuery Weekcalendar plugin (deprecated)
Post by: batemice on February 07, 2010, 08:46:35 PM
Am I on the right way?

Code: [Select]
CREATE TABLE `events` (
  `event_id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `user_id` int(10) UNSIGNED NOT NULL DEFAULT '0',
`user_id_fk_contacts` int(10) unsigned NOT NULL,
  `start` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
  `end` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
  `title` text NOT NULL,
  PRIMARY KEY(`event_id`),
KEY(`user_id_fk_contacts`),
  CONSTRAINT FOREIGN KEY (`user_id`)
    REFERENCES `users`(`user_id`)
   
)
Title: calendar plugin install - mysql script error
Post by: Scarabaeus on February 07, 2010, 09:42:49 PM
Well, that executed without an error!
Let's just hope it accomplished the original goal.

Great first post!!

Really appreciate the help.
Thanks,
Scarabaeus
Title: jQuery Weekcalendar plugin (deprecated)
Post by: rosali on May 28, 2010, 05:24:40 AM
This thread holds post moved from http://www.roundcubeforum.net/7-third-party-contributions/46-api-based-plugins/6161-roundcube-calendar-jquery-calendar.html.

The original thread was rather crowdy. Free different plugins were discussed:

(*) jQuery Weekcalendar plugin (deprecated)
(*) jQuery Fullcalendar plugin (developed by Lazlo)
(*) jQuery Fullcalendar myroundcube plugin (based on Lazlo initial version and forked by rosali)

Now this thread is for weekcalendar only.