change song choice to freestyle text
This commit is contained in:
@@ -575,6 +575,16 @@ function booking_admin() {
|
||||
),
|
||||
'#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?'),
|
||||
|
@@ -726,6 +726,16 @@ function booking_update_7248() {
|
||||
db_change_field('booking_person', 'booking_medical_conditions', 'booking_medical_conditions', $spec);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add field for attendee's freestyle text entry
|
||||
*/
|
||||
function booking_update_7249() {
|
||||
$spec = array('type' => 'varchar', 'length' => '1000', 'not null' => FALSE);
|
||||
db_add_field('booking_person', 'booking_freestyle_text', $spec);
|
||||
//update the view to match the new table definition
|
||||
_booking_node_create_mysqlview();
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of hook_install().
|
||||
*/
|
||||
|
@@ -941,6 +941,15 @@ function booking_form($node, &$form_state, $inserting = FALSE, $early_access_all
|
||||
'#default_value' => !empty($data->booking_song_choice) ? $data->booking_song_choice : ''
|
||||
);
|
||||
}
|
||||
if (variable_get('booking_enable_freestyle', 0) == 1) {
|
||||
$form['misc-areas']['booking_freestyle_text'] = array(
|
||||
'#type' => 'textfield',
|
||||
'#title' => t("Freestyle (optional)"),
|
||||
'#maxlength' => 500,
|
||||
'#required' => FALSE,
|
||||
'#default_value' => !empty($data->booking_freestyle_text) ? $data->booking_freestyle_text : ''
|
||||
);
|
||||
}
|
||||
|
||||
if ($inserting == TRUE) {
|
||||
$form['submit'] = array(
|
||||
|
Reference in New Issue
Block a user