]> git.mjollnir.org Git - moodle.git/commitdiff
FIxes for bug 5197
authormoodler <moodler>
Sat, 15 Apr 2006 02:41:27 +0000 (02:41 +0000)
committermoodler <moodler>
Sat, 15 Apr 2006 02:41:27 +0000 (02:41 +0000)
mod/data/lib.php
mod/data/view.php

index b7371f8523cd6aa9bd98a98f19588c350c390032..841fd8399f1f17a5a005cb0fd7d2bbdbfb2e8179 100755 (executable)
@@ -1106,6 +1106,8 @@ function data_get_ratings($recordid, $sort="u.firstname ASC") {
 //prints all comments + a text box for adding additional comment
 function data_print_comments($data, $record, $page=0) {
 
+    global $CFG;
+
     echo '<a name="comments"></a>';
 
     if ($comments = get_records('data_comments','recordid',$record->id)) {
index 0f31ee39cf2ed6bb0b95db827fc313a31e6bf313..f19576351637b12f16c40d013aa73ae97e7b7374 100755 (executable)
                             'view.php?d='.$data->id);
 
                     $records[] = $deleterecord;
-                    data_print_template('singletemplate', $records, $data);
+                    echo data_print_template('singletemplate', $records, $data, '', 0, true);
 
                     print_footer($course);
                     exit;
 
             if (empty($data->singletemplate)){
                 notify(get_string('nosingletemplate','data'));
+                data_generate_default_template($data, 'singletemplate', 0, false, false);
             }
 
             data_print_template('singletemplate', $records, $data, $search, $page);
 
             if (empty($data->listtemplate)){
                 notify(get_string('nolisttemplate','data'));
+                data_generate_default_template($data, 'listtemplate', 0, false, false);
             }
             echo $data->listtemplateheader;
             data_print_template('listtemplate', $records, $data, $search, $page);