Hi !

It is possible to filter the signups in admin/content/signup. You can decide if you want to see all/open/closed signups and edit the signups.

I would like to add a filter, so that the user can decide if he wants to see events that already took place / that will take place / both.
I figured out that it is necessary to edit the signup.module in line 1228, but my problem is that i've got no knowledge about adding hard coded filter. I tried to realize this with the help of "views", but i couldn't find a view for this page.

Greetings

CommentFileSizeAuthor
#5 change_sort_order.txt470 byteslzimon

Comments

googletorp’s picture

You can do this with views. Filter on the content type you use for signup. Then
1- filter on the date field and get before today = signups that has happened.
2- filter on date field and get after today = signups to come.
3- no filter = all signups.

If you don't have a content type just for signups things might get a bit more tricky but should still be possible.

Edit:

I misread your initial post, didn't see that it was the admin interface you wanted to change. Anyways, you can either create a custom view for it with the method above. You should be able to display most signup specific fields. Another option would be to alter the admin interface with theme hooks ect. I haven't looked at the signup code recently, but I believe you can theme it like you want and add filters aswell, if you really want to. When it comes down to it, this is just a matter of how you want to present it to your users/clients.

lzimon’s picture

Thanks for your reply.

There is a problem creating an own view: i'm using drupal 5 (->view 1). I can create the rows "start date", "event" and "signups" but i can't add the following rows:
- Limit with "live-editing" (=textfield that allows to edit the max. participants)
- status (=closing&opening events)
- signup broadcast (send email to subscribers with 1 click)
- show detailed information about signups

Well, i "can" add the rows of course, but not inside my website, i would have to code them. And i think it's easier to add 1 Filter than 4 rows ;)

I suppose i have to code the filter too, that won't be an unsolvable task (-> google :p) but i need to know where i have to add the code exactly ;) (supposing line 1228, but i don't know how to implement it. I tried the "try and error" method, but i got only a white page with a line called "error in line xxxx" as result :p).

Summary: i don't think i have to add a new view / filter in views but a filter in the signupmodule (because there is no view available for admin/content/signup ->no vid, no global field values / filter, no possibility to export the view,etc...)

€: Just read your edit :3
I think the solution is to hack the signup.module or to use hooks (the better solution imho). Problem: i'm "coding" php since 1 week, so i don't have an idea how to implement that hook thing :D (i know what a hook is, but i've never worked with one. I would only need a global example how it's handled in Drupal5, perhaps you've got a link in mind ? I'll look up the Drupal manual for now)

lzimon’s picture

hhhhm.....
What about signup/views/view.inc ? ;) Would be to easy to use the provided implementation, wouldn't it ? :p Don't know how i could oversight this.

This is the first time i'm "building" a filter, perhaps someone could help me a little bit ? (How do you implement a filter in signup ? Have i to add the filter in views.inc and views_default.inc ?). Until someone responses i'll try&error ;D

googletorp’s picture

I'm not too used to drupal 5, but I took a look at it.

The form itself is pretty easy to change with the hook_form_alter. With that you can alter the form values and what is displayed. This wont change the results of the sql queries and will at best change nothing or simply render the form inactive. That is you can change the values of the filter but it will do nothing.

The sql query and filtering is happening in the function, signup_admin_form_sql. I dont know if it is possible to change that function with hooks. (it's on line 1327 by the way) It is that function that both gets the signup data and filter based on status with the

if (isset($filter_status)) {
    $admin_common_sql['where'] = array("s.status = $filter_status");

You can't use this however as the signup data itself doesn't contain any date information. So you would have to based on the signups get the nodes, find the date, filter on that, and then return the correct signups.

If you can alter the function it could be done with some hard work, but hardly work it, as open/closed and has happened will happen, in many cases will be the same.

So it wont be easy to create this little change...

lzimon’s picture

StatusFileSize
new470 bytes

Thanks for your help.

I was trying to code your suggestion at the weekend, but it didn't work so i gave up ;) It's to difficult for me yet.

But i made a little workaround: i've changed the sort order in the default view. The events are now sorted according to their start date. I attached a little .txt to this post, so if anyone wants to change the sort order too he doesn't need to search the codeline on his own.

Perhaps it's even the better solution for the user, because he has to do one click less.

Anyway, thank you very much :)

Suggestion for the signupteam: could you integrate the table in a view, so that the customizing would be easier ?

ezra-g’s picture

Status: Active » Closed (won't fix)

This is possible through the Views support for 6.x compatible versions an onward. Sadly, this won't be fixed in Drupal 5.