forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'MDL-61208-master' of git://github.com/farhan6318/moodle
- Loading branch information
Showing
32 changed files
with
738 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Syncing enrolments task. | ||
* | ||
* @package enrol_category | ||
* @author Farhan Karmali <[email protected]> | ||
* @copyright Farhan Karmali | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
namespace enrol_category\task; | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
/** | ||
* Syncing enrolments task. | ||
* | ||
* @package enrol_category | ||
* @author Farhan Karmali <[email protected]> | ||
* @copyright Farhan Karmali | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class enrol_category_sync extends \core\task\scheduled_task { | ||
|
||
/** | ||
* Name for this task. | ||
* | ||
* @return string | ||
*/ | ||
public function get_name() { | ||
return get_string('enrolcategorysynctask', 'enrol_category'); | ||
} | ||
|
||
/** | ||
* Run task for syncing category enrolments. | ||
*/ | ||
public function execute() { | ||
global $CFG; | ||
|
||
if (!enrol_is_enabled('category')) { | ||
return; | ||
} | ||
|
||
require_once("$CFG->dirroot/enrol/category/locallib.php"); | ||
$trace = new null_progress_trace(); | ||
enrol_category_sync_full($trace); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Task definition for enrol_category. | ||
* @author Farhan Karmali <[email protected]> | ||
* @copyright Farhan Karmali | ||
* @package enrol_category | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
$tasks = array( | ||
array( | ||
'classname' => '\enrol_category\task\enrol_category_sync', | ||
'blocking' => 0, | ||
'minute' => '*', | ||
'hour' => '*', | ||
'day' => '*', | ||
'month' => '*', | ||
'dayofweek' => '*', | ||
'disabled' => 0 | ||
) | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Syncing enrolments task. | ||
* | ||
* @package enrol_cohort | ||
* @author Farhan Karmali <[email protected]> | ||
* @copyright Farhan Karmali | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
namespace enrol_cohort\task; | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
/** | ||
* Syncing enrolments task. | ||
* | ||
* @package enrol_cohort | ||
* @author Farhan Karmali <[email protected]> | ||
* @copyright Farhan Karmali | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class enrol_cohort_sync extends \core\task\scheduled_task { | ||
|
||
/** | ||
* Name for this task. | ||
* | ||
* @return string | ||
*/ | ||
public function get_name() { | ||
return get_string('enrolcohortsynctask', 'enrol_cohort'); | ||
} | ||
|
||
/** | ||
* Run task for syncing cohort enrolments. | ||
*/ | ||
public function execute() { | ||
global $CFG; | ||
|
||
require_once("$CFG->dirroot/enrol/cohort/locallib.php"); | ||
$trace = new null_progress_trace(); | ||
enrol_cohort_sync($trace); | ||
$trace->finished(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Task definition for enrol_cohort. | ||
* @author Farhan Karmali <[email protected]> | ||
* @copyright Farhan Karmali | ||
* @package enrol_cohort | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
$tasks = array( | ||
array( | ||
'classname' => '\enrol_cohort\task\enrol_cohort_sync', | ||
'blocking' => 0, | ||
'minute' => 'R', | ||
'hour' => '*', | ||
'day' => '*', | ||
'month' => '*', | ||
'dayofweek' => '*', | ||
'disabled' => 0 | ||
) | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<?php | ||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* The send expiry notifications task. | ||
* | ||
* @package enrol_manual | ||
* @author Farhan Karmali <[email protected]> | ||
* @copyright Farhan Karmali | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
namespace enrol_manual\task; | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
/** | ||
* The send expiry notifications task. | ||
* | ||
* @package enrol_manual | ||
* @author Farhan Karmali <[email protected]> | ||
* @copyright Farhan Karmali | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class send_expiry_notifications extends \core\task\scheduled_task { | ||
|
||
/** | ||
* Name for this task. | ||
* | ||
* @return string | ||
*/ | ||
public function get_name() { | ||
return get_string('sendexpirynotificationstask', 'enrol_manual'); | ||
} | ||
|
||
/** | ||
* Run task for sending expiry notifications. | ||
*/ | ||
public function execute() { | ||
$enrol = enrol_get_plugin('manual'); | ||
$trace = new \text_progress_trace(); | ||
$enrol->send_expiry_notifications($trace); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
/** | ||
* Syncing enrolments task. | ||
* | ||
* @package enrol_manual | ||
* @author Farhan Karmali <[email protected]> | ||
* @copyright Farhan Karmali | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
namespace enrol_manual\task; | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
/** | ||
* Syncing enrolments task. | ||
* | ||
* @package enrol_manual | ||
* @author Farhan Karmali <[email protected]> | ||
* @copyright Farhan Karmali | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class sync_enrolments extends \core\task\scheduled_task { | ||
|
||
/** | ||
* Name for this task. | ||
* | ||
* @return string | ||
*/ | ||
public function get_name() { | ||
return get_string('syncenrolmentstask', 'enrol_manual'); | ||
} | ||
|
||
/** | ||
* Run task for syncing enrolments. | ||
*/ | ||
public function execute() { | ||
$enrol = enrol_get_plugin('manual'); | ||
$trace = new \text_progress_trace(); | ||
$enrol->sync($trace); | ||
} | ||
} |
Oops, something went wrong.