MigrationMoodle: Add task for courses by EFC* users - refs BT#15992

pull/3127/head
Angel Fernando Quiroz Campos 6 years ago
parent aa4759be2f
commit d133e7ed96
  1. 10
      plugin/migrationmoodle/admin.php
  2. 2
      plugin/migrationmoodle/lang/english.php
  3. 30
      plugin/migrationmoodle/src/Task/EfcCoursesTask.php

@ -17,7 +17,8 @@ if ('true' != $plugin->get('active')) {
$menu = [
1 => [
'action' => 'users',
//'action' => 'users',
'action' => 'efc_users',
'parent' => 0,
],
2 => [
@ -25,7 +26,8 @@ $menu = [
'parent' => 0,
],
3 => [
'action' => 'courses',
//'action' => 'courses',
'action' => 'efc_courses',
'parent' => 0,
],
4 => [
@ -124,10 +126,6 @@ $menu = [
'action' => 'questions_true_false',
'parent' => 24,
],
28 => [
'action' => 'efc_users',
'parent' => 0,
],
];
Display::display_header($plugin->get_title());

@ -9,8 +9,10 @@ $strings['UninstallError'] = 'An error ocurred while the plugin was uninstalled.
// Tasks
$strings['UsersTask'] = 'Users';
$strings['EfcUsersTask'] = 'Users (filtered with username efc*)';
$strings['CourseCategoriesTask'] = 'Course categories';
$strings['CoursesTask'] = 'Courses';
$strings['EfcCoursesTask'] = 'Courses (filtered for efc* users)';
$strings['CourseSectionsTask'] = 'Course sections';
$strings['CourseModulesLessonTask'] = 'Course modules: Lessons';
$strings['LessonPagesTask'] = 'Lesson pages';

@ -0,0 +1,30 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\MigrationMoodle\Task;
use Chamilo\PluginBundle\MigrationMoodle\Extractor\BaseExtractor;
/**
* Class EfcCoursesTask.
*
* @package Chamilo\PluginBundle\MigrationMoodle\Task
*/
class EfcCoursesTask extends CoursesTask
{
/**
* @return array
*/
public function getExtractConfiguration()
{
return [
'class' => BaseExtractor::class,
'query' => "SELECT DISTINCT c.*
FROM mdl_course c
INNER JOIN mdl_context ctx ON c.id = ctx.instanceid
INNER JOIN mdl_role_assignments ra ON ctx.id = ra.contextid
INNER JOIN mdl_user u ON ra.userid = u.id
WHERE u.username LIKE 'efc%'",
];
}
}
Loading…
Cancel
Save