minor tweaks to UI
This commit is contained in:
@@ -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,
|
||||
@@ -1369,14 +1374,22 @@ function booking_studygroups_update_form($node, &$form_state, $sid) {
|
||||
$final_message = t('Finished processing study group !group.', array('!group' => $group->booking_studygroup_descrip));
|
||||
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)));
|
||||
|
||||
@@ -1760,6 +1773,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",
|
||||
|
Reference in New Issue
Block a user