Skip to content

Commit

Permalink
Moodle plugin CI improved
Browse files Browse the repository at this point in the history
  • Loading branch information
raja-lmsace committed Apr 9, 2024
1 parent 8a9fcb1 commit df39831
Show file tree
Hide file tree
Showing 26 changed files with 818 additions and 174 deletions.
2 changes: 1 addition & 1 deletion actions/notification/amd/build/chaptersource.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion actions/notification/classes/actionform.php
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ public function get_email_placeholders() {
* @return array
*/
public function assignment_data_fields() {
return [ 'Assignment_Extensions'];
return ['Assignment_Extensions'];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion actions/notification/classes/schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ protected function get_scheduled_records($userid=null) {
WHERE ns.status = :status AND ai.status <> 0
AND active_enrols.activeenrolment <> 0
AND c.visible = 1
AND c.startdate <= :startdate AND (c.enddate = 0 OR c.enddate >= :enddate)
AND c.startdate <= :startdate AND (c.enddate = 0 OR c.enddate >= :enddate)
AND ue.deleted = 0 AND ue.suspended = 0
AND ns.suppressreached = 0 AND ns.scheduletime <= :current_timestamp $userwhere ORDER BY ns.timecreated ASC";

Expand Down
4 changes: 2 additions & 2 deletions actions/notification/db/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<FIELD NAME="headercontentformat" TYPE="int" LENGTH="9" NOTNULL="false" DEFAULT="1" SEQUENCE="false"/>
<FIELD NAME="staticcontent" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="staticcontentformat" TYPE="int" LENGTH="9" NOTNULL="false" DEFAULT="1" SEQUENCE="false"/>
<FIELD NAME="dynamiccontent" TYPE="char" LENGTH="50" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="dynamiccontent" TYPE="int" LENGTH="11" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="contentlength" TYPE="int" LENGTH="9" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="contenttype" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="footercontent" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
Expand Down Expand Up @@ -58,7 +58,7 @@
<FIELD NAME="subject" TYPE="char" LENGTH="500" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="headercontent" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="staticcontent" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="dynamiccontent" TYPE="char" LENGTH="50" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="dynamiccontent" TYPE="int" LENGTH="11" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="contentlength" TYPE="int" LENGTH="9" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="contenttype" TYPE="text" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="chapterid" TYPE="int" LENGTH="9" NOTNULL="false" SEQUENCE="false"/>
Expand Down
16 changes: 16 additions & 0 deletions actions/notification/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,21 @@ function xmldb_pulseaction_notification_upgrade($oldversion) {
$dbman->change_field_precision($temptable, $timemodified);
}

// Update the type of dynamic content.
$instable = new xmldb_table('pulseaction_notification');
$dynamiccontent = new xmldb_field('dynamiccontent', XMLDB_TYPE_INTEGER, '11', null, null, null, null);
// Verify field exists.
if ($dbman->field_exists($instable, $dynamiccontent)) {
// Change the field.
$dbman->change_field_precision($instable, $dynamiccontent);
}

// Update the templates table dynamiccontent.
$temptable = new xmldb_table('pulseaction_notification_ins');
if ($dbman->field_exists($temptable, $dynamiccontent)) {
// Change the field.
$dbman->change_field_precision($temptable, $dynamiccontent);
}

return true;
}
1 change: 1 addition & 0 deletions actions/notification/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ function pulseaction_notification_output_fragment_preview_content($args) {
$selector = html_writer::select($list, 'userselector', $user->id);

$data = ['message' => $messagehtml, 'usersselector' => $selector];

return $OUTPUT->render_from_template('pulseaction_notification/preview', ['data' => $data]);
}
}
2 changes: 1 addition & 1 deletion amd/build/module.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion amd/build/module.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion amd/build/preset.min.js.map

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions amd/src/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,9 @@ define(['core_editor/events'], function() {
templatevars.forEach((elem) => {
elem.addEventListener('click', function(e) {
var target = e.currentTarget;
if (branch <= "402") {
var EditorInput = target.querySelector('[id*="_editoreditable"]');
} else {
var EditorInput = target.querySelector('textarea[id*="_content_editor"]');
}
var EditorInput = (branch <= "402")
? target.querySelector('[id*="_editoreditable"]')
: target.querySelector('textarea[id*="_content_editor"]');
module.insertCaretActive(EditorInput);
});
});
Expand Down
Loading

0 comments on commit df39831

Please sign in to comment.