Skip to content

Commit

Permalink
adding referral.mustache
Browse files Browse the repository at this point in the history
  • Loading branch information
fmido88 committed Jun 16, 2024
1 parent 307b8f4 commit 6783598
Show file tree
Hide file tree
Showing 27 changed files with 129 additions and 32 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Wallet Enrollment for Moodle #
==========

## V 5.4.0 ##
- increase precisions of data fields holding amounts.
- Improve the UI of the referrals page (thanks to Davor Budimir)
- Fix bug in referral page that always redirect users.

## V 5.3.2 ##
- Adding main page for wallet (when the user click my wallet).
- Add bundles for quick top up with conditional discounts
Expand Down
2 changes: 1 addition & 1 deletion amd/build/overlyprice.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/overlyprice.min.js.map

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

4 changes: 3 additions & 1 deletion amd/src/overlyprice.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ function searchAndInject(node = document) {
*/
function startObserver() {
regionMain = document.getElementById("region-main");
observer.observe(regionMain, config);
if (regionMain) {
observer.observe(regionMain, config);
}
}

/**
Expand Down
1 change: 1 addition & 0 deletions amd/src/referral.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/

import $ from 'jquery';
// eslint-disable-next-line camelcase
import {get_strings} from 'core/str';
import Prefetch from 'core/prefetch';

Expand Down
4 changes: 3 additions & 1 deletion classes/form/transactions_filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ public function definition() {
$mform->addElement('text', 'value', get_string('value', 'enrol_wallet'));
$mform->setType('value', PARAM_FLOAT);

$options = \enrol_wallet\category\options::get_all_categories_options();
$catoptions = \enrol_wallet\category\options::get_all_categories_options();
$mform->addElement('select', 'category', get_string('category'), $catoptions);

// Transaction per page.
$limits = [];
for ($i = 25; $i <= 1000; $i = $i + 25) {
Expand Down
2 changes: 1 addition & 1 deletion classes/pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static function process_referral_page($userid = 0) {
'url' => $signup->out(),
'code' => $exist->code,
'mail_subject' => rawurlencode(get_string('referral_share_subject', 'enrol_wallet')),
'mail_body' => rawurlencode(get_string('referral_share_body', 'enrol_wallet'))
'mail_body' => rawurlencode(get_string('referral_share_body', 'enrol_wallet')),
];
$output .= $OUTPUT->render_from_template('enrol_wallet/referral', $templatedata);
if (!empty($holdgift)) {
Expand Down
1 change: 1 addition & 0 deletions classes/payment/service_provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public static function get_success_url(string $paymentarea, int $itemid): \moodl
*/
public static function deliver_order(string $paymentarea, int $itemid, int $paymentid, int $userid): bool {
global $DB, $CFG;

require_once($CFG->dirroot.'/enrol/wallet/lib.php');
// Get the fake item in case of topping up the wallet.
$item = $DB->get_record('enrol_wallet_items', ['id' => $itemid], '*', MUST_EXIST);
Expand Down
2 changes: 1 addition & 1 deletion classes/restriction/info.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function get_course_module() {
* @return bool True if this item is available to the user, false otherwise
*/
public function is_available(&$information, $grabthelot = false, $userid = 0,
\course_modinfo|null $modinfo = null) {
$modinfo = null) {
global $USER, $OUTPUT, $DB;

// Default to no information.
Expand Down
Loading

0 comments on commit 6783598

Please sign in to comment.