Log on:
Powered by Elgg

ellen davis :: Blog

March 06, 2007

I have uploaded the calendar plugin.  It should work on elgg 0.7.  Note that this plugin needs lots of testing yet.  I would not recommend it for a production site.  Any commments, problems, suggestions for improvements would be most welcome.

 

 

Keywords: calendar, elgg0.7, plugin

Posted by ellen davis | 0 comment(s)

December 29, 2006

From looking at dashboard (mod/adash/add.php), I found add.php displays the form to add data, and when the user clicks submit it is also used to save the data to SQL database.

I used most of the code from the old calendar to display the form.  I did change the way that the date is requested.  Instead of a text field, I now use drop down lists for day, month, year, hour, minute.  This makes it easier for me to code (the textfield data had to be parsed).  

I also found that Active Calendar does not use hour/minutes in its events.  I may have to use something else.  We'll see.

So, the form is now displayed when you are logged on and click Add an Event.   And the data is saved to SQL when hitting submit.

Some error checking is done.  A title is required.  The dates are chekced to be valid (can't choose Feb 31, or date end before date start).  If an error arises, the form is displayed again (with the user's input), with an error message.

 

SQL changes:

  I have dropped use of the CALcalendar table. It had ident and owner fields.  owner matched owner from elggusers.  ident was used a calendar-owner (it matched owner in CALevents).  I am simply using elggusers.owner for owner in events table now.  I'm not sure why it was done this way in the orginial code (written by someone else).   

 The CALevents table has been renamed to calendar_events.  The layout of this table stays the same.

 

Permissions Testing:

 

I wasn't exactly sure how the permissions worked.  So I did a little testing by going to the calendar add page  "http://myhost/elgg-0.672/mod/calendar/add.php?owner=2" when:

  • Not logged in:  Says “You do not have permission to events to this calendar.”
  • Logged in as news: Lets me add a record. (owner=2 access=user1) Should news be able to add this event?  This seems wrong to me.  With access=user1, does this mean that only news would be able to view this event? 
  • Logged in as another user (not news):  Says “You do not have permission to events to this calendar.”
  • Logged in as user2 (owner of calendar):  Lets me add event, as expected.

 

Keywords: calendar

Posted by ellen davis | 0 comment(s)

December 22, 2006

After I read Nathan's comment to my initial Calendar Rwewite posting, it got me to thinking about how I coded the SQL table setup for calendar.

I used the code from dashboard.  It worked great and created the calendar tables when I went to my elgg site.  But, then I got to thinking.  If I had a busy site, and just installed the elgg calendar plugin, then the next person who went to the site would get the Success messages.  This probably would confuse the user.  And the system administrator would miss the chance to see those messages (or error messages).

So I thought, make sure the SQL table code is only run if logged on as news.

if (isloggedin() && user_info("username",$_SESSION['userid']) == 'news') {

This works OK. The tables are created the next time news logs in.

But, there would be a period of time when the Your Calendar tab would show for logged in users, but the tables would not be created yet.  (Your Calendar is defined in calendar_pagesetup in lib.php and the calendar tables are created in calendar_init which also lives in lib.php.  The core elgg runs _init and _pagesetup for all plugins in mod.) This could be small, if the administrator logged in as news right after installing the calendar files to mod.  But again, it seems messy.  The SQL tables should definitely be created first.  Then, the Your Calendar tab should show up.

So, I'm thinking of taking the SQL table creation code out of calendar_init.  And maybe create some special first time initialization only routine.  Maybe something like Nathan's folio_foliosetupdb.php.

So, the process would be to run calendarsetupdb.php first, then place the calendar files in mod.

Am I on the right track? Or is there a way to turn off elgg, except for news while installing a plugin?

 

Keywords: elgg calendar sql

Posted by ellen davis | 1 comment(s)

I;ve decided to attempt to rewrite the calendar plugin.  I'll put a few days work into it and see how it goes.

 I plan to use the Active Calendar class from http://www.micronetwork.de/activecalendar/ to produce the calendars.

 Messages from Ben and Sven on the Elgg Developement list have given me some direction.  Put all the code in mod, and use adash (dashboard) as an example.  Having all the code in one directory should simplify things.

 I'll post my progress here.

Keywords: calendar

Posted by ellen davis | 1 comment(s)

May 03, 2006

This is my first entry.

 I will be testing Elgg for possibly deployment at the college where I work.

 

Posted by ellen davis | 0 comment(s)