There should be an option to be able to filter the page's table by year, month, or date. That way, a user wants to see all birthdays for October, they can filter the the list to get that specific subset.
Also, it would be nice to be able to set the fields that are shown in the table. I have first and last name fields that I would rather show than the user name.
Some modules put the view into the views default list to allow administrators to override the default module view. This would be a great feature that could accommodate these features
Comments
Comment #1
maartenvg commentedFiltering: not a problem. I'll look into filtering by month and year, (not by day, because that would be silly). BTW, when sorted by date in the admin-settings, you can already scroll to a certain month and see all people born in that month.
The optional table columns is already more or less implemented: use the theme override functionality of Drupal. Just copy the function into template.php (change the name accordingly) and remove the necessary code to hide columns you don't want to see.
I'm also planning to try to make the 'age' and 'star sign' fields visible to the Views module (Birthday field already is) so you can use Views with Usernodes and create a user listing completely according to your own wishes including things from other modules and birthday information.
Comment #2
maartenvg commentedI've implemented this and committed it to CVS. Takes a few hours to show up on the project page, but please test it after that.
The implementation includes filtering by month and/or by year. So you can list only people from august, only from 1978 _and_ only from august in 1978.
Comment #3
Sara Adams commentedI've had a look at this. There are two issues I found with a first quick look:
1. There is no option of only allowing filtering by month (or only by year). Given that you've already got the option "Hide year/age", it should be possible to deactive filtering by year. Either this should be an extra option, or you just use the value of "Hide year/age". After all, anyone who'll want to hide the year, will also want to disable filtering by year.
2. For filtering by year the start and end year are hard coded. On the admin page there should be an option to set start and end year. Right now it's an awfully long list, and for different sites only specific ranges are needed. It might even be people need birthdays < 1900 or > 2050 (history or sci-fi). In any case, adding a control for this would be a good idea.
Best wishes,
-- Sara
Comment #4
maartenvg commentedad 1)
True, I'll use the birthdays_hide_year variable. I'll think about adding an option to show the filtering, but the options screen is getting rather cluttered/complex for not even such a big module.
ad 2)
Currently I'll leave it this way. By using the Profile module to provide the date field, the years to be shown are also chosen by the Profile module. And this influences the year range that is shown on the filter drop down. I'll research whether
- I even _can_ customize the range Profile module uses (I think I can)
- selecting dates before 1900 or after 2050 gives problems when saving them to the database (I think it won't).
Comment #5
Sara Adams commentedI changed a bit to make it work for me:
1. remove "style:text-align:right" and instead add a class 'birthdays-filter'
2. don't show year filter if 'Hide year and age' is activated.
Maybe not the cleanest solution, but I'm sure you'll have good ideas. :)
See http://www.exetermcr.com/birthdays uses the birthdays module with these changes
-- Sara
Comment #6
Sara Adams commentedYou're too fast for me. :)
ad 2) It's hard coded right now, isn't it?
drupal_map_assoc(range(1900,2050))
If you've got restrictions from the profile module, can't you pull those numbers from profile, too? I just don't like hard-coded stuff, that's all.
-- Sara
Comment #7
maartenvg commentedI've implemented your patch and added an option to hide filtering overall. It's committed to CVS.
And I see what you mean. I'll look whether I can change the hard coded part into something dynamic but still keep it efficient.
(PS, next time when you generate a diff, use "diff -u", those are a bit easier to read :-) )
Comment #8
Sara Adams commentedWill do.
Comment #9
maartenvg commentedI forgot to mark this as fixed.
Version 5.x-1.2 just went up, and it changes things a bit. The list of years on the Birthdays page ranges from the current year to 1900 (sorted from high to low), this is the same as the new profile field handling. This is more reasonable than 1900-2050, I think. Untill someone actually requests a change to the years range I'll leave this semi-hard coded.
Comment #10
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.