You are here

function signup_mark_not_attended_action in Signup 7

Same name and namespace in other branches
  1. 6.2 signup.module \signup_mark_not_attended_action()
  2. 6 signup.module \signup_mark_not_attended_action()

Action callback to mark a given signup that the user didn't attend the node.

Parameters

stdClass $signup: Reference to a fully-loaded signup object to record attendance on.

Return value

none Nothing: $signup object is modified by reference and the {signup_log} table is directly UPDATE'ed in the database.

File

./signup.module, line 1021
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_mark_not_attended_action(&$signup) {

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

  /* db_query("UPDATE {signup_log} SET attended = %d WHERE sid = %d", FALSE, $signup->sid) */
  db_update('signup_log')
    ->fields(array(
    'attended' => FALSE,
  ))
    ->condition('sid', $signup->sid)
    ->execute();
  $signup->attended = FALSE;
  watchdog('action', 'Marked signup @signup_id did not attend.', array(
    '@signup_id' => $signup->sid,
  ));
}