';
$options = array (SORTEDLISTVIEW => get_string('sortedlist','attforblock'), SORTEDGRIDVIEW => get_string('sortedgrid','attforblock'));
- $data = "attendances.php?id=$id&grouptype=$grouptype&gridcols=$gridcols";
+ $dataurl = "attendances.php?id=$id&grouptype=$grouptype&gridcols=$gridcols";
if ($group!=-1) {
- $data = $data . "&group=$group";
+ $dataurl = $dataurl . "&group=$group";
}
$today = usergetmidnight($sessdata->sessdate);
$select = "sessdate>={$today} AND sessdate<{$today}+86400 AND attendanceid={$cm->instance}";
- $sessions = get_records_select('attendance_sessions', $select, 'sessdate ASC');
+ $todaysessions = get_records_select('attendance_sessions', $select, 'sessdate ASC');
$optionssesions = array();
- if (count($sessions)>1) {
+ if (count($todaysessions)>1) {
echo '";
- foreach($sessions as $sessdatarow) {
- $optionssessions[$sessdatarow->id] = userdate($sessdatarow->sessdate, get_string('strftimehm', 'attforblock')) . "-" . userdate($sessdatarow->sessdate+$sessdata->duration, get_string('strftimehm', 'attforblock'));
+ foreach($todaysessions as $sessdatarow) {
+ $descr = userdate($sessdatarow->sessdate, get_string('strftimehm', 'attforblock')) . "-" . userdate($sessdatarow->sessdate+$sessdatarow->duration, get_string('strftimehm', 'attforblock'));
+ if ($sessdatarow->description) {
+ $descr = $sessdatarow->description . ' ('.$descr.')';
+ }
+ $optionssessions[$sessdatarow->id] = $descr;
}
- popup_form("$data&sessionid=", $optionssessions, 'fastsessionmenu', $sessionid, '');
+ popup_form("$dataurl&sessionid=", $optionssessions, 'fastsessionmenu', $sessionid, '');
echo " | | |
";
}
- $data .= "&sessionid=$sessionid";
+ $dataurl .= "&sessionid=$sessionid";
echo '";
- popup_form("$data&view=", $options, 'viewmenu', $view, '');
+ popup_form("$dataurl&view=", $options, 'viewmenu', $view, '');
if ($view == SORTEDGRIDVIEW) {
set_user_preference("attforblock_viewmode", $view);
set_user_preference("attforblock_gridcolumns", $gridcols);
@@ -135,11 +140,8 @@
'4 '.get_string('columns','attforblock'),'5 '.get_string('columns','attforblock'),'6 '.get_string('columns','attforblock'),
'7 '.get_string('columns','attforblock'),'8 '.get_string('columns','attforblock'),'9 '.get_string('columns','attforblock'),
'10 '.get_string('columns','attforblock'));
- $data = "attendances.php?id=$id&sessionid=$sessionid&grouptype=$grouptype&view=$view";
- if ($group!=-1) {
- $data = $data . "&group=$group";
- }
- popup_form("$data&gridcols=", $options, 'colsmenu', $gridcols, '');
+ $dataurl .= "&view=$view";
+ popup_form("$dataurl&gridcols=", $options, 'colsmenu', $gridcols, '');
}
echo ' |