Roundcube Community Forum

 

RoundCube Calendar (jQuery Calendar)

Started by Lazlo, February 08, 2010, 08:42:23 AM

Previous topic - Next topic

hantu

Hi

I cannot figure out what went wrong when installing calendar plugin into roundcubemail-0.2.1

My OS
Centos 5.3
package used is iRedMail-0.5.1 released


here are my steps, anything missing?


Step1
I extracted the calender plugin into /var/www/roundcubemail/plugins/calendar

Step2
I updated mysql

mysql> use database roundcubemail;
mysql>  source /var/www/roundcubemail-0.2.1/plugins/calendar/SQL/mysql.sql
mysql> show tables;


Step3
I also added the following line for /var/www/roundcubemail/config/main.inc.php

$rcmail_config['plugins'] = array(
  "calendar"
  );

Step4
I restart Apache services

Note:
I also enable /var/www/roundcubemail/plugins/calendar/config/config.inc.php Should I do that?

In /var/www/roundcubemail/plugins/calendar/config/config.inc.php
// backend type (database)
$rcmail_config['backend'] = "database";

Should I change my database address?

Thanks
Lee

lacri

hi hantu,

you need min roundcube 0.3 stable

roundcube 0.2.1 dont support plugins

the plugin api comes with roundcube 0.3.

i think roundcube 0.3.1 or the current svn version is better for jQuery Calendar.

best lacri

voltron81

Hi guys,
I'm running roundcube 0.3.1 and I've installed the last version of this great plugin.

-I've put the folder in the /plugins folder
-I've added the SQL file (mysql -u roundcube -p roundcubemail < SQL/mysql.sql)
-I've edited the file /roundcube/plugins/calendar/config.inc.php, adding the name of the roundcube database and username and password
-I've renamed the file /roundcube/plugins/calendar/config/config.inc.php.dist to config.inc.php (I don't think I've to edit that file)

Now I'm entering in the webmail, I can see the Calendar, I can read the example events, but if I try to add a new one, it's just not memorized...
In can see that the events table in the database is empty...

Am I wrong in something?
Thanks

Michele

voltron81

Sorry, my bad...

I edited the file /roundcube/plugins/calendar/config/config.inc.php, putting database instead of dummy and now it's working fine...

thanks a lot, great job

Michele

v2mody

hi ,
i have used old version of that calendar before ,

however yesterday i tried the latest version , it didn't work untill i add this line from the old config file to the new one
$rcmail_config['use_calendar'] = 'calendar';
it was not exist in the new config file like the old one ??? odd
if i didn't add this line , i can't see the calendar icon on roundcube

just small comments on the new version
before if i select a meeting , there was a start and end date above
now only start date , can i possibly use the old method of showing for example 6-8 meeting instead of only starting date ?/

brashquido

Thanks for the tip v2mody. adding that line worked for me on a 0.3.1 install using beta 2 of Calendar.

strictlydata

Hi,

I am having an issue that the current skin is not being selected. It is always choosing the default skin.

Is there a bug?

Thanks

strictlydata

This seems to have fixed the issue!

zeta67


poyo77

Hello,
I'm French, so I speak a poor english... Sorry.

I've got a CalDav server (Davical) with many users in it...

How to configure calendar plugin to access all User's calendar?

Note: Calendar plugin works so fine with one user.

thanks for your help.

Poyo77

tjm74

Quote from: rosali;25008solved

use that:

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

    $tz = isset($_SESSION['timezone']) ? $_SESSION['timezone'] : date('Z')/3600;

mmm, not quite.  This shifts all events that are not in the current timezone off by one hour -- so if it's july (during daylight saving time) and you're looking back at what happened in january (during which we observed standard time), or vice versa, events look fine in your current month but they are off by an hour during the months where the other tz was observed.

I have a fix, it's not pretty but it works better.  I even try to determine whether DST is not observed where you are (or at least, where the server is, which is usually a good indication).

1. fix toGMT


  function toGMT($time) {
    $gmt_offset = date('Z');

    // current gmt offset may not match event's gmt offset
    // adjust accordingly
    if (date('I') && !date('I',$time)) {
      $gmt_offset -= 3600;
    } else if (!date('I') && date('I',$time)) {
      $gmt_offset += 3600;
    }

    return date('Y-m-d H:i:s',$time - $gmt_offset);
  }


2. fix getEvents (in database.php)

  public function getEvents($start, $end) {
    if (!empty($this->rcmail->user->ID)) {

      /* This was completely wrong -- the question is whether to adjust
         the EVENT's time for DST.
         Whether we are CURRENTLY observing DST is not really the issue.
         The question is (A) does the user observe DST? and if so,
         (B) does THIS EVENT fall on the calendar during DST or STD time?
      */

      if ($this->rcmail->config->get('timezone') === "auto") {
        $auto = TRUE;
        $tz = isset($_SESSION['timezone']) ? $_SESSION['timezone'] : date('Z')/3600;
      } else {
        $auto = FALSE;
        $tz = $this->rcmail->config->get('timezone');
        if($this->rcmail->config->get('dst_active')) {
          $dst_active = TRUE;
          $tz++;
        }
      }

      if (date('I') || (!$auto && $dst_active)) {
        $tz_std = $tz - 1;
        $tz_dst = $tz;
      } else {
        $tz_std = $tz;
        $tz_dst = $tz + 1;
      }

      // Server does not observe DST?  Then most likely the user doesn't either.
      if (($auto || !$dst_active) && !date('I',mktime(0,0,0,7,1,2010))) {
        // no DST adjustment
        $tz_std = $tz;
        $tz_dst = $tz;
      }

      $result = $this->rcmail->db->query(
        "SELECT * FROM events
         WHERE user_id=?",
         $this->rcmail->user->ID
       );

      $events = array();
      while ($result && ($event = $this->rcmail->db->fetch_assoc($result))) {
        $event['start'] = strtotime($event['start']);
        $event['end'] = strtotime($event['end']);

        // is/was the EVENT during daylight saving time?
        if (date('I',$event['start'] + $tz * 3600)) {
          $event['start'] += $tz_dst * 3600;
          $event['end'] += $tz_dst * 3600;
        } else {
          $event['start'] += $tz_std * 3600;
          $event['end'] += $tz_std * 3600;
        }

        $events[]=array(
          'id'    => $event['event_id'],
          'start' => date('c', $event['start']),
          'end'   => date('c', $event['end']),
          'title' => $event['summary'],
          'description'  => $event['description'],
          'className'  => $event['category'],
          'allDay'=> ($event['all_day'] == 1)?true:false,
        );
      }

      return json_encode($events);
    }
  }


rosali

Hmmm... works for me. Which browser?
Regards,
Rosali

katie

Quote from: Blueyed1;27098Hi Katie

Did you ever get it to work?? RC with calendar on postgresSQL ?

/Blueyed1

No.

Makes no sense to hack around at this state.

Any Ideas?

Blueyed1

#73
Quote from: katie;27206No.

Makes no sense to hack around at this state.

Any Ideas?

It's a pitty that it dosn't work with postgreSQL... I managed to get some tables in the postgreSQL db and I can see/edit them with phpPgAdmin. But I don't know if the tables are correct or what else I need to do. Look at screenshots below.









/Blueyed1

SKaero

Assuming the database is setup correctly you would need to edit the sql querys that are going to the database that are in the main plugin file.