I've been working on a new module that integrates WebCalendar into Drupal. Its pretty much finished except for help pages etc.

WebCalendar is a great PHP calendar, you can read about all its features here http://webcalendar.sourceforge.net/

There was an old module called bridgewebcal, but its quite old and doesnt work very well (at all?). This new module works differently to the old one (i've reused a little bit of code from the settings page). The new module itself doesnt do a real lot except provide permissions and a way of accessing WebCalendar in Drupal through an iframe. The main part is a 'plugin' sort of file for WebCalendar itself that connects to the Drupal database.

WebCalendar isnt that pretty in its stock form, but you can make it look quite nice with minimal effort.

So if anyone wants to try out this new module, you can get it from here http://infirmus.jumbahost.com/webcal-4.7.0.tar.gz

Let me know about any problems, if it even works for you, and what needs to be improved.
All feedback is appreciated.

Comments

Christefano-oldaccount’s picture

Do you have a demo of this? WebCalendar has a lot of features I want to use (especially the import/export) but I'm unclear how WebCalendar's security and user administration affects the Drupal database.

jaredwiltshire’s picture

No, sorry no demo.

It will not affect the Drupal database in any way except updating the last access time for sessions and users.

The plugin will cause WebCalendar to gets a list of users and their permissions from the Drupal database but stores settings etc in its own database.

User administration in WebCalendar is disabled by the plugin.

[edit] Just to make it clear to everyone:

THIS MODULE HAS NOT BEEN FULLY TESTED.

It is still in early stages. Please do not install it on production servers.

bonobo’s picture

I'm looking forward to testing this out thoroughly --

At the risk of asking a question that will be obvious upon testing/looking at the data structure:

User info (username/pw) is stored in the drupal db, and webcal-specific settings stored in the webcal database? So, if a user changes their pw on the Drupal site, it does not affect their access to webcalendar?

Thanks for this work -- there has been a fair amount of talk on this, but no follow through -- until now!

Cheers,

Bill

-------
http://www.funnymonkey.com
Tools for Teachers

jaredwiltshire’s picture

No, it doesnt matter if the Drupal user changes their password, or even if their username changes.

The Drupal users "uid" is used as their WebCalendar username.

[edit] I hope it works well for you (and everyone else)! I developed it for a site I'm being paid to work on, so I may as well give something back to the Drupal community.

jaredwiltshire’s picture

BTW, it may not even be nessescary to update the last access time. I'm not sure - http://drupal.org/node/87706

jaredwiltshire’s picture

Anyone tried it out yet?

alrs’s picture

I just set it up by pointing it at a webcalendar 1.1.1 installation. Looks OK so far.

Is it going to be a problem to point multiple webcalendar installations at a single drupal database?

jaredwiltshire’s picture

Does it work with 1.1.1? It wasn't developed with 1.1.1 in mind, it was designed around the 1.0.x series (1.0.4 in particular).

No it shouldn't matter how many webcalendar installations use the same Drupal database. Try it and let me know if u run into any problems.

Snarltoof’s picture

It works more or less; doesn't seem to integrate with drupal authentication... also, it would be cool if it could scroll; the page is truncated right at the print preview link, so the other links aren't accessible...

jaredwiltshire’s picture

Administer...Settings...Webcal...Scrolling iframe.

Could you please elaborate more on the "doesn't seem to integrate with drupal authentication". You have to edit some settings (including your Drupal database details) in the user-app-drupal.php for it to work.

Snarltoof’s picture

yeah, that helps, thanks! I'll experiment with logins.

Great work!

alrs’s picture

I have it sort-of working with a fresh webcalendar install where it recognizes the logged-in admin but doesn't recognize logged-in regular users.

My earlier comment that it works "ok" is wrong, though the month-view integrated with my existing webcalendar database it would bomb when trying to view_entry.php

jaredwiltshire’s picture

You have to give the users the "login to webcal" permission.

Could you post the exact details of what happened? e.g. Error messages.

It may require a fresh install of WebCalendar. When changing the authentication over to Drupal an old webcal installation wont have access to users in its own database which could cause the problem you described.

jaredwiltshire’s picture

I was impressed by the announcement about the new default theme for 5.0 and made an updated version of the module that works with 5.0.

You can get it here - removed

jaredwiltshire’s picture

I have created a drupal.org project for this module.

http://drupal.org/project/webcal

You can download the module from there.

edinjapan’s picture

Thank you for this module. I have it up and running in 4.7.4 and am starting to test things. One "wish" that I have is as follows:
I am using the localizer module to do a multilingual site. Webcalendar supports my languages (English and Japanese) and I can successfully see both languages but only by changing my browser preferences. What I would like to do is have the Webcalendar UI language follow the drupal UI language.

While I am not well-versed in php, in looking through the module code, I can't see anywhere that a language is set. Does this mean that the language is totally left up to the preference settings in WebCalendar itself?
If so, do you know of an "easy" hook that might be tapped?

jaredwiltshire’s picture

There is no support for telling WebCalendar what language to use. You can set the language for WebCalendar in the WebCalendar settings (browser defined or specific language).

edinjapan’s picture

Thank you for the response and once again for creating this module.
I understand the settings in WebCalendar itself, but the behavior is not what I would like. For example, my browser is set to English as a preference, but I often view my site in Japanese (via an on-site language switchblock). I would like WebCalendar to switch along with my site UI rather than use the fixed language preference or switch with browser preference. Looking harder at WebCalendar, it looks like this may not be a trivial problem. I'll keep trying though. If I find a way I'll let you know so that you can integrate it in the future.

Codorke’s picture

Nice work ! I'm getting it running now but still have some login issues.
The calendar (on my site) is viewable by everyone and all users should immidiatly see the public calendar
without any login.
I got that working but now i can't login as admin anymore...
Is there a link or something so i can login as admin anyway ?

jaredwiltshire’s picture

Have you set the permissions?

For anonymous users to see the public calendar they have to have the "access webcal" permission.

Are you talking about the default admin user that is created during the installation of WebCalendar? You cannot login as this user when authenticating against Drupal (you may be able to change some values in the webcalendar database so his settings are mapped to a Drupal id though, happy hunting).

golson’s picture

Authentication is not working. Followed installation README instructions for the module, so don't think that's an issue. I've given all drupal user roles all webcal permissions, but still unable to authenticate with anyone. Using:
-- webcalendar 1.0.4
-- php 5.1.6
-- mysql 5.0.18
-- drupal 4.7.4

Thanks,

- Will

-------------------------------------------------------

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\www\drupal\webcalendar\includes\php-dbi.php on line 265

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\www\drupal\webcalendar\includes\php-dbi.php on line 265

Error
Access denied for user 'ODBC'@'localhost' (using password: NO)
SELECT u.uid FROM sessions s, users u WHERE s.sid = 'i06os2kqgkqbna1dacarkmcgl0' AND s.uid=u.uid

jaredwiltshire’s picture

This seems to be a problem with your WebCalendar setup, nothing to do with this module. Check your settings.php file contains the correct database username/password.

golson’s picture

WebCalendar works fine standalone. Changing user_inc to user-app-drupal leads to failure. The two configuration files are below. Do you see any problems? Here's setting.inc:

db_type: mysql
db_host: localhost
db_database: drupal
db_login: drupal
db_password: drupal
db_persistent: true
single_user_login:
readonly: false
use_http_auth: false
single_user: false
user_inc: user-app-drupal.php

and here's user-app-drupal.php:

/************************* Config ***********************************/

// Full URL to Drupal (including http:// or https:// and a trailing slash)
$app_url = 'http://localhost/drupal/';

// Is WebCalendar going to be loaded in an iframe?
$app_in_iframe = true;

// Name of database containing Drupal's tables
$app_db = 'drupal';

// Host that Drupal's db is on
$app_host = 'localhost';

// Login/Password to access Drupal's database
$app_login = 'drupal';
$app_pass = 'drupal';

// Drupal's database prefix
$app_db_prefix = '';

/*************************** End Config *****************************/

jaredwiltshire’s picture

atratus’s picture

I've just posted some tweaking I did to fix my own login problems with Drupal 5.3 and WebCalendar 1.1.6 under issue http://drupal.org/node/176815

What I've done seems very applicable to this issue as well.

bonobo’s picture

As jaredwiltshire says, make sure the username/pw are correct in your settings.php file -- you will also want to make sure that the user specified in your settings.php file has been assigned rights to your database --

Also, while you're at it, make sure you have specified the correct database name --

Cheers,

Bill

-------
http://www.funnymonkey.com
Tools for Teachers

jaredwiltshire’s picture

Please dont report problems/errors/bugs in this forum topic. Please create an issue instead.

acuitas’s picture

I am trying to install Webcal into Drupal. It says to change the settings.php file in the ./includes/settings.php location. Drupal doesn't have one, and neither does Webcal. What are you referring to?

My email address is webmaster@acuitas.com
Thank you for your time.

vm’s picture

drupals settings.php file is in sites/default/

jaredwiltshire’s picture

Both WebCalendar 1.0.x and WebCalendar 1.1.x have a file called settings.php in the includes directory.

[edit] actually I think as a part of the setup process in 1.0.x you have to rename settings.php.orig to settings.php. The instructions supplied with the module are for setting up the Drupal integration, you still have to follow the WebCalendar documentation to setup WebCalendar first.

register’s picture

Everything seems to be working for me, except that the settings in admin >> settings >> webcal don't seem to do anything. If I change the iframe width or start view, it doesn't change the way the calendar is displayed. Also, the calendar doesn't seem to come up in an iframe. When I go to the calendar, my blocks don't show up. As far as I can tell, the rest of it works. I tried installing a database for an existing installation and I could only view them with the module disabled (btw, is there any possible way to add these?)

Thanks for the module, btw.

register’s picture

Is it designed this way or is it supposed to work with clean urls? I ask because I didn't see anything about it not working with clean urls.

P.S. Does the public access account work? When I enable it, I'm unable to choose it as a participant when posting an event. I think I can understand why this is, but is there a workaround to it?

Btw, I'm really enjoying this and just wanna say thank you!

hyperlinked’s picture

Actually, Clean URLs aren't really the problem. If you can't get Webcalendar to appear within your Drupal framework you probably used "webcal" as the name of your Webcalendar install folder.

I'm somewhat of a n00b with Drupal, but I guess it doesn't take a rocket scientist to assume that if there's a conflict between a real path (/drupal/webcal) and a virtual path generated by Clean URLs, the real path will win.

Just rename the install folder to "webcalendar" and make your changes in administer > settings > webcal to reflect the new folder name.

simler’s picture

I had the calendar working fine before I set up clean urls and now... I'm getting a reflection of the drupal site over and over in repeated iframes, ad infinitum in the content area. If I use the ?q=webcal/ url, it displays correctly.

Any ideas? Much appreciated.
-sean

nawaaz_ahmed’s picture

Hi - I think I have followed most of your steps in install.txt.

But when I click the calendar link in the menu I get

'Can't access this file directly!'

What can I be doing wrong?

Thanks!
Nawaaz

offal’s picture

This calendar seems really good, but since I'm fairly inexperienced with drupal and mysql I need some more detailed, step-by-step, drupal-specific instructions on how to install this beauty.
After reading the install.txt I figured out that I also have to download the actual webcalendar from http://webcalendar.sourceforge.net (it didn't mention that in the install.txt). Furthermore it seems like I have to somehow integrate the thing into mysql. How is this done? Could you please point me to some detailed instructions or perhaps expand on the existing installation instructions.

EDIT: Ok, I may have found a how-to at

http://www.k5n.us/dokuwiki/doku.php?id=howto_install_webcalendar_1.1.1_u...

Still, it would be nice for the install.txt to include a few more pointers, especially that the web calendar needs to be installed separately.

Does anyone know of other how-tos that may be helpful here?

qcanoe’s picture

I second offal's comments emphatically! :-)

signal000’s picture

Does anyone has this working fully integrated and can help get it working on Drupal 6 ?