From 4e513ec721ba04fbbe49f8fe8455e2efd563c18e Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Wed, 4 Mar 2015 16:18:13 +1100 Subject: [PATCH] Group admin options more logically --- booking.admin.inc | 152 +++++++++++++++++++++++++--------------------- 1 file changed, 82 insertions(+), 70 deletions(-) diff --git a/booking.admin.inc b/booking.admin.inc index 561b478..4692db6 100644 --- a/booking.admin.inc +++ b/booking.admin.inc @@ -109,33 +109,54 @@ function booking_admin() { '#default_value' => variable_get('booking_paypal_sandbox', 0), ); + $form['features'] = array ( + '#type' => 'fieldset', + '#title' => 'Enable/Disable Features', + ); + $form['features']['booking_enable_roomallocations'] = array ( + '#type' => 'radios', + '#title' => t('Enable room allocations?'), + '#description' => t('Select whether to enable the management and allocation of rooms.'), + '#options' => array (0 => t('No'), t('Yes')), + '#default_value' => variable_get('booking_enable_roomallocations', 0), + ); + + $form['features']['booking_enable_studygroups'] = array ( + '#type' => 'radios', + '#title' => t('Enable study group calculations?'), + '#description' => t('Select whether to enable the creation and management of study groups.'), + '#options' => array (0 => t('No'), t('Yes')), + '#default_value' => variable_get('booking_enable_studygroups', 0), + ); + $form['features']['booking_enable_travelform'] = array ( + '#type' => 'radios', + '#title' => t('Enable travel details form?'), + '#description' => t('Select whether to enable the form that allows attendees to enter their travel details.'), + '#options' => array (0 => t('No'), t('Yes')), + '#default_value' => variable_get('booking_enable_travelform', 0), + ); + $form['features']['booking_readinggroup_id'] = array ( + '#type' => 'textfield', + '#title' => t('Studygroup ID for the reading group'), + '#description' => t("Set the ID for the studygroup that corresponds with the reading group. Set to zero if reading groups aren't in use."), + '#size' => 3, + '#maxlength' => 3, + '#default_value' => variable_get('booking_readinggroup_id','0'), + ); + $form['features']['booking_publish_readinggroups'] = array ( + '#type' => 'radios', + '#title' => t('Display reading group colours on the Who\'s Coming page?'), + '#description' => t('Select whether to publish reading group colours.'), + '#options' => array (0 => t('No'), t('Yes')), + '#default_value' => variable_get('booking_publish_readinggroups', 0), + ); + $form['misc'] = array ( '#type' => 'fieldset', '#title' => 'Configuration Options', ); - $form['misc']['booking_default_country'] = array ( - '#type' => 'select', - '#title' => t('Select Default Country'), - '#description' => t('Select default country for residential address.'), - '#options' => _booking_country_options(), - '#default_value' => variable_get('booking_default_country', 'Australia'), - ); - $form['misc']['booking_default_state'] = array ( - '#type' => 'select', - '#title' => t('Select Default State'), - '#description' => t('Select default state for residential address.'), - '#options' => _booking_state_options(), - '#default_value' => variable_get('booking_default_state', 'NSW'), - ); - - $form['misc']['booking_default_gender'] = array ( - '#type' => 'select', - '#title' => t('Select Default Gender'), - '#description' => t('Select default gender for booking form.'), - '#options' => _booking_gender_options(), - '#default_value' => variable_get('booking_default_gender', 'M'), - ); + $form['misc']['booking_allow_couples'] = array ( '#type' => 'radios', '#title' => t('Allow married couples?'), @@ -179,21 +200,50 @@ function booking_admin() { '#options' => array (0 => t('No'), t('Yes')), '#default_value' => variable_get('booking_enable_combined_pricing', 0), ); - $form['misc']['booking_enable_medicare'] = array ( + + $form['regn_options'] = array ( + '#type' => 'fieldset', + '#title' => 'Registration Form Configuration', + ); + + $form['regn_options']['booking_default_country'] = array ( + '#type' => 'select', + '#title' => t('Select Default Country'), + '#description' => t('Select default country for residential address.'), + '#options' => _booking_country_options(), + '#default_value' => variable_get('booking_default_country', 'Australia'), + ); + $form['regn_options']['booking_default_state'] = array ( + '#type' => 'select', + '#title' => t('Select Default State'), + '#description' => t('Select default state for residential address.'), + '#options' => _booking_state_options(), + '#default_value' => variable_get('booking_default_state', 'NSW'), + ); + + $form['regn_options']['booking_default_gender'] = array ( + '#type' => 'select', + '#title' => t('Select Default Gender'), + '#description' => t('Select default gender for booking form.'), + '#options' => _booking_gender_options(), + '#default_value' => variable_get('booking_default_gender', 'M'), + ); + + $form['regn_options']['booking_enable_medicare'] = array ( '#type' => 'radios', '#title' => t('Enable Medicare requirement?'), '#description' => t('Select whether to require bookings to enter medicare details.'), '#options' => array (0 => t('No'), t('Yes')), '#default_value' => variable_get('booking_enable_medicare', 1), ); - $form['misc']['booking_enable_tshirts'] = array ( + $form['regn_options']['booking_enable_tshirts'] = array ( '#type' => 'radios', '#title' => t('Enable sizing information?'), '#description' => t('Select whether to include clothe sizing in the booking form.'), '#options' => array (0 => t('No'), t('Yes')), '#default_value' => variable_get('booking_enable_tshirts', 0), ); - $form['misc']['booking_tshirts_text_definition'] = array ( + $form['regn_options']['booking_tshirts_text_definition'] = array ( '#type' => 'textfield', '#title' => t('Clothes Sizing Text Definition'), '#default_value' => variable_get('booking_tshirts_text_definition', 'Preferred t-shirt size'), @@ -201,42 +251,42 @@ function booking_admin() { '#size' => 150, '#maxlength' => 2000, ); - $form['misc']['booking_enable_passport'] = array ( + $form['regn_options']['booking_enable_passport'] = array ( '#type' => 'radios', '#title' => t('Enable passport information?'), '#description' => t('Select whether to include passport details in the booking form.'), '#options' => array (0 => t('No'), t('Yes')), '#default_value' => variable_get('booking_enable_passport', 0), ); - $form['misc']['booking_enable_helpareas'] = array ( + $form['regn_options']['booking_enable_helpareas'] = array ( '#type' => 'radios', '#title' => t('Enable help area questions?'), '#description' => t('Select whether to include questions about areas people are willing to help with in the booking form.'), '#options' => array (0 => t('No'), t('Yes')), '#default_value' => variable_get('booking_enable_helpareas', 0), ); - $form['misc']['booking_enable_skills'] = array ( + $form['regn_options']['booking_enable_skills'] = array ( '#type' => 'radios', '#title' => t('Enable special skills information?'), '#description' => t('Select whether to include questions about special skills people have in the booking form.'), '#options' => array (0 => t('No'), t('Yes')), '#default_value' => variable_get('booking_enable_skills', 0), ); - $form['misc']['booking_enable_roommate'] = array ( + $form['regn_options']['booking_enable_roommate'] = array ( '#type' => 'radios', '#title' => t('Enable room-mate selection?'), '#description' => t('Select whether to allow attendees to list a preferred room-mate in the booking form.'), '#options' => array (0 => t('No'), t('Yes')), '#default_value' => variable_get('booking_enable_roommate', 0), ); - $form['misc']['booking_enable_dietary'] = array ( + $form['regn_options']['booking_enable_dietary'] = array ( '#type' => 'radios', '#title' => t('Allow attendee to specify dietary requirements?'), '#description' => t('If set to No, the following text definition will be used instead.'), '#options' => array (0 => t('No'), t('Yes')), '#default_value' => variable_get('booking_enable_dietary', 0), ); - $form['misc']['booking_dietary_text_definition'] = array ( + $form['regn_options']['booking_dietary_text_definition'] = array ( '#type' => 'textfield', '#title' => t('Dietary Requirements Text Definition'), '#default_value' => variable_get('booking_dietary_text_definition', 'Please use the contact us form to indicate what dietary requirements you have.'), @@ -244,45 +294,7 @@ function booking_admin() { '#size' => 150, '#maxlength' => 2000, ); - $form['misc']['booking_enable_roomallocations'] = array ( - '#type' => 'radios', - '#title' => t('Enable room allocations?'), - '#description' => t('Select whether to enable the management and allocation of rooms.'), - '#options' => array (0 => t('No'), t('Yes')), - '#default_value' => variable_get('booking_enable_roomallocations', 0), - ); - $form['misc']['booking_enable_studygroups'] = array ( - '#type' => 'radios', - '#title' => t('Enable study group calculations?'), - '#description' => t('Select whether to enable the creation and management of study groups.'), - '#options' => array (0 => t('No'), t('Yes')), - '#default_value' => variable_get('booking_enable_studygroups', 0), - ); - /* - $form['misc']['booking_studygroup_count'] = array ( - '#type' => 'textfield', - '#title' => t('Number of study groups'), - '#description' => t("Total number of study groups in use. Make sure this matches the actual number defined."), - '#size' => 3, - '#maxlength' => 3, - '#default_value' => variable_get('booking_studygroup_count','0'), - ); - */ - $form['misc']['booking_readinggroup_id'] = array ( - '#type' => 'textfield', - '#title' => t('Studygroup ID for the reading group'), - '#description' => t("Set the ID for the studygroup that corresponds with the reading group. Set to zero if reading groups aren't in use."), - '#size' => 3, - '#maxlength' => 3, - '#default_value' => variable_get('booking_readinggroup_id','0'), - ); - $form['misc']['booking_publish_readinggroups'] = array ( - '#type' => 'radios', - '#title' => t('Display reading group colours on the Who\'s Coming page?'), - '#description' => t('Select whether to publish reading group colours.'), - '#options' => array (0 => t('No'), t('Yes')), - '#default_value' => variable_get('booking_publish_readinggroups', 0), - ); + $form['management'] = array ( '#type' => 'fieldset', '#title' => 'Data Management Options',