Commit c95034f2 authored by dongsheng's avatar dongsheng
Browse files

MDL-9758, add 2 new tags, see tracker.

parent c9623740
......@@ -966,6 +966,12 @@ function data_print_template($template, $records, $data, $search='',$page=0, $re
$patterns[]='##user##';
$replacement[] = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$record->userid.
'&amp;course='.$data->course.'">'.fullname($record).'</a>';
$patterns[] = '##timeadded##';
$replacement[] = '<span>'.get_string('data:added', 'data').userdate($record->timecreated).'</span>';
$patterns[] = '##timemodified##';
$replacement [] = '<span>'.get_string('data:modified', 'data').userdate($record->timemodified).'</span>';
$patterns[]='##approve##';
if (has_capability('mod/data:approve', $context) && ($data->approval) && (!$record->approved)){
......
......@@ -226,6 +226,8 @@
echo '<option value="##edit##">' .get_string('edit', 'data'). ' - ##edit##</option>';
echo '<option value="##delete##">' .get_string('delete', 'data'). ' - ##delete##</option>';
echo '<option value="##approve##">' .get_string('approve', 'data'). ' - ##approve##</option>';
echo '<option value="##timeadded##">'.get_string('timeadded', 'data'). ' - ##timeadded##</option>';
echo '<option value="##timemodified##">'.get_string('timemodified', 'data'). ' - ##timemodified##</option>';
echo '<option value="##user##">' .get_string('user'). ' - ##user##</option>';
if ($mode != 'singletemplate') {
// more points to single template - not useable there
......
......@@ -418,7 +418,7 @@
} else {
$what = ' DISTINCT r.id, r.approved, r.timecreated, r.userid, u.firstname, u.lastname ';
$what = ' DISTINCT r.id, r.approved, r.timecreated, r.timemodified, r.userid, u.firstname, u.lastname ';
$count = ' COUNT(r.id) ';
$tables = $CFG->prefix.'data_records r, '.$CFG->prefix.'user u ';
$where = 'WHERE r.dataid = '.$data->id. ' AND r.userid = u.id ';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment