cvs diff: Diffing .
Index: INSTALL.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/signup/INSTALL.txt,v
retrieving revision 1.13.2.1
diff -u -p -r1.13.2.1 INSTALL.txt
--- INSTALL.txt	20 Dec 2008 00:53:06 -0000	1.13.2.1
+++ INSTALL.txt	22 Jan 2009 17:40:20 -0000
@@ -63,6 +63,12 @@ the Drupal package and read the online d
      NOTE: Anonymous users aren't allowed cancel their signups even if
      this permission is granted to the role 'anonymous user'.
 
+   'edit own signups':
+     Allows users to edit their own signups.  When viewing their own
+     signup information, users will be able to update the values.
+     NOTE: Anonymous users aren't allowed edit their signups even if
+     this permission is granted to the role 'anonymous user'.
+
    'view all signups':
      Allows users to view all of the users who have signed up for any
      signup-enabled content on the site.
Index: signup.css
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/signup/signup.css,v
retrieving revision 1.3
diff -u -p -r1.3 signup.css
--- signup.css	19 Nov 2008 01:44:07 -0000	1.3
+++ signup.css	22 Jan 2009 17:40:20 -0000
@@ -1,3 +1,8 @@
 /* $Id: signup.css,v 1.3 2008/11/19 01:44:07 dww Exp $ */
 
 #signup-filter-status-form .form-submit { margin-bottom: 0; }
+
+#signup-edit-form .form-submit {
+  margin-right: .5em;
+}
+
Index: signup.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/signup/signup.module,v
retrieving revision 1.205.2.10
diff -u -p -r1.205.2.10 signup.module
--- signup.module	19 Jan 2009 16:45:24 -0000	1.205.2.10
+++ signup.module	22 Jan 2009 17:40:21 -0000
@@ -151,28 +151,6 @@ function signup_theme() {
         'node' => NULL,
       ),
     ),
-    'signup_current_signup' => array(
-      'file' => 'node.inc',
-      'path' => $path,
-      'arguments' => array(
-        'signup_data' => NULL,
-        'cancel_signup_form' => '',
-      ),
-    ),
-    'signup_custom_data_table' => array(
-      'file' => 'node.inc',
-      'path' => $path,
-      'arguments' => array(
-        'data' => NULL,
-      ),
-    ),
-    'signup_custom_data_rows' => array(
-      'file' => 'node.inc',
-      'path' => $path,
-      'arguments' => array(
-        'data' => NULL,
-      ),
-    ),
     'signup_user_form' => array(
       'file' => 'signup_form.inc',
       'path' => $path,
@@ -180,7 +158,7 @@ function signup_theme() {
         'node' => NULL,
       ),
     ),
