Skip to content

Commit 9f14265

Browse files
authored
Merge pull request #6672 from yverhenne/add-sorting-by-date-to-pending
Add sorting by date and search by user in pending.php
2 parents b39ec60 + 7b28a2b commit 9f14265

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

main/exercise/pending.php

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,22 @@ function updateExerciseList(courseId) {
296296
]
297297
);
298298

299+
$userOptions = [];
300+
if (!empty($filter_user)) {
301+
$userInfo = api_get_user_info($filter_user);
302+
if (!empty($userInfo)) {
303+
$userOptions[$filter_user] = $userInfo['complete_name_with_username'];
304+
}
305+
}
306+
$form->addSelectAjax(
307+
'filter_by_user',
308+
get_lang('User'),
309+
$userOptions,
310+
[
311+
'url' => api_get_path(WEB_AJAX_PATH).'user_manager.ajax.php?a=get_user_like',
312+
]
313+
);
314+
299315
$status = [
300316
1 => get_lang('All'),
301317
2 => get_lang('Validated'),
@@ -445,8 +461,12 @@ function action_formatter(cellvalue, options, rowObject) {
445461
return "<span title=\""+tabLoginx[0]+rowObject[2]+tabLoginx[1]+"\">"+cellvalue+"</span>";
446462
}';
447463

448-
$extra_params['autowidth'] = 'true';
449-
$extra_params['height'] = 'auto';
464+
$extra_params = [
465+
'autowidth' => 'true',
466+
'height' => 'auto',
467+
'sortname' => 'exe_date',
468+
'sortorder' => 'asc',
469+
];
450470
$gridJs = Display::grid_js(
451471
'results',
452472
$url,

0 commit comments

Comments
 (0)