Author Topic: jQuery Weekcalendar plugin (deprecated)  (Read 25046 times)

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
jQuery Weekcalendar plugin (deprecated)
« Reply #30 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;
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
jQuery Weekcalendar plugin (deprecated)
« Reply #31 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) ;)
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline Lazlo

  • Full Member
  • ***
  • Posts: 50
jQuery Weekcalendar plugin (deprecated)
« Reply #32 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.

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
jQuery Weekcalendar plugin (deprecated)
« Reply #33 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 :(
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline Lazlo

  • Full Member
  • ***
  • Posts: 50
jQuery Weekcalendar plugin (deprecated)
« Reply #34 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.
« Last Edit: January 29, 2010, 03:16:33 PM by Lazlo »

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
jQuery Weekcalendar plugin (deprecated)
« Reply #35 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.
« Last Edit: January 31, 2010, 12:46:50 AM by rosali »
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline Lazlo

  • Full Member
  • ***
  • Posts: 50
jQuery Weekcalendar plugin (deprecated)
« Reply #36 on: January 30, 2010, 03:34:18 AM »
Thanks, great work rosali.

Offline mmaraghy

  • Jr. Member
  • **
  • Posts: 28
just a couple thoughts
« Reply #37 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.

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
jQuery Weekcalendar plugin (deprecated)
« Reply #38 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).

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)

Offline Lazlo

  • Full Member
  • ***
  • Posts: 50
jQuery Weekcalendar plugin (deprecated)
« Reply #39 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.

Offline lacri

  • Full Member
  • ***
  • Posts: 179
    • http://www.php-lexikon.de
jQuery Weekcalendar plugin (deprecated)
« Reply #40 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
« Last Edit: February 02, 2010, 11:22:31 AM by lacri »

Offline rosali

  • Hero Member
  • *****
  • Posts: 2,533
jQuery Weekcalendar plugin (deprecated)
« Reply #41 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.
Regards,
Rosali
__________________
MyRoundcube Project (commercial)

Offline lacri

  • Full Member
  • ***
  • Posts: 179
    • http://www.php-lexikon.de
jQuery Weekcalendar plugin (deprecated)
« Reply #42 on: February 02, 2010, 11:24:23 AM »
ohhh upload quota exceeded ;)
i have now attached the calendar.js to my original post

Offline lacri

  • Full Member
  • ***
  • Posts: 179
    • http://www.php-lexikon.de
jQuery Weekcalendar plugin (deprecated)
« Reply #43 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.
« Last Edit: February 03, 2010, 10:54:44 AM by lacri »

Offline Scarabaeus

  • Jr. Member
  • **
  • Posts: 13
calendar plugin install - mysql script error
« Reply #44 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,
« Last Edit: February 06, 2010, 06:09:47 PM by Scarabaeus »
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 ]