minor tweaks to UI

This commit is contained in:
2014-11-18 16:46:03 +11:00
parent 61ba6cc45a
commit be3cc83630
5 changed files with 69 additions and 50 deletions

View File

@@ -110,7 +110,7 @@ function booking_admin() {
);
$form['misc'] = array (
'#type' => 'fieldset',
'#title' => 'Miscellaneous Settings',
'#title' => 'Configuration Options',
);
$form['misc']['booking_default_gender'] = array (
'#type' => 'select',
@@ -229,7 +229,7 @@ function booking_admin() {
$form['misc']['booking_dietary_text_definition'] = array (
'#type' => 'textfield',
'#title' => t('Dietary Requirements Text Definition'),
'#default_value' => variable_get('booking_dietary_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 (as above).',
'#size' => 150,
'#maxlength' => 2000,
@@ -273,7 +273,11 @@ function booking_admin() {
'#options' => array (0 => t('No'), t('Yes')),
'#default_value' => variable_get('booking_publish_readinggroups', 0),
);
$form['misc']['booking_csv_exclude_fields'] = array (
$form['management'] = array (
'#type' => 'fieldset',
'#title' => 'Data Management Options',
);
$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', ''),
@@ -281,7 +285,7 @@ function booking_admin() {
'#size' => 150,
'#maxlength' => 2000,
);
$form['misc']['booking_import_include_fields'] = array (
$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', ''),

View File

@@ -140,14 +140,28 @@ function booking_event_form($node, &$form_state, $create, $editid = 0)
'#required' => TRUE,
'#default_value' => !empty($data->booking_eventname) ? $data->booking_eventname : '',
);
$form['booking_event_active'] = array(
'#type' => 'checkbox',
'#title' => t('Make this event active'),
'#default_value' => 1
);
$form['booking_register_open'] = array(
$form['booking_event_start'] = array(
'#type' => 'date_select',
'#title' => t('Date that this event will start'),
'#default_value' => empty($data->booking_event_start) ? date("Y-m-d H:i:s") : date("Y-m-d H:i:s", $data->booking_event_start),
'#date_format' => 'd/m/Y H:i',
'#date_label_position' => 'within',
'#date_year_range' => '0:+5'
);
$form['booking_event_end'] = array(
'#type' => 'date_select',
'#title' => t('Date that this event will conclude'),
'#default_value' => empty($data->booking_event_end) ? date("Y-m-d H:i:s") : date("Y-m-d H:i:s", $data->booking_event_end),
'#date_format' => 'd/m/Y H:i',
'#date_label_position' => 'within',
'#date_year_range' => '0:+5'
);
$form['booking_register_open'] = array(
'#type' => 'date_select',
'#title' => t('Date that registrations will open for this event'),
'#default_value' => empty($data->booking_register_open) ? date("Y-m-d H:i:s") : date("Y-m-d H:i:s", $data->booking_register_open),
@@ -155,8 +169,15 @@ function booking_event_form($node, &$form_state, $create, $editid = 0)
'#date_label_position' => 'within',
'#date_year_range' => '0:+5'
);
$form['booking_register_close'] = array(
$form['booking_earlybird_close'] = array(
'#type' => 'date_select',
'#title' => t('Date that the early discounted rate will close for this event (if not applicable, set to registration close date)'),
'#default_value' => empty($data->booking_earlybird_close) ? date("Y-m-d H:i:s") : date("Y-m-d H:i:s", $data->booking_earlybird_close),
'#date_format' => 'd/m/Y H:i',
'#date_label_position' => 'within',
'#date_year_range' => '0:+5'
);
$form['booking_register_close'] = array(
'#type' => 'date_select',
'#title' => t('Date that registrations will close for this event'),
'#default_value' => empty($data->booking_register_close) ? date("Y-m-d H:i:s") : date("Y-m-d H:i:s", $data->booking_register_close),
@@ -165,30 +186,8 @@ function booking_event_form($node, &$form_state, $create, $editid = 0)
'#date_year_range' => '0:+5'
);
$form['booking_earlybird_close'] = array(
'#type' => 'date_select',
'#title' => t('Date that the early discounted rate will close for this event (if not applicable, set to registration close date)'),
'#default_value' => empty($data->booking_earlybird_close) ? date("Y-m-d H:i:s") : date("Y-m-d H:i:s", $data->booking_earlybird_close),
'#date_format' => 'd/m/Y H:i',
'#date_label_position' => 'within',
'#date_year_range' => '0:+5'
);
$form['booking_event_start'] = array(
'#type' => 'date_select',
'#title' => t('Date that this event will start'),
'#default_value' => empty($data->booking_event_start) ? date("Y-m-d H:i:s") : date("Y-m-d H:i:s", $data->booking_event_start),
'#date_format' => 'd/m/Y H:i',
'#date_label_position' => 'within',
'#date_year_range' => '0:+5'
);
$form['booking_event_end'] = array(
'#type' => 'date_select',
'#title' => t('Date that this event will conclude'),
'#default_value' => empty($data->booking_event_end) ? date("Y-m-d H:i:s") : date("Y-m-d H:i:s", $data->booking_event_end),
'#date_format' => 'd/m/Y H:i',
'#date_label_position' => 'within',
'#date_year_range' => '0:+5'
);
if ($create == true)
{

View File

@@ -218,6 +218,7 @@ function booking_update_7204() {
'booking_num_group_sessions' => 16,
))
->execute();
*/
}
/**

View File

@@ -145,32 +145,32 @@ function booking_price_form($node, &$form_state, $create, $editid = 0)
);
$form['booking_price'] = array (
'#type' => 'textfield',
'#title' => t('The earlybird price relating to this entry'),
'#title' => t('The earlybird price relating to this entry. Set this to match the normal price if not using a discount for early bookings.'),
'#field_prefix' => '$',
'#size' => 5,
'#maxlength' => 10,
'#required' => TRUE,
'#default_value' => !empty($data->booking_price) ? $data->booking_price : '',
);
$form['booking_buttonid'] = array (
'#type' => 'textfield',
'#title' => t('The PayPal button ID'),
'#size' => 20,
'#maxlength' => 20,
'#default_value' => !empty($data->booking_buttonid) ? $data->booking_buttonid : '',
);
$form['booking_late_price'] = array (
'#type' => 'textfield',
'#title' => t('The late booking price relating to this entry'),
'#title' => t('The normal booking price relating to this entry.'),
'#field_prefix' => '$',
'#size' => 5,
'#maxlength' => 10,
'#required' => TRUE,
'#default_value' => !empty($data->booking_late_price) ? $data->booking_late_price : '',
);
$form['booking_buttonid'] = array (
'#type' => 'textfield',
'#title' => t('The PayPal button ID. This setting is deprecated.'),
'#size' => 20,
'#maxlength' => 20,
'#default_value' => !empty($data->booking_buttonid) ? $data->booking_buttonid : '',
);
$form['booking_late_buttonid'] = array (
'#type' => 'textfield',
'#title' => t('The PayPal button ID for late bookings'),
'#title' => t('The PayPal button ID for late bookings. This setting is deprecated.'),
'#size' => 20,
'#maxlength' => 20,
'#default_value' => !empty($data->booking_late_buttonid) ? $data->booking_late_buttonid : '',
@@ -178,13 +178,13 @@ function booking_price_form($node, &$form_state, $create, $editid = 0)
$form['booking_price_active'] = array(
'#type' => 'checkbox',
'#title' => t('Make this price active'),
'#title' => t('Tick to make this price active for the current event.'),
'#default_value' => !empty($data->booking_price_active) ? $data->booking_price_active : '',
);
$form['booking_depositonly'] = array(
'#type' => 'checkbox',
'#title' => t('This is a deposit only price'),
'#title' => t('Tick to indicate that this is a deposit only price.'),
'#default_value' => !empty($data->booking_depositonly) ? $data->booking_depositonly : 0,
);

View File

@@ -460,7 +460,8 @@ function booking_studygroups_edit_form($node, &$form_state, $nid) {
*/
}
if ($group->sid == variable_get('booking_readinggroup_id','7'))
//if ($group->sid == variable_get('booking_readinggroup_id','7'))
if ($group->booking_is_readinggroup == 'Y')
{
$options = $readinggroup_options;
}
@@ -1111,8 +1112,10 @@ function booking_studygroups_update_form($node, &$form_state, $sid) {
//if the study group id matches the group we're currently looking at, and they have a role defined
//or if the group id matches, they are a committee member and this is the readings group
//if (($person->booking_studygroup_id == $group->sid && $person->booking_studygroup_role > 0) ||
// ($person->booking_studygroup_id == $group->sid && $committee_flag == 'Y' && $group->sid == $reading_group_id))
if (($person->booking_studygroup_id == $group->sid && $person->booking_studygroup_role > 0) ||
($person->booking_studygroup_id == $group->sid && $committee_flag == 'Y' && $group->sid == $reading_group_id))
($person->booking_studygroup_id == $group->sid && $committee_flag == 'Y' && $group->booking_is_readinggroup == 'Y'))
{
$calculation_messages[] = t('Leader/helper/committee with id !id assigned to session !session (currently with !num people).',
array('!id' => $person->booking_node_id, '!session' => $person->booking_session_id,
@@ -1299,7 +1302,8 @@ function booking_studygroups_update_form($node, &$form_state, $sid) {
$found = TRUE;
//if the existing session is not the same as our newly calculated session, run an update query
if ($mapping->booking_session_id !== $person->session && $group->sid != $reading_group_id)
//if ($mapping->booking_session_id !== $person->session && $group->sid != $reading_group_id)
if ($mapping->booking_session_id !== $person->session && $group->booking_is_readinggroup == 'N')
{
$message = t('Suggest changing user !id (!name) from session !old to !session. Role id is !role',
array('!id' => $person->nid, '!old' => $mapping->booking_session_id, '!session' => $person->session,
@@ -1313,7 +1317,8 @@ function booking_studygroups_update_form($node, &$form_state, $sid) {
$updates_to_confirm[] = array('sid' => $mapping->sid, 'fields' => $update);
}
elseif ($mapping->booking_session_id !== $person->session && $group->sid == $reading_group_id)
//elseif ($mapping->booking_session_id !== $person->session && $group->sid == $reading_group_id)
elseif ($mapping->booking_session_id !== $person->session && $group->booking_is_readinggroup == 'Y')
{
$message = t('Suggest changing user !id (!name) from reading group session !old to !session. Role id is !role',
array('!id' => $person->nid, '!old' => $mapping->booking_session_id, '!session' => $person->session,
@@ -1370,13 +1375,21 @@ function booking_studygroups_update_form($node, &$form_state, $sid) {
drupal_set_message($final_message);
watchdog('booking', "<pre>" . $final_message . "\n" . implode("\n", $update_messages) . "</pre>");
//make sure to update team colours if necessary
if ($group->booking_is_readinggroup == 'Y')
{
booking_studygroups_process_colours();
}
} //finished processing study groups
/*
//make sure to update team colours if necessary
if ($sid == $reading_group_id)
{
booking_studygroups_process_colours();
}
*/
//watchdog('booking', "Attendee list final version: @info", array('@info' => var_export($attendees, TRUE)));
@@ -1761,6 +1774,8 @@ function booking_studygroups_process_colours() {
//get the id of the special study group that is actually the reading group
$readinggroup_studygroup_id = variable_get('booking_readinggroup_id','7');
//TODO: Query for all groups with the reading group flag set to Y, and loop through them all
//query for the mappings relating to $readinggroup_studygroup_id
$group_mapping_query = db_query("SELECT * FROM {booking_studygroup_mapping} WHERE booking_eventid = :eid AND booking_studygroup_id = :sid",
array(':eid' => $event->eid, ':sid' => $readinggroup_studygroup_id));