Merge branch 'MDL-54125_master' of git://github.com/markn86/moodle

This commit is contained in:
Andrew Nicols
2016-05-11 14:11:07 +08:00
+6 -11
View File
@@ -1208,14 +1208,13 @@ function data_print_template($template, $records, $data, $search='', $page=0, $r
$cm = get_coursemodule_from_instance('data', $data->id);
$context = context_module::instance($cm->id);
static $fields = NULL;
static $isteacher;
static $dataid = NULL;
static $fields = array();
static $dataid = null;
if (empty($dataid)) {
$dataid = $data->id;
} else if ($dataid != $data->id) {
$fields = NULL;
$fields = array();
}
if (empty($fields)) {
@@ -1223,7 +1222,6 @@ function data_print_template($template, $records, $data, $search='', $page=0, $r
foreach ($fieldrecords as $fieldrecord) {
$fields[]= data_get_field($fieldrecord, $data);
}
$isteacher = has_capability('mod/data:managetemplates', $context);
}
if (empty($records)) {
@@ -1698,14 +1696,13 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order='
data_generate_default_template($data, 'asearchtemplate');
}
static $fields = NULL;
static $isteacher;
static $dataid = NULL;
static $fields = array();
static $dataid = null;
if (empty($dataid)) {
$dataid = $data->id;
} else if ($dataid != $data->id) {
$fields = NULL;
$fields = array();
}
if (empty($fields)) {
@@ -1713,8 +1710,6 @@ function data_print_preference_form($data, $perpage, $search, $sort='', $order='
foreach ($fieldrecords as $fieldrecord) {
$fields[]= data_get_field($fieldrecord, $data);
}
$isteacher = has_capability('mod/data:managetemplates', $context);
}
// Replacing tags