-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
591 additions
and
7 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,67 @@ | ||
<?php | ||
// This file is part of mod_datalynx for Moodle - http://moodle.org/ | ||
// | ||
// It 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. | ||
// | ||
// It 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 mod_datalynx comment created event. | ||
* | ||
* @package mod_datalynx | ||
* @copyright 2023 Thomas Winkler | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
namespace mod_datalynx\event; | ||
|
||
defined('MOODLE_INTERNAL') or die(); | ||
|
||
/** | ||
* The mod_datalynx comment created event class. | ||
* | ||
* @package mod_datalynx | ||
* @since Moodle 4.0 | ||
* @copyright 2023 Thomas Winkler | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class cron_trigger extends \core\event\base { | ||
|
||
/** | ||
* Init method. | ||
* | ||
* @return void | ||
*/ | ||
protected function init() { | ||
$this->data['objecttable'] = 'datalynx'; | ||
$this->data['crud'] = 'u'; | ||
$this->data['edulevel'] = self::LEVEL_OTHER; | ||
} | ||
|
||
/** | ||
* Return localised event name. | ||
* | ||
* @return string | ||
*/ | ||
public static function get_name() { | ||
return get_string('datalynx_cron_trigger', 'mod_datalynx'); | ||
} | ||
|
||
/** | ||
* Returns description of what happened. | ||
* | ||
* @return string | ||
*/ | ||
public function get_description() { | ||
return "Cron Job trigger occured"; | ||
} | ||
} |
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/>. | ||
|
||
/** | ||
* Trigger an event in a periodic time | ||
* | ||
* @package mod_datalynx | ||
* @copyright 2023 Thomas Winkler | ||
* @author Thomas Winkler | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
namespace mod_datalynx\task; | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
/** | ||
* Trigger an event in a periodic time | ||
* | ||
* @package mod_datalynx | ||
* @copyright 2023 Thomas Winkler | ||
* @author Thomas Winkler | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
* | ||
*/ | ||
class cron_trigger extends \core\task\scheduled_task { | ||
|
||
public function get_name() { | ||
return get_string('cron_trigger', 'mod_datalynx'); | ||
} | ||
|
||
/** | ||
* | ||
* Close off any overdue attempts. | ||
*/ | ||
public function execute() { | ||
global $DB; | ||
$records = $DB->get_records('datalynx_rules', null, '', 'DISTINCT dataid'); | ||
foreach ($records as $record) { | ||
$df = new \mod_datalynx\datalynx($record->dataid); | ||
$event = \mod_datalynx\event\cron_trigger::create(array('context' => $df->context, 'objectid' => $df->id())); | ||
$event->trigger(); | ||
} | ||
} | ||
} |
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,38 @@ | ||
<?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/>. | ||
|
||
/** | ||
* Definition of Quiz scheduled tasks. | ||
* | ||
* @package mod _datalynx | ||
* @category task | ||
* @copyright 2023 Thomas Winkler Michael Hughes <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
$tasks = [ | ||
[ | ||
'classname' => 'mod_datalynx\task\cron_trigger', | ||
'blocking' => 0, | ||
'minute' => '*', | ||
'hour' => '*', | ||
'day' => '*', | ||
'dayofweek' => '*', | ||
'month' => '*' | ||
] | ||
]; |
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
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,32 @@ | ||
<?php | ||
// This file is part of mod_datalynx for Moodle - http://moodle.org/ | ||
// | ||
// It 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. | ||
// | ||
// It 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/>. | ||
|
||
/** | ||
* | ||
* @package datalynxrule | ||
* @subpackage ftpsyncfiles | ||
* @copyright 2023 Thomas Winkler | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
$string['event'] = 'Datalynx Ereignis'; | ||
$string['pluginname'] = 'FTP Sync Data'; | ||
$string['triggerspecificevent'] = 'Nur bei markierter Checkbox senden'; | ||
|
||
$string['sftpsettings'] = 'SFTP Settings'; | ||
$string['sftpserver'] = 'STFP Server'; | ||
$string['sftpusername'] = 'STFP Username'; | ||
$string['sftppassword'] = 'STFP Passwort'; | ||
$string['sftppath'] = 'STFP Path'; |
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,32 @@ | ||
<?php | ||
// This file is part of mod_datalynx for Moodle - http://moodle.org/ | ||
// | ||
// It 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. | ||
// | ||
// It 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/>. | ||
|
||
/** | ||
* | ||
* @package datalynxrule | ||
* @subpackage ftpsyncfiles | ||
* @copyright 2023 Thomas Winkler | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
$string['event'] = 'Datalynx event'; | ||
$string['pluginname'] = 'FTP Sync Data'; | ||
$string['triggerspecificevent'] = 'Nur bei markierter Checkbox senden'; | ||
|
||
$string['sftpsettings'] = 'SFTP Settings'; | ||
$string['sftpserver'] = 'STFP Server'; | ||
$string['sftpusername'] = 'STFP Username'; | ||
$string['sftppassword'] = 'STFP Password'; | ||
$string['sftppath'] = 'STFP Path'; |
Oops, something went wrong.