Minor tweaks

This commit is contained in:
2014-06-30 17:40:26 +10:00
parent 53ea1fd2fe
commit ad131989b5
7 changed files with 91 additions and 35 deletions

View File

@@ -436,7 +436,7 @@ function booking_studygroups_edit_form($node, &$form_state, $nid) {
return "";
}
$prefix = t("<p>Manually assign/update study group sessions for !first !last.<br />If updating an existing session ID, this will also copy any role assigned (leader, helper, etc).</p><p><b>Note:&nbsp;Still under testing!</b></p>", array('!first' => $person->booking_firstname, '!last' => $person->booking_lastname));
$prefix = t("<p>Manually assign/update study group sessions for !first !last.<br />If updating an existing session ID, this will also copy any role assigned (leader, helper, etc).</p>", array('!first' => $person->booking_firstname, '!last' => $person->booking_lastname));
//select the groups this person is already assigned to, indexed by studygroup id
$person_groups_query = db_query("SELECT * FROM {booking_studygroup_mapping} WHERE booking_eventid = :eid AND booking_node_id = :nid",
@@ -580,6 +580,11 @@ function booking_studygroups_edit_form_submit($form, &$form_state) {
//check if there is a valid value to process
if ($value > 0 || $value == 'Remove')
{
//if there was no previous mapping but Remove has been selected anyway, just skip to the next value to look at
if (empty($person_groups[$key]) && $value == 'Remove')
{
continue;
}
//check to see if we need to remove a study group mapping
if (! empty($person_groups[$key]) && $value == 'Remove')
{
@@ -1329,7 +1334,7 @@ function booking_studygroups_update_form($node, &$form_state, $sid) {
//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)
{
$message = t('Found existing study group session for user !id (!name). Changing old session !old to !session. Role id is !role',
$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,
'!role' => $person->booking_studygroup_role, '!name' => $person->booking_firstname . " " . $person->booking_lastname));
@@ -1343,7 +1348,7 @@ function booking_studygroups_update_form($node, &$form_state, $sid) {
}
elseif ($mapping->booking_session_id !== $person->session && $group->sid == $reading_group_id)
{
$message = t('Found existing reading group session for user !id (!name). Changing old session !old to !session. Role id is !role',
$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,
'!role' => $person->booking_studygroup_role, '!name' => $person->booking_firstname . " " . $person->booking_lastname));
@@ -1421,7 +1426,7 @@ function booking_studygroups_update_form($node, &$form_state, $sid) {
);
$form['result'] = array(
'#type' => 'fieldset',
'#title' => 'Generated Updates',
'#title' => 'Suggested Updates',
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);