-    'signup_email_token_anonymous_username' => array(
+    'signup_anonymous_username' => array(
       'file' => 'signup_form.inc',
       'path' => $path,
       'arguments' => array(
@@ -350,6 +328,16 @@ function signup_menu() {
     'file' => 'signup_cancel.inc',
     'file path' => $path,
   );
+  $items['signup/edit/%signup_menu'] = array(
+    'title' => 'Edit signup',
+    'page callback' => 'signup_edit_page',
+    'page arguments' => array(2),
+    'access callback' => '_signup_edit_menu_access',
+    'access arguments' => array(2),
+    'type' => MENU_LOCAL_TASK,
+    'file' => 'signup_edit_form.inc',
+    'file path' => $path,
+  );
 
   $items['admin/content/signup'] = array(
     'description' => 'View all signup-enabled posts, and open or close signups on them.',
@@ -509,6 +497,33 @@ function _signup_user_menu_access($accou
 }
 
 /**
+ * Menu loader callback to load a project node.
+ */
+function signup_menu_load($sid) {
+  if (!is_numeric($sid)) {
+    return FALSE;
+  }
+  $signup = signup_load_signup($sid);
+  if (empty($signup)) {
+    return FALSE;
+  }
+  return $signup;
+}
+
+function _signup_edit_menu_access($signup) {
+  global $user;
+  if (user_access('edit own signups') && !empty($user->uid) && ($user->uid == $signup->uid)) {
+    return TRUE;
+  }
+  // Check admin powers for this signup.
+  $node = node_load($signup->nid);
+  if (_signup_menu_access($node, 'admin')) {
+    return TRUE;
+  }
+  return FALSE;
+}
+
+/**
  * Menu callback to handle the default tab at node/N/signups
  *
  * This tests the user's permission to see what tab they should really see.
@@ -567,6 +582,7 @@ function signup_perm() {
     'sign up for content',
     'cancel signups',
     'cancel own signups',
+    'edit own signups',
     'view all signups',
     'administer all signups',
     'administer signups for own content',
@@ -857,8 +873,10 @@ function signup_object_info() {
  */ 
 function signup_load_signup($sid) {
   $signup = db_fetch_object(db_query("SELECT sl.*, n.title, u.name FROM {signup_log} sl INNER JOIN {node} n ON sl.nid = n.nid INNER JOIN {users} u ON sl.uid = u.uid WHERE sl.sid = %d", $sid));
-  // This label is escaped by VBO, so it needs to be plain text, not HTML.
-  $signup->label = t("!user signup for '!title'", array('!user' => $signup->name, '!title' => $signup->title));
+  if (!empty($signup)) {
+    // This label is escaped by VBO, so it needs to be plain text, not HTML.
+    $signup->label = t("!user signup for '!title'", array('!user' => $signup->name, '!title' => $signup->title));
+  }
   return $signup;
 }
 
@@ -1318,13 +1336,8 @@ function _signup_get_email_tokens($node,
     }
     $tokens['%user_signup_info'] = theme('signup_email_token_custom_data', $signup_data);
   }
-  // Determine if this is an anon signup or not, and get the right info.
-  if (!empty($signup->anon_mail)) {
-    $tokens['%user_name'] = theme('signup_email_token_anonymous_username', $signup_data, $signup->anon_mail);
-  }
-  else {
-    $tokens['%user_name'] = $signup->name;
-  }
+
+  $tokens['%user_name'] = _signup_get_username($signup);
   $tokens['%user_mail'] = _signup_get_email($signup);
   $tokens['%cancel_signup_url'] = _signup_get_cancel_link($signup->sid);
 
@@ -1345,6 +1358,42 @@ function _signup_get_email($signup) {
 }
 
 /**
+ * Get the name to use for a given signup.
+ *
+ * @param $signup
+ *   A fully-loaded signup object.
+ * @param $link
+ *   Optional boolean indicating that the name should be rendered as a link to
+ *   the user's profile (if it's an authenticated signup).
+ *
+ * @return
+ *   The appropriate name to use for the signed up user.
+ */
+function _signup_get_username($signup, $link = FALSE) {
+  // Get the array of custom signup data (if any).
+  $signup_data = array();
+  if (!empty($signup->form_data)) {
+    if (is_array($signup->form_data)) {
+      $signup_data = $signup->form_data;
+    }
+    else {
+      $signup_data = unserialize($signup->form_data);
+    }
+  }
+  // Determine if this is an anon signup or not, and get the right info.
+  if (!empty($signup->anon_mail)) {
+    $user_name = theme('signup_anonymous_username', $signup_data, $signup->anon_mail);
+  }
+  elseif ($link) {
+    $user_name = theme('username', $signup);
+  }
+  else {
+    $user_name = $signup->name;
+  }
+  return $user_name;
+}
+
+/**
  * Generate a link to cancel a given signup.
  */
 function _signup_get_cancel_link($sid) {
cvs diff: Diffing includes
Index: includes/node_output.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/signup/includes/node_output.inc,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 node_output.inc
--- includes/node_output.inc	14 Jan 2009 18:11:21 -0000	1.1.2.4
+++ includes/node_output.inc	22 Jan 2009 17:40:21 -0000
@@ -40,6 +40,7 @@ function _signup_node_output($node, $typ
 function _signup_current_user_signup($node, $type = 'node') {
   global $user;
   $output = '';
+  $fieldset = $type == 'node' ? TRUE : FALSE;
   // The node has been closed for signups, and the user has
   // signup permissions.  Let them know it's closed.
   if (!$node->signup_status) {
@@ -48,17 +49,15 @@ function _signup_current_user_signup($no
       // If they're logged in and already signed up, show their current
       // signup info and give them the option to cancel.
       if ($user->uid) {
-        $result = db_query("SELECT * FROM {signup_log} WHERE uid = %d AND nid = %d", $user->uid, $node->nid);
-        $signup_info = db_fetch_object($result);
-        if (!empty($signup_info)) {
-          $current_signup = _signup_print_current_signup($node, $signup_info);
+        $signup = db_fetch_object(db_query("SELECT sl.*, n.title, u.name FROM {signup_log} sl INNER JOIN {node} n ON sl.nid = n.nid INNER JOIN {users} u ON sl.uid = u.uid WHERE sl.uid = %d AND sl.nid = %d", $user->uid, $node->nid));
+        if (!empty($signup)) {
+          $output .= _signup_render_signup_edit_form($signup, $type);
         }
       }
       $output .= theme('signup_signups_closed', $node, $current_signup);
     }
   }
   else {
-    $fieldset = $type == 'node' ? TRUE : FALSE;
     if ($user->uid == 0) {
       // This is an anonymous user.
       if (user_access('sign up for content')) {
@@ -91,9 +90,8 @@ function _signup_current_user_signup($no
       // An authenticated user.
 
       // See if the user is already signed up for this node.
-      $result = db_query("SELECT * FROM {signup_log} WHERE uid = %d AND nid = %d", $user->uid, $node->nid);
-      $signup_info = db_fetch_object($result);
-      if (empty($signup_info)) {
+      $signup = db_fetch_object(db_query("SELECT sl.*, n.title, u.name FROM {signup_log} sl INNER JOIN {node} n ON sl.nid = n.nid INNER JOIN {users} u ON sl.uid = u.uid WHERE sl.uid = %d AND sl.nid = %d", $user->uid, $node->nid));
+      if (empty($signup)) {
         // Not yet signed up
         if (user_access('sign up for content')) {
           // User has permission to do so, so give them the form.
@@ -103,7 +101,7 @@ function _signup_current_user_signup($no
       }
       else {
         // Already signed up, display their info.
-        $output .= _signup_print_current_signup($node, $signup_info);
+        $output .= _signup_render_signup_edit_form($signup, $type);
       }
     }
   }
@@ -173,36 +171,15 @@ function signup_node_tab($node) {
 }
 
 /**
- * Helper function to display the current user's signup information.
- *
- * Contains the logic to determine what should be displayed, then invokes the
- * appropriate form builder and theme functions.
- *
- * @param $node
- *   The fully-loaded node object to display signup data about.
- * @param $signup_info
- *   Database object with information about the signup to display.
- *
- * @return
- *   Themed HTML to output for the given node and signup.
- *
- * @see theme_signup_current_signup()
+ * Helper function to render the form to edit your own signup.
  */
-function _signup_print_current_signup($node, $signup_info) {
-  // Generate an array of data about the current signup for the theme function.
-  $signup_data = array();
-  $signup_data['custom_data'] = unserialize($signup_info->form_data);
-  $signup_data['signup_timestamp'] = $signup_info->signup_time;
-
-  // See if the current user is allowed to cancel their signup, and if so,
-  // render the HTML for the cancel form (which is just a single button).
-  $cancel_signup_form = '';
-  if (user_access('cancel own signups')) {
-    module_load_include('inc', 'signup', 'includes/signup_cancel_form');
-    $cancel_signup_form = drupal_get_form('signup_cancel_form', $signup_info->sid);
+function _signup_render_signup_edit_form($signup, $type) {
+  $path = drupal_get_path('module', 'signup');
+  if ($type == 'node') {
+    drupal_add_css("$path/signup.css");
   }
-
-  // Hand off everything to the theme function for actual HTML generation.
-  return theme('signup_current_signup', $signup_data, $cancel_signup_form);
+  drupal_add_js("$path/js/signup_edit_form.js");
+  module_load_include('inc', 'signup', 'includes/signup_edit_form');
+  return drupal_get_form('signup_edit_form', $signup, $type);
 }
 
Index: includes/signup_cancel_form.inc
===================================================================
RCS file: includes/signup_cancel_form.inc
diff -N includes/signup_cancel_form.inc
--- includes/signup_cancel_form.inc	19 Dec 2008 01:00:35 -0000	1.1.2.1
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,35 +0,0 @@
-<?php
-// $Id: signup_cancel_form.inc,v 1.1.2.1 2008/12/19 01:00:35 dww Exp $
-
-
-/**
- * @file
- * Code for the signup cancel form.
- */
-
-/**
- * Submit handler for the cancel signup form.
- *
- * @param $form
- *   The form being submitted.
- * @param $form_state
- *   The state of the submitted form, including the values.
- */
-function signup_cancel_form_submit($form, &$form_state) {
-  signup_cancel_signup($form_state['values']['sid']);
-}
-
-/**
- * Form builder for the cancel signup form.
- *
- * @param $form_state
- *   The form state from the FormAPI.
- * @param $sid
- *   The signup ID (sid) to cancel (primary key of the {signup_log} table).
- */
-function signup_cancel_form(&$form_state, $sid) {
-  $form['sid'] = array('#type' => 'value', '#value' => $sid);
-  $form['submit'] = array('#type' => 'submit', '#value' => t('Cancel signup'));
-  return $form;
-}
-
Index: includes/signup_edit_form.inc
===================================================================
RCS file: includes/signup_edit_form.inc
diff -N includes/signup_edit_form.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ includes/signup_edit_form.inc	22 Jan 2009 17:40:22 -0000
@@ -0,0 +1,172 @@
+<?php
+// $Id$
+
+
+/**
+ * @file
+ * Code for the form to edit existing signups.
+ */
+
+/**
+ * Build the form for editing existing signups.
+ *
+ * @param $form_state
+ *   The state of the form to build (not currently used).
+ * @param $signup
+ *   The fully-loaded signup object with data about the signup to edit.
+ * @param $type
+ *   The type of signup edit form to render, can be 'node', 'tab', or 'admin'.
+ *
+ * @return
+ *   The FAPI form array for the signup edit form.
+ */
+function signup_edit_form($form_state, $signup, $type) {
+  global $user;
+  $form = array();
+
+  $form['#signup'] = $signup;
+  $node = node_load($signup->nid);
+
+  // Check permissions.
+  $admin = _signup_menu_access($node, 'admin');
+  $own = !empty($user->uid) && $user->uid == $signup->uid;
+  $can_cancel = $admin || (user_access('cancel own signups') && $own);
+  $can_edit = $admin || (user_access('edit own signups') && $own);
+
+  if ($type == 'admin') {
+    $title = t("Information for !user's signup to !node", array('!user' => _signup_get_username($signup, TRUE), '!node' => l($node->title, 'node/'. $node->nid)));
+  }
+  else {
+    $title = t('Your signup information');
+  }
+
+  if ($type == 'node') {
+    $form['elements'] = array(
+      '#type' => 'fieldset',
+      '#title' => $title,
+      '#collapsible' => TRUE,
+      '#collapsed' => variable_get('signup_fieldset_collapsed', 1),
+    );
+  }
+  else {
+    $form['elements'] = array();
+    $form['elements']['header'] = array(
+      '#type' => 'markup',
+      '#value' => $title,
+      '#prefix' => '<h4>',
+      '#suffix' => '</h4>',
+    );
+  }
+
+  if (!empty($signup->anon_mail)) {
+    $form['elements']['signup_anon_mail'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Email'),
+      '#default_value' => $signup->anon_mail,
+      '#size' => 40,
+      '#maxlength' => 255,
+      '#required' => TRUE,
+    );
+    $form['#validate'][] = 'signup_validate_anon_mail';
+  }
+
+  // Build the themed signup form for this site and include that.
+  $site_form = theme('signup_user_form', $node);
+  $form_data = unserialize($signup->form_data);
+
+  // This is sort of a hack, but we don't support nested arrays for the custom
+  // signup form anyway, so it works for now.  Obviously all this will change
+  // with signup_fields and friends, but for now it works.
+  foreach ($form_data as $key => $value) {
+    if (!empty($site_form['signup_form_data'][$key])) {
+      $site_form['signup_form_data'][$key]['#default_value'] = $value;
+      if (!$can_edit) {
+        // If they can't edit, mark all the fields as disabled.
+        $site_form['signup_form_data'][$key]['#disabled'] = TRUE;
+        // Also, remove the required attribute from all fields (so that the
+        // cancel button, if it exists, will work).
+        $site_form['signup_form_data'][$key]['#required'] = FALSE;
+      }
+    }
+  }
+  $form['elements'] += $site_form;
+
+  // Add the appropriate buttons based on permissions.
+  if ($can_edit) {
+    $form['elements']['save'] = array(
+      '#type' => 'submit',
+      '#value' => t('Save'),
+      '#submit' => array('signup_edit_form_update_submit'),
+    );
+  }
+  if ($can_cancel) {
+    $form['elements']['cancel-signup'] = array(
+      '#type' => 'submit',
+      '#value' => t('Cancel signup'),
+      '#submit' => array('signup_edit_form_cancel_submit'),
+    );
+  }
+
+  return $form;
+}
+
+/**
+ * Validation callback when editing the anonymous email for an existing signup.
+ */
+function signup_validate_anon_mail($form, &$form_state) {
+  $mail = $form_state['values']['signup_anon_mail'];
+  if (!valid_email_address($mail)) {
+    form_set_error('signup_anon_mail', t('The e-mail address %mail is not valid.', array('%mail' => $mail)));
+  }
+}
+
+/**
+ * Submit callback when updating an existing signup.
+ */
+function signup_edit_form_update_submit($form, $form_state) {
+  $signup_info = array();
+  if (!empty($form_state['values']['signup_form_data'])) {
+    $signup_info = $form_state['values']['signup_form_data'];
+  }
+  $values[] = "form_data = '%s'";
+  $args[] = serialize($signup_info);
+
+  // If the form contains an e-mail address for an anonymous signup, save it.
+  if (!empty($form_state['values']['signup_anon_mail'])) {
+    $values[] = "anon_mail = '%s'";
+    $args[] = $form_state['values']['signup_anon_mail'];
+  }
+
+  /// @TODO invoke a hook?
+  /// @TODO should we have a "signup_update_time" field and update that, too?
+  $updates = implode(', ', $values);
+  $args[] = $form['#signup']->sid;
+  db_query("UPDATE {signup_log} SET $updates WHERE sid = %d", $args);
+  drupal_set_message(t('Signup information updated.'));
+}
+
+/**
+ * Submit callback to cancel the signup when editing an existing signup.
+ */
+function signup_edit_form_cancel_submit($form, &$form_state) {
+  signup_cancel_signup($form['#signup']->sid);
+  if (empty($_REQUEST['destination'])) {
+    // If there's no destination already set, redirect to the node.
+    $form_state['redirect'] = 'node/'. $form['#signup']->nid;
+  }
+}
+
+/**
+ * Page handler for the administrator page to edit an existing signup.
+ *
+ * @param $signup
+ *   The fully-loaded signup object to edit.
+ *
+ * @return
+ *   The HTML to use for the signup edit page.
+ */
+function signup_edit_page($signup) {
+  drupal_set_title(t('Edit signup'));
+  return drupal_get_form('signup_edit_form', $signup, 'admin');
+}
+
cvs diff: Diffing js
Index: js/signup_edit_form.js
===================================================================
RCS file: js/signup_edit_form.js
diff -N js/signup_edit_form.js
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ js/signup_edit_form.js	22 Jan 2009 17:40:22 -0000
@@ -0,0 +1,35 @@
+/* $Id$ */
+
+/**
+ * On the signup edit form, add some bling to make users "confirm" the edit.
+ *
+ * When the form first loads, all the form elements are disabled
+ * except for the 'Update signup' button.  When a user clicks that,
+ * the other form elements are enabled, and the 'Update signup' button
+ * text changes into 'Save changes'.
+ *
+ * We also have to enable the form elements whenever the form is
+ * submitted so that the cancel button works properly.
+ */
+Drupal.behaviors.enableSignupEditForm = function(context) {
+  var $button = $('#edit-save', context).click(enableSave);
+  var $form = $button.parents('form:first');
+  var $form_elements = $form.find('input:not(:hidden), textarea, select');
+  var original_button_title = $button.val();
+ 
+  $form_elements.attr('disabled', 'disabled');
+  $button.attr('disabled', '').val(Drupal.t('Edit'));
+  $('#edit-cancel-signup').attr('disabled', '')
+  $form.submit(enableElements);
+ 
+  function enableSave() {
+    $form_elements.attr('disabled', '');
+    $button.unbind('click', enableSave).val(original_button_title);
+    return false;
+  }
+ 
+  function enableElements() {
+    $form_elements.attr('disabled', '');
+  }
+}
+
cvs diff: Diffing panels
cvs diff: Diffing panels/content_types
cvs diff: Diffing theme
Index: theme/node.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/signup/theme/node.inc,v
retrieving revision 1.1.2.1
diff -u -p -r1.1.2.1 node.inc
--- theme/node.inc	7 Jan 2009 00:55:05 -0000	1.1.2.1
+++ theme/node.inc	22 Jan 2009 17:40:22 -0000
@@ -58,81 +58,3 @@ function theme_signup_anonymous_user_log
 function theme_signup_node_output_header($node) {
   return '<a name="signup"></a>';
 }
-
-/**
- * Controls the output of the users signup data and optional cancel button.
- *
- * @param $signup_data
- *   Array containing information about the user's signup.  Contains:
- *   'signup_timestamp' - Integer timestamp when the user signed up.
- *   'custom_data' - Array containing the user's custom signup data.
- * @param $cancel_signup_form
- *   Optional HTML for a "Cancel signup" button if the user is allowed.
- *
- * @return
- *   Themed output containing the user's current signup information.
- */
-function theme_signup_current_signup($signup_data, $cancel_signup_form = '') {
-  $output = theme('signup_custom_data_table', $signup_data['custom_data']);
-  $output .= $cancel_signup_form;
-  return $output;
-}
-
-/**
- * Renders custom signup user data into a table.
- *
- * @param $data
- *   Array of custom user signup data.
- *
- * @return
- *   The themed table with custom signup user data.
- *
- * @see theme_signup_user_form()
- */
-function theme_signup_custom_data_table($data) {
-  $output = '';
-  if (is_array($data)) {
-    $header = array(array('data' => t('Your signup information'), 'colspan' => 2));
-    $rows = theme('signup_custom_data_rows', $data);
-    $output .= theme('table', $header, $rows);
-  }
-  return $output;
-}
-
-/**
- * Renders custom signup user data into table rows.
- *
- * WARNING: This theme function is recursive (it calls itself for
- * nested data), so if you override it, be sure not to change the part
- * where it does "call_user_func(__FUNCTION__)".
- *
- * @param $data
- *   Array of custom user signup data.
- *
- * @return
- *   An array of table rows.
- *
- * @see theme_signup_user_form()
- */
-function theme_signup_custom_data_rows($data) {
-  $rows = array();
-  // All of the possible array key values should already be translated as
-  // string literals in theme_signup_user_form() via the #title attributes, so
-  // passing a variable to t() is actually safe here.  However, to avoid
-  // warnings when extracting strings, "hide" the call to t() by using a
-  // variable to hold the function name.
-  $tr = 't';
-  // Loop through each first level element.
-  foreach ($data as $key => $value) {
-    if (is_array($value)) {
-      // Element is nested, render it recursively.
-      // Instead of the overhead of theme(), just call ourself directly.
-      $rows += call_user_func(__FUNCTION__, $value);
-    }
-    else {
-      $rows[] = array($tr($key) .':', check_plain($value));
-    }
-  }
-  return $rows;
-}
-
Index: theme/signup_form.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/signup/theme/signup_form.inc,v
retrieving revision 1.3.2.1
diff -u -p -r1.3.2.1 signup_form.inc
--- theme/signup_form.inc	7 Jan 2009 00:55:05 -0000	1.3.2.1
+++ theme/signup_form.inc	22 Jan 2009 17:40:22 -0000
@@ -17,7 +17,7 @@
  *
  * WARNING: If your site allows anonymous signups and you alter the
  * 'Name' field in this function, you will probably have to implement a
- * version of theme_signup_email_token_anonymous_username() for your site.
+ * version of theme_signup_anonymous_username() for your site.
  *
  * In order for the form to be rendered properly and for the custom
  * fields to be fully translatable when printed in other parts of the
@@ -42,7 +42,7 @@
  * @return
  *   Array defining the form to present to the user to signup for a node.
  *
- * @see theme_signup_email_token_anonymous_username()
+ * @see theme_signup_anonymous_username()
  */
 function theme_signup_user_form($node) {
   global $user;
@@ -73,12 +73,15 @@ function theme_signup_user_form($node) {
 }
 
 /**
- * Returns the value to use for the %user_name email token for anonymous users.
+ * Returns the value to use for the user name for anonymous signups.
  *
  * WARNING: If you implemented your own version of theme_signup_form_data()
  * that changed or removed the custom 'Name' field and your site
  * allows anonymous signups, you will need to modify this, too.
  *
+ * This value is used for the %user_name email token for anonymous users, and
+ * also to identify a particular anonymous signup in various places in the UI.
+ *
  * @param $form_data
  *   Array of custom signup form values for the current signup.
  * @param $email
@@ -88,7 +91,7 @@ function theme_signup_user_form($node) {
  *
  * @see theme_signup_user_form()
  */
-function theme_signup_email_token_anonymous_username($form_data, $email) {
+function theme_signup_anonymous_username($form_data, $email) {
   // In some cases, the best you can do is to use the anonymous user's
   // supplied email address, in which case, you should uncomment this:
   //return $email;
@@ -97,3 +100,4 @@ function theme_signup_email_token_anonym
   // your site's version of theme_signup_user_form().
   return $form_data['Name'];
 }
+
cvs diff: Diffing translations
cvs diff: Diffing views
Index: views/signup.views.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/signup/views/signup.views.inc,v
retrieving revision 1.4.2.5
diff -u -p -r1.4.2.5 signup.views.inc
--- views/signup.views.inc	14 Jan 2009 17:36:18 -0000	1.4.2.5
+++ views/signup.views.inc	22 Jan 2009 17:40:22 -0000
@@ -274,6 +274,14 @@ function signup_views_data() {
     ),
   );
 
+  $data['signup_log']['edit_link'] = array(
+    'title' => t('User: Edit signup link'),
+    'field' => array(
+      'handler' => 'signup_handler_field_signup_edit_link',
+      'help' => t('Link to edit this particular signup.'),
+    ),
+  );
+
   return $data;
 }
 
@@ -292,6 +300,9 @@ function signup_views_handlers() {
       'signup_handler_argument_signup_user_uid' => array(
         'parent' => 'views_handler_argument_numeric',
       ),
+      'signup_handler_field_signup_edit_link' => array(
+        'parent' => 'views_handler_field_node_link',
+      ),
       'signup_handler_field_signup_node_link' => array(
         'parent' => 'views_handler_field_node_link',
       ),
cvs diff: Diffing views/handlers
Index: views/handlers/signup_handler_field_signup_edit_link.inc
===================================================================
RCS file: views/handlers/signup_handler_field_signup_edit_link.inc
diff -N views/handlers/signup_handler_field_signup_edit_link.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ views/handlers/signup_handler_field_signup_edit_link.inc	22 Jan 2009 17:40:22 -0000
@@ -0,0 +1,33 @@
+<?php
+// $Id$
+
+/**
+ * Field handler to generate a link to edit a given signup.
+ */
+class signup_handler_field_signup_edit_link extends views_handler_field_node_link {
+  function construct() {
+    parent::construct();
+    $this->additional_fields['sid'] = array('table' => 'signup_log', 'field' => 'sid');
+    $this->additional_fields['uid'] = array('table' => 'signup_log', 'field' => 'uid');
+  }
+
+  function render($values) {
+    global $user;
+
+    // Check access to edit this signup.
+    $signup = new StdClass();
+    $signup->sid = $values->{$this->aliases['sid']};
+    $signup->nid = $values->{$this->aliases['nid']};
+    $signup->uid = $values->{$this->aliases['uid']};
+    if (!_signup_edit_menu_access($signup)) {
+      return;
+    }
+
+    // If we made it this far, generate the actual link.
+    $text = !empty($this->options['text']) ? $this->options['text'] : t('Edit signup');
+    $url = "signup/edit/$signup->sid";
+    $link_options['query'] = drupal_get_destination();
+    return l($text, $url, $link_options);
+  }
+}
+
cvs diff: Diffing views/plugins
