sproctor / php-calendar

PHP-Calendar
http://www.php-calendar.org/
Apache License 2.0
138 stars 67 forks source link

Extending URL Parameters #118

Closed willyd61 closed 1 year ago

willyd61 commented 9 years ago

I am looking at extending the URL parameters to include a new column I added to the occurrences table, its a status field that I would like to give the ability to filter the current view the end user is looking at. I see multiple functions that would likely need to be modified such as display_month. I am wondering if this is the easiest route to take.

I placed links on the calendar.php file to display each unique status below the calendar name, the idea is to click this status and it sends status=xxx to the current URL, which I have coded and updates the URL to include this like http://ebsweb/cmgcalendar/index.php?action=display_month&year=2014&month=9&day=5&status=new

Any help on this would be much appreciated and I can send the code I end up with back to you for future users that might want to include custom fields for their calendar records with ability to filter on these.

Regards, Will L.

sabas commented 9 years ago

You could modify get_events (https://github.com/sproctor/php-calendar/blob/master/includes/display_functions.php#L26) to accept a filter parameter, then filter out events in php or from the same function call a new function in the database class (https://github.com/sproctor/php-calendar/blob/master/includes/phpcdatabase.class.php) that performs a custom query, basing on get_occurrences_by_date_range and adding a filter...

sproctor commented 9 years ago

I've been working on custom event fields for the last couple of days. I'm not sure about having them associated with individual occurrences. Seems like it would make things complicated. My implementation isn't fully baked yet. I haven't added the schema to the installer yet.

If you want to add the code to filter based on these custom fields, I'd certainly merge it. I should have the installer updated in a day or two. If you'd like to mess around with my implementation, I can send you the username and password to the dev calendar.

willyd61 commented 9 years ago

hey sean, Yes, I would be interested in messing around with your implementation, send me the details and I will take a look.

sproctor commented 9 years ago

It's checked in on the master branch.

willyd61 commented 9 years ago

OK, I have finally made it back around to this project. Where do I find the non baked filter code you have? You didn't say which file to try and merge. I also thought of a different way to attack this problem, I could do a calendar overlay, multiple CID on one page, then each calendar could be a filter and toggle the overlay. Do you think this approach is cleaner and easier?

willyd61 commented 9 years ago

OK, downloaded the master branch and ran the installer, schema installer has issues, I am guessing you haven't had a chance to update this.

sproctor commented 1 year ago

This is going to be part of v3, so I'm closing this issue as the work is done, but won't be available until that release is available.