MDL-83152 mod_glossary: fix chronological sorting of pending entries.

This commit is contained in:
Paul Holden 2024-08-02 10:06:03 +01:00
parent a2653cc924
commit 77ecfb747d
No known key found for this signature in database
GPG key ID: A81A96D6045F6164

View file

@ -1835,7 +1835,7 @@ function glossary_print_approval_menu($cm, $glossary,$mode, $hook, $sortkey = ''
glossary_print_all_links($cm, $glossary, $mode, $hook); glossary_print_all_links($cm, $glossary, $mode, $hook);
glossary_print_sorting_links($cm, $mode, 'CREATION', 'asc'); glossary_print_sorting_links($cm, $mode, $sortkey, $sortorder);
} }
/** /**
* @param object $cm * @param object $cm
@ -2060,6 +2060,11 @@ function glossary_print_sorting_links($cm, $mode, $sortkey = '',$sortorder = '')
$neworder = ''; $neworder = '';
$currentorder = ''; $currentorder = '';
$currentsort = ''; $currentsort = '';
if ($sortkey === '') {
$sortkey = 'CREATION';
}
if ( $sortorder ) { if ( $sortorder ) {
if ( $sortorder == 'asc' ) { if ( $sortorder == 'asc' ) {
$currentorder = $asc; $currentorder = $asc;
@ -2082,10 +2087,9 @@ function glossary_print_sorting_links($cm, $mode, $sortkey = '',$sortorder = '')
$icon = " " . $OUTPUT->pix_icon('asc', $newordertitle, 'glossary'); $icon = " " . $OUTPUT->pix_icon('asc', $newordertitle, 'glossary');
} }
} }
$ficon = ''; $ficon = '';
$fneworder = ''; $fneworder = '';
$fbtag = '';
$fendbtag = '';
$sicon = ''; $sicon = '';
$sneworder = ''; $sneworder = '';
@ -2093,7 +2097,6 @@ function glossary_print_sorting_links($cm, $mode, $sortkey = '',$sortorder = '')
$sbtag = ''; $sbtag = '';
$fbtag = ''; $fbtag = '';
$fendbtag = ''; $fendbtag = '';
$sendbtag = '';
$sendbtag = ''; $sendbtag = '';