diff --git a/lang/en_utf8/data.php b/lang/en_utf8/data.php index be397ac2367..18f558a4a51 100644 --- a/lang/en_utf8/data.php +++ b/lang/en_utf8/data.php @@ -203,6 +203,7 @@ $string['savetemplate'] = 'Save template'; $string['sendinratings'] = 'Send in my latest ratings'; $string['single'] = 'View single'; $string['singletemplate'] = 'Single template'; +$string['showall'] = 'Show all entries'; $string['teachersandstudents'] = '$a->teachers and $a->students'; $string['templates'] = 'Templates'; $string['templatesaved'] = 'Template saved'; diff --git a/mod/data/lib.php b/mod/data/lib.php index bbb35b40ab2..8ed6196a34e 100755 --- a/mod/data/lib.php +++ b/mod/data/lib.php @@ -904,6 +904,24 @@ function data_print_template($template, $records, $data, $search='',$page=0, $re } +function data_print_show_all_form($data, $perpage, $sort, $order, $mode) { + echo '
'; + echo '
'; + echo '
'; + echo ''; + echo ''; + echo ''; // clear search + echo ''; + echo ''; + echo ''; + echo ''; + + echo '
'; + echo '
'; + echo '
'; +} + + /************************************************************************ * function that takes in the current data, number of items per page, * * a search string and prints a preference box in view.php * @@ -912,7 +930,7 @@ function data_print_template($template, $records, $data, $search='',$page=0, $re * @param string $search * * output null * ************************************************************************/ -function data_print_preference_form($data, $perpage, $search, $sort='', $order='ASC'){ +function data_print_preference_form($data, $perpage, $search, $sort='', $order='ASC', $mode='single'){ echo '
'; echo '
'; echo '
'; @@ -949,6 +967,7 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order=' echo ''; //print ASC or DESC echo '   '; + echo ''; echo ''; echo '
'; echo '
'; diff --git a/mod/data/view.php b/mod/data/view.php index 468818d0c4c..46037815f67 100755 --- a/mod/data/view.php +++ b/mod/data/view.php @@ -407,6 +407,7 @@ data_print_template('singletemplate', $records, $data, $search, $page); } else if ($search){ notify(get_string('nomatch','data')); + data_print_show_all_form($data, $perpage, $sort, $order, $mode); } else { notify(get_string('norecords','data')); } @@ -446,7 +447,7 @@ } if ($records || $search || $page) { - data_print_preference_form($data, $perpage, $search, $sort, $order); + data_print_preference_form($data, $perpage, $search, $sort, $order, $mode); } /// If we have blocks, then print the left side here