MDL-9758 backported timeadded and timemodified + improved lang strings
This commit is contained in:
@@ -225,6 +225,8 @@ $string['templates'] = 'Templates';
|
||||
$string['templatesaved'] = 'Template saved';
|
||||
$string['text'] = 'Text';
|
||||
$string['textarea'] = 'Textarea';
|
||||
$string['timeadded'] = 'Time added';
|
||||
$string['timemodified'] = 'Time modified';
|
||||
$string['todatabase'] = 'to this database.';
|
||||
$string['type'] = 'Field type';
|
||||
$string['undefinedprocessactionmethod'] = 'No action method defined in Data_Preset to handle action \"$a\".';
|
||||
|
||||
@@ -972,6 +972,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.
|
||||
'&course='.$data->course.'">'.fullname($record).'</a>';
|
||||
|
||||
$patterns[] = '##timeadded##';
|
||||
$replacement[] = userdate($record->timecreated);
|
||||
|
||||
$patterns[] = '##timemodified##';
|
||||
$replacement [] = userdate($record->timemodified);
|
||||
|
||||
$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
|
||||
|
||||
+4
-4
@@ -388,7 +388,7 @@
|
||||
$ordering = "u.firstname $order, u.lastname $order";
|
||||
}
|
||||
|
||||
$what = ' DISTINCT r.id, r.approved, r.userid, u.firstname, u.lastname';
|
||||
$what = ' DISTINCT r.id, r.approved, r.timecreated, r.timemodified, r.userid, u.firstname, u.lastname';
|
||||
$count = ' COUNT(DISTINCT c.recordid) ';
|
||||
$tables = $CFG->prefix.'data_content c,'.$CFG->prefix.'data_records r,'.$CFG->prefix.'data_content cs, '.$CFG->prefix.'user u ';
|
||||
$where = 'WHERE c.recordid = r.id
|
||||
@@ -425,7 +425,7 @@
|
||||
$sortcontent = $sortfield->get_sort_field();
|
||||
$sortcontentfull = $sortfield->get_sort_sql('c.'.$sortcontent);
|
||||
|
||||
$what = ' DISTINCT r.id, r.approved, r.userid, u.firstname, u.lastname, c.'.$sortcontent.', '.$sortcontentfull.' AS _order ';
|
||||
$what = ' DISTINCT r.id, r.approved, r.timecreated, r.timemodified, r.userid, u.firstname, u.lastname, c.'.$sortcontent.', '.$sortcontentfull.' AS _order ';
|
||||
$count = ' COUNT(DISTINCT c.recordid) ';
|
||||
$tables = $CFG->prefix.'data_content c,'.$CFG->prefix.'data_records r,'.$CFG->prefix.'data_content cs, '.$CFG->prefix.'user u ';
|
||||
$where = 'WHERE c.recordid = r.id
|
||||
@@ -459,7 +459,7 @@
|
||||
}
|
||||
|
||||
} else if ($search) {
|
||||
$what = ' DISTINCT r.id, r.approved, r.userid, u.firstname, u.lastname ';
|
||||
$what = ' DISTINCT r.id, r.approved, r.timecreated, r.timemodified, r.userid, u.firstname, u.lastname ';
|
||||
$count = ' COUNT(DISTINCT c.recordid) ';
|
||||
$tables = $CFG->prefix.'data_content c,'.$CFG->prefix.'data_records r, '.$CFG->prefix.'user u ';
|
||||
$where = 'WHERE c.recordid = r.id
|
||||
@@ -490,7 +490,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 ';
|
||||
|
||||
Reference in New Issue
Block a user