You are here

function signup_close_signup in Signup 7

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. 6 signup.module \signup_close_signup()

Callback function for closing signups.

Parameters

int $nid: The node ID of the node to which signups are being opened.

string $cron: A string indicating whether the callback is being executed by cron.

4 calls to signup_close_signup()
signup_node_admin_summary_form_submit in includes/node_admin_summary.inc
@todo Please document this function.
signup_save_node in includes/node_form.inc
TODO: this doc is not correct for D7 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 1229
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') {

  // TODO Please review the conversion of this statement to the D7 database API syntax.

  /* db_query("UPDATE {signup} SET status = 0 WHERE nid = %d", $nid) */
  db_update('signup')
    ->fields(array(
    'status' => 0,
  ))
    ->condition('nid', $nid)
    ->execute();
  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));
  }
}