mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 04:22:07 +02:00
MDL-57455 mod_data: moved export tag checkbox and set default
Also capitalised string 'tags'. AMOS BEGIN CPY [tags,core],[tags,mod_data] AMOS END
This commit is contained in:
parent
ffbe92bffb
commit
3dfd48ba9c
@ -77,6 +77,10 @@ class mod_data_export_form extends moodleform {
|
||||
if ($numfieldsthatcanbeselected > 1) {
|
||||
$this->add_checkbox_controller(1, null, null, 1);
|
||||
}
|
||||
if (core_tag_tag::is_enabled('mod_data', 'data_records')) {
|
||||
$mform->addElement('checkbox', 'exporttags', get_string('includetags', 'data'));
|
||||
$mform->setDefault('exporttags', 1);
|
||||
}
|
||||
$context = context_module::instance($this->_cm->id);
|
||||
if (has_capability('mod/data:exportuserinfo', $context)) {
|
||||
$mform->addElement('checkbox', 'exportuser', get_string('includeuserdetails', 'data'));
|
||||
@ -86,10 +90,6 @@ class mod_data_export_form extends moodleform {
|
||||
$mform->addElement('checkbox', 'exportapproval', get_string('includeapproval', 'data'));
|
||||
}
|
||||
|
||||
if (core_tag_tag::is_enabled('mod_data', 'data_records')) {
|
||||
$mform->addElement('checkbox', 'exporttags', get_string('includetags', 'data'));
|
||||
}
|
||||
|
||||
$this->add_action_buttons(true, get_string('exportentries', 'data'));
|
||||
}
|
||||
|
||||
|
@ -348,7 +348,7 @@ $string['subplugintype_datafield_plural'] = 'Database field types';
|
||||
$string['subplugintype_datapreset'] = 'Preset';
|
||||
$string['subplugintype_datapreset_plural'] = 'Presets';
|
||||
$string['tagarea_data_records'] = 'Data records';
|
||||
$string['tags'] = 'tags';
|
||||
$string['tags'] = 'Tags';
|
||||
$string['tagsdeleted'] = 'Database tags have been deleted';
|
||||
$string['teachersandstudents'] = '{$a->teachers} and {$a->students}';
|
||||
$string['templates'] = 'Templates';
|
||||
|
@ -3156,6 +3156,9 @@ function data_get_exportdata($dataid, $fields, $selectedfields, $currentgroup=0,
|
||||
$exportdata[0][] = $field->field->name;
|
||||
}
|
||||
}
|
||||
if ($tags) {
|
||||
$exportdata[0][] = get_string('tags', 'data');
|
||||
}
|
||||
if ($userdetails) {
|
||||
$exportdata[0][] = get_string('user');
|
||||
$exportdata[0][] = get_string('username');
|
||||
@ -3168,9 +3171,6 @@ function data_get_exportdata($dataid, $fields, $selectedfields, $currentgroup=0,
|
||||
if ($approval) {
|
||||
$exportdata[0][] = get_string('approved', 'data');
|
||||
}
|
||||
if ($tags) {
|
||||
$exportdata[0][] = get_string('tags', 'data');
|
||||
}
|
||||
|
||||
$datarecords = $DB->get_records('data_records', array('dataid'=>$dataid));
|
||||
ksort($datarecords);
|
||||
@ -3193,6 +3193,10 @@ function data_get_exportdata($dataid, $fields, $selectedfields, $currentgroup=0,
|
||||
}
|
||||
$exportdata[$line][] = $contents;
|
||||
}
|
||||
if ($tags) {
|
||||
$itemtags = \core_tag_tag::get_item_tags_array('mod_data', 'data_records', $record->id);
|
||||
$exportdata[$line][] = implode(', ', $itemtags);
|
||||
}
|
||||
if ($userdetails) { // Add user details to the export data
|
||||
$userdata = get_complete_user_data('id', $record->userid);
|
||||
$exportdata[$line][] = fullname($userdata);
|
||||
@ -3206,10 +3210,6 @@ function data_get_exportdata($dataid, $fields, $selectedfields, $currentgroup=0,
|
||||
if ($approval) { // Add approval status
|
||||
$exportdata[$line][] = (int) $record->approved;
|
||||
}
|
||||
if ($tags) {
|
||||
$itemtags = \core_tag_tag::get_item_tags_array('mod_data', 'data_records', $record->id);
|
||||
$exportdata[$line][] = implode(', ', $itemtags);
|
||||
}
|
||||
}
|
||||
$line++;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user