Index: signup_status.admin.inc =================================================================== --- signup_status.admin.inc (revision 30) +++ signup_status.admin.inc (working copy) @@ -134,6 +134,18 @@ '#description' => t("This table defines the signup status options available on this site. If the 'Modify signup count' box is checked, signups in that status will be counted towards the signup limit (if any). Note that changing this value once signups exist will update those signups and potentially open or close signups on the affected event(s). If the 'Show on form' box is checked, users will have the option of selecting the status when they signup or edit an existing signup. The order of statusus in this table determines the ordering choices on the signup form (if any are shown). The blank row at the bottom can be used to add a new status."), ); + $options[0] = 'No default'; + foreach ($signup_status_codes as $id => $status) { + $options[$id] = $status['name']; + } + $form['signup_status_default_status'] = array( + '#type' => 'select', + '#title' => t('Default status'), + '#default_value' => variable_get('signup_status_default_status', 0), + '#options' => $options, + '#description' => t('If no status is specified during signup, automatically assign this default status.'), + ); + $form['submit'] = array( '#type' => 'submit', '#value' => t('Save configuration'), @@ -209,6 +221,10 @@ signup_status_admin_signup_count_change($count_changed_status_codes); } } + + if (isset($values['signup_status_default_status'])) { + variable_set('signup_status_default_status', $values['signup_status_default_status']); + } } /** Index: signup_status.module =================================================================== --- signup_status.module (revision 30) +++ signup_status.module (working copy) @@ -150,7 +150,10 @@ if (!empty($form_values['signup_status'])) { $signup->status = $form_values['signup_status']; } - + else { + $signup->status = variable_get('signup_status_default_status', 0); + } + // See if the current status should impact the signup total or not. if (!empty($signup->status)) { $signup_status_codes = signup_status_codes(); @@ -209,6 +212,12 @@ if (isset($current_status)) { $element['#default_value'] = $current_status; } + else { + $default = variable_get('signup_status_default_status', 0); + if ($default) { + $element['#default_value'] = $default; + } + } } return $element; }