You are here

function signup_close_signup in Signup 6

Same name and namespace in other branches
  1. 5.2 signup.module \signup_close_signup()
  2. 5 signup.module \signup_close_signup()
  3. 6.2 signup.module \signup_close_signup()
  4. 7 signup.module \signup_close_signup()

Callback function for closing signups

4 calls to signup_close_signup()
signup_node_admin_summary_form_submit in includes/node_admin_summary.inc
signup_save_node in includes/node_form.inc
Save signup-related information when a node is created or edited.
_signup_check_limit in ./signup.module
Checks the signup limit for a given node, and sees if a change in either the limit or total # of signups should result in a change in signup status (open vs. closed) and prints a message indicating what happened.
_signup_cron_autoclose in includes/cron.inc
Helper function that handles auto-closing time-based nodes during cron.

File

./signup.module, line 1138
The Signup module (http://drupal.org/project/signup) manages replies to nodes. In particular, it's good for event management. Signup supports sending reminder emails and automatically closing signups for nodes with a start time, via the Event…

Code

function signup_close_signup($nid, $cron = 'no') {
  db_query("UPDATE {signup} SET status = 0 WHERE nid = %d", $nid);
  if ($cron == 'no') {
    $node = node_load($nid);
    foreach (module_implements('signup_close') as $module) {
      $function = $module . '_signup_close';
      $function($node);
    }
    watchdog('signup', 'Signups closed for %title.', array(
      '%title' => $node->title,
    ), WATCHDOG_NOTICE, l(t('view'), 'node/' . $nid));
  }
}