mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-28945: Fix course/activity completion reports initial selection broken
This commit is contained in:
parent
6731a04d93
commit
1f186372ea
2 changed files with 36 additions and 14 deletions
|
@ -241,6 +241,9 @@ $pagingbar = '';
|
||||||
foreach ($initials as $initial) {
|
foreach ($initials as $initial) {
|
||||||
$var = 'si'.$initial;
|
$var = 'si'.$initial;
|
||||||
|
|
||||||
|
$othervar = $initial == 'first' ? 'silast' : 'sifirst';
|
||||||
|
$othervar = $$othervar != 'all' ? "&{$othervar}={$$othervar}" : '';
|
||||||
|
|
||||||
$pagingbar .= ' <div class="initialbar '.$initial.'initial">';
|
$pagingbar .= ' <div class="initialbar '.$initial.'initial">';
|
||||||
$pagingbar .= get_string($initial.'name').': ';
|
$pagingbar .= get_string($initial.'name').': ';
|
||||||
|
|
||||||
|
@ -248,7 +251,7 @@ foreach ($initials as $initial) {
|
||||||
$pagingbar .= '<strong>'.get_string('all').'</strong> ';
|
$pagingbar .= '<strong>'.get_string('all').'</strong> ';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$pagingbar .= '<a href="'.$link.'">'.get_string('all').'</a> ';
|
$pagingbar .= "<a href=\"{$link}{$othervar}\">".get_string('all').'</a> ';
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($alphabet as $letter) {
|
foreach ($alphabet as $letter) {
|
||||||
|
@ -256,7 +259,7 @@ foreach ($initials as $initial) {
|
||||||
$pagingbar .= '<strong>'.$letter.'</strong> ';
|
$pagingbar .= '<strong>'.$letter.'</strong> ';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$pagingbar .= '<a href="'.$link.'&'.$var.'='.$letter.'">'.$letter.'</a> ';
|
$pagingbar .= "<a href=\"$link&$var={$letter}{$othervar}\">$letter</a> ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,10 +273,15 @@ if($total > COMPLETION_REPORT_PAGE) {
|
||||||
$pagingbar .= '<div class="paging">';
|
$pagingbar .= '<div class="paging">';
|
||||||
$pagingbar .= get_string('page').': ';
|
$pagingbar .= get_string('page').': ';
|
||||||
|
|
||||||
|
$sistrings = array();
|
||||||
|
$sistrings[] = $sifirst != 'all' ? "sifirst={$sifirst}" : null;
|
||||||
|
$sistrings[] = $silast != 'all' ? "silast={$silast}" : null;
|
||||||
|
$sistring = !empty($sistrings) ? implode('&', $sistrings) : '';
|
||||||
|
|
||||||
// Display previous link
|
// Display previous link
|
||||||
if ($start > 0) {
|
if ($start > 0) {
|
||||||
$pstart = max($start - COMPLETION_REPORT_PAGE, 0);
|
$pstart = max($start - COMPLETION_REPORT_PAGE, 0);
|
||||||
$pagingbar .= '(<a class="previous" href="'.$link.$pstart.'">'.get_string('previous').'</a>) ';
|
$pagingbar .= "(<a class=\"previous\" href=\"{$link}{$pstart}{$sistring}\">".get_string('previous').'</a>) ';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create page links
|
// Create page links
|
||||||
|
@ -286,7 +294,7 @@ if($total > COMPLETION_REPORT_PAGE) {
|
||||||
$pagingbar .= ' '.$curpage.' ';
|
$pagingbar .= ' '.$curpage.' ';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$pagingbar .= ' <a href="'.$link.$curstart.'">'.$curpage.'</a> ';
|
$pagingbar .= " <a href=\"{$link}{$curstart}{$sistring}\">$curpage</a> ";
|
||||||
}
|
}
|
||||||
|
|
||||||
$curstart += COMPLETION_REPORT_PAGE;
|
$curstart += COMPLETION_REPORT_PAGE;
|
||||||
|
@ -295,7 +303,7 @@ if($total > COMPLETION_REPORT_PAGE) {
|
||||||
// Display next link
|
// Display next link
|
||||||
$nstart = $start + COMPLETION_REPORT_PAGE;
|
$nstart = $start + COMPLETION_REPORT_PAGE;
|
||||||
if ($nstart < $total) {
|
if ($nstart < $total) {
|
||||||
$pagingbar .= ' (<a class="next" href="'.$link.$nstart.'">'.get_string('next').'</a>)';
|
$pagingbar .= " (<a class=\"next\" href=\"{$link}{$nstart}{$sistring}\">".get_string('next').'</a>)';
|
||||||
}
|
}
|
||||||
|
|
||||||
$pagingbar .= '</div>';
|
$pagingbar .= '</div>';
|
||||||
|
@ -441,12 +449,15 @@ if(!$csv) {
|
||||||
|
|
||||||
// User heading / sort option
|
// User heading / sort option
|
||||||
print '<th scope="col" class="completion-sortchoice" style="clear: both;">';
|
print '<th scope="col" class="completion-sortchoice" style="clear: both;">';
|
||||||
|
|
||||||
|
$sistring = "&silast={$silast}&sifirst={$sifirst}";
|
||||||
|
|
||||||
if($firstnamesort) {
|
if($firstnamesort) {
|
||||||
print
|
print
|
||||||
get_string('firstname').' / <a href="./?course='.$course->id.'">'.
|
get_string('firstname')." / <a href=\"./?course={$course->id}{$sistring}\">".
|
||||||
get_string('lastname').'</a>';
|
get_string('lastname').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a href="./?course='.$course->id.'&sort=firstname">'.
|
print "<a href=\"./?course={$course->id}&sort=firstname{$sistring}\">".
|
||||||
get_string('firstname').'</a> / '.
|
get_string('firstname').'</a> / '.
|
||||||
get_string('lastname');
|
get_string('lastname');
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,6 +173,9 @@ $pagingbar = '';
|
||||||
foreach ($initials as $initial) {
|
foreach ($initials as $initial) {
|
||||||
$var = 'si'.$initial;
|
$var = 'si'.$initial;
|
||||||
|
|
||||||
|
$othervar = $initial == 'first' ? 'silast' : 'sifirst';
|
||||||
|
$othervar = $$othervar != 'all' ? "&{$othervar}={$$othervar}" : '';
|
||||||
|
|
||||||
$pagingbar .= ' <div class="initialbar '.$initial.'initial">';
|
$pagingbar .= ' <div class="initialbar '.$initial.'initial">';
|
||||||
$pagingbar .= get_string($initial.'name').': ';
|
$pagingbar .= get_string($initial.'name').': ';
|
||||||
|
|
||||||
|
@ -180,7 +183,7 @@ foreach ($initials as $initial) {
|
||||||
$pagingbar .= '<strong>'.get_string('all').'</strong> ';
|
$pagingbar .= '<strong>'.get_string('all').'</strong> ';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$pagingbar .= '<a href="'.$link.'">'.get_string('all').'</a> ';
|
$pagingbar .= "<a href=\"{$link}{$othervar}\">".get_string('all').'</a> ';
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($alphabet as $letter) {
|
foreach ($alphabet as $letter) {
|
||||||
|
@ -188,7 +191,7 @@ foreach ($initials as $initial) {
|
||||||
$pagingbar .= '<strong>'.$letter.'</strong> ';
|
$pagingbar .= '<strong>'.$letter.'</strong> ';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$pagingbar .= '<a href="'.$link.'&'.$var.'='.$letter.'">'.$letter.'</a> ';
|
$pagingbar .= "<a href=\"$link&$var={$letter}{$othervar}\">$letter</a> ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,10 +205,15 @@ if($total > COMPLETION_REPORT_PAGE) {
|
||||||
$pagingbar .= '<div class="paging">';
|
$pagingbar .= '<div class="paging">';
|
||||||
$pagingbar .= get_string('page').': ';
|
$pagingbar .= get_string('page').': ';
|
||||||
|
|
||||||
|
$sistrings = array();
|
||||||
|
$sistrings[] = $sifirst != 'all' ? "sifirst={$sifirst}" : null;
|
||||||
|
$sistrings[] = $silast != 'all' ? "silast={$silast}" : null;
|
||||||
|
$sistring = !empty($sistrings) ? implode('&', $sistrings) : '';
|
||||||
|
|
||||||
// Display previous link
|
// Display previous link
|
||||||
if ($start > 0) {
|
if ($start > 0) {
|
||||||
$pstart = max($start - COMPLETION_REPORT_PAGE, 0);
|
$pstart = max($start - COMPLETION_REPORT_PAGE, 0);
|
||||||
$pagingbar .= '(<a class="previous" href="'.$link.$pstart.'">'.get_string('previous').'</a>) ';
|
$pagingbar .= "(<a class=\"previous\" href=\"{$link}{$pstart}{$sistring}\">".get_string('previous').'</a>) ';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create page links
|
// Create page links
|
||||||
|
@ -218,7 +226,7 @@ if($total > COMPLETION_REPORT_PAGE) {
|
||||||
$pagingbar .= ' '.$curpage.' ';
|
$pagingbar .= ' '.$curpage.' ';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$pagingbar .= ' <a href="'.$link.$curstart.'">'.$curpage.'</a> ';
|
$pagingbar .= " <a href=\"{$link}{$curstart}{$sistring}\">$curpage</a> ";
|
||||||
}
|
}
|
||||||
|
|
||||||
$curstart += COMPLETION_REPORT_PAGE;
|
$curstart += COMPLETION_REPORT_PAGE;
|
||||||
|
@ -227,7 +235,7 @@ if($total > COMPLETION_REPORT_PAGE) {
|
||||||
// Display next link
|
// Display next link
|
||||||
$nstart = $start + COMPLETION_REPORT_PAGE;
|
$nstart = $start + COMPLETION_REPORT_PAGE;
|
||||||
if ($nstart < $total) {
|
if ($nstart < $total) {
|
||||||
$pagingbar .= ' (<a class="next" href="'.$link.$nstart.'">'.get_string('next').'</a>)';
|
$pagingbar .= " (<a class=\"next\" href=\"{$link}{$nstart}{$sistring}\">".get_string('next').'</a>)';
|
||||||
}
|
}
|
||||||
|
|
||||||
$pagingbar .= '</div>';
|
$pagingbar .= '</div>';
|
||||||
|
@ -251,12 +259,15 @@ if(!$csv) {
|
||||||
|
|
||||||
// User heading / sort option
|
// User heading / sort option
|
||||||
print '<th scope="col" class="completion-sortchoice">';
|
print '<th scope="col" class="completion-sortchoice">';
|
||||||
|
|
||||||
|
$sistring = "&silast={$silast}&sifirst={$sifirst}";
|
||||||
|
|
||||||
if($firstnamesort) {
|
if($firstnamesort) {
|
||||||
print
|
print
|
||||||
get_string('firstname').' / <a href="./?course='.$course->id.'">'.
|
get_string('firstname')." / <a href=\"./?course={$course->id}{$sistring}\">".
|
||||||
get_string('lastname').'</a>';
|
get_string('lastname').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a href="./?course='.$course->id.'&sort=firstname">'.
|
print "<a href=\"./?course={$course->id}&sort=firstname{$sistring}\">".
|
||||||
get_string('firstname').'</a> / '.
|
get_string('firstname').'</a> / '.
|
||||||
get_string('lastname');
|
get_string('lastname');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue