Hello,
I need to disable programaticaly a webform for people that register to a seat limited seminar session.
I could hide the form in a block and use the php hide or display option for the block but I need to limit that display to a specific path (say: "seminar-register"). As I can have only one option set for the bloc visibility true / false on code or only display on specified path, I was wondering I could place a call to disable the webform. I know this option exists in the admin for webform but I need to access it via code. Is this possible ? Is there a documented api call I might user ?
Thank you !

Comments

vernond’s picture

There isn't a api call for this functionality. If you have time to create a D7 port (it goes mostly around changing the database access stuff), maybe this project can help you: http://drupal.org/project/webform_limit_submissions

quicksketch’s picture

Status: Active » Closed (fixed)

I was wondering I could place a call to disable the webform. I know this option exists in the admin for webform but I need to access it via code. Is this possible ? Is there a documented api call I might user ?

You can disable any Webform by settings $node->webform['status'] = 0;

$node = node_load($nid);
$node->webform['status'] = 0;
node_save($node);

Though now that #503264: Limit the total number of submissions is going to be in the next version of Webform (3.15) you might not need any custom code at all.

I'm going to close this issue after a lack of activity.