|
@@ -36,6 +36,14 @@ if (!$user->admin) {
|
|
|
}
|
|
|
|
|
|
$action = GETPOST('action', 'aZ09');
|
|
|
+$sortfield = GETPOST('sortfield', 'aZ09');
|
|
|
+$sortorder = GETPOST('sortorder', 'aZ09');
|
|
|
+if (empty($sortfield)) {
|
|
|
+ $sortfield = 'date';
|
|
|
+}
|
|
|
+if (empty($sortorder)) {
|
|
|
+ $sortorder = 'desc';
|
|
|
+}
|
|
|
|
|
|
$upload_dir = $conf->admin->dir_temp;
|
|
|
|
|
@@ -73,8 +81,6 @@ if ($action == 'updateform') {
|
|
|
} else {
|
|
|
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile', 'alpha')), null, 'errors');
|
|
|
}
|
|
|
- Header('Location: '.$_SERVER["PHP_SELF"]);
|
|
|
- exit;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -190,7 +196,7 @@ $formfile = new FormFile($db);
|
|
|
$formfile->form_attach_new_file($_SERVER['PHP_SELF'], $langs->trans("FormToTestFileUploadForm"), 0, 0, 1, 50, '', '', 1, '', 0);
|
|
|
|
|
|
// List of document
|
|
|
-$filearray = dol_dir_list($upload_dir, "files", 0, '', '', 'name', SORT_ASC, 1);
|
|
|
+$filearray = dol_dir_list($upload_dir, "files", 0, '', '', $sortfield, $sortorder == 'desc' ? SORT_DESC : SORT_ASC, 1);
|
|
|
$formfile->list_of_documents($filearray, null, 'admin_temp', '');
|
|
|
|
|
|
// End of page
|