MDL-8733 fixed approving logic when editing; fixed approve icon
This commit is contained in:
+3
-4
@@ -137,10 +137,9 @@
|
||||
|
||||
/// All student edits are marked unapproved by default
|
||||
$record = get_record('data_records','id',$rid);
|
||||
|
||||
if ($data->approval == 1 || isteacher($course->id)) {
|
||||
$record->approved = 1;
|
||||
} else {
|
||||
|
||||
/// reset approved flag after student edit
|
||||
if (!isteacher($course->id)) {
|
||||
$record->approved = 0;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -893,7 +893,7 @@ function data_print_template($template, $records, $data, $search='',$page=0, $re
|
||||
|
||||
$patterns[]='/\#\#Approve\#\#/i';
|
||||
if ($isteacher && ($data->approval) && (!$record->approved)){
|
||||
$replacement[] = '<a href="'.$CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&approve='.$record->id.'&sesskey='.sesskey().'"><img src="'.$CFG->pixpath.'/i/approve.gif" height="11" width="11" border="0" alt="'.get_string('approve').'" /></a>';
|
||||
$replacement[] = '<a href="'.$CFG->wwwroot.'/mod/data/view.php?d='.$data->id.'&approve='.$record->id.'&sesskey='.sesskey().'"><img src="'.$CFG->wwwroot.'/mod/glossary/check.gif" height="11" width="11" border="0" alt="'.get_string('approve').'" /></a>';
|
||||
} else {
|
||||
$replacement[] = '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user