@@ -45,24 +45,16 @@ public function get_name(): string {
45
45
* Execute.
46
46
*/
47
47
public function execute () {
48
- global $ CFG , $ DB ;
48
+ global $ DB ;
49
49
50
50
// Get the certificatesperrun, includeinnotvisiblecourses, and certificateexecutionperiod configurations.
51
51
$ certificatesperrun = (int )get_config ('customcert ' , 'certificatesperrun ' );
52
52
$ includeinnotvisiblecourses = (bool )get_config ('customcert ' , 'includeinnotvisiblecourses ' );
53
53
$ certificateexecutionperiod = (int )get_config ('customcert ' , 'certificateexecutionperiod ' );
54
54
$ offset = (int )get_config ('customcert ' , 'certificate_offset ' );
55
-
56
- if ($ CFG ->dbtype === 'oci ' ) {
57
- // For Oracle, convert the CLOB to a VARCHAR2 (limiting to 4000 characters) since we are using DISTINCT.
58
- $ emailothersselect = "DBMS_LOB.SUBSTR(c.emailothers, 4000, 1) AS emailothers " ;
59
- $ emailotherslengthsql = "DBMS_LOB.GETLENGTH(c.emailothers) " ;
60
- } else {
61
- $ emailothersselect = "c.emailothers " ;
62
- $ emailotherslengthsql = $ DB ->sql_length ('c.emailothers ' );
63
- }
64
-
55
+ $ emailothersselect = "c.emailothers " ;
65
56
$ emailotherslengthsql = $ DB ->sql_length ('c.emailothers ' );
57
+
66
58
$ sql = "SELECT DISTINCT c.id, c.templateid, c.course, c.requiredtime, c.emailstudents, c.emailteachers, $ emailothersselect,
67
59
ct.id AS templateid, ct.name AS templatename, ct.contextid, co.id AS courseid,
68
60
co.fullname AS coursefullname, co.shortname AS courseshortname
0 commit comments