I've created a patch that adds a link to node/#/signups for downloading the list of signups as a csv file.
The code was written in a 5.x-1.0 signup install, and ported to 5.x-2.4 afterwards. I was not able to test the 5.x-2.4 version, so the patch really needs review. (Also I'm not really sure about the $items[] element I've added, as this is the first time I did that)
The Email address, User Id (only for anonymous, left empty) and Signup date are appended as custom user details. (These custom user details could perhaps be made configurable through the admin so that additional user details can be added or any of the current can be left out)
A patch to 5.x-1.0 is available too, but I guess this is obsolete.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | signup.module.patch | 6.34 KB | syngi |
| signup.module.patch | 6.33 KB | syngi |
Comments
Comment #1
syngi commentedI've changed the line that appends the signup date to get a localized string:
$signed_up_user_data .= ',"' . gmdate(variable_get('signup_date_string', 'M jS, g:i A'), $signed_up_user->signup_time + $offset) . '"';with
$signed_up_user_data .= ',"' . format_date($signed_up_user->signup_time, 'custom', variable_get('signup_date_string', 'M j Y, G:i'), $offset) . '"';Comment #2
syngi commentedOr to make the signup module use the format_date API function the 'small' format could be used.
As I'm not sure whether the 'small' or 'medium' format is preferred or whether the offset has to be passed too, see http://drupal.org/node/132142#comment-775166, I'm not adding another patch, but leaving this open to you dww :p
Comment #3
mdowsett commentedI'm a bit junior at applying patches....I've made some adjustments to my signup.module already (patches and some minor code changes)....my more general question is do patches only work on stock .modules or do they find similar parts of the code and apply the changes in the patch....I'm just concerned about breaking what I have.
Comment #4
mdowsett commentedOK...I'm dangerously impatient with this sort of thing....or adventurous...
I applied the patch and got this error:
Hunk #1 FAILED at 282.
Hunk #2 FAILED at 1441.
Hunk #3 FAILED at 1459.
Hunk #4 succeeded at 1738 with fuzz 2 (offset 239 lines).
Hunk #5 succeeded at 1857 with fuzz 2 (offset 2 lines).
Hunk #6 FAILED at 1902.
4 out of 6 hunks FAILED -- saving rejects to file signup.module.rej
So should I apply those failed 'chunks' by hand? I don't know how to read the patch file.....to I simply add the lines flagged with a + after the code just above the plus?
Comment #5
mdowsett commentedI did them by hand....and I got it working! I'm so proud... :)
Comment #6
dwwDoing this with the views_bonus_export.module from http://drupal.org/project/views_bonus is the right solution for this. I just tried it myself (and aside from a devel.module bug it uncovered, #290474: devel breaks non-HTML pages: application/* and text/x-comma-separated-values, it worked flawlessly). I have no problem telling people they have to enable views and views_bonus if they want csv exports of their signups, especially since the existing patch is hard-coded in various ways that not everyone is going to want. views + views_bonus_export is much more flexible and full-featured, and doesn't require any additional complication/code in signup.module itself.
Cheers,
-Derek