diff -urp signup_status/signup_status.admin.inc signup_status.default_status/signup_status.admin.inc --- signup_status/signup_status.admin.inc 2009-09-21 13:44:30.000000000 +1000 +++ signup_status.default_status/signup_status.admin.inc 2009-10-08 17:58:08.000000000 +1100 @@ -133,7 +133,19 @@ function signup_status_admin_settings_fo '#type' => 'item', '#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."), ); - + + $codes = signup_status_codes(); + foreach ($codes as $id => $status) { + $options[$id] = $status['name']; + } + $form['signup_status_default'] = array( + '#type' => 'select', + '#title' => t('Default status'), + '#default_value' => variable_get('signup_status_default', 1), + '#options' => $options, + '#description' => t('The status that will be automatically assigned to new signups.'), + ); + $form['submit'] = array( '#type' => 'submit', '#value' => t('Save configuration'), @@ -209,6 +221,9 @@ function signup_status_admin_settings_fo signup_status_admin_signup_count_change($count_changed_status_codes); } } + + if (isset($values['signup_status_default'])) + variable_set('signup_status_default', $values['signup_status_default']); } /** diff -urp signup_status/signup_status.module signup_status.default_status/signup_status.module --- signup_status/signup_status.module 2009-09-21 09:15:16.000000000 +1000 +++ signup_status.default_status/signup_status.module 2009-10-08 17:58:13.000000000 +1100 @@ -150,6 +150,9 @@ function signup_status_signup_data_alter if (!empty($form_values['signup_status'])) { $signup->status = $form_values['signup_status']; } + else { + $signup->status = variable_get('signup_status_default', 1); + } // See if the current status should impact the signup total or not. if (!empty($signup->status)) { @@ -209,6 +212,9 @@ function _signup_status_status_form_elem if (isset($current_status)) { $element['#default_value'] = $current_status; } + else { + $element['#default_value'] = variable_get('signup_status_default', 1); + } } return $element; }