diff --git a/classes/output/wallet_balance.php b/classes/output/wallet_balance.php index 63595eea..d9a66a52 100644 --- a/classes/output/wallet_balance.php +++ b/classes/output/wallet_balance.php @@ -135,6 +135,7 @@ public function export_for_template(renderer_base $output) { $tempctx->transfer = !empty($transferenabled) ? $transfer : false; $tempctx->referral = !empty($refenabled) ? $referral : false; $tempctx->policy = !empty($policy) ? $policy : false; + $tempctx->walleturl = (new moodle_url('/enrol/wallet/wallet.php#linkbalance'))->out(); } $tempctx->currentuser = $this->currentuser; return $tempctx; diff --git a/db/install.xml b/db/install.xml index b2e96c5e..49ed002a 100644 --- a/db/install.xml +++ b/db/install.xml @@ -1,5 +1,5 @@ - @@ -89,7 +89,7 @@ - + diff --git a/db/upgrade.php b/db/upgrade.php index 754e54f9..f606dc69 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -348,5 +348,20 @@ function xmldb_enrol_wallet_upgrade($oldversion) { // Wallet savepoint reached. upgrade_plugin_savepoint(true, 2024022500, 'enrol', 'wallet'); } + + if ($oldversion < 2024022619) { + + // Changing type of field percent on table enrol_wallet_cond_discount to number. + $table = new xmldb_table('enrol_wallet_cond_discount'); + $field = new xmldb_field('percent', XMLDB_TYPE_NUMBER, '4, 2', null, XMLDB_NOTNULL, null, null, 'cond'); + + // Launch change of type for field percent. + $dbman->change_field_precision($table, $field); + $dbman->change_field_type($table, $field); + + // Wallet savepoint reached. + upgrade_plugin_savepoint(true, 2024022619, 'enrol', 'wallet'); + } + return true; } diff --git a/templates/display.mustache b/templates/display.mustache index 99a2cc25..f4cfba4d 100644 --- a/templates/display.mustache +++ b/templates/display.mustache @@ -55,7 +55,13 @@
{{# currentuser}} -

{{# str }} mywallet, enrol_wallet {{/ str }}

+ {{#walleturl}} + + {{/walleturl}} +

{{# str }} mywallet, enrol_wallet {{/ str }}

+ {{#walleturl}} +
+ {{/walleturl}} {{/ currentuser}}
{{# currentuser}}{{# str }} youhavebalance, enrol_wallet {{/ str }}{{/ currentuser}}
diff --git a/templates/single-bundle.mustache b/templates/single-bundle.mustache index 17ebdb1d..b63b206d 100644 --- a/templates/single-bundle.mustache +++ b/templates/single-bundle.mustache @@ -21,6 +21,16 @@ Example context (json): { + formid: "123", + method: "post", + url: "https://example.com", + id: "456", + discount: "20", + after: "80", + before: "100", + currency: "EGP", + category: "sample", + description: "example discount" } }} diff --git a/version.php b/version.php index 3f2bb620..e95e0527 100644 --- a/version.php +++ b/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2024022500; +$plugin->version = 2024022619; $plugin->requires = 2020061500; $plugin->component = 'enrol_wallet'; $plugin->release = '5.2.0';