here's a small patch that provides initial support for opening closed signups on a node (item #2 in the TODO comment at the top of signup.module). to keep the patch small, i didn't bother with a complete solution that added a new admin tab for "closed signups" that was like the existing admin/signup overview tab, but which listed closed events and provided a link to re-open them. instead, i just focused my changes on the node/X/signups tab. i think these two things are complementary, and you could certainly apply this patch to provide one while i or someone else works on another patch to provide the other. i tested applying this patch to both 1.1.2.18 and 1.1.2.22, and it patched cleanly in both cases.
enjoy,
-derek
| Comment | File | Size | Author |
|---|---|---|---|
| #17 | signup_4.7_reopen_fixes.patch | 9.02 KB | dww |
| #16 | signup_4.6_reopen_fixes.patch | 8.91 KB | dww |
| #10 | signup_open.full-sql_fix-2.patch | 8.15 KB | dww |
| #9 | signup_open.full-sql_fix.patch | 8.16 KB | dww |
| #8 | signup_open.full.patch | 8.1 KB | dww |
Comments
Comment #1
dwwafter playing with this for a few more minutes, i decided i like the display/interface better with this patch (signup_open.1a.patch). i think this is a more elegant UI, so i'd prefer this patch to my previous posting. this version takes less space, and is nicer to look at...
thanks,
-derek
Comment #2
hunmonk commentedseveral things:
also, it would be great if you could provide a patch to put the same functionality in HEAD.
Comment #3
dwwthat's exactly where i put the buttons. this all happens on the "signups" tab (node/X/signups), not on the main view. unless something got *seriously* messed up with the patch, this new table with the buttons shows up on the signups tab. furthermore, i don't know what you mean about priv problems... if i log out of the site, i don't get a signup tab and i therefore have no access to the buttons. if i log in as a regular user i can see the signups, but still don't have a signup tab and can't close/open events. only if i log in as an admin do i get the signups tab with the additional info/buttons.
good to know, i was just following the signup_close_signup() code as closely as possible. i figured it'd be possible that someday we might have signups only *open* at a specific date, managed via cron...
good point. again, i'm still just trying to get stuff working based on what i see, and trying to put things next to other things that already do something like what i need. i agree they should be moved, once i have a better understanding of how all this callback generation stuff really works (i gotta read more about the drupal api). if it's trivial for you to post a patch to my patch that moved them where you think they should go, that'd help me understand more about how you want the module laid out. mostly i get the principle: things should live near what they do functionally, not just near similar implementations. ;) i'll take another look at this aspect of it and see if i can find a more suitable location.
maybe it's confusing because i used a callback to implement the button, and there's some more simple way, but what i have definitely generates buttons, not links. if you apply the patch and play with it, you'll see what i mean. if you look at the part where i'm putting a value into the "ctrl_row" array, you'll see:
it's definitely a "Close Signups" form_submit() button that posts the simple form... (with the hidden nid value so the callback knows what node this form corresponds to).
no offense, but i've got enough to worry about just trying to get my own custom version of signup working and coordinating my changes with one branch of your respository. ;) plus, i'm still working out all the other problems with other modules not quite doing what they should... my primary concern at the moment is getting my site up and running. for now, my site's running 4.6, so that's what i'm getting familiar with and actively developing. that said, signup is going to play such a central role in my site that i'm trying to share as much of my work on signup as possible... but, i can't make any promises about HEAD patches for any of the stuff i'm doing, until i end up getting ready to convert my entire site to 4.7. i'm still climbing the steep learning curve, so i'm trying to stay focused on what i most need to know. i'm sure you understand. when/if i get inspired to start looking at the HEAD/4.7 signup code, i'll see if i can crank out a similar patch, and if so, i'll definitely follow-up to this thread.
also, i wanted to get feedback on this patch before i spent more time on it, started trying to figure out how to add the new admin/signup/closed_events tab to view and re-open all closed signups, etc, etc...
thanks,
-derek
Comment #4
hunmonk commentedi see that now. that's what i get for reading the patch instead of applying it ;) and there's no perm problem as long as the stuff lives under the signup tab.
i won't have time to do this until after the conference. if you haven't fixed it by then, i'll have a look at it.
no worries. it's just nice to get feature patches for all supported versions. i definitely don't want to have features appearing in an older version that don't appear in the current version, unless they've been explicitly removed. normally differences between versions are minor, so if the feature was very important and the changes were minor, i'd just hack the new patch myself, which very well might be the case here.
Comment #5
dwwok, i figured out what you meant about implementing the form callbacks for those buttons in the node/X/signups page itself. while i was at it, i also added a tab to admin/signups to view closed events, and the links on that page allow you to open each event. i noticed that while testing this new tab, i often had to toggle page caching on/off for changes i made to signup_menu() to be visible. :( is that normal?
anyway, i'll post a few more comments and patches with the individual changes i've made. at the end, i'll post a new, full patch that does everything (which applies cleanly to 1.1.2.24).
-derek
Comment #6
dwwpatch #2 -- adds the admin/signups/closed_events tab
cvs log:
Comment #7
dwwpatch #3: fixes the "Open Signups" and "Close Signups" buttons to be implemented in the right place, and other cleanup of open/close methods, buttons and links to be more sane...
patch attached, cvs log follows...
Comment #8
dwwhere's the full, corrected (hopefully final) patch of everything i've mentioned in this thread. this takes a clean copy of 1.1.2.24 and adds all of the open signups functionality, including the buttons on node/X/signups and the new admin/signups/closed_events tab.
i guess the only other things i left out of the patch were to remove the TODO item in the comment at the top of the file (that list looks like it's fairly stale and could use some lovin', anyway), and to update the help text "Signups can be manually closed for any node at administer->signup" to mention these changes. i wasn't sure if there are any other places that documentation needs to be updated, so i figured i'd just leave all of that to you. ;) let me know if you want me to generate a patch to signup_help() and the TODO comment...
enjoy,
-derek
Comment #9
dwwhere's a new full patch that includes the fix to the SQL query mentioned in http://drupal.org/node/44914
Comment #10
dwwwhoops, the formatting you chose for the SQL fix in revision 1.1.2.25 was slightly different than what i was patching against. this patch will apply cleanly to 1.1.2.25...
Comment #11
hunmonk commentedwill look at this more once we figure out what the hell we're doing w/ the module... :)
Comment #12
dwwclearly, signup isn't going away anytime soon, and this stuff would be useful. i'll take another look at this feature/patch, see if it still applies, and consider checking it in.
Comment #13
hunmonk commentednot sure why you'd want to work on this, since it's already implemented... ;)
marking as fixed.
Comment #14
dwwi'm not thrilled with the current implementation. for example, in admin/signup, it's silly to have "overview" and "open events" as separate tabs if they show the same thing. plus, my earlier patches added a button the node/X/signups tab to open/close signups on that node, which is a handy UI element. so, i'm still gonna dust this stuff off, and get some of these improvements into the code...
Comment #15
dwwoh, and because the current implementation in admin/signup is broken: given the way the SQL is written, it will only let you open or close events that have had a signup already. :( this is a serious problem for the http://drupalcon.org site right now.
Comment #16
dwwhere's the patch for 4.6
Comment #17
dwwpatch for 4.7 and HEAD
Comment #18
dwwapplied to HEAD, 4.7 and 4.6.
it'd be nice if someone signup-aware could still review these patches. ;) but i know they're not any worse than the previous code (which wouldn't allow you to do anything in /admin/signups unless the node had at least 1 signup). but, it'd probably good for *someone* else to make sure they're ok. i've tested heavily, but i might be doing something stupid... ;)
thanks,
-derek
Comment #19
(not verified) commented