Roundcube Community Forum

 

jQuery Weekcalendar plugin (deprecated)

Started by Lazlo, January 25, 2010, 08:22:50 AM

Previous topic - Next topic

rosali

solved

use that:

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

    $tz = isset($_SESSION['timezone']) ? $_SESSION['timezone'] : date('Z')/3600;
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

rosali

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) ;)
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Lazlo

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.

rosali

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 :(
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Lazlo

#34
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.

rosali

#35
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

   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.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Lazlo


mmaraghy

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.

rosali

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).

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 ...
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Lazlo

Quote from: rosali;25042Great 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.

lacri

#40
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

rosali

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.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

lacri

ohhh upload quota exceeded ;)
i have now attached the calendar.js to my original post

lacri

#43
@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.

Scarabaeus

#44
when trying to execute the mysql script for the 'calendar' plug in, this portion of the script
ALTER TABLE `events`
  ADD CONSTRAINT `events_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE;
produces this error
#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,
hMailServer 5.3.3 - Build 1879 | ClamAV 0.96.5 (tBB) | SpamAssassin 3.2.3.5
AfterLogic Webmail Pro 6.3.10 | RoundCube 0.7.1
WampServer 2.0i - [ Apache 2.2.11 | MySQL 5.1.36 | PHP 5.3.0 ]