MDL-13114 tool_uploadcourse: Clean up after scheck scan
This commit is contained in:
@@ -390,7 +390,6 @@ class tool_uploadcourse_helper {
|
||||
* @return int category ID.
|
||||
*/
|
||||
public static function resolve_category($data, &$errors = array()) {
|
||||
global $DB;
|
||||
$catid = null;
|
||||
|
||||
if (!empty($data['category'])) {
|
||||
|
||||
@@ -38,7 +38,7 @@ class tool_uploadcourse_step2_form extends tool_uploadcourse_base_form {
|
||||
* @return void.
|
||||
*/
|
||||
public function definition () {
|
||||
global $CFG, $COURSE, $DB;
|
||||
global $CFG;
|
||||
|
||||
$mform = $this->_form;
|
||||
$data = $this->_customdata['data'];
|
||||
@@ -134,9 +134,6 @@ class tool_uploadcourse_step2_form extends tool_uploadcourse_base_form {
|
||||
$mform->setDefault('defaults[showreports]', $courseconfig->showreports);
|
||||
|
||||
if (!empty($CFG->legacyfilesinnewcourses)) {
|
||||
if (empty($course->legacyfiles)) {
|
||||
$choices = array('0' => get_string('no'), '2' => get_string('yes'));
|
||||
}
|
||||
$mform->addElement('select', 'defaults[legacyfiles]', get_string('courselegacyfiles'), $choices);
|
||||
$mform->addHelpButton('defaults[legacyfiles]', 'courselegacyfiles');
|
||||
if (!isset($courseconfig->legacyfiles)) {
|
||||
@@ -198,8 +195,6 @@ class tool_uploadcourse_step2_form extends tool_uploadcourse_base_form {
|
||||
* @return array $errors - form errors
|
||||
*/
|
||||
public function validation($data, $files) {
|
||||
global $DB;
|
||||
|
||||
$errors = parent::validation($data, $files);
|
||||
$columns = $this->_customdata['columns'];
|
||||
$optype = $data['options']['mode'];
|
||||
|
||||
@@ -107,8 +107,6 @@ class tool_uploadcourse_tracker {
|
||||
* @return void
|
||||
*/
|
||||
public function results($total, $created, $updated, $deleted, $errors) {
|
||||
global $OUTPUT;
|
||||
|
||||
if ($this->outputmode == self::NO_OUTPUT) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -192,9 +192,9 @@ $cir = new csv_import_reader($importid, 'uploadcourse');
|
||||
$readcount = $cir->load_csv_content($content, $options['encoding'], $options['delimiter']);
|
||||
unset($content);
|
||||
if ($readcount === false) {
|
||||
print_error('csvfileerror', 'tool_uploadcourse', $returnurl, $cir->get_error());
|
||||
print_error('csvfileerror', 'tool_uploadcourse', '', $cir->get_error());
|
||||
} else if ($readcount == 0) {
|
||||
print_error('csvemptyfile', 'error', $returnurl, $cir->get_error());
|
||||
print_error('csvemptyfile', 'error', '', $cir->get_error());
|
||||
}
|
||||
$processor = new tool_uploadcourse_processor($cir, $processoroptions, $defaults);
|
||||
$processor->execute(new tool_uploadcourse_tracker(tool_uploadcourse_tracker::OUTPUT_PLAIN));
|
||||
|
||||
Reference in New Issue
Block a user