Menu

#521 Calendar module able to filter for specific calendar events

open
nobody
5
2009-02-25
2009-02-25
No

With this patch (to PGV 4.2) a user can show events registered in a specific calendar only. Independently of which calendar is used on the user interface.

For example, a user can select the Gregorian month calendar (like before, click on the "View month" link and then click on the "Gregorian" link). That calendar could be too crowded. Then, he or she could show only those events with a jewish calendar date (selecting a clalendar from the dropdown added by this patch).

Besides this patch, it's needed a new string:

$pgv_lang["show_events_from_cal"] = "Show only events from this calendar:";

A help text (havent done that) also should be written:
print_help_link("show_events_from_cal_help", "qm", "show_events_from_cal");

Hope it helps others.

Discussion

  • Ely Schoenfeld

    Ely Schoenfeld - 2009-02-25

    PGV's 4.2 calendar.php patch to be able to filter one calendar events.

     
  • Greg Roach

    Greg Roach - 2009-02-26

    A more efficient and somewhat simpler approach might have been to pass the calendar to get_anniversary_events() so that it only fetches the events for a single calendar, rather than fetching them all and filtering out the others.

     
  • Ely Schoenfeld

    Ely Schoenfeld - 2009-02-26

    Hi Greg.

    Thank you very much for answering, and so soon.

    It sounds great.

    But unless there is another definition of get_anniversary_events(), the one in functions_db.php only receives a julian date, a list of facts and a ged_id as parameters, and has a foreach that covers all the calendars

    Just in case, tried to find if there was a function that receives a calendar (either a name or an object) that could retreive events, and couldn't find it.

    I think I didn't understand what you meant.

    Could you explain it in more detail?

    Ely.

     
  • Greg Roach

    Greg Roach - 2009-02-26

    I mean modify the existing get_anniversary_events function. e.g.

    replace

    function get_anniversary_events($jd, $facts='', $ged_id=PGV_GED_ID)

    with something like

    function get_anniversary_events($jd, $facts='', $ged_id=PGV_GED_ID, $calendar='all'

     
  • Ely Schoenfeld

    Ely Schoenfeld - 2009-02-26

    Oh I get it.

    Here is the new patch.

    Let me know if there is something else to change.

    Ely.

     
  • Ely Schoenfeld

    Ely Schoenfeld - 2009-02-26

    PGV's 4.2 calendar.php patch to be able to filter one calendar events. Better: changing get_anniversary_events

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.