code cleanup
This commit is contained in:
@@ -118,6 +118,7 @@ function booking_studygroups_leadhelp_view_summary() {
|
||||
->orderBy('sid');
|
||||
$studygroup_list = $query->execute()->fetchAllAssoc('sid');
|
||||
|
||||
//add columns for the study groups
|
||||
foreach ($studygroup_list as $group) {
|
||||
$header[] = $group->booking_studygroup_descrip;
|
||||
}
|
||||
@@ -126,49 +127,31 @@ function booking_studygroups_leadhelp_view_summary() {
|
||||
" AND (booking_status = 1 OR booking_status = 2)" .
|
||||
" ORDER BY booking_lastname, booking_firstname")->fetchAllAssoc('nid');
|
||||
|
||||
//loop through each matching person
|
||||
foreach ($person_query as $person) {
|
||||
//add the name to an array for this line
|
||||
$newline = array($person->booking_firstname, $person->booking_lastname);
|
||||
|
||||
foreach ($studygroup_list as $group) {
|
||||
$session = 'session' . $group->sid;
|
||||
$session_role = 'session' . $group->sid . '_role';
|
||||
//watchdog('booking_debug2', "<pre>Leader Helper session @session, role @role</pre>",
|
||||
// array('@session' => $session, '@role' => $session_role));
|
||||
|
||||
$session_role = 'session' . $group->sid . '_role'
|
||||
//add details if they have a role for this studygroup
|
||||
if ($person->$session_role > 0) {
|
||||
$text = _booking_studygroup_role_lookup($person->$session_role);
|
||||
$newline[] .= "<b>" . $text . "</b>, session #" . $person->$session;
|
||||
}
|
||||
else {
|
||||
//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;
|
||||
}
|
||||
//otherwise put a blank entry for this studygroup
|
||||
else {
|
||||
$newline[] = "";
|
||||
}
|
||||
}
|
||||
*/
|
||||
} //end iterate studygroup list
|
||||
//add the line to the array of rows
|
||||
$rows[] = $newline;
|
||||
}
|
||||
} //end iterate person list
|
||||
|
||||
//output everything
|
||||
$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));
|
||||
|
||||
return $output;
|
||||
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user