Permalink
Browse files

Added default sort

  • Loading branch information...
ikawhero
ikawhero committed Mar 27, 2006
1 parent 95d6f2e commit e0279f63d7becd47f43a0bdf25551e31ae35b97e
Showing with 7 additions and 1 deletion.
  1. +7 −1 mod/data/view.php
View
@@ -38,7 +38,7 @@
$approve = optional_param('approve', 0, PARAM_INT); //approval recordid
$delete = optional_param('delete', 0, PARAM_INT); //delete recordid
$perpagemenu = optional_param('perpage1', 0, PARAM_INT); //value from drop down
$sort = optional_param('sort',0,PARAM_INT); //sort by field
$sort = optional_param('sort',-1,PARAM_INT); //sort by field
$order = optional_param('order','ASC',PARAM_ALPHA); //sort order
$group = optional_param('group','0',PARAM_INT); //groupid
@@ -73,6 +73,12 @@
redirect($CFG->wwwroot.'/mod/data/field.php?d='.$data->id); // Redirect to field entry
}
}
/// If we haven't set a sort field use the default sort field
if ($sort == -1) {
$sort = $data->defaultsort;
$order = ($data->defaultsortdir == 0) ? 'ASC' : 'DESC';
}
//set user preference if available
if (isset($_GET['updatepref'])){

0 comments on commit e0279f6

Please sign in to comment.