I have extended the module to include an option to close a webform at a specified date as well. At this moment the logic first checks to close the form based upon date. If that is okay, then it closes if max submissions have been reached. If either the cut-off date or max submissions figure gets changed, the form will automatically close or re-open as required by the new values.

The code includes the suggested changes from span (http://drupal.org/node/1211752#comment-4734466) and emastyle (http://drupal.org/node/1177624#comment-4675276).

Please take a look and see if you agree that the functionality is related enough to be paired in the same module.

I cannot decide whether an additional field is required to specify whether date cut-off or max submissions should be the 'senior' deciding factor as to whether a form is closed or not. Input appreciated.

Another outstanding thing is to get the jquery datepicker working on the limit submissions page as well.

Because I've doubled the size of the source file I'm attaching my .module (lose the .jpg extension) file rather than a patch file.

CommentFileSizeAuthor
webform_limit_submissions.module.jpg7.88 KBvernond
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

vernond’s picture

Status: Active » Needs review
DonnyCarette’s picture

Thanks vernond, nice work!
I will take a look to the code to add a new release.
There will come more features soon

DonnyCarette’s picture

Vernond,

I did a quick review of your code, more in a couple of days

  • I also think date is more important for closing the form when this is reached
  • If we make date module a dependencie, than we could use that for selecting the date with the jQuery datepicker (Now the date input only works if the webform contains a date field)
vernond’s picture

@DonnyCarette - Cool, let me know what I can do to help.

paul.dambra’s picture

I've just tested this and had to add

module_load_include('inc', 'webform', 'components/date');

above the use of _webform_render_date but other than that it works perfectly for my needs. Many thanks!

DonnyCarette’s picture

Status: Needs review » Closed (fixed)

Code worked fine so added in new release 6.x-2.2
Closing this issue as fixed, thanks again for the extra feature!