diff --git a/booking.helper.inc b/booking.helper.inc index d706cde..0f13c09 100644 --- a/booking.helper.inc +++ b/booking.helper.inc @@ -1651,13 +1651,19 @@ function _booking_readinggroup_email_listing($node) { } } + // Don't show an empty header row if there was no-one in the group + if (count($rows) < 1) { + return implode("\n", $rows); + } + + // Use Drupal's table theming function to build the table if HTML email is enabled if(variable_get('booking_enable_html_mail', 0) == 1) { $table = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => $attributes)); watchdog('booking_debug', "
Reading group table\n@info", array('@info' => print_r($table, true))); return $table; } else { - return ""; + return implode("\n", $rows); } } diff --git a/booking.tokens.inc b/booking.tokens.inc index cdb5820..402bd8d 100644 --- a/booking.tokens.inc +++ b/booking.tokens.inc @@ -496,8 +496,12 @@ function booking_token_info() { ); $info['tokens']['booking']['leaderhelper-pair'] = array( 'name' => t('Registration Study Group Leader-Helper Pair'), - 'description' => t('List out the leader and helper pairs, with intro text.') + 'description' => t('List out the leader and helper pairs.') ); + $info['tokens']['booking']['readinggroup-listing'] = array( + 'name' => t('Reading Group Membership'), + 'description' => t('Lists all the people in a Reading Group, but only for the leader.') + ); $info['tokens']['booking']['room-allocation'] = array( 'name' => t('Room Allocation'), 'description' => t('Details of room allocated to attendee.')