add more detail to study group definitions and email token

This commit is contained in:
Nathan Coad
2018-06-16 18:39:55 +10:00
parent be5d1e8c2f
commit ed45d52007
5 changed files with 57 additions and 20 deletions

View File

@@ -1620,16 +1620,18 @@ function _booking_studygroup_email_summary($node) {
$studygroups = $studygroups_query->fetchAllAssoc('sid');
//for ($i = 1; $i <= variable_get('booking_studygroup_count','0'); $i++)
foreach ($studygroups as $studygroup)
{
foreach ($studygroups as $studygroup) {
//calculate the session references
$sessionid = "session" . $studygroup->sid;
$roleid = $sessionid . "_role";
//check that this study group session has been defined for this attendee
if (!empty($node->$sessionid))
{
$rows[] = t($studygroup->booking_studygroup_descrip . ": Group " . $node->$sessionid . ", " . _booking_studygroup_role_lookup($node->$roleid));
if (!empty($node->$sessionid)) {
//$rows[] = t($studygroup->booking_studygroup_descrip . ": Group " . $node->$sessionid . ", " . _booking_studygroup_role_lookup($node->$roleid));
$rows[] = t('!role for group !descrip, which will occur on !weekday. !explan', array(
'!descrip' => $studygroup->booking_studygroup_descrip, '!weekday' => $studygroup->booking_studygroup_weekday,
'!explan' => $studygroup->booking_studygroup_explanation, '!role' => _booking_studygroup_role_lookup($node->$roleid),
));
}
}
}
@@ -1639,7 +1641,13 @@ function _booking_studygroup_email_summary($node) {
}
if(variable_get('booking_enable_html_mail', 0) == 1) {
return implode("\n<br />", $rows);
$output = "\n<ul>\n";
foreach ($rows as $row) {
$output .= "\t<li>$row</li>\n";
}
$output .= "</ul>\n";
//return implode("\n<br />", $rows);
return $output;
}
else {
return implode("\n", $rows);