Merge branch 'master' of gitlab.coadcorp.com:drupal/booking
This commit is contained in:
@@ -566,6 +566,15 @@ function booking_update_7235() {
|
|||||||
//update the view to match the new table definition
|
//update the view to match the new table definition
|
||||||
_booking_node_create_mysqlview();
|
_booking_node_create_mysqlview();
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Add flag to indicate a studygroup session has been manually assigned
|
||||||
|
*/
|
||||||
|
function booking_update_7236() {
|
||||||
|
$spec = array('type' => 'varchar', 'length' => '1', 'not null' => FALSE, 'default' => 'N');
|
||||||
|
db_add_field('booking_studygroup_mapping', 'booking_session_manually_allocated', $spec);
|
||||||
|
//update the view to match the new table definition
|
||||||
|
_booking_node_create_mysqlview();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implementation of hook_install().
|
* Implementation of hook_install().
|
||||||
@@ -577,10 +586,10 @@ function booking_install() {
|
|||||||
->fields(array(
|
->fields(array(
|
||||||
'booking_eventid' => 1,
|
'booking_eventid' => 1,
|
||||||
'booking_price' => '50.00',
|
'booking_price' => '50.00',
|
||||||
'booking_price_descrip' => 'Deposit',
|
'booking_price_descrip' => 'Deposit',
|
||||||
'booking_buttonid' => '',
|
'booking_buttonid' => '',
|
||||||
'booking_price_active' => 1,
|
'booking_price_active' => 1,
|
||||||
'booking_depositonly' => 1,
|
'booking_depositonly' => 1,
|
||||||
))
|
))
|
||||||
->execute();
|
->execute();
|
||||||
//earlybird close is 31st Jan 2012 at 13:59:59 UTC
|
//earlybird close is 31st Jan 2012 at 13:59:59 UTC
|
||||||
@@ -840,20 +849,20 @@ function booking_schema() {
|
|||||||
|
|
||||||
$schema['booking_travel'] = array(
|
$schema['booking_travel'] = array(
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'tid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
|
'tid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
|
||||||
'booking_person_nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
|
'booking_person_nid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
|
||||||
'booking_transport_type' => array('type' => 'varchar', 'length' => '100', 'not null' => FALSE),
|
'booking_transport_type' => array('type' => 'varchar', 'length' => '100', 'not null' => FALSE),
|
||||||
'booking_transport_from_morriset_reqd' => array('type' => 'varchar', 'length' => '1', 'not null' => FALSE),
|
'booking_transport_from_morriset_reqd' => array('type' => 'varchar', 'length' => '1', 'not null' => FALSE),
|
||||||
'booking_transport_to_morriset_reqd' => array('type' => 'varchar', 'length' => '1', 'not null' => FALSE),
|
'booking_transport_to_morriset_reqd' => array('type' => 'varchar', 'length' => '1', 'not null' => FALSE),
|
||||||
'booking_flightnum_inbound' => array('type' => 'varchar', 'length' => '100', 'not null' => FALSE),
|
'booking_flightnum_inbound' => array('type' => 'varchar', 'length' => '100', 'not null' => FALSE),
|
||||||
'booking_flight_datetime_inbound' => array('type' => 'int', 'not null' => FALSE, 'disp-width' => '11'),
|
'booking_flight_datetime_inbound' => array('type' => 'int', 'not null' => FALSE, 'disp-width' => '11'),
|
||||||
'booking_flightnum_outbound' => array('type' => 'varchar', 'length' => '100', 'not null' => FALSE),
|
'booking_flightnum_outbound' => array('type' => 'varchar', 'length' => '100', 'not null' => FALSE),
|
||||||
'booking_flight_datetime_outbound' => array('type' => 'int', 'not null' => FALSE, 'disp-width' => '11'),
|
'booking_flight_datetime_outbound' => array('type' => 'int', 'not null' => FALSE, 'disp-width' => '11'),
|
||||||
'booking_accom_before_reqd' => array('type' => 'varchar', 'length' => '1', 'not null' => FALSE),
|
'booking_accom_before_reqd' => array('type' => 'varchar', 'length' => '1', 'not null' => FALSE),
|
||||||
'booking_accom_before_staying_with' => array('type' => 'varchar', 'length' => '200', 'not null' => FALSE),
|
'booking_accom_before_staying_with' => array('type' => 'varchar', 'length' => '200', 'not null' => FALSE),
|
||||||
'booking_accom_after_reqd' => array('type' => 'varchar', 'length' => '1', 'not null' => FALSE),
|
'booking_accom_after_reqd' => array('type' => 'varchar', 'length' => '1', 'not null' => FALSE),
|
||||||
'booking_accom_after_staying_with' => array('type' => 'varchar', 'length' => '200', 'not null' => FALSE),
|
'booking_accom_after_staying_with' => array('type' => 'varchar', 'length' => '200', 'not null' => FALSE),
|
||||||
),
|
),
|
||||||
'primary key' => array('tid'),
|
'primary key' => array('tid'),
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -877,11 +886,13 @@ function booking_schema() {
|
|||||||
'booking_node_id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
|
'booking_node_id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
|
||||||
'booking_studygroup_id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
|
'booking_studygroup_id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
|
||||||
'booking_session_id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10', 'default' => 0),
|
'booking_session_id' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10', 'default' => 0),
|
||||||
|
'booking_session_manually_allocated' => array('type' => 'varchar', 'length' => '1', 'not null' => FALSE, 'default' => 'N'),
|
||||||
'booking_studygroup_role' => array('type' => 'varchar', 'length' => '100', 'not null' => FALSE, 'default' => 0),
|
'booking_studygroup_role' => array('type' => 'varchar', 'length' => '100', 'not null' => FALSE, 'default' => 0),
|
||||||
),
|
),
|
||||||
'primary key' => array('sid'),
|
'primary key' => array('sid'),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//this table isn't currently in use
|
||||||
$schema['booking_readinggroup_definition'] = array(
|
$schema['booking_readinggroup_definition'] = array(
|
||||||
'fields' => array(
|
'fields' => array(
|
||||||
'rid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
|
'rid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'),
|
||||||
|
@@ -343,6 +343,12 @@ function booking_studygroup_leadhelp_edit_form($node, &$form_state, $group_id) {
|
|||||||
unset($reserveleader);
|
unset($reserveleader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//record whether this was a reading group, so we can update colours if necessary
|
||||||
|
$form['booking_readinggroup'] = array (
|
||||||
|
'#type' => 'hidden',
|
||||||
|
'#value' => $studygroup->booking_is_readinggroup,
|
||||||
|
);
|
||||||
|
|
||||||
//close out the form
|
//close out the form
|
||||||
$form['submit'] = array (
|
$form['submit'] = array (
|
||||||
'#type' => 'submit',
|
'#type' => 'submit',
|
||||||
@@ -371,7 +377,7 @@ function booking_studygroup_leadhelp_edit_form_submit($form, &$form_state) {
|
|||||||
'booking_studygroup_helper' => 2,
|
'booking_studygroup_helper' => 2,
|
||||||
'booking_studygroup_reserveleader' => 3,
|
'booking_studygroup_reserveleader' => 3,
|
||||||
);
|
);
|
||||||
|
|
||||||
//iterate over the different role types
|
//iterate over the different role types
|
||||||
foreach ($role_types as $type => $type_id) {
|
foreach ($role_types as $type => $type_id) {
|
||||||
//iterate over the sessions for that role type
|
//iterate over the sessions for that role type
|
||||||
@@ -454,6 +460,11 @@ function booking_studygroup_leadhelp_edit_form_submit($form, &$form_state) {
|
|||||||
} //iterate session
|
} //iterate session
|
||||||
} //iterate role type
|
} //iterate role type
|
||||||
|
|
||||||
|
//do we need to update colours for reading group?
|
||||||
|
if ($form_state['values']['booking_readinggroup']) == 'Y') {
|
||||||
|
booking_studygroups_process_colours();
|
||||||
|
}
|
||||||
|
|
||||||
$final_message = "Made $counter updates leader/helper roles for study group id $group_id. Changing one person to another counts as two updates.";
|
$final_message = "Made $counter updates leader/helper roles for study group id $group_id. Changing one person to another counts as two updates.";
|
||||||
drupal_set_message($final_message, 'status', FALSE);
|
drupal_set_message($final_message, 'status', FALSE);
|
||||||
watchdog('booking', "<pre>" . $final_message . "\n" . implode("\n", $update_messages) . "</pre>");
|
watchdog('booking', "<pre>" . $final_message . "\n" . implode("\n", $update_messages) . "</pre>");
|
||||||
|
@@ -560,6 +560,7 @@ function booking_studygroups_edit_form_submit($form, &$form_state) {
|
|||||||
foreach ($reading_groups as $group) {
|
foreach ($reading_groups as $group) {
|
||||||
if ($group->sid == $key) {
|
if ($group->sid == $key) {
|
||||||
booking_studygroups_process_colours();
|
booking_studygroups_process_colours();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -585,6 +586,7 @@ function booking_studygroups_edit_form_submit($form, &$form_state) {
|
|||||||
foreach ($reading_groups as $group) {
|
foreach ($reading_groups as $group) {
|
||||||
if ($group->sid == $key) {
|
if ($group->sid == $key) {
|
||||||
booking_studygroups_process_colours();
|
booking_studygroups_process_colours();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} //end new value check
|
} //end new value check
|
||||||
@@ -1545,7 +1547,7 @@ function booking_studygroups_printview_form($node, &$form_state, $group_id) {
|
|||||||
*/
|
*/
|
||||||
function booking_studygroups_view_form($node, &$form_state, $group_id) {
|
function booking_studygroups_view_form($node, &$form_state, $group_id) {
|
||||||
global $event;
|
global $event;
|
||||||
$is_reading_group = FALSE;
|
//$is_reading_group = FALSE;
|
||||||
$form = array();
|
$form = array();
|
||||||
$options = array();
|
$options = array();
|
||||||
$rows = array();
|
$rows = array();
|
||||||
@@ -1575,18 +1577,12 @@ function booking_studygroups_view_form($node, &$form_state, $group_id) {
|
|||||||
array(':eid' => $event->eid, ':sid' => $group_id))
|
array(':eid' => $event->eid, ':sid' => $group_id))
|
||||||
->fetchObject();
|
->fetchObject();
|
||||||
|
|
||||||
if (! $group)
|
if (! $group) {
|
||||||
{
|
|
||||||
drupal_set_message("Error: Could not find matching study group ID. Unable to view group membership.", 'error', FALSE);
|
drupal_set_message("Error: Could not find matching study group ID. Unable to view group membership.", 'error', FALSE);
|
||||||
drupal_goto('admin/config/booking');
|
drupal_goto('admin/config/booking');
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
if ($group_id == variable_get('booking_readinggroup_id','7'))
|
|
||||||
{
|
|
||||||
$is_reading_group = TRUE;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
$header = array(
|
$header = array(
|
||||||
'booking_session_id' => array('data' => t('Study Group Session'), 'field' => 'm.booking_session_id', 'sort' => 'asc'),
|
'booking_session_id' => array('data' => t('Study Group Session'), 'field' => 'm.booking_session_id', 'sort' => 'asc'),
|
||||||
'booking_name' => array('data' => t('Name'), 'field' => 'p.booking_lastname'),
|
'booking_name' => array('data' => t('Name'), 'field' => 'p.booking_lastname'),
|
||||||
|
Reference in New Issue
Block a user