code cleanup
This commit is contained in:
@@ -118,6 +118,7 @@ function booking_studygroups_leadhelp_view_summary() {
|
|||||||
->orderBy('sid');
|
->orderBy('sid');
|
||||||
$studygroup_list = $query->execute()->fetchAllAssoc('sid');
|
$studygroup_list = $query->execute()->fetchAllAssoc('sid');
|
||||||
|
|
||||||
|
//add columns for the study groups
|
||||||
foreach ($studygroup_list as $group) {
|
foreach ($studygroup_list as $group) {
|
||||||
$header[] = $group->booking_studygroup_descrip;
|
$header[] = $group->booking_studygroup_descrip;
|
||||||
}
|
}
|
||||||
@@ -126,49 +127,31 @@ function booking_studygroups_leadhelp_view_summary() {
|
|||||||
" AND (booking_status = 1 OR booking_status = 2)" .
|
" AND (booking_status = 1 OR booking_status = 2)" .
|
||||||
" ORDER BY booking_lastname, booking_firstname")->fetchAllAssoc('nid');
|
" ORDER BY booking_lastname, booking_firstname")->fetchAllAssoc('nid');
|
||||||
|
|
||||||
|
//loop through each matching person
|
||||||
foreach ($person_query as $person) {
|
foreach ($person_query as $person) {
|
||||||
//add the name to an array for this line
|
//add the name to an array for this line
|
||||||
$newline = array($person->booking_firstname, $person->booking_lastname);
|
$newline = array($person->booking_firstname, $person->booking_lastname);
|
||||||
|
|
||||||
foreach ($studygroup_list as $group) {
|
foreach ($studygroup_list as $group) {
|
||||||
$session = 'session' . $group->sid;
|
$session = 'session' . $group->sid;
|
||||||
$session_role = 'session' . $group->sid . '_role';
|
$session_role = 'session' . $group->sid . '_role'
|
||||||
//watchdog('booking_debug2', "<pre>Leader Helper session @session, role @role</pre>",
|
//add details if they have a role for this studygroup
|
||||||
// array('@session' => $session, '@role' => $session_role));
|
|
||||||
|
|
||||||
if ($person->$session_role > 0) {
|
if ($person->$session_role > 0) {
|
||||||
$text = _booking_studygroup_role_lookup($person->$session_role);
|
$text = _booking_studygroup_role_lookup($person->$session_role);
|
||||||
$newline[] .= "<b>" . $text . "</b>, session #" . $person->$session;
|
$newline[] .= "<b>" . $text . "</b>, session #" . $person->$session;
|
||||||
}
|
}
|
||||||
else {
|
//otherwise put a blank entry for this studygroup
|
||||||
//watchdog('booking_debug2', "<pre>Leader Helper check\n@info</pre>", array('@info' => print_r( $group, true)));
|
|
||||||
$newline[] = "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
//go through each of the studygroups and check if the person belongs to the group
|
|
||||||
foreach ($group_mapping as $group) {
|
|
||||||
$role = $group->booking_studygroup_role;
|
|
||||||
if ($group->booking_node_id == $person->nid && $role > 0) {
|
|
||||||
$text = _booking_studygroup_role_lookup($role);
|
|
||||||
$newline[] .= "<b>" . $text . "</b> for session #" . $group->booking_session_id;
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
$newline[] = "";
|
$newline[] = "";
|
||||||
}
|
}
|
||||||
}
|
} //end iterate studygroup list
|
||||||
*/
|
|
||||||
//add the line to the array of rows
|
//add the line to the array of rows
|
||||||
$rows[] = $newline;
|
$rows[] = $newline;
|
||||||
}
|
} //end iterate person list
|
||||||
|
|
||||||
//output everything
|
//output everything
|
||||||
$output .= t("<h3>!event Study Group Leaders and Helpers</h3>", array('!event' => $event->booking_eventname));
|
$output .= t("<h3>!event Study Group Leaders and Helpers</h3>", array('!event' => $event->booking_eventname));
|
||||||
$output .= theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => $attributes));
|
$output .= theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => $attributes));
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user