781 lines
33 KiB
PHP
781 lines
33 KiB
PHP
<?php
|
|
/**
|
|
* @file
|
|
* The administration menu implementations for the booking module configuration pages
|
|
*/
|
|
|
|
function booking_admin() {
|
|
$form = array();
|
|
|
|
//regenerate all our menu hooks when loading this form
|
|
menu_rebuild();
|
|
|
|
//create the mysql view booking_person_view if necessary
|
|
try {
|
|
$sqlview_check = db_query("SELECT * FROM {booking_person_view}")->fetchAssoc();
|
|
watchdog('booking_debug', "<pre>SQL View booking_person_view check\n@info</pre>", array('@info' => print_r( $sqlview_check, true)));
|
|
}
|
|
catch (Exception $e) {
|
|
watchdog('booking_debug', "<pre>SQL View booking_person_view check does not exist\n@info</pre>", array('@info' => $e->getMessage()));
|
|
_booking_node_create_mysqlview();
|
|
}
|
|
|
|
//form commences here
|
|
$form['email'] = array(
|
|
'#type' => 'fieldset',
|
|
'#title' => 'Email Addresses',
|
|
'#collapsible' => TRUE,
|
|
);
|
|
|
|
$form['email']['booking_from_email'] = array(
|
|
'#type' => 'textfield',
|
|
'#title' => t('Sender Email Address'),
|
|
'#description' => t("The email address used as the source of outbound emails."),
|
|
'#size' => 60,
|
|
'#maxlength' => 150,
|
|
'#required' => TRUE,
|
|
'#default_value' => variable_get('booking_from_email', variable_get('site_mail', ini_get('sendmail_from')))
|
|
);
|
|
|
|
$form['email']['booking_notify_email'] = array(
|
|
'#type' => 'textfield',
|
|
'#title' => t('Notification Email Address(es)'),
|
|
'#description' => t("The email addresses to which registration notifications are sent."),
|
|
'#size' => 60,
|
|
'#maxlength' => 200,
|
|
'#required' => TRUE,
|
|
'#default_value' => variable_get('booking_notify_email', variable_get('site_mail', ini_get('sendmail_from')))
|
|
);
|
|
|
|
$form['email']['booking_contact_email'] = array(
|
|
'#type' => 'textfield',
|
|
'#title' => t('Contact Email Address'),
|
|
'#description' => t("The email address attendees are instructed to contact for additional information."),
|
|
'#size' => 60,
|
|
'#maxlength' => 150,
|
|
'#required' => TRUE,
|
|
'#default_value' => variable_get('booking_contact_email', variable_get('site_mail', ini_get('sendmail_from'))),
|
|
);
|
|
|
|
$form['email']['booking_logistics_email'] = array(
|
|
'#type' => 'textfield',
|
|
'#title' => t('Logistics Email Address'),
|
|
'#description' => t("The email address used for logistics information like travel forms etc."),
|
|
'#size' => 60,
|
|
'#maxlength' => 150,
|
|
'#required' => TRUE,
|
|
'#default_value' => variable_get('booking_logistics_email', variable_get('site_mail', ini_get('sendmail_from'))),
|
|
);
|
|
$form['email']['booking_enable_html_mail'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Enable html emails?'),
|
|
'#description' => t('Turn this feature on for html based emails, otherwise plaintext emails will be used. HTML based emails will require a custom template file to be defined.<br /><strong>WARNING: This will reset all existing mail definitions.</strong> Take care before changing this value.'),
|
|
'#options' => array(
|
|
0 => t('No'),
|
|
t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_enable_html_mail', 0),
|
|
);
|
|
$form['email']['booking_custom_email_count'] = array(
|
|
'#type' => 'textfield',
|
|
'#title' => t('Number of custom email definitions'),
|
|
'#description' => t("Set to the number of custom email definitions to use."),
|
|
'#size' => 3,
|
|
'#maxlength' => 3,
|
|
'#default_value' => variable_get('booking_custom_email_count', '5')
|
|
);
|
|
$form['email']['booking_email_allowed_attachments'] = array(
|
|
'#type' => 'textfield',
|
|
'#title' => t('Allowed email attachments'),
|
|
'#description' => t("File extensions to allow as email attachments for the manual email page."),
|
|
'#size' => 60,
|
|
'#maxlength' => 150,
|
|
'#required' => TRUE,
|
|
'#default_value' => variable_get('booking_email_allowed_attachments', 'pdf docx'),
|
|
);
|
|
|
|
$form['attendee'] = array(
|
|
'#type' => 'fieldset',
|
|
'#title' => 'Attendee restrictions',
|
|
'#collapsible' => TRUE,
|
|
);
|
|
|
|
$form['attendee']['booking_max_dob'] = array(
|
|
'#type' => 'date_select',
|
|
'#title' => t('Maximum Date of Birth'),
|
|
'#description' => t("The youngest date of birth you wish to allow into the event."),
|
|
'#default_value' => variable_get('booking_max_dob', '1995-04-15 00:00:00'),
|
|
'#date_format' => 'd/m/Y',
|
|
'#date_label_position' => 'within',
|
|
'#date_year_range' => '-60:-10'
|
|
);
|
|
|
|
$form['attendee']['booking_enable_min_age_restriction'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Enable old age restriction?'),
|
|
'#description' => t('Set this to Yes if you wish to prevent people over the age defined below from registering.'),
|
|
'#options' => array(
|
|
0 => t('No'),
|
|
t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_enable_min_age_restriction', 1)
|
|
);
|
|
|
|
$form['attendee']['booking_min_dob'] = array(
|
|
'#type' => 'date_select',
|
|
'#title' => t('Minimum Date of Birth'),
|
|
'#description' => t("The oldest date of birth you wish to allow into the event. Note that only the year is taken into account."),
|
|
'#default_value' => variable_get('booking_min_dob', '1995-04-15 00:00:00'),
|
|
'#date_format' => 'd/m/Y',
|
|
'#date_label_position' => 'within',
|
|
'#date_year_range' => '-60:-10'
|
|
);
|
|
|
|
$form['attendee']['booking_regn_limit'] = array(
|
|
'#type' => 'textfield',
|
|
'#title' => t('Registration limit'),
|
|
'#description' => t("Total number of attendees permitted."),
|
|
'#size' => 5,
|
|
'#maxlength' => 5,
|
|
'#required' => TRUE,
|
|
'#default_value' => variable_get('booking_regn_limit', '500')
|
|
);
|
|
|
|
$form['paypal'] = array(
|
|
'#type' => 'fieldset',
|
|
'#title' => 'Paypal Settings',
|
|
'#collapsible' => TRUE,
|
|
//'#collapsed' => TRUE,
|
|
);
|
|
/*
|
|
$form['paypal']['booking_use_paypal'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Use Paypal? (DEPRECATED)'),
|
|
'#description' => t('Select whether to use paypal for automatic payment handling, or process payments manually. This option is now deprecated. Use the payment processor option below instead.'),
|
|
'#options' => array(
|
|
0 => t('No'),
|
|
t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_use_paypal', 0)
|
|
);
|
|
*/
|
|
$form['paypal']['booking_paypal_account'] = array(
|
|
'#type' => 'textfield',
|
|
'#title' => t('Specify Paypal Account Address'),
|
|
'#default_value' => variable_get('booking_paypal_account', ''),
|
|
'#description' => '(email address)'
|
|
);
|
|
$form['paypal']['booking_paypal_sandbox'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Sandbox/Development mode'),
|
|
'#description' => t('When in development mode, the payment gateway will point at sandbox.paypal.com for testing purposes. Leave this as off unless doing testing.'),
|
|
'#options' => array(
|
|
0 => t('Off'),
|
|
t('On')
|
|
),
|
|
'#default_value' => variable_get('booking_paypal_sandbox', 0)
|
|
);
|
|
$form['paypal']['booking_paypal_transaction_fee_fixedcost'] = array(
|
|
'#type' => 'textfield',
|
|
'#title' => t('Paypal fixed cost transaction fee'),
|
|
'#default_value' => variable_get('booking_paypal_transaction_fee_fixedcost', '0.3'),
|
|
'#field_prefix' => '$',
|
|
'#size' => 5,
|
|
'#description' => 'Transaction fee is currently $0.3 AUD and is added before the percentage fee is applied.'
|
|
);
|
|
$form['paypal']['booking_paypal_transaction_fee_percentage'] = array(
|
|
'#type' => 'textfield',
|
|
'#title' => t('Paypal Percentage Transaction Fee'),
|
|
'#default_value' => variable_get('booking_paypal_transaction_fee_percentage', '2.6'),
|
|
'#field_prefix' => '%',
|
|
'#size' => 5,
|
|
'#description' => 'Percentage of transaction charged as paypal fee, currently 2.6% in Australia'
|
|
);
|
|
$form['paypal']['booking_paypal_transaction_fee_percentage_intl'] = array(
|
|
'#type' => 'textfield',
|
|
'#title' => t('Paypal Percentage Transaction Fee (International)'),
|
|
'#default_value' => variable_get('booking_paypal_transaction_fee_percentage_intl', '3.6'),
|
|
'#field_prefix' => '%',
|
|
'#size' => 5,
|
|
'#description' => 'Percentage of transaction charged as paypal fee for transactions that include currency conversion, currently 3.6% in Australia'
|
|
);
|
|
|
|
//Stripe Settings
|
|
$form['stripe'] = array (
|
|
'#type' => 'fieldset',
|
|
'#title' => 'Stripe Settings',
|
|
'#collapsible' => TRUE,
|
|
//'#collapsed' => TRUE,
|
|
);
|
|
$explanation_text = t('<p>Verify your country supports stripe at <a href="https://stripe.com/global">the stripe website</a>.</p>' .
|
|
'<p>Register an account at stripe.com and visit <a href="https://dashboard.stripe.com/account/apikeys">the API keys page</a>, then copy your API keys here.</p>');
|
|
$form['stripe']['explanation-text'] = array(
|
|
'#type' => 'container',
|
|
'#children' => $explanation_text,
|
|
);
|
|
$form['stripe']['booking_stripe_test_secret_key'] = array (
|
|
'#type' => 'textfield',
|
|
'#title' => t('Specify Stripe Test Secret Key'),
|
|
'#default_value' => variable_get('booking_stripe_test_secret_key', ''),
|
|
'#description' => '(Secret API key)',
|
|
);
|
|
$form['stripe']['booking_stripe_test_public_key'] = array (
|
|
'#type' => 'textfield',
|
|
'#title' => t('Specify Stripe Test Public Key'),
|
|
'#default_value' => variable_get('booking_stripe_test_public_key', ''),
|
|
'#description' => '(Public API key)',
|
|
);
|
|
$form['stripe']['booking_stripe_live_secret_key'] = array (
|
|
'#type' => 'textfield',
|
|
'#title' => t('Specify Stripe Live Secret Key'),
|
|
'#default_value' => variable_get('booking_stripe_live_secret_key', ''),
|
|
'#description' => '(Secret API key)',
|
|
);
|
|
$form['stripe']['booking_stripe_live_public_key'] = array (
|
|
'#type' => 'textfield',
|
|
'#title' => t('Specify Stripe Live Public Key'),
|
|
'#default_value' => variable_get('booking_stripe_live_public_key', ''),
|
|
'#description' => '(Public API key)',
|
|
);
|
|
$form['stripe']['booking_stripe_testmode'] = array (
|
|
'#type' => 'radios',
|
|
'#title' => t('Stripe Test mode'),
|
|
'#description' => t('When in test mode, payments will use test api keys which will not make any charges to cards. Leave this as off unless doing testing.'),
|
|
'#options' => array (0 => t('Off'), t('On')),
|
|
'#default_value' => variable_get('booking_stripe_testmode', 0),
|
|
);
|
|
$form['stripe']['booking_stripe_transaction_fee_fixedcost'] = array (
|
|
'#type' => 'textfield',
|
|
'#title' => t('Stripe fixed cost transaction fee'),
|
|
'#default_value' => variable_get('booking_stripe_transaction_fee_fixedcost', '0.3'),
|
|
'#field_prefix' => '$',
|
|
'#size' => 5,
|
|
'#description' => 'Transaction fee is currently $0.3 AUD and is added before the percentage fee is applied.',
|
|
);
|
|
$form['stripe']['booking_stripe_transaction_fee_percentage'] = array (
|
|
'#type' => 'textfield',
|
|
'#title' => t('Stripe Percentage Transaction Fee'),
|
|
'#default_value' => variable_get('booking_stripe_transaction_fee_percentage', '1.75'),
|
|
'#field_prefix' => '%',
|
|
'#size' => 5,
|
|
'#description' => 'Percentage of transaction charged as stripe fee, currently 1.75% in Australia',
|
|
);
|
|
$form['stripe']['booking_stripe_transaction_fee_percentage_intl'] = array (
|
|
'#type' => 'textfield',
|
|
'#title' => t('Stripe Percentage Transaction Fee (International)'),
|
|
'#default_value' => variable_get('booking_stripe_transaction_fee_percentage_intl', '2.9'),
|
|
'#field_prefix' => '%',
|
|
'#size' => 5,
|
|
'#description' => 'Percentage of transaction charged as stripe fee for transactions that include currency conversion, currently 2.9% in Australia. This fee also applies to American Express cards.',
|
|
);
|
|
$form['stripe']['booking_stripe_logo'] = array (
|
|
'#type' => 'textfield',
|
|
'#title' => t('Logo URL for Stripe Checkout Form'),
|
|
'#description' => 'Enter the full URL to a logo file that will be used on the stripe checkout form.<br />The recommended minimum size is 128x128px. The supported image types are: .gif, .jpeg, and .png.',
|
|
'#default_value' => variable_get('booking_stripe_logo', 'https://stripe.com/img/documentation/checkout/marketplace.png'),
|
|
);
|
|
|
|
//feature settings
|
|
$form['features'] = array(
|
|
'#type' => 'fieldset',
|
|
'#title' => 'Enable/Disable Features',
|
|
'#collapsible' => TRUE,
|
|
);
|
|
$form['features']['booking_payment_processor'] = array (
|
|
'#type' => 'radios',
|
|
'#title' => t('Select Payment Processor to use'),
|
|
'#description' => t('Select between Paypal, Stripe or Manaul Payment to use for processing payments.'),
|
|
'#options' => array (0 => t('Paypal'), t('Stripe'), t('Manual Payments')),
|
|
'#default_value' => variable_get('booking_payment_processor', 0),
|
|
);
|
|
$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_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_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_variety_sessions'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Enable variety session form?'),
|
|
'#description' => t('Note that this feature is still under development and cannot yet be used.'),
|
|
'#options' => array(
|
|
0 => t('No'),
|
|
t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_enable_variety_sessions', 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. This option is only applicable if study groups are enabled.'),
|
|
'#options' => array(
|
|
0 => t('No'),
|
|
t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_publish_readinggroups', 0)
|
|
);
|
|
|
|
$form['features']['booking_friendly_csv_groupnames'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Use human-friendly study group names in CSV export?'),
|
|
'#description' => t('Select whether to use descriptions for study group columns when exporting CSV. If No, internal database field names are used.'),
|
|
'#options' => array(0 => t('No'), t('Yes')),
|
|
'#default_value' => variable_get('booking_friendly_csv_groupnames', 0),
|
|
);
|
|
$form['features']['booking_studygroup_csv_ages'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Include ages in study group CSV export?'),
|
|
'#description' => t('Select whether to inclde ages for attendees when exporting study groups to CSV.'),
|
|
'#options' => array(0 => t('No'), t('Yes')),
|
|
'#default_value' => variable_get('booking_studygroup_csv_ages', 0),
|
|
);
|
|
$form['features']['booking_enable_emoji_removal'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Remove emoji from user input?'),
|
|
'#description' => t('Select whether to strip emoji from user input before saving to database. Useful if mysql does not support utf8mb4.'),
|
|
'#options' => array(
|
|
0 => t('No'),
|
|
t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_enable_emoji_removal', 1)
|
|
);
|
|
$form['misc'] = array(
|
|
'#type' => 'fieldset',
|
|
'#title' => 'Configuration Options'
|
|
);
|
|
|
|
$form['misc']['booking_auto_confirm_email'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Send An Automatic Registration Email?'),
|
|
'#description' => t('Automatically send a confirmation email to a user when they\'ve registered for an event? Set this to No if using paypal and only showing on the "whos coming" page once a person has paid. Or set to Yes if "Show on lists once booked in" is set to No and paypal is not being used. If set to No, a registration confirmation email will be sent to a user when their registration status changes to Paid, either manually or via paypal plugin. '),
|
|
'#options' => array(
|
|
0 => t('No'),
|
|
t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_auto_confirm_email', 0)
|
|
);
|
|
$form['misc']['booking_auto_workflow_email'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Send An Automatic Workflow Email?'),
|
|
'#description' => t('Automatically send workflow emails to attendee on events such as status changes, travel details received, etc'),
|
|
'#options' => array(
|
|
0 => t('No'),
|
|
t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_auto_workflow_email', 0)
|
|
);
|
|
$form['misc']['booking_bcc_notify_email_workflow'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Include notification email address on outgoing workflow emails?'),
|
|
'#description' => t('Send a BCC of any workflow email generated to the notification email address as well'),
|
|
'#options' => array(
|
|
0 => t('No'),
|
|
t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_bcc_notify_email_workflow', 0)
|
|
);
|
|
$form['misc']['booking_auto_show_on_lists'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Show on lists once booked in?'),
|
|
'#description' => t('Immediately appear on bookedin/waiting lists even before payment is received?'),
|
|
'#options' => array(
|
|
0 => t('No'),
|
|
t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_auto_show_on_lists', 0)
|
|
);
|
|
|
|
$form['misc']['booking_enable_combined_pricing'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Use Combined Pricing?'),
|
|
'#description' => t('Select whether to combine pricing for married couples (Yes) or have each spouse pay separately (No).'),
|
|
'#options' => array(
|
|
0 => t('No'),
|
|
t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_enable_combined_pricing', 0)
|
|
);
|
|
|
|
$form['regn_options'] = array(
|
|
'#type' => 'fieldset',
|
|
'#title' => 'Registration Form Configuration',
|
|
'#collapsible' => TRUE,
|
|
);
|
|
|
|
$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. Select the last value (blank) in most cases, to ensure attendees choose a value for this field'),
|
|
'#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_allow_couples'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Allow married couples?'),
|
|
'#description' => t('Select whether to cater for married couples in the registration form'),
|
|
'#options' => array(
|
|
0 => t('No'),
|
|
t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_allow_couples', 0)
|
|
);
|
|
$form['regn_options']['booking_ask_dependant_children'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Ask whether a couple has dependant children attending?'),
|
|
'#description' => t('Select whether to ask about dependant children of married couples in the registration form'),
|
|
'#options' => array(
|
|
0 => t('No'),
|
|
t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_ask_dependant_children', 0)
|
|
);
|
|
$form['regn_options']['booking_dependant_children_text_definition'] = array(
|
|
'#type' => 'textfield',
|
|
'#title' => t('Text to display about dependant children'),
|
|
'#default_value' => variable_get('booking_dependant_children_text_definition', '<b>Please note that only one dependant child under the age of two is allowed.</b>'),
|
|
'#description' => 'Text to use on registration form if married couple has said they are bringing children.',
|
|
'#size' => 150,
|
|
'#maxlength' => 1000,
|
|
'#states' => array(
|
|
// Only show this field when the 'booking_enable_dietary' radio option is set to No
|
|
'visible' => array(
|
|
':input[name="booking_ask_dependant_children"]' => array(
|
|
'value' => 1
|
|
)
|
|
)
|
|
)
|
|
);
|
|
|
|
$form['regn_options']['booking_enable_medicare'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Enable Medicare requirement?'),
|
|
'#description' => t('Select whether to include medicare details on registration form.'),
|
|
'#options' => array(
|
|
0 => t('No'),
|
|
t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_enable_medicare', 1)
|
|
);
|
|
$form['regn_options']['booking_enforce_medicare_verification'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Force Medicare verification?'),
|
|
'#description' => t('Prevent people from registering if they do not enter a valid medicare card? (Only applies if medicare details are enabled).'),
|
|
'#options' => array(
|
|
0 => t('No'),
|
|
t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_enforce_medicare_verification', 1)
|
|
);
|
|
$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'),
|
|
'#description' => 'Text to use on registration form to request clothing size (eg t-shirt or hoodie).',
|
|
'#size' => 150,
|
|
'#maxlength' => 2000
|
|
);
|
|
$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['regn_options']['booking_enable_passport'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Enable passport information? (DEPRECATED)'),
|
|
'#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['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'),
|
|
1 => t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_enable_helpareas', 0)
|
|
);
|
|
$form['regn_options']['booking_enabled_helparea_options'] = array(
|
|
'#type' => 'select',
|
|
'#multiple' => TRUE,
|
|
'#title' => t('Select help areas to enable'),
|
|
'#description' => t('Select which questions to include in the booking form. Ensure you hold down control/command when selecting multiple options.'),
|
|
'#options' => _booking_get_help_areas(),
|
|
'#default_value' => variable_get('booking_enabled_helparea_options', ''),
|
|
'#states' => array(
|
|
// Only show this field when the 'booking_enable_helpareas' radio option is set to true
|
|
'visible' => array(
|
|
':input[name="booking_enable_helpareas"]' => array(
|
|
'value' => 1
|
|
)
|
|
)
|
|
)
|
|
);
|
|
|
|
$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['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['regn_options']['booking_enable_songchoice'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Enable attendee to specify song choice?'),
|
|
'#description' => t('Select whether to include questions about song choice in the booking form.'),
|
|
'#options' => array(
|
|
0 => t('No'),
|
|
t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_enable_songchoice', 0)
|
|
);
|
|
$form['regn_options']['booking_enable_freestyle'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Enable attendee to enter freestyle text'),
|
|
'#description' => t('Select whether to include freestyle text field in the booking form.'),
|
|
'#options' => array(
|
|
0 => t('No'),
|
|
t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_enable_freestyle', 0)
|
|
);
|
|
$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'),
|
|
1 => t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_enable_dietary', 0)
|
|
);
|
|
$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.'),
|
|
'#description' => 'Text to use on registration form if attendee may not specify dietary requirements.',
|
|
'#size' => 150,
|
|
'#maxlength' => 2000,
|
|
'#states' => array(
|
|
// Only show this field when the 'booking_enable_dietary' radio option is set to No
|
|
'visible' => array(
|
|
':input[name="booking_enable_dietary"]' => array(
|
|
'value' => 0
|
|
)
|
|
)
|
|
)
|
|
);
|
|
$form['regn_options']['booking_enable_medcond'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Allow attendee to specify medical conditions?'),
|
|
'#description' => t('If set to No, the following text definition will be used instead.'),
|
|
'#options' => array(
|
|
0 => t('No'),
|
|
1 => t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_enable_medcond', 0)
|
|
);
|
|
$form['regn_options']['booking_medcond_text_definition'] = array(
|
|
'#type' => 'textfield',
|
|
'#title' => t('Medical Condition Text Definition'),
|
|
'#default_value' => variable_get('booking_medcond_text_definition', 'Please use the contact us form to indicate what medical condition you have.'),
|
|
'#description' => 'Text to use on registration form if attendee may not specify a medical condition.',
|
|
'#size' => 150,
|
|
'#maxlength' => 2000,
|
|
'#states' => array(
|
|
// Only show this field when the 'booking_enable_medcond' radio option is set to No
|
|
'visible' => array(
|
|
':input[name="booking_enable_medcond"]' => array(
|
|
'value' => 0
|
|
)
|
|
)
|
|
)
|
|
);
|
|
|
|
$form['regn_options']['booking_enable_earlyaccess_codes'] = array(
|
|
'#type' => 'radios',
|
|
'#title' => t('Allow early access to registration form with unique code?'),
|
|
'#description' => t('Select whether to enable the feature that will allow early registrations with a unique code. Turning on this feature will allow registrations immediately, regardless of event registration start date.'),
|
|
'#options' => array(
|
|
0 => t('No'),
|
|
t('Yes')
|
|
),
|
|
'#default_value' => variable_get('booking_enable_earlyaccess_codes', 0)
|
|
);
|
|
$form['regn_options']['booking_earlyaccess_codes_count'] = array(
|
|
'#type' => 'textfield',
|
|
'#title' => t('Number of early access codes'),
|
|
'#description' => t("Set to the number of early access codes to generate. You will need to visit the !configuration to actually generate these codes.",
|
|
array('!configuration' => l('Configuration Page', 'admin/config/booking/earlyaccess'))),
|
|
'#size' => 3,
|
|
'#maxlength' => 3,
|
|
'#default_value' => variable_get('booking_earlyaccess_codes_count', '0'),
|
|
);
|
|
|
|
$form['management'] = array(
|
|
'#type' => 'fieldset',
|
|
'#title' => 'Data Management Options',
|
|
'#collapsible' => TRUE,
|
|
);
|
|
$form['management']['booking_csv_exclude_fields'] = array(
|
|
'#type' => 'textfield',
|
|
'#title' => t('Fields to exclude from CSV report'),
|
|
'#default_value' => variable_get('booking_csv_exclude_fields', ''),
|
|
'#description' => 'Separate each field with a semi-colon. Field names as per database schema.',
|
|
'#size' => 150,
|
|
'#maxlength' => 2000
|
|
);
|
|
$form['management']['booking_import_include_fields'] = array(
|
|
'#type' => 'textfield',
|
|
'#title' => t('Fields to import from an uploaded CSV file'),
|
|
'#default_value' => variable_get('booking_import_include_fields', ''),
|
|
'#description' => 'Separate each field with a semi-colon. Field names as per database schema, case sensitive. Nid and booking_status fields compulsory.',
|
|
'#size' => 150,
|
|
'#maxlength' => 2000
|
|
);
|
|
|
|
$booking_view_fields = _booking_get_person_fields();
|
|
$form['management']['booking_export_include_fields_dynamic'] = array(
|
|
'#type' => 'select',
|
|
'#multiple' => TRUE,
|
|
'#title' => t('Not In Use - Select database fields'),
|
|
'#description' => t('Select database fields to export to CSV. Ensure you hold down control/command when selecting multiple options.'),
|
|
'#options' => $booking_view_fields,
|
|
'#default_value' => variable_get('booking_export_include_fields_dynamic', ''),
|
|
);
|
|
$form['management']['booking_import_include_fields_dynamic'] = array(
|
|
'#type' => 'select',
|
|
'#multiple' => TRUE,
|
|
'#title' => t('Not In Use - Select database fields'),
|
|
'#description' => t('Select database fields to import from an uploaded CSV file. Ensure you hold down control/command when selecting multiple options.'),
|
|
'#options' => $booking_view_fields,
|
|
'#default_value' => variable_get('booking_import_include_fields_dynamic', ''),
|
|
);
|
|
|
|
$form['meta-tokens'] = array(
|
|
'#type' => 'fieldset',
|
|
'#title' => 'Meta Token Definitions',
|
|
'#collapsible' => TRUE,
|
|
);
|
|
$form['meta-tokens']['booking_studygroup_summary_li_text'] = array (
|
|
'#type' => 'textfield',
|
|
'#title' => t('Study Group Summary Format'),
|
|
'#default_value' => variable_get('booking_studygroup_summary_li_text',
|
|
'You are a <b>[meta-booking:studygroup-role]</b> for group <b>[meta-booking:studygroup-descrip]</b>, which will occur on [meta-booking:studygroup-weekday].' .
|
|
'<br /><b>[meta-booking:studygroup-explan]</b>'
|
|
),
|
|
'#description' => 'List element definition (using tokens) for token [booking:studygroup-summary], which is the study group summary in emails. ' .
|
|
'Note: Don\'t add the li tags, they will be added automatically.',
|
|
'#size' => 150,
|
|
'#maxlength' => 2000,
|
|
);
|
|
$form['meta-tokens']['booking_studygroup_leaderhelperpair_text'] = array (
|
|
'#type' => 'textfield',
|
|
'#title' => t('Leader/Helper Pair Format'),
|
|
'#default_value' => variable_get('booking_studygroup_leaderhelperpair_text',
|
|
'<b>[meta-booking:studygroup-role]</b> for <b>[meta-booking:studygroup-descrip]</b>. ' .
|
|
'Your [meta-booking:studygroup-otherrole] is <b>[meta-booking:studygroup-othername]</b>. ' .
|
|
'You can contact them on [meta-booking:studygroup-otherphone] or [meta-booking:studygroup-otheremail].'
|
|
),
|
|
'#description' => 'List element definition (using tokens) for token [booking:leaderhelper-pair], which is the study group leader/helper pair information in emails. ' .
|
|
'Note: Don\'t add the li tags, they will be added automatically.',
|
|
'#size' => 150,
|
|
'#maxlength' => 2000,
|
|
);
|
|
|
|
//return system_settings_form($form);
|
|
//make sure we update our custom sql view every time we change something on the admin page
|
|
$form = system_settings_form($form);
|
|
//$form['#submit'][] = '_booking_node_create_mysqlview';
|
|
return $form;
|
|
|
|
}
|
|
|
|
function booking_admin_validate($form, $form_state)
|
|
{
|
|
//TODO: put back in when using booking start and end dates
|
|
/*
|
|
$booking_start = $form_state['values']['booking_start'];
|
|
$booking_end = $form_state['values']['booking_end'];
|
|
|
|
|
|
//create timestamps for comparison
|
|
$booking_start_ts = _date_to_ts( $booking_start );
|
|
$booking_end_ts = _date_to_ts( $booking_end );
|
|
|
|
|
|
//validate main conference start and end dates
|
|
if ($booking_start_ts > $booking_end_ts) {
|
|
form_set_error('booking_date_endbeforestart', t('You have selected a Conference end date that is before the Conference start date.'));
|
|
} else {
|
|
variable_set('booking_conference_dates', _date_range_to_string($booking_start, $booking_end));
|
|
drupal_set_message( t('Conference date range: "!date"', array ('!date' => _date_range_to_string($booking_start, $booking_end))));
|
|
}
|
|
*/
|
|
}
|