MDL-8733 fixed approving logic when editing; fixed approve icon

This commit is contained in:
skodak
2007-03-03 12:17:35 +00:00
parent bd90f02488
commit 6317484ca7
2 changed files with 4 additions and 5 deletions
+3 -4
View File
@@ -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
View File
@@ -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.'&amp;approve='.$record->id.'&amp;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.'&amp;approve='.$record->id.'&amp;sesskey='.sesskey().'"><img src="'.$CFG->wwwroot.'/mod/glossary/check.gif" height="11" width="11" border="0" alt="'.get_string('approve').'" /></a>';
} else {
$replacement[] = '';
}