[Register]
Powered by Elgg

Plugins :: Blog :: calendar plugin

March 06, 2007

I have just uploaded a new version of the calendar plugin.  It is still very much a development version. This version works with elgg 0.7.

Suggestions or comments for improvement can be sent to the list.

 

Keywords: calendar, plugin

Posted by ellen davis @ Plugins


Comments

  1. Excellent, I look forward to trying it out a bit later. Cheers.

    user iconDavid Tosh on Tuesday, 06 March 2007, 16:38 UTC # |

  2. what does it do (in terms of groups) - meaning: can a calendar be set for all to see (like a master community calendar that people can add to displayed perhaps on a home page)...or is there a demo running someplace that we could look at? (or screenshots perhaps if no demo)?


    user icondaveinboston on Tuesday, 06 March 2007, 17:48 UTC # |

  3. I don't have a demo site avialable.  Here is a screenshot of the monthly view.

    http://elgg.net/edavis/files/-1/16305/calendar-01.png

    Each user and each community has a calendar.  Each event has access restrictions placed on it - private, public, loggedin, community, group

     

    user iconellen davis on Tuesday, 06 March 2007, 18:26 UTC # |

  4. Also, when you am logged in and looking at you calendar , you will get two links -

    My Community Events - displays a monthly calendar of the events (which I have access) for all the communities to which I belong

    My Friends Events -  displays a monthly calendar of the events (which I have access) for all of my friends 

     

    user iconellen davis on Tuesday, 06 March 2007, 18:31 UTC # |

  5. very nice - i'm looking at putting up an elgg site for a local school (mostly parents) and this is absolutely perfect for what they'd need (e.g. "class breakfast on thursday" etc..)

    user icondaveinboston on Tuesday, 06 March 2007, 19:09 UTC # |

  6. Thank you for this great MOD.

    I do get following error after installing it with your instructions

    Warning: Missing argument 4 for calendar_get_events() in /var/www/vhosts/amosnet.de/httpdocs/friends/mod/calendar/actions.php on line 194

    Any ideas? 

    user iconAmos Struck on Tuesday, 06 March 2007, 21:31 UTC # |

  7. Hmmm.   Try  setting $field4 = '0' in line 194 in mod/calendar/actions.php.

     

    What version of PHP are you using?

    user iconellen davis on Wednesday, 07 March 2007, 14:43 UTC # |

  8. Here it also complains about missing argument 3 for calendar_event_create() called at line 109 of add.php. Adding $event_id as 3rd argument on that line fixes the issue.

    The fix you suggested worked well for the other problem, thanks! I'm using php5 on an ubuntu box.

    By the way, great plugin! 

    user iconRenato on Thursday, 08 March 2007, 04:05 UTC # |

  9. I'm translating the plugin to portuguese and noted some problems:

    • the function to check if the end time is later than the start time compares $calendar_input->start(end)_amorpm =='PM', but the case is 'pm'. It's near line 360 of actions.php
    • the access text (public, private etc) is not passed through gettext near line 190 of index.php
    • it seems gettext doesn't handle well concatenated strings, so I had to join them at lines 43, 378 of actions.php
    • supply is mispelled in lines 42 and 72 of delete.php
    • there's an additional is in the text of line 352 of actions.php
    • I wanted to show the date when viewing an event according to the user locale, so I replaced the code below line 127 of dayview.php for:

    [code=PHP]

    if($locale = user_flag_get('language',$page_owner))
        setlocale(LC_TIME,"$locale.utf-8",$locale);
    else
        setlocale(LC_TIME,$CFG->defaultlocale);

    $start_date = strftime("%d %B %Y",$event->date_start);
    $start_time = strftime("%H:%M",$event->date_start);

    $end_date = strftime("%d %B %Y",$event->date_end);
    $end_time = strftime("%H:%M",$event->date_end);

    [/code]

    Finally, I'm still having problems to translate all the things of activecalendar. It seems I have to write the array and call setMonthNames etc. every time, it's a little lenghty...putting it directly on activecalendar/source/activecalendar.php didn't work.

    Cheers, and thanks again for the plugin! 

    user iconRenato on Thursday, 08 March 2007, 07:54 UTC # |

  10. Tried to export an event, but google agenda says:

    Failed to import events: Unable to process your iCal/CSV file. The file is not properly formatted.

    Don't know, maybe google is crazy :p

    There will be some kind of import function too? 

    user iconRenato on Thursday, 08 March 2007, 08:13 UTC # |

  11. This plugin is a huge improvement on the original - thanks for rewriting the whole thing!

    There are a couple of little issues:

    1) Creating an event for a community produces the following error:

    Warning: Missing argument 3 for calendar_event_create(), called in /home/sandpit/html/mod/calendar/add.php on line 109 and defined in /home/sandpit/html/mod/calendar/actions.php on line 320

    2) When you click on your 'Community events' and 'Friends events' the following error occurs if you have no communities or friends:

    Warning: Invalid argument supplied for foreach() in /home/sandpit/html/mod/calendar/actions.php on line 282

    As soon as you make a friend or join a community the error disappears and all seems to be working fine.

    3) Exporting an event is not yet working.

    Cheers. 

    user iconDavid Tosh on Thursday, 08 March 2007, 13:51 UTC # |

  12. The last field in _get_events and _event_create is optional, or only required upon certain circumstances.  For example, _get_events only needs the first 3 fields for 'friends' events, but needs the extra field4 for 'rss' events:

    $monthly_events = calendar_get_events($min_time, $max_time,'friends');
    $events =  calendar_get_events($mintime,$maxtime,'rss',20);

    Funny that this was not raising an error for me.  I believe the fix is to set a default value for the optional field.  

    function calendar_get_events($min_time, $max_time,$caltype,$field4 = 0) {
    function calendar_event_create($calendar_input,$action,$event_id = 0) {


    Renato - thanks for your fixes.  I'll incorporate them in to the source.  
    The month and day names are in index.php using gettext and set using setMonthNames and setDayNames.  Does that help?


    user iconellen davis on Thursday, 08 March 2007, 13:59 UTC # |

  13. I think the "Missing argument 3" warning can be cured by changing line 109 of actions.php to  function calendar_event_create($calendar_input,$action,$event_id=0) { (add =0 to make $event_id an optional argument since it is not needed when creating an event for the first time)

    user iconEwout ter Haar on Thursday, 08 March 2007, 13:59 UTC # |

  14. oops, posted at the same time as Ellen. Fortunately, she gave the same solution, and more...Smile

    user iconEwout ter Haar on Thursday, 08 March 2007, 14:05 UTC # |

  15. This is beginning to look really great :)

    We're getting a persistent error with an invalid argument for foreach() - this is because your $results = get_records_sql call is returning false, and that false value is being passed down to the foreach function.

    It's probably better practice to do something like:

        if ($results = get_records_sql("... your query ...") ) {

            // Code to execute if we've found something

            foreach($results as $result) { /* etc */ }

        } else {

            // Optional code to run if no items were found

        } 

    user iconBen Werdmuller on Thursday, 08 March 2007, 14:26 UTC # |

  16. Hi Ellen,

    You have to use setMonthNames and setDayNames every time you make a new activeCalendar(). I copied the gettexts etc to the actions.php near line 80. Also, it's necessary to do the same in activecalendar/data/js.php, but there you need to include require_once("../../../../includes.php") in order to have __gettext working. Also, the "Close Calendar" at line 29 is missing gettext (really <?php print __gettext ... ?>).

    I noticed also that "Start Date Calendar", "Start and "End" are not translated near and below line 100 of actions.php.

    user iconRenato on Thursday, 08 March 2007, 22:04 UTC # |

  17. Hi again, Ellen

    It's necessary to create an "export" directory with 777 permission under the dataroot, but that's not in the INSTALL instructions (although it's obvious from the error message =).

    I would like to point some suggestions of usability:

    • when the user is in his calendar and click in a day without any event, it could be redirected to the add event page (it's the else{ ... } of ben's solution above).
    • when looking at a someone's else event, it would be nice to have a "copy (import?) to my calendar" function

    user iconRenato on Friday, 09 March 2007, 23:52 UTC # |

  18. this is a nice improvement.  i had the argument 3 and 4 errors but they were corrected by the suggestions above.  I also have an error in event archive:

    Warning: Invalid argument supplied for foreach() in /home/doggyblo/public_html/mod/calendar/archiveview.php on line 47

    user iconTodd on Sunday, 11 March 2007, 16:40 UTC # |

  19. Hello, just found a bug with the export feature. The dates are formatted incorrectly. For example:

    DTSTART;TZID=US/Eastern:200749T210000

    Instead of:

    DTSTART;TZID=US/Eastern:20070409T210000

     

    user iconGeorge on Monday, 02 April 2007, 06:09 UTC # |

You must be logged in to post a comment.

Site supported by Curverider Ltd - powered by the awesome Elgg