diff --git a/booking.studygroups_report.inc b/booking.studygroups_report.inc index 3b5b38d..46c2f31 100644 --- a/booking.studygroups_report.inc +++ b/booking.studygroups_report.inc @@ -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', "
Leader Helper session @session, role @role
", - // 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[] .= "" . $text . ", session #" . $person->$session; } - else { - //watchdog('booking_debug2', "
Leader Helper check\n@info
", 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[] .= "" . $text . " 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("

!event Study Group Leaders and Helpers

", array('!event' => $event->booking_eventname)); $output .= theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => $attributes)); return $output; - - - } \ No newline at end of file