diff --git a/booking.helper.inc b/booking.helper.inc index e3a96e0..936525c 100644 --- a/booking.helper.inc +++ b/booking.helper.inc @@ -1117,6 +1117,70 @@ function _booking_travelform_email_summary($node) { return implode("\n", $rows); } +/** + * Helper function to format summary of studygroup sessions to be used as a token + */ +function _booking_studygroup_email_summary($node) { + global $event; + $rows = array(); + + //display study session data if enabled + if (variable_get('booking_enable_studygroups', 0) == 1) + { + //look up the titles of the study groups + $studygroups_query = db_query("SELECT * FROM {booking_studygroup_list} WHERE booking_eventid = :eid", + array(':eid' => $event->eid)); + $studygroups = $studygroups_query->fetchAllAssoc('sid'); + + for ($i = 1; $i <= variable_get('booking_studygroup_count','0'); $i++) + { + //calculate the session references + $sessionid = "session" . $i; + $roleid = $sessionid . "_role"; + + //check that this study group session has been defined for this attendee + if (!empty($node->$sessionid)) + { + $rows[] = t($studygroups[$i]->booking_studygroup_descrip . " session number:\t" . $node->$sessionid); + $rows[] = t("Role:\t" . _booking_studygroup_role_lookup($node->$roleid)); + } + + } + } + + foreach ($rows as $key => $value) + $rows[$key] = wordwrap($value); + + return implode("\n", $rows); +} + +/** + * Helper function to format summary of room allocation to be used as a token + */ +function _booking_room_email_summary($node) { + global $event; + $rows = array(); + + //display study session data if enabled + if (variable_get('booking_enable_roomallocations', 0) == 1) + { + //check that this attendee has had a room allocated + if (! empty($node->rid)) + { + $rows[] = t("Room Location\t" . _booking_room_location_lookup($node->booking_room_location_id)); + $rows[] = t("Room Number\t" . $node->booking_room_number); + $rows[] = t("Bed Type\t" . _booking_room_bedtype_lookup($node->booking_room_bedtype)); + } + else + $rows[] = t("No room currently allocated."); + } + + foreach ($rows as $key => $value) + $rows[$key] = wordwrap($value); + + return implode("\n", $rows); +} + /** * @brief Generates a Universally Unique IDentifier, version 4. * diff --git a/booking.register.inc b/booking.register.inc index 5620bb7..b8436d9 100644 --- a/booking.register.inc +++ b/booking.register.inc @@ -1706,7 +1706,10 @@ function booking_view($node, $view_mode) { //display study session data if enabled if (variable_get('booking_enable_studygroups', 0) == 1) { - + $studygroup_heading = t("
!link
", + array('!link' => l(t('Edit Groups'), t('admin/booking/!id/edit-studygroup', array('!id' => $node->nid))) + )); + //look up the titles of the study groups $studygroups_query = db_query("SELECT * FROM {booking_studygroup_list} WHERE booking_eventid = :eid", array(':eid' => $event->eid)); @@ -1725,7 +1728,7 @@ function booking_view($node, $view_mode) { } $node->content['group-heading'] = array( - '#markup' => "