Coupon
Versions
Current version
4.4.4.2 (build 2025120102) (2025120102)
4.4.4.2 (build 2025120102)
Plugin type: Blocks
Frankenstyle component name: block_coupon
Version build number: 2025120102
Version release name: 4.4.4.2 (build 2025120102)
Maturity: Stable
Supported Moodle versions: 4.5, 5.0, 5.1, 5.2
Repository URL (Git): https://github.com/sebsoftnl/moodle-block_coupon
Repository branch:
Repository tag: 4.4.4.2
Issue/bug tracker URL: https://github.com/sebsoftnl/moodle-block_coupon/issues
Version 4.4.4.2 (build 2025120102)
** Fix #51
Version 4.4.4.1 (build 2025120101)
** Fix invalid $CFG->supported
Version 4.4.3 (build 2025120100)
** Added "cohort_is_member" check to task (since Moodle does NOT when using "cohort_remove_member")
** Changed detection query for cohort task
** Corrected PARAM_ type in "find_batches" (entry permits PARAM_TEXT, WS states PARAM_ALPHANUMEXT)
** Added has_capability checks on dynamic tables
** Fixed issue #28 - fix COUNT() sql (remove "order by" seems to fix it).
** Fixed issue #31
** Fixed issue #32
** Fixed issue #34
** Fixed issue #35
** Fixed issue #39
** Fixed issue #40 (implements PR#42). Thanks, @ryanjbudhu
** Fixed issue #41 (implements PR#43). Thanks, @ryanjbudhu
** Fixed issue #44 (duplicate of #35)
** Fixed issue #46
** Fixed issue #47
** Fixed issue #48
** Fixed issue #49
** Fixed notice in durationext element.
** Fixed issue #37 - webservice calls to generate coupons. Thanks @ Antoni Bertran.
** Do not create "query"/search part in find_courses() if the search is empty.
** Moved fetching of element data for templates to service due to "Too much data passed as arguments to js_call_amd".
Version 4.4.2 (build 2024100103)
** Requiring Moodle 4.5+
** Centralized all CI actions to new defaults for Sebsoft
Version 4.4.1 (build 2024100102)
** Fixed requiring Moodle 4.2 minimum
Version 4.4.0 (build 2024100100)
** Several bugfixes
** Require Moodle 4.2 MINIMUM
** Lots of coding compliance changes
** Introduced editing of course/cohort coupons (based on settings)
** Implementation for batch filter is now an autocomplete
** Fixed issue with CSV upload not being processed
** Fixed (github) issue #27
** Fixed (github) issue #3 (was done long ago already, but just to be complete)
** Supported up to Moodle 4.5
Version 4.3.3 (build 2024020100)
- Fixed "array_key_exists" errors in filters
- Fixed wrong templated name for CSV manual (Email != E-mail)
- Fixed (merged) course name formatting
- Fixed (github) issue #16
- Fixed (github) issue #18
- Fixed (github) issue #19
- Fixed (github) issue #20
- Added settings default for "enrolment period"
- Added settings default for "generate codes only" (issue #23)
- Various small fixes
- Added environment.xml
Version 4.3.2 (build 2024010200)
- Fixed issues while installing module
- Fixed issues while claiming coupons
- Merged in changes by Rob Joyce in default translation files
Version 4.3.1 (build 2023110302)
- Fixed reported issue in upgrade process
Version 4.3.0 (build 2023110300)
- Fixed some bugs
- Added templating
- Revised webservices
- Massive code overhaul to facilitate PDF templates
- Massive overhaul in "wizard" pages for better logic and navigation
Version 4.2.3 (build 2023090101)
- Added generator flags configuration
- Added generator flags selection/limiting in coupon forms
- Fixed long existing unintended generator flags bug
Version 4.2.2 (build 2022090101)
- Fixed issue where coupon users aren't displayed in tables.
- Finally re-added the long long long lost coupon expiry.
- Small changes in codegenerator (pre-work)
Version 4.2.1 (build 2022090100)
- Changed dependency to Moodle 4.0+
- Added gitlab CI up to Moodle 4.1
- Removed Moodle versions up to 4.0 from gitlab CI
- Fixed date selector on cleanup page.
- Resolved MOODLE_INTERNAL checks.
- Clean up SOME unused vars.
- Removed the long deprecated "is_allowed_from_ajax()" calls in externallib.php
Version 4.2.0 (build 2020010816)
- Added exclusion of courses already enrolled for coursegrouping coupon types
- Added coursegrouping coupon types (choose x out of y courses)
- Added SPONSORS.md to specifically state our gratitude apart from mentioning them in the README.
- Special thanks goes out to eLearn Solutions with Boston Connect (a subsidiary of Boston City Campus)
as a sponsor of this plugin! - Added webservice call to claim coupon code. Bear in mind this is ONLY applicable
at the moment to course type coupons. Refinement is needed (as well as an overhaul of the plugin and services).
Version 4.1.0 (build 2021011000)
- Added tabs + settings for coupon request users (coupons / progressreport).
- Fixed #1: no QR code in the generated PDF (think this was fixed before, just confirming again)
- Fixed #4: Not possible to confirm account with self-registration auth method disabled (see Version 4.0.9 (build 2020010813); this is a workaround)
- Fixed #3: Extend webservices with enrolment period. Course coupons ONLY.
- Renderer moved to /classes/output
- 2 remaining renderer "full page reports" were now moved to their own controllers.
Version 4.0.10 (build 2020010815)
- Added font selection for PDF for more language support. RTL might still be an issue (fixed #5).
- Extended PDF preview with "current" font selection and current QR setting.
- Added clientreference field when requesting coupons.
- Coupon requests are no longer removed upon denial/approval, but marked as denied/finalized.
- Coupon requestability is now also implemented for cohorts.
- Implemented a helper to support \core_user\fields but also serve the old method (for Moodle pre 3.11)
- Removed maximum of 10 logo files, it is now set to -1 (unlimited).
Version 4.0.9.1 (build 2020010814)
- Fixed bug in new function introduced in 4.0.9.
Version 4.0.9 (build 2020010813)
- Fixed part of code checker compliance.
- Added method to allow signup, even when no signups are allowed in the site (disabled by default).
Version 4.0.8 (build 2020010810)
- Fixed error notification with usage in qr code.
- Fixed error notification(s) if coupon is already used.
Version 4.0.7 (build 2020010809)
- Fixed coupon type enrolment extension. Status is now forced to ACTIVE (Thanks Hiro Nakamura).
- Changed some language strings (EN only) so the period character does not end up outside of the containing paragraph.
Version 4.0.7 (build 2020010808)
- Fixed main assert_not_claimed function: reinstated exception
- Added component to generic error (input_coupon.php)
Version 4.0.7 (build 2020010807)
- Added task to remove cohort members (i.e. take care of cohort unenrolment).
- Fixed webservice call return for generate_coupons_for_cohorts.
- Fixed webservice call return for generate_coupons_for_course.
Version 4.0.6 (build 2020010806)
- Added autocompletes for cohort/cohort courses.
- Added user_deleted observer.
- Fixed notice (generate_pdf) on POST data (user requesting coupon; made field an advcheckbox).
- Fixed CSS issue... sigh.
- Undo previous work on user column (used coupons).
- Fix sorting on user column.
- Add sorting on owner column.
- Added user/claimed_on columns for personalised coupons.
- Fixed langstring 'coupon_notification_content'.
- Fixed get_string variables (in helper).
- Fixed "Curly brace syntax for accessing array elements and string offsets has
been deprecated in PHP 7.4. Found: $codealphabet{$n}" in codegenerator.
Version 4.0.6 (build 2020010805)
- Added INDICES to block_coupon.
Version 4.0.6 (build 2020010804)
- Changed course selection when generating coupons to auto-complete element.
- Changed cohort selection when generating coupons to auto-complete element.
- Added services.
- Added 10px whitespace between buttons in block.
- Set width of most default for elements to 75% (never EVER set to 100% due to autocomplete element).
- Modified course group selection to checkboxes.
- Added tab dedicated to personalised coupons (uses global setting to enable!).
- Add field to manipulate code size for coupons.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, funding of these changes, bug reports and beta testing.
Version 4.0.5 (build 2020010803)
- Added option to include PDF when sending personalised coupons.
- Modified (AGAIN) sending process of personal coupons.
Version 4.0.4.2 (build 2020010802)
- Changed length of batchid to 255.
Version 4.0.4.1 (build 2020010801)
- Updated privacy provider.
- Removed https verification from custom signup page.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, bug reports and beta testing.
Version 4.0.4 (build 2020010800)
- Validated Moodle 3.8
- Changed a few table implementations (fixes sorting bugs)
- Changed headers/sorting on tables for USER fields
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for donating to Moodle 3.8 validation, useful input and beta testing.
Version 4.0.3-RC1 (build 2019031805)
- Release candidate for beta testing
Version 4.0.2 (build 2019031804)
- Added ADVANCED global $CFG options to manipulate template bot output offsets.
- Fixed wrongful addition of "batchID" when adding any filter (used/unused coupon view)
- Fixed PHP notice in batchID filter
- Fixed some more Oracle table alias issues
- Fixed wrong links in notification context urls
- Added maillog tab. Still too many requests about mails not being sent, so we decided
to wrap Moodle's email_to_user method and log any debug output if relevant. - General code cleanup (as a result of Travis-CI)
Version 4.0.1 (build 2019031802)
Fixed param type on download page.
Added an overview to display downloadable batches (only scans for coupon archives in moodledata).
Added option to download from this overview.
Fixed issue #27 again (wrong link to user profile)
Fixed issue #38 again (wrong link to user profile, different view)
Fixed issue #37 (configurable button class for links; see global plugin configuration)
Fixed issue #36 (had already been done in build 2018050301, only noted here for automatic issue resolving)
Filter forms are now collapsed by default. Always expanded drove me nuts on larger filters/forms.
Fixed breaking LIMIT database issues affecting OracleDB ("LIMIT" clauses not supported as such)
Fixed breaking alias issues affecting OracleDB (Oracle does NOT support the "AS" keyword)
Fixed issue #39 (partial) Added filter capabilities in error report.
Fixed issue #31 (part 2: message sent twice)
Special thanks to Theodore Pylarinos for providing extremely detailed information
that helped to haunt down the bug of downloads not being found!
Special thanks to Wade Colclough from Zuken Limited for providing excellent feedback
and willingness to put in the time and effort to help fixing issues related to Oracle DB.
Version 4.0.0 (build 2019031801)
- Added correct userid identifier on requests table so the link to the user
profile points to the correct one (extension to issue #27)
Version 4.0.0 (build 2019031800)
Small change in workflow of user requested coupons
Added mailing and notification of accepted user requested coupons
Added internal Moodle notifications
Code overhaul: nearly all logic has been rewritten for maintainability reasons.
Verified workings on Moodle 3.4 (updated version.php accordingly)
AMD modules have now properly been minified
We're NO longer "following" Moodle versions.
Thanks everyone for all feedback!
Version 3.5.2 (build 2018050306)
Fixed issue(s) with CSV/Manual recipients not working.
Coupon batches now all have the same "timecreated"
Removed sorting of "action" column in coupon overviews
Custom mail function is now replaced with Moodle's own email_to_user()
Due to MANY issues where the email containing the coupons is not received, the
decision was made to change the process to sending an email containing a
download link where the generated batch can be downloaded from instead of
providing the email with an attachment.
Fixed issue #22 (we now use TCPDF's own QR Code generator)
Added/fixed validation on "request user" configuration form
Added more information to coupons requests overview table
In line with issue 32, configuration of the enrolment duration for course type
coupons has been moved to the course selection page.
Fixed issue #35 (bug in observers)
Fixed issue #34 (feature request for zip name)
Fixed issue #32 (PDF preview)
Fixed issue #30 (request user - required field setting amount of coupons has no effect)
Fixed issue #29 (request user settings: added explanations)
Fixed issue #28 (wrong paging/view for requestusers)
Fixed issue #27 (wrong link to user profile in requestusers table)
Changed sourcecode here and there to prevent debug output/PHP notices
Removed restriction on amount of coupons when only generating the codes.
Added coupon cleanup confirmation screen.
Thanks Franky Just for your valuable feedback, bug reports and additional remarks!
Version 3.5.1 (build 2018050305)
Fixed issue #23 (invalid use of PARAM_RAW)
Fixed issue #24 (redirect vulnerabilities -> changed all to PARAM_LOCALURL)
Fixed issue #25 (removed use of deprecated function notify_problem)
Fixed some missing capability checks / security issues
Thanks Dan Marsden for your valuable feedback, bug reports and plugin review!
Thanks Jesús Rincón for raising issue #25
backported some of the issues to the Moodle 3.0+ release
NOTE: All other releases except one Moodle 3.0+ release and the most recent
Moodle 3.5+ release have been pulled.
Version 3.5.0 (build 2018050304)
- Fixed issue #21 (cohort_is_member fatal error: thanks Michael Neulinger)
Version 3.5.0 (build 2018050303)
Fixed faulty course / cohort ID filter
Added course groups filter possibilities
Added "timeclaimed" information to keep track of when coupons were actually claimed
Removed table sorting for courses/cohorts/groups (didn't work and should have never been part of the tables)
Added quick rudimentary check to validate whether a person is already "signed up" when entering a code.
(i.e. member in all linked cohorts or enrolled for all linked courses).
Thanks Kevin Freeborn for your very valuable feedback!
Version 3.5.0 (build 2018050302)
- Added possibility to only generate coupon codes (no PDFs will be generated, nor will they be sent!)
- Added batchid field to database to track generated batches of coupons
- Added custom batch naming when generating coupons (system automatically creates one if not provided)
- Added possibility to filter coupons on BATCH ID/name
Version 3.5.0 (build 2018050301)
- Changed internal signup to comply to Moodle 3.5.
- Added option global to use login page layout (which is a Moodle standard really, but wasn't enforced)
- Added coupon code error checking to signup form (refuse signup in case coupon code is invalid)
- Added coupon request possibilities (please refer to manual for usage description)
- Added global options for and display of help texts for custom signup and coupon input texts
- Added possibility to request coupons for course types only. Involves admin to configure both the courses and allowed users
- Removed deprecated verify_https_required() call from custom (internal) signup
Version 3.5.0 (build 2018050300)
- FIXED issue #15 ("mdb->get_record() found more than one record" when calling find_block_instance_id()).
- FIXED issue #19 where enrolment was never updated when using a new coupon after enrolment expired.
- Fixed "Sent" column in coupon overviews (displayed information based on wrong field)
- Added privacy provider
- Validated functionality for Moodle 3.5 onwards
- Minimum required Moodle version: 3.5
Version 3.3.2 (build 2017092503)
- Added role selection for coupons (course type only)
Version 3.3.1 (build 2017092501)
- Added coupon code to "progress report" for validation purposes (feature request)
- Added claimed user to "used coupons" overview for validation purposes (feature request)
Version 3.3.0 (build 2017092500)
- Fixed deprecated pix_url references (replaced by image_url)
- Validated functionality for Moodle 3.3 onwards
- Minimum required Moodle version: 3.3
Version 2017052402 (Release 3.0.3 (build 2017052402))
Fixed bug in cohort type coupons (fixed incorrect usercheck and cohort synchronisation)
Added option to display QR Code in PDF or leave it out.
Thanks to everyone for their valuable input and remarks.
Version 2017052401 (Release 3.0.2 (build 2017052401))
Resolved issue #14
Thanks to everyone for their valuable input and remarks.
Version 2017052400 (Release 3.0.1 (build 2017052400))
Added new type of coupon: extend (course) enrolment
Added webservices!
Incorporated some changes here and the in overviews
Thanks to everyone for their valuable input and remarks.
Version 2017050100 (Release 3.0.0 (build 2017050100))
Added $CFG->wwwroot on all moodle_urls
Added setting to choose default assigned role (resolve issue #12: Student role problem.
Roles were fetched by shortname = 'student', NOT foolproof)
Disabled sorting by 'owner' column in coupon overviews (resolve issue #13).
Fixed error notification when insert
4.4.4.1 (build 2025120101) (2025120101)
4.4.4.1 (build 2025120101)
Plugin type: Blocks
Frankenstyle component name: block_coupon
Version build number: 2025120101
Version release name: 4.4.4.1 (build 2025120101)
Maturity: Stable
Supported Moodle versions: 4.5, 5.0, 5.1
Repository URL (Git): https://github.com/sebsoftnl/moodle-block_coupon
Repository branch:
Repository tag: 4.4.4.1
Issue/bug tracker URL: https://github.com/sebsoftnl/moodle-block_coupon/issues
Version 4.4.3 (build 2025120100)
** Added "cohort_is_member" check to task (since Moodle does NOT when using "cohort_remove_member")
** Changed detection query for cohort task
** Corrected PARAM_ type in "find_batches" (entry permits PARAM_TEXT, WS states PARAM_ALPHANUMEXT)
** Added has_capability checks on dynamic tables
** Fixed issue #28 - fix COUNT() sql (remove "order by" seems to fix it).
** Fixed issue #31
** Fixed issue #32
** Fixed issue #34
** Fixed issue #35
** Fixed issue #39
** Fixed issue #40 (implements PR#42). Thanks, @ryanjbudhu
** Fixed issue #41 (implements PR#43). Thanks, @ryanjbudhu
** Fixed issue #44 (duplicate of #35)
** Fixed issue #46
** Fixed issue #47
** Fixed issue #48
** Fixed issue #49
** Fixed notice in durationext element.
** Fixed issue #37 - webservice calls to generate coupons. Thanks @ Antoni Bertran.
** Do not create "query"/search part in find_courses() if the search is empty.
** Moved fetching of element data for templates to service due to "Too much data passed as arguments to js_call_amd".
Version 4.4.2 (build 2024100103)
** Requiring Moodle 4.5+
** Centralized all CI actions to new defaults for Sebsoft
Version 4.4.1 (build 2024100102)
** Fixed requiring Moodle 4.2 minimum
Version 4.4.0 (build 2024100100)
** Several bugfixes
** Require Moodle 4.2 MINIMUM
** Lots of coding compliance changes
** Introduced editing of course/cohort coupons (based on settings)
** Implementation for batch filter is now an autocomplete
** Fixed issue with CSV upload not being processed
** Fixed (github) issue #27
** Fixed (github) issue #3 (was done long ago already, but just to be complete)
** Supported up to Moodle 4.5
Version 4.3.3 (build 2024020100)
- Fixed "array_key_exists" errors in filters
- Fixed wrong templated name for CSV manual (Email != E-mail)
- Fixed (merged) course name formatting
- Fixed (github) issue #16
- Fixed (github) issue #18
- Fixed (github) issue #19
- Fixed (github) issue #20
- Added settings default for "enrolment period"
- Added settings default for "generate codes only" (issue #23)
- Various small fixes
- Added environment.xml
Version 4.3.2 (build 2024010200)
- Fixed issues while installing module
- Fixed issues while claiming coupons
- Merged in changes by Rob Joyce in default translation files
Version 4.3.1 (build 2023110302)
- Fixed reported issue in upgrade process
Version 4.3.0 (build 2023110300)
- Fixed some bugs
- Added templating
- Revised webservices
- Massive code overhaul to facilitate PDF templates
- Massive overhaul in "wizard" pages for better logic and navigation
Version 4.2.3 (build 2023090101)
- Added generator flags configuration
- Added generator flags selection/limiting in coupon forms
- Fixed long existing unintended generator flags bug
Version 4.2.2 (build 2022090101)
- Fixed issue where coupon users aren't displayed in tables.
- Finally re-added the long long long lost coupon expiry.
- Small changes in codegenerator (pre-work)
Version 4.2.1 (build 2022090100)
- Changed dependency to Moodle 4.0+
- Added gitlab CI up to Moodle 4.1
- Removed Moodle versions up to 4.0 from gitlab CI
- Fixed date selector on cleanup page.
- Resolved MOODLE_INTERNAL checks.
- Clean up SOME unused vars.
- Removed the long deprecated "is_allowed_from_ajax()" calls in externallib.php
Version 4.2.0 (build 2020010816)
- Added exclusion of courses already enrolled for coursegrouping coupon types
- Added coursegrouping coupon types (choose x out of y courses)
- Added SPONSORS.md to specifically state our gratitude apart from mentioning them in the README.
- Special thanks goes out to eLearn Solutions with Boston Connect (a subsidiary of Boston City Campus)
as a sponsor of this plugin! - Added webservice call to claim coupon code. Bear in mind this is ONLY applicable
at the moment to course type coupons. Refinement is needed (as well as an overhaul of the plugin and services).
Version 4.1.0 (build 2021011000)
- Added tabs + settings for coupon request users (coupons / progressreport).
- Fixed #1: no QR code in the generated PDF (think this was fixed before, just confirming again)
- Fixed #4: Not possible to confirm account with self-registration auth method disabled (see Version 4.0.9 (build 2020010813); this is a workaround)
- Fixed #3: Extend webservices with enrolment period. Course coupons ONLY.
- Renderer moved to /classes/output
- 2 remaining renderer "full page reports" were now moved to their own controllers.
Version 4.0.10 (build 2020010815)
- Added font selection for PDF for more language support. RTL might still be an issue (fixed #5).
- Extended PDF preview with "current" font selection and current QR setting.
- Added clientreference field when requesting coupons.
- Coupon requests are no longer removed upon denial/approval, but marked as denied/finalized.
- Coupon requestability is now also implemented for cohorts.
- Implemented a helper to support \core_user\fields but also serve the old method (for Moodle pre 3.11)
- Removed maximum of 10 logo files, it is now set to -1 (unlimited).
Version 4.0.9.1 (build 2020010814)
- Fixed bug in new function introduced in 4.0.9.
Version 4.0.9 (build 2020010813)
- Fixed part of code checker compliance.
- Added method to allow signup, even when no signups are allowed in the site (disabled by default).
Version 4.0.8 (build 2020010810)
- Fixed error notification with usage in qr code.
- Fixed error notification(s) if coupon is already used.
Version 4.0.7 (build 2020010809)
- Fixed coupon type enrolment extension. Status is now forced to ACTIVE (Thanks Hiro Nakamura).
- Changed some language strings (EN only) so the period character does not end up outside of the containing paragraph.
Version 4.0.7 (build 2020010808)
- Fixed main assert_not_claimed function: reinstated exception
- Added component to generic error (input_coupon.php)
Version 4.0.7 (build 2020010807)
- Added task to remove cohort members (i.e. take care of cohort unenrolment).
- Fixed webservice call return for generate_coupons_for_cohorts.
- Fixed webservice call return for generate_coupons_for_course.
Version 4.0.6 (build 2020010806)
- Added autocompletes for cohort/cohort courses.
- Added user_deleted observer.
- Fixed notice (generate_pdf) on POST data (user requesting coupon; made field an advcheckbox).
- Fixed CSS issue... sigh.
- Undo previous work on user column (used coupons).
- Fix sorting on user column.
- Add sorting on owner column.
- Added user/claimed_on columns for personalised coupons.
- Fixed langstring 'coupon_notification_content'.
- Fixed get_string variables (in helper).
- Fixed "Curly brace syntax for accessing array elements and string offsets has
been deprecated in PHP 7.4. Found: $codealphabet{$n}" in codegenerator.
Version 4.0.6 (build 2020010805)
- Added INDICES to block_coupon.
Version 4.0.6 (build 2020010804)
- Changed course selection when generating coupons to auto-complete element.
- Changed cohort selection when generating coupons to auto-complete element.
- Added services.
- Added 10px whitespace between buttons in block.
- Set width of most default for elements to 75% (never EVER set to 100% due to autocomplete element).
- Modified course group selection to checkboxes.
- Added tab dedicated to personalised coupons (uses global setting to enable!).
- Add field to manipulate code size for coupons.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, funding of these changes, bug reports and beta testing.
Version 4.0.5 (build 2020010803)
- Added option to include PDF when sending personalised coupons.
- Modified (AGAIN) sending process of personal coupons.
Version 4.0.4.2 (build 2020010802)
- Changed length of batchid to 255.
Version 4.0.4.1 (build 2020010801)
- Updated privacy provider.
- Removed https verification from custom signup page.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, bug reports and beta testing.
Version 4.0.4 (build 2020010800)
- Validated Moodle 3.8
- Changed a few table implementations (fixes sorting bugs)
- Changed headers/sorting on tables for USER fields
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for donating to Moodle 3.8 validation, useful input and beta testing.
Version 4.0.3-RC1 (build 2019031805)
- Release candidate for beta testing
Version 4.0.2 (build 2019031804)
- Added ADVANCED global $CFG options to manipulate template bot output offsets.
- Fixed wrongful addition of "batchID" when adding any filter (used/unused coupon view)
- Fixed PHP notice in batchID filter
- Fixed some more Oracle table alias issues
- Fixed wrong links in notification context urls
- Added maillog tab. Still too many requests about mails not being sent, so we decided
to wrap Moodle's email_to_user method and log any debug output if relevant. - General code cleanup (as a result of Travis-CI)
Version 4.0.1 (build 2019031802)
Fixed param type on download page.
Added an overview to display downloadable batches (only scans for coupon archives in moodledata).
Added option to download from this overview.
Fixed issue #27 again (wrong link to user profile)
Fixed issue #38 again (wrong link to user profile, different view)
Fixed issue #37 (configurable button class for links; see global plugin configuration)
Fixed issue #36 (had already been done in build 2018050301, only noted here for automatic issue resolving)
Filter forms are now collapsed by default. Always expanded drove me nuts on larger filters/forms.
Fixed breaking LIMIT database issues affecting OracleDB ("LIMIT" clauses not supported as such)
Fixed breaking alias issues affecting OracleDB (Oracle does NOT support the "AS" keyword)
Fixed issue #39 (partial) Added filter capabilities in error report.
Fixed issue #31 (part 2: message sent twice)
Special thanks to Theodore Pylarinos for providing extremely detailed information
that helped to haunt down the bug of downloads not being found!
Special thanks to Wade Colclough from Zuken Limited for providing excellent feedback
and willingness to put in the time and effort to help fixing issues related to Oracle DB.
Version 4.0.0 (build 2019031801)
- Added correct userid identifier on requests table so the link to the user
profile points to the correct one (extension to issue #27)
Version 4.0.0 (build 2019031800)
Small change in workflow of user requested coupons
Added mailing and notification of accepted user requested coupons
Added internal Moodle notifications
Code overhaul: nearly all logic has been rewritten for maintainability reasons.
Verified workings on Moodle 3.4 (updated version.php accordingly)
AMD modules have now properly been minified
We're NO longer "following" Moodle versions.
Thanks everyone for all feedback!
Version 3.5.2 (build 2018050306)
Fixed issue(s) with CSV/Manual recipients not working.
Coupon batches now all have the same "timecreated"
Removed sorting of "action" column in coupon overviews
Custom mail function is now replaced with Moodle's own email_to_user()
Due to MANY issues where the email containing the coupons is not received, the
decision was made to change the process to sending an email containing a
download link where the generated batch can be downloaded from instead of
providing the email with an attachment.
Fixed issue #22 (we now use TCPDF's own QR Code generator)
Added/fixed validation on "request user" configuration form
Added more information to coupons requests overview table
In line with issue 32, configuration of the enrolment duration for course type
coupons has been moved to the course selection page.
Fixed issue #35 (bug in observers)
Fixed issue #34 (feature request for zip name)
Fixed issue #32 (PDF preview)
Fixed issue #30 (request user - required field setting amount of coupons has no effect)
Fixed issue #29 (request user settings: added explanations)
Fixed issue #28 (wrong paging/view for requestusers)
Fixed issue #27 (wrong link to user profile in requestusers table)
Changed sourcecode here and there to prevent debug output/PHP notices
Removed restriction on amount of coupons when only generating the codes.
Added coupon cleanup confirmation screen.
Thanks Franky Just for your valuable feedback, bug reports and additional remarks!
Version 3.5.1 (build 2018050305)
Fixed issue #23 (invalid use of PARAM_RAW)
Fixed issue #24 (redirect vulnerabilities -> changed all to PARAM_LOCALURL)
Fixed issue #25 (removed use of deprecated function notify_problem)
Fixed some missing capability checks / security issues
Thanks Dan Marsden for your valuable feedback, bug reports and plugin review!
Thanks Jesús Rincón for raising issue #25
backported some of the issues to the Moodle 3.0+ release
NOTE: All other releases except one Moodle 3.0+ release and the most recent
Moodle 3.5+ release have been pulled.
Version 3.5.0 (build 2018050304)
- Fixed issue #21 (cohort_is_member fatal error: thanks Michael Neulinger)
Version 3.5.0 (build 2018050303)
Fixed faulty course / cohort ID filter
Added course groups filter possibilities
Added "timeclaimed" information to keep track of when coupons were actually claimed
Removed table sorting for courses/cohorts/groups (didn't work and should have never been part of the tables)
Added quick rudimentary check to validate whether a person is already "signed up" when entering a code.
(i.e. member in all linked cohorts or enrolled for all linked courses).
Thanks Kevin Freeborn for your very valuable feedback!
Version 3.5.0 (build 2018050302)
- Added possibility to only generate coupon codes (no PDFs will be generated, nor will they be sent!)
- Added batchid field to database to track generated batches of coupons
- Added custom batch naming when generating coupons (system automatically creates one if not provided)
- Added possibility to filter coupons on BATCH ID/name
Version 3.5.0 (build 2018050301)
- Changed internal signup to comply to Moodle 3.5.
- Added option global to use login page layout (which is a Moodle standard really, but wasn't enforced)
- Added coupon code error checking to signup form (refuse signup in case coupon code is invalid)
- Added coupon request possibilities (please refer to manual for usage description)
- Added global options for and display of help texts for custom signup and coupon input texts
- Added possibility to request coupons for course types only. Involves admin to configure both the courses and allowed users
- Removed deprecated verify_https_required() call from custom (internal) signup
Version 3.5.0 (build 2018050300)
- FIXED issue #15 ("mdb->get_record() found more than one record" when calling find_block_instance_id()).
- FIXED issue #19 where enrolment was never updated when using a new coupon after enrolment expired.
- Fixed "Sent" column in coupon overviews (displayed information based on wrong field)
- Added privacy provider
- Validated functionality for Moodle 3.5 onwards
- Minimum required Moodle version: 3.5
Version 3.3.2 (build 2017092503)
- Added role selection for coupons (course type only)
Version 3.3.1 (build 2017092501)
- Added coupon code to "progress report" for validation purposes (feature request)
- Added claimed user to "used coupons" overview for validation purposes (feature request)
Version 3.3.0 (build 2017092500)
- Fixed deprecated pix_url references (replaced by image_url)
- Validated functionality for Moodle 3.3 onwards
- Minimum required Moodle version: 3.3
Version 2017052402 (Release 3.0.3 (build 2017052402))
Fixed bug in cohort type coupons (fixed incorrect usercheck and cohort synchronisation)
Added option to display QR Code in PDF or leave it out.
Thanks to everyone for their valuable input and remarks.
Version 2017052401 (Release 3.0.2 (build 2017052401))
Resolved issue #14
Thanks to everyone for their valuable input and remarks.
Version 2017052400 (Release 3.0.1 (build 2017052400))
Added new type of coupon: extend (course) enrolment
Added webservices!
Incorporated some changes here and the in overviews
Thanks to everyone for their valuable input and remarks.
Version 2017050100 (Release 3.0.0 (build 2017050100))
Added $CFG->wwwroot on all moodle_urls
Added setting to choose default assigned role (resolve issue #12: Student role problem.
Roles were fetched by shortname = 'student', NOT foolproof)
Disabled sorting by 'owner' column in coupon overviews (resolve issue #13).
Fixed error notification when inserting to table block_coupon_courses
Added course name(s) to coupons
Changed default coupon temp
4.4.2 (build 2024100103) (2024100103)
4.4.2 (build 2024100103)
Plugin type: Blocks
Frankenstyle component name: block_coupon
Version build number: 2024100103
Version release name: 4.4.2 (build 2024100103)
Maturity: Stable
Supported Moodle versions: 4.5, 5.0
Repository URL (Git): https://github.com/sebsoftnl/moodle-block_coupon
Repository branch:
Repository tag: 4.4.2
Issue/bug tracker URL: https://github.com/sebsoftnl/moodle-block_coupon/issues
Version 4.4.2 (build 2024100103)
** Requiring Moodle 4.5+
** Centralized all CI actions to new defaults for Sebsoft
Version 4.4.1 (build 2024100102)
** Fixed requiring Moodle 4.2 minimum
Version 4.4.0 (build 2024100100)
** Several bugfixes
** Require Moodle 4.2 MINIMUM
** Lots of coding compliance changes
** Introduced editing of course/cohort coupons (based on settings)
** Implementation for batch filter is now an autocomplete
** Fixed issue with CSV upload not being processed
** Fixed (github) issue #27
** Fixed (github) issue #3 (was done long ago already, but just to be complete).
** Supported up to Moodle 4.5
Version 4.3.3 (build 2024020100)
- Fixed "array_key_exists" errors in filters
- Fixed wrong templated name for CSV manual (Email != E-mail)
- Fixed (merged) course name formatting
- Fixed (github) issue #16
- Fixed (github) issue #18
- Fixed (github) issue #19
- Fixed (github) issue #20
- Added settings default for "enrolment period"
- Added settings default for "generate codes only" (issue #23)
- Various small fixes
- Added environment.xml
Version 4.3.2 (build 2024010200)
- Fixed issues while installing module
- Fixed issues while claiming coupons
- Merged in changes by Rob Joyce in default translation files
Version 4.3.1 (build 2023110302)
- Fixed reported issue in upgrade process
Version 4.3.0 (build 2023110300)
- Fixed some bugs
- Added templating
- Revised webservices
- Massive code overhaul to facilitate PDF templates
- Massive overhaul in "wizard" pages for better logic and navigation
Version 4.2.3 (build 2023090101)
- Added generator flags configuration
- Added generator flags selection/limiting in coupon forms
- Fixed long existing unintended generator flags bug
Version 4.2.2 (build 2022090101)
- Fixed issue where coupon users aren't displayed in tables.
- Finally re-added the long long long lost coupon expiry.
- Small changes in codegenerator (pre-work)
Version 4.2.1 (build 2022090100)
- Changed dependency to Moodle 4.0+
- Added gitlab CI up to Moodle 4.1
- Removed Moodle versions up to 4.0 from gitlab CI
- Fixed date selector on cleanup page.
- Resolved MOODLE_INTERNAL checks.
- Clean up SOME unused vars.
- Removed the long deprecated "is_allowed_from_ajax()" calls in externallib.php
Version 4.2.0 (build 2020010816)
- Added exclusion of courses already enrolled for coursegrouping coupon types
- Added coursegrouping coupon types (choose x out of y courses)
- Added SPONSORS.md to specifically state our gratitude apart from mentioning them in the README.
- Special thanks goes out to eLearn Solutions with Boston Connect (a subsidiary of Boston City Campus)
as a sponsor of this plugin! - Added webservice call to claim coupon code. Bear in mind this is ONLY applicable
at the moment to course type coupons. Refinement is needed (as well as an overhaul of the plugin and services).
Version 4.1.0 (build 2021011000)
- Added tabs + settings for coupon request users (coupons / progressreport).
- Fixed #1: no QR code in the generated PDF (think this was fixed before, just confirming again)
- Fixed #4: Not possible to confirm account with self-registration auth method disabled (see Version 4.0.9 (build 2020010813); this is a workaround)
- Fixed #3: Extend webservices with enrolment period. Course coupons ONLY.
- Renderer moved to /classes/output
- 2 remaining renderer "full page reports" were now moved to their own controllers.
Version 4.0.10 (build 2020010815)
- Added font selection for PDF for more language support. RTL might still be an issue (fixed #5).
- Extended PDF preview with "current" font selection and current QR setting.
- Added clientreference field when requesting coupons.
- Coupon requests are no longer removed upon denial/approval, but marked as denied/finalized.
- Coupon requestability is now also implemented for cohorts.
- Implemented a helper to support \core_user\fields but also serve the old method (for Moodle pre 3.11)
- Removed maximum of 10 logo files, it is now set to -1 (unlimited).
Version 4.0.9.1 (build 2020010814)
- Fixed bug in new function introduced in 4.0.9.
Version 4.0.9 (build 2020010813)
- Fixed part of code checker compliance.
- Added method to allow signup, even when no signups are allowed in the site (disabled by default).
Version 4.0.8 (build 2020010810)
- Fixed error notification with usage in qr code.
- Fixed error notification(s) if coupon is already used.
Version 4.0.7 (build 2020010809)
- Fixed coupon type enrolment extension. Status is now forced to ACTIVE (Thanks Hiro Nakamura).
- Changed some language strings (EN only) so the period character does not end up outside of the containing paragraph.
Version 4.0.7 (build 2020010808)
- Fixed main assert_not_claimed function: reinstated exception
- Added component to generic error (input_coupon.php)
Version 4.0.7 (build 2020010807)
- Added task to remove cohort members (i.e. take care of cohort unenrolment).
- Fixed webservice call return for generate_coupons_for_cohorts.
- Fixed webservice call return for generate_coupons_for_course.
Version 4.0.6 (build 2020010806)
- Added autocompletes for cohort/cohort courses.
- Added user_deleted observer.
- Fixed notice (generate_pdf) on POST data (user requesting coupon; made field an advcheckbox).
- Fixed CSS issue... sigh.
- Undo previous work on user column (used coupons).
- Fix sorting on user column.
- Add sorting on owner column.
- Added user/claimed_on columns for personalised coupons.
- Fixed langstring 'coupon_notification_content'.
- Fixed get_string variables (in helper).
- Fixed "Curly brace syntax for accessing array elements and string offsets has
been deprecated in PHP 7.4. Found: $codealphabet{$n}" in codegenerator.
Version 4.0.6 (build 2020010805)
- Added INDICES to block_coupon.
Version 4.0.6 (build 2020010804)
- Changed course selection when generating coupons to auto-complete element.
- Changed cohort selection when generating coupons to auto-complete element.
- Added services.
- Added 10px whitespace between buttons in block.
- Set width of most default for elements to 75% (never EVER set to 100% due to autocomplete element).
- Modified course group selection to checkboxes.
- Added tab dedicated to personalised coupons (uses global setting to enable!).
- Add field to manipulate code size for coupons.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, funding of these changes, bug reports and beta testing.
Version 4.0.5 (build 2020010803)
- Added option to include PDF when sending personalised coupons.
- Modified (AGAIN) sending process of personal coupons.
Version 4.0.4.2 (build 2020010802)
- Changed length of batchid to 255.
Version 4.0.4.1 (build 2020010801)
- Updated privacy provider.
- Removed https verification from custom signup page.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, bug reports and beta testing.
Version 4.0.4 (build 2020010800)
- Validated Moodle 3.8
- Changed a few table implementations (fixes sorting bugs)
- Changed headers/sorting on tables for USER fields
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for donating to Moodle 3.8 validation, useful input and beta testing.
Version 4.0.3-RC1 (build 2019031805)
- Release candidate for beta testing
Version 4.0.2 (build 2019031804)
- Added ADVANCED global $CFG options to manipulate template bot output offsets.
- Fixed wrongful addition of "batchID" when adding any filter (used/unused coupon view)
- Fixed PHP notice in batchID filter
- Fixed some more Oracle table alias issues
- Fixed wrong links in notification context urls
- Added maillog tab. Still too many requests about mails not being sent, so we decided
to wrap Moodle's email_to_user method and log any debug output if relevant. - General code cleanup (as a result of Travis-CI)
Version 4.0.1 (build 2019031802)
Fixed param type on download page.
Added an overview to display downloadable batches (only scans for coupon archives in moodledata).
Added option to download from this overview.
Fixed issue #27 again (wrong link to user profile)
Fixed issue #38 again (wrong link to user profile, different view)
Fixed issue #37 (configurable button class for links; see global plugin configuration)
Fixed issue #36 (had already been done in build 2018050301, only noted here for automatic issue resolving)
Filter forms are now collapsed by default. Always expanded drove me nuts on larger filters/forms.
Fixed breaking LIMIT database issues affecting OracleDB ("LIMIT" clauses not supported as such)
Fixed breaking alias issues affecting OracleDB (Oracle does NOT support the "AS" keyword)
Fixed issue #39 (partial) Added filter capabilities in error report.
Fixed issue #31 (part 2: message sent twice)
Special thanks to Theodore Pylarinos for providing extremely detailed information
that helped to haunt down the bug of downloads not being found!
Special thanks to Wade Colclough from Zuken Limited for providing excellent feedback
and willingness to put in the time and effort to help fixing issues related to Oracle DB.
Version 4.0.0 (build 2019031801)
- Added correct userid identifier on requests table so the link to the user
profile points to the correct one (extension to issue #27)
Version 4.0.0 (build 2019031800)
Small change in workflow of user requested coupons
Added mailing and notification of accepted user requested coupons
Added internal Moodle notifications
Code overhaul: nearly all logic has been rewritten for maintainability reasons.
Verified workings on Moodle 3.4 (updated version.php accordingly)
AMD modules have now properly been minified
We're NO longer "following" Moodle versions.
Thanks everyone for all feedback!
Version 3.5.2 (build 2018050306)
Fixed issue(s) with CSV/Manual recipients not working.
Coupon batches now all have the same "timecreated"
Removed sorting of "action" column in coupon overviews
Custom mail function is now replaced with Moodle's own email_to_user()
Due to MANY issues where the email containing the coupons is not received, the
decision was made to change the process to sending an email containing a
download link where the generated batch can be downloaded from instead of
providing the email with an attachment.
Fixed issue #22 (we now use TCPDF's own QR Code generator)
Added/fixed validation on "request user" configuration form
Added more information to coupons requests overview table
In line with issue 32, configuration of the enrolment duration for course type
coupons has been moved to the course selection page.
Fixed issue #35 (bug in observers)
Fixed issue #34 (feature request for zip name)
Fixed issue #32 (PDF preview)
Fixed issue #30 (request user - required field setting amount of coupons has no effect)
Fixed issue #29 (request user settings: added explanations)
Fixed issue #28 (wrong paging/view for requestusers)
Fixed issue #27 (wrong link to user profile in requestusers table)
Changed sourcecode here and there to prevent debug output/PHP notices
Removed restriction on amount of coupons when only generating the codes.
Added coupon cleanup confirmation screen.
Thanks Franky Just for your valuable feedback, bug reports and additional remarks!
Version 3.5.1 (build 2018050305)
Fixed issue #23 (invalid use of PARAM_RAW)
Fixed issue #24 (redirect vulnerabilities -> changed all to PARAM_LOCALURL)
Fixed issue #25 (removed use of deprecated function notify_problem)
Fixed some missing capability checks / security issues
Thanks Dan Marsden for your valuable feedback, bug reports and plugin review!
Thanks Jesús Rincón for raising issue #25
backported some of the issues to the Moodle 3.0+ release
NOTE: All other releases except one Moodle 3.0+ release and the most recent
Moodle 3.5+ release have been pulled.
Version 3.5.0 (build 2018050304)
- Fixed issue #21 (cohort_is_member fatal error: thanks Michael Neulinger)
Version 3.5.0 (build 2018050303)
Fixed faulty course / cohort ID filter
Added course groups filter possibilities
Added "timeclaimed" information to keep track of when coupons were actually claimed
Removed table sorting for courses/cohorts/groups (didn't work and should have never been part of the tables)
Added quick rudimentary check to validate whether a person is already "signed up" when entering a code.
(i.e. member in all linked cohorts or enrolled for all linked courses).
Thanks Kevin Freeborn for your very valuable feedback!
Version 3.5.0 (build 2018050302)
- Added possibility to only generate coupon codes (no PDFs will be generated, nor will they be sent!)
- Added batchid field to database to track generated batches of coupons
- Added custom batch naming when generating coupons (system automatically creates one if not provided)
- Added possibility to filter coupons on BATCH ID/name
Version 3.5.0 (build 2018050301)
- Changed internal signup to comply to Moodle 3.5.
- Added option global to use login page layout (which is a Moodle standard really, but wasn't enforced)
- Added coupon code error checking to signup form (refuse signup in case coupon code is invalid)
- Added coupon request possibilities (please refer to manual for usage description)
- Added global options for and display of help texts for custom signup and coupon input texts
- Added possibility to request coupons for course types only. Involves admin to configure both the courses and allowed users
- Removed deprecated verify_https_required() call from custom (internal) signup
Version 3.5.0 (build 2018050300)
- FIXED issue #15 ("mdb->get_record() found more than one record" when calling find_block_instance_id()).
- FIXED issue #19 where enrolment was never updated when using a new coupon after enrolment expired.
- Fixed "Sent" column in coupon overviews (displayed information based on wrong field)
- Added privacy provider
- Validated functionality for Moodle 3.5 onwards
- Minimum required Moodle version: 3.5
Version 3.3.2 (build 2017092503)
- Added role selection for coupons (course type only)
Version 3.3.1 (build 2017092501)
- Added coupon code to "progress report" for validation purposes (feature request)
- Added claimed user to "used coupons" overview for validation purposes (feature request)
Version 3.3.0 (build 2017092500)
- Fixed deprecated pix_url references (replaced by image_url)
- Validated functionality for Moodle 3.3 onwards
- Minimum required Moodle version: 3.3
Version 2017052402 (Release 3.0.3 (build 2017052402))
Fixed bug in cohort type coupons (fixed incorrect usercheck and cohort synchronisation)
Added option to display QR Code in PDF or leave it out.
Thanks to everyone for their valuable input and remarks.
Version 2017052401 (Release 3.0.2 (build 2017052401))
Resolved issue #14
Thanks to everyone for their valuable input and remarks.
Version 2017052400 (Release 3.0.1 (build 2017052400))
Added new type of coupon: extend (course) enrolment
Added webservices!
Incorporated some changes here and the in overviews
Thanks to everyone for their valuable input and remarks.
Version 2017050100 (Release 3.0.0 (build 2017050100))
Added $CFG->wwwroot on all moodle_urls
Added setting to choose default assigned role (resolve issue #12: Student role problem.
Roles were fetched by shortname = 'student', NOT foolproof)
Disabled sorting by 'owner' column in coupon overviews (resolve issue #13).
Fixed error notification when inserting to table block_coupon_courses
Added course name(s) to coupons
Changed default coupon template-main contents (language files)
Added filtering for progress reports
Added filtering for coupon overview
Code overhaul to comply to stricter Moodle coding standards (codechecker, Moodle phpdoc check)
Added course_deleted event handler
Added cohort_deleted event handler
Added custom cleaning of coupons
Added QR based coupon to PDF including processing
Added signup for QR based coupon when user is not logged on yet
Added possibility for signup with a coupon code (in block_coupon, when user is not yet logged in)
Added new manager to manage multiple coupon background
Added option to select coupon background to use
minimum required version: Moodle3 3.0
Thanks to everyone for their valuable input and remarks.
Version 2016040800 (Release 2.7.3 (build 2016040800))
raising memory limit and maximum execution time when generating coupons
4.4.1 (build 2024100102) (2024100102)
4.4.1 (build 2024100102)
Plugin type: Blocks
Frankenstyle component name: block_coupon
Version build number: 2024100102
Version release name: 4.4.1 (build 2024100102)
Maturity: Stable
Supported Moodle versions: 4.2, 4.3, 4.4, 4.5
Repository URL (Git): https://github.com/sebsoftnl/moodle-block_coupon
Repository branch:
Repository tag: 4.4.1
Issue/bug tracker URL: https://github.com/sebsoftnl/moodle-block_coupon/issues
Version 4.4.1 (build 2024100102)
** Fixed requiring Moodle 4.2 minimum
Version 4.4.0 (build 2024100100)
** Several bugfixes
** Require Moodle 4.2 MINIMUM
** Lots of coding compliance changes
** Introduced editing of course/cohort coupons (based on settings)
** Implementation for batch filter is now an autocomplete
** Fixed issue with CSV upload not being processed
** Fixed (github) issue #27
** Fixed (github) issue #3 (was done long ago already, but just to be complete).
** Supported up to Moodle 4.5
Version 4.3.3 (build 2024020100)
- Fixed "array_key_exists" errors in filters
- Fixed wrong templated name for CSV manual (Email != E-mail)
- Fixed (merged) course name formatting
- Fixed (github) issue #16
- Fixed (github) issue #18
- Fixed (github) issue #19
- Fixed (github) issue #20
- Added settings default for "enrolment period"
- Added settings default for "generate codes only" (issue #23)
- Various small fixes
- Added environment.xml
Version 4.3.2 (build 2024010200)
- Fixed issues while installing module
- Fixed issues while claiming coupons
- Merged in changes by Rob Joyce in default translation files
Version 4.3.1 (build 2023110302)
- Fixed reported issue in upgrade process
Version 4.3.0 (build 2023110300)
- Fixed some bugs
- Added templating
- Revised webservices
- Massive code overhaul to facilitate PDF templates
- Massive overhaul in "wizard" pages for better logic and navigation
Version 4.2.3 (build 2023090101)
- Added generator flags configuration
- Added generator flags selection/limiting in coupon forms
- Fixed long existing unintended generator flags bug
Version 4.2.2 (build 2022090101)
- Fixed issue where coupon users aren't displayed in tables.
- Finally re-added the long long long lost coupon expiry.
- Small changes in codegenerator (pre-work)
Version 4.2.1 (build 2022090100)
- Changed dependency to Moodle 4.0+
- Added gitlab CI up to Moodle 4.1
- Removed Moodle versions up to 4.0 from gitlab CI
- Fixed date selector on cleanup page.
- Resolved MOODLE_INTERNAL checks.
- Clean up SOME unused vars.
- Removed the long deprecated "is_allowed_from_ajax()" calls in externallib.php
Version 4.2.0 (build 2020010816)
- Added exclusion of courses already enrolled for coursegrouping coupon types
- Added coursegrouping coupon types (choose x out of y courses)
- Added SPONSORS.md to specifically state our gratitude apart from mentioning them in the README.
- Special thanks goes out to eLearn Solutions with Boston Connect (a subsidiary of Boston City Campus)
as a sponsor of this plugin! - Added webservice call to claim coupon code. Bear in mind this is ONLY applicable
at the moment to course type coupons. Refinement is needed (as well as an overhaul of the plugin and services).
Version 4.1.0 (build 2021011000)
- Added tabs + settings for coupon request users (coupons / progressreport).
- Fixed #1: no QR code in the generated PDF (think this was fixed before, just confirming again)
- Fixed #4: Not possible to confirm account with self-registration auth method disabled (see Version 4.0.9 (build 2020010813); this is a workaround)
- Fixed #3: Extend webservices with enrolment period. Course coupons ONLY.
- Renderer moved to /classes/output
- 2 remaining renderer "full page reports" were now moved to their own controllers.
Version 4.0.10 (build 2020010815)
- Added font selection for PDF for more language support. RTL might still be an issue (fixed #5).
- Extended PDF preview with "current" font selection and current QR setting.
- Added clientreference field when requesting coupons.
- Coupon requests are no longer removed upon denial/approval, but marked as denied/finalized.
- Coupon requestability is now also implemented for cohorts.
- Implemented a helper to support \core_user\fields but also serve the old method (for Moodle pre 3.11)
- Removed maximum of 10 logo files, it is now set to -1 (unlimited).
Version 4.0.9.1 (build 2020010814)
- Fixed bug in new function introduced in 4.0.9.
Version 4.0.9 (build 2020010813)
- Fixed part of code checker compliance.
- Added method to allow signup, even when no signups are allowed in the site (disabled by default).
Version 4.0.8 (build 2020010810)
- Fixed error notification with usage in qr code.
- Fixed error notification(s) if coupon is already used.
Version 4.0.7 (build 2020010809)
- Fixed coupon type enrolment extension. Status is now forced to ACTIVE (Thanks Hiro Nakamura).
- Changed some language strings (EN only) so the period character does not end up outside of the containing paragraph.
Version 4.0.7 (build 2020010808)
- Fixed main assert_not_claimed function: reinstated exception
- Added component to generic error (input_coupon.php)
Version 4.0.7 (build 2020010807)
- Added task to remove cohort members (i.e. take care of cohort unenrolment).
- Fixed webservice call return for generate_coupons_for_cohorts.
- Fixed webservice call return for generate_coupons_for_course.
Version 4.0.6 (build 2020010806)
- Added autocompletes for cohort/cohort courses.
- Added user_deleted observer.
- Fixed notice (generate_pdf) on POST data (user requesting coupon; made field an advcheckbox).
- Fixed CSS issue... sigh.
- Undo previous work on user column (used coupons).
- Fix sorting on user column.
- Add sorting on owner column.
- Added user/claimed_on columns for personalised coupons.
- Fixed langstring 'coupon_notification_content'.
- Fixed get_string variables (in helper).
- Fixed "Curly brace syntax for accessing array elements and string offsets has
been deprecated in PHP 7.4. Found: $codealphabet{$n}" in codegenerator.
Version 4.0.6 (build 2020010805)
- Added INDICES to block_coupon.
Version 4.0.6 (build 2020010804)
- Changed course selection when generating coupons to auto-complete element.
- Changed cohort selection when generating coupons to auto-complete element.
- Added services.
- Added 10px whitespace between buttons in block.
- Set width of most default for elements to 75% (never EVER set to 100% due to autocomplete element).
- Modified course group selection to checkboxes.
- Added tab dedicated to personalised coupons (uses global setting to enable!).
- Add field to manipulate code size for coupons.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, funding of these changes, bug reports and beta testing.
Version 4.0.5 (build 2020010803)
- Added option to include PDF when sending personalised coupons.
- Modified (AGAIN) sending process of personal coupons.
Version 4.0.4.2 (build 2020010802)
- Changed length of batchid to 255.
Version 4.0.4.1 (build 2020010801)
- Updated privacy provider.
- Removed https verification from custom signup page.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, bug reports and beta testing.
Version 4.0.4 (build 2020010800)
- Validated Moodle 3.8
- Changed a few table implementations (fixes sorting bugs)
- Changed headers/sorting on tables for USER fields
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for donating to Moodle 3.8 validation, useful input and beta testing.
Version 4.0.3-RC1 (build 2019031805)
- Release candidate for beta testing
Version 4.0.2 (build 2019031804)
- Added ADVANCED global $CFG options to manipulate template bot output offsets.
- Fixed wrongful addition of "batchID" when adding any filter (used/unused coupon view)
- Fixed PHP notice in batchID filter
- Fixed some more Oracle table alias issues
- Fixed wrong links in notification context urls
- Added maillog tab. Still too many requests about mails not being sent, so we decided
to wrap Moodle's email_to_user method and log any debug output if relevant. - General code cleanup (as a result of Travis-CI)
Version 4.0.1 (build 2019031802)
Fixed param type on download page.
Added an overview to display downloadable batches (only scans for coupon archives in moodledata).
Added option to download from this overview.
Fixed issue #27 again (wrong link to user profile)
Fixed issue #38 again (wrong link to user profile, different view)
Fixed issue #37 (configurable button class for links; see global plugin configuration)
Fixed issue #36 (had already been done in build 2018050301, only noted here for automatic issue resolving)
Filter forms are now collapsed by default. Always expanded drove me nuts on larger filters/forms.
Fixed breaking LIMIT database issues affecting OracleDB ("LIMIT" clauses not supported as such)
Fixed breaking alias issues affecting OracleDB (Oracle does NOT support the "AS" keyword)
Fixed issue #39 (partial) Added filter capabilities in error report.
Fixed issue #31 (part 2: message sent twice)
Special thanks to Theodore Pylarinos for providing extremely detailed information
that helped to haunt down the bug of downloads not being found!
Special thanks to Wade Colclough from Zuken Limited for providing excellent feedback
and willingness to put in the time and effort to help fixing issues related to Oracle DB.
Version 4.0.0 (build 2019031801)
- Added correct userid identifier on requests table so the link to the user
profile points to the correct one (extension to issue #27)
Version 4.0.0 (build 2019031800)
Small change in workflow of user requested coupons
Added mailing and notification of accepted user requested coupons
Added internal Moodle notifications
Code overhaul: nearly all logic has been rewritten for maintainability reasons.
Verified workings on Moodle 3.4 (updated version.php accordingly)
AMD modules have now properly been minified
We're NO longer "following" Moodle versions.
Thanks everyone for all feedback!
Version 3.5.2 (build 2018050306)
Fixed issue(s) with CSV/Manual recipients not working.
Coupon batches now all have the same "timecreated"
Removed sorting of "action" column in coupon overviews
Custom mail function is now replaced with Moodle's own email_to_user()
Due to MANY issues where the email containing the coupons is not received, the
decision was made to change the process to sending an email containing a
download link where the generated batch can be downloaded from instead of
providing the email with an attachment.
Fixed issue #22 (we now use TCPDF's own QR Code generator)
Added/fixed validation on "request user" configuration form
Added more information to coupons requests overview table
In line with issue 32, configuration of the enrolment duration for course type
coupons has been moved to the course selection page.
Fixed issue #35 (bug in observers)
Fixed issue #34 (feature request for zip name)
Fixed issue #32 (PDF preview)
Fixed issue #30 (request user - required field setting amount of coupons has no effect)
Fixed issue #29 (request user settings: added explanations)
Fixed issue #28 (wrong paging/view for requestusers)
Fixed issue #27 (wrong link to user profile in requestusers table)
Changed sourcecode here and there to prevent debug output/PHP notices
Removed restriction on amount of coupons when only generating the codes.
Added coupon cleanup confirmation screen.
Thanks Franky Just for your valuable feedback, bug reports and additional remarks!
Version 3.5.1 (build 2018050305)
Fixed issue #23 (invalid use of PARAM_RAW)
Fixed issue #24 (redirect vulnerabilities -> changed all to PARAM_LOCALURL)
Fixed issue #25 (removed use of deprecated function notify_problem)
Fixed some missing capability checks / security issues
Thanks Dan Marsden for your valuable feedback, bug reports and plugin review!
Thanks Jesús Rincón for raising issue #25
backported some of the issues to the Moodle 3.0+ release
NOTE: All other releases except one Moodle 3.0+ release and the most recent
Moodle 3.5+ release have been pulled.
Version 3.5.0 (build 2018050304)
- Fixed issue #21 (cohort_is_member fatal error: thanks Michael Neulinger)
Version 3.5.0 (build 2018050303)
Fixed faulty course / cohort ID filter
Added course groups filter possibilities
Added "timeclaimed" information to keep track of when coupons were actually claimed
Removed table sorting for courses/cohorts/groups (didn't work and should have never been part of the tables)
Added quick rudimentary check to validate whether a person is already "signed up" when entering a code.
(i.e. member in all linked cohorts or enrolled for all linked courses).
Thanks Kevin Freeborn for your very valuable feedback!
Version 3.5.0 (build 2018050302)
- Added possibility to only generate coupon codes (no PDFs will be generated, nor will they be sent!)
- Added batchid field to database to track generated batches of coupons
- Added custom batch naming when generating coupons (system automatically creates one if not provided)
- Added possibility to filter coupons on BATCH ID/name
Version 3.5.0 (build 2018050301)
- Changed internal signup to comply to Moodle 3.5.
- Added option global to use login page layout (which is a Moodle standard really, but wasn't enforced)
- Added coupon code error checking to signup form (refuse signup in case coupon code is invalid)
- Added coupon request possibilities (please refer to manual for usage description)
- Added global options for and display of help texts for custom signup and coupon input texts
- Added possibility to request coupons for course types only. Involves admin to configure both the courses and allowed users
- Removed deprecated verify_https_required() call from custom (internal) signup
Version 3.5.0 (build 2018050300)
- FIXED issue #15 ("mdb->get_record() found more than one record" when calling find_block_instance_id()).
- FIXED issue #19 where enrolment was never updated when using a new coupon after enrolment expired.
- Fixed "Sent" column in coupon overviews (displayed information based on wrong field)
- Added privacy provider
- Validated functionality for Moodle 3.5 onwards
- Minimum required Moodle version: 3.5
Version 3.3.2 (build 2017092503)
- Added role selection for coupons (course type only)
Version 3.3.1 (build 2017092501)
- Added coupon code to "progress report" for validation purposes (feature request)
- Added claimed user to "used coupons" overview for validation purposes (feature request)
Version 3.3.0 (build 2017092500)
- Fixed deprecated pix_url references (replaced by image_url)
- Validated functionality for Moodle 3.3 onwards
- Minimum required Moodle version: 3.3
Version 2017052402 (Release 3.0.3 (build 2017052402))
Fixed bug in cohort type coupons (fixed incorrect usercheck and cohort synchronisation)
Added option to display QR Code in PDF or leave it out.
Thanks to everyone for their valuable input and remarks.
Version 2017052401 (Release 3.0.2 (build 2017052401))
Resolved issue #14
Thanks to everyone for their valuable input and remarks.
Version 2017052400 (Release 3.0.1 (build 2017052400))
Added new type of coupon: extend (course) enrolment
Added webservices!
Incorporated some changes here and the in overviews
Thanks to everyone for their valuable input and remarks.
Version 2017050100 (Release 3.0.0 (build 2017050100))
Added $CFG->wwwroot on all moodle_urls
Added setting to choose default assigned role (resolve issue #12: Student role problem.
Roles were fetched by shortname = 'student', NOT foolproof)
Disabled sorting by 'owner' column in coupon overviews (resolve issue #13).
Fixed error notification when inserting to table block_coupon_courses
Added course name(s) to coupons
Changed default coupon template-main contents (language files)
Added filtering for progress reports
Added filtering for coupon overview
Code overhaul to comply to stricter Moodle coding standards (codechecker, Moodle phpdoc check)
Added course_deleted event handler
Added cohort_deleted event handler
Added custom cleaning of coupons
Added QR based coupon to PDF including processing
Added signup for QR based coupon when user is not logged on yet
Added possibility for signup with a coupon code (in block_coupon, when user is not yet logged in)
Added new manager to manage multiple coupon background
Added option to select coupon background to use
minimum required version: Moodle3 3.0
Thanks to everyone for their valuable input and remarks.
Version 2016040800 (Release 2.7.3 (build 2016040800))
raising memory limit and maximum execution time when generating coupons.
Fixed cleanup task
Fixed last page of wizard not displaying selected groups
4.3.3 (build 2024040900) (2024040900)
4.3.3 (build 2024040900)
Plugin type: Blocks
Frankenstyle component name: block_coupon
Version build number: 2024040900
Version release name: 4.3.3 (build 2024040900)
Maturity: Stable
Supported Moodle versions: 4.0, 4.1, 4.2, 4.3
Repository URL (Git): https://github.com/sebsoftnl/moodle-block_coupon
Repository branch:
Repository tag: 4.3.3
Issue/bug tracker URL: https://github.com/sebsoftnl/moodle-block_coupon/issues
Version 4.3.3 (build 2024020100)
- Fixed "array_key_exists" errors in filters
- Fixed wrong templated name for CSV manual (Email != E-mail)
- Fixed (merged) course name formatting
- Fixed (github) issue #20
- Added settings default for "enrolment period"
- Added settings default for "generate codes only"
- Various small fixes
- Added environment.xml
Version 4.3.2 (build 2024010200)
- Fixed issues while installing module
- Fixed issues while claiming coupons
- Merged in changes by Rob Joyce in default translation files
Version 4.3.1 (build 2023110302)
- Fixed reported issue in upgrade process
Version 4.3.0 (build 2023110300)
- Fixed some bugs
- Added templating
- Revised webservices
- Massive code overhaul to facilitate PDF templates
- Massive overhaul in "wizard" pages for better logic and navigation
Version 4.2.3 (build 2023090101)
- Added generator flags configuration
- Added generator flags selection/limiting in coupon forms
- Fixed long existing unintended generator flags bug
Version 4.2.2 (build 2022090101)
- Fixed issue where coupon users aren't displayed in tables.
- Finally re-added the long long long lost coupon expiry.
- Small changes in codegenerator (pre-work)
Version 4.2.1 (build 2022090100)
- Changed dependency to Moodle 4.0+
- Added gitlab CI up to Moodle 4.1
- Removed Moodle versions up to 4.0 from gitlab CI
- Fixed date selector on cleanup page.
- Resolved MOODLE_INTERNAL checks.
- Clean up SOME unused vars.
- Removed the long deprecated "is_allowed_from_ajax()" calls in externallib.php
Version 4.2.0 (build 2020010816)
- Added exclusion of courses already enrolled for coursegrouping coupon types
- Added coursegrouping coupon types (choose x out of y courses)
- Added SPONSORS.md to specifically state our gratitude apart from mentioning them in the README.
- Special thanks goes out to eLearn Solutions with Boston Connect (a subsidiary of Boston City Campus)
as a sponsor of this plugin! - Added webservice call to claim coupon code. Bear in mind this is ONLY applicable
at the moment to course type coupons. Refinement is needed (as well as an overhaul of the plugin and services).
Version 4.1.0 (build 2021011000)
- Added tabs + settings for coupon request users (coupons / progressreport).
- Fixed #1: no QR code in the generated PDF (think this was fixed before, just confirming again)
- Fixed #4: Not possible to confirm account with self-registration auth method disabled (see Version 4.0.9 (build 2020010813); this is a workaround)
- Fixed #3: Extend webservices with enrolment period. Course coupons ONLY.
- Renderer moved to /classes/output
- 2 remaining renderer "full page reports" were now moved to their own controllers.
Version 4.0.10 (build 2020010815)
- Added font selection for PDF for more language support. RTL might still be an issue (fixed #5).
- Extended PDF preview with "current" font selection and current QR setting.
- Added clientreference field when requesting coupons.
- Coupon requests are no longer removed upon denial/approval, but marked as denied/finalized.
- Coupon requestability is now also implemented for cohorts.
- Implemented a helper to support \core_user\fields but also serve the old method (for Moodle pre 3.11)
- Removed maximum of 10 logo files, it is now set to -1 (unlimited).
Version 4.0.9.1 (build 2020010814)
- Fixed bug in new function introduced in 4.0.9.
Version 4.0.9 (build 2020010813)
- Fixed part of code checker compliance.
- Added method to allow signup, even when no signups are allowed in the site (disabled by default).
Version 4.0.8 (build 2020010810)
- Fixed error notification with usage in qr code.
- Fixed error notification(s) if coupon is already used.
Version 4.0.7 (build 2020010809)
- Fixed coupon type enrolment extension. Status is now forced to ACTIVE (Thanks Hiro Nakamura).
- Changed some language strings (EN only) so the period character does not end up outside of the containing paragraph.
Version 4.0.7 (build 2020010808)
- Fixed main assert_not_claimed function: reinstated exception
- Added component to generic error (input_coupon.php)
Version 4.0.7 (build 2020010807)
- Added task to remove cohort members (i.e. take care of cohort unenrolment).
- Fixed webservice call return for generate_coupons_for_cohorts.
- Fixed webservice call return for generate_coupons_for_course.
Version 4.0.6 (build 2020010806)
- Added autocompletes for cohort/cohort courses.
- Added user_deleted observer.
- Fixed notice (generate_pdf) on POST data (user requesting coupon; made field an advcheckbox).
- Fixed CSS issue... sigh.
- Undo previous work on user column (used coupons).
- Fix sorting on user column.
- Add sorting on owner column.
- Added user/claimed_on columns for personalised coupons.
- Fixed langstring 'coupon_notification_content'.
- Fixed get_string variables (in helper).
- Fixed "Curly brace syntax for accessing array elements and string offsets has
been deprecated in PHP 7.4. Found: $codealphabet{$n}" in codegenerator.
Version 4.0.6 (build 2020010805)
- Added INDICES to block_coupon.
Version 4.0.6 (build 2020010804)
- Changed course selection when generating coupons to auto-complete element.
- Changed cohort selection when generating coupons to auto-complete element.
- Added services.
- Added 10px whitespace between buttons in block.
- Set width of most default for elements to 75% (never EVER set to 100% due to autocomplete element).
- Modified course group selection to checkboxes.
- Added tab dedicated to personalised coupons (uses global setting to enable!).
- Add field to manipulate code size for coupons.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, funding of these changes, bug reports and beta testing.
Version 4.0.5 (build 2020010803)
- Added option to include PDF when sending personalised coupons.
- Modified (AGAIN) sending process of personal coupons.
Version 4.0.4.2 (build 2020010802)
- Changed length of batchid to 255.
Version 4.0.4.1 (build 2020010801)
- Updated privacy provider.
- Removed https verification from custom signup page.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, bug reports and beta testing.
Version 4.0.4 (build 2020010800)
- Validated Moodle 3.8
- Changed a few table implementations (fixes sorting bugs)
- Changed headers/sorting on tables for USER fields
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for donating to Moodle 3.8 validation, useful input and beta testing.
Version 4.0.3-RC1 (build 2019031805)
- Release candidate for beta testing
Version 4.0.2 (build 2019031804)
- Added ADVANCED global $CFG options to manipulate template bot output offsets.
- Fixed wrongful addition of "batchID" when adding any filter (used/unused coupon view)
- Fixed PHP notice in batchID filter
- Fixed some more Oracle table alias issues
- Fixed wrong links in notification context urls
- Added maillog tab. Still too many requests about mails not being sent, so we decided
to wrap Moodle's email_to_user method and log any debug output if relevant. - General code cleanup (as a result of Travis-CI)
Version 4.0.1 (build 2019031802)
Fixed param type on download page.
Added an overview to display downloadable batches (only scans for coupon archives in moodledata).
Added option to download from this overview.
Fixed issue #27 again (wrong link to user profile)
Fixed issue #38 again (wrong link to user profile, different view)
Fixed issue #37 (configurable button class for links; see global plugin configuration)
Fixed issue #36 (had already been done in build 2018050301, only noted here for automatic issue resolving)
Filter forms are now collapsed by default. Always expanded drove me nuts on larger filters/forms.
Fixed breaking LIMIT database issues affecting OracleDB ("LIMIT" clauses not supported as such)
Fixed breaking alias issues affecting OracleDB (Oracle does NOT support the "AS" keyword)
Fixed issue #39 (partial) Added filter capabilities in error report.
Fixed issue #31 (part 2: message sent twice)
Special thanks to Theodore Pylarinos for providing extremely detailed information
that helped to haunt down the bug of downloads not being found!
Special thanks to Wade Colclough from Zuken Limited for providing excellent feedback
and willingness to put in the time and effort to help fixing issues related to Oracle DB.
Version 4.0.0 (build 2019031801)
- Added correct userid identifier on requests table so the link to the user
profile points to the correct one (extension to issue #27)
Version 4.0.0 (build 2019031800)
Small change in workflow of user requested coupons
Added mailing and notification of accepted user requested coupons
Added internal Moodle notifications
Code overhaul: nearly all logic has been rewritten for maintainability reasons.
Verified workings on Moodle 3.4 (updated version.php accordingly)
AMD modules have now properly been minified
We're NO longer "following" Moodle versions.
Thanks everyone for all feedback!
Version 3.5.2 (build 2018050306)
Fixed issue(s) with CSV/Manual recipients not working.
Coupon batches now all have the same "timecreated"
Removed sorting of "action" column in coupon overviews
Custom mail function is now replaced with Moodle's own email_to_user()
Due to MANY issues where the email containing the coupons is not received, the
decision was made to change the process to sending an email containing a
download link where the generated batch can be downloaded from instead of
providing the email with an attachment.
Fixed issue #22 (we now use TCPDF's own QR Code generator)
Added/fixed validation on "request user" configuration form
Added more information to coupons requests overview table
In line with issue 32, configuration of the enrolment duration for course type
coupons has been moved to the course selection page.
Fixed issue #35 (bug in observers)
Fixed issue #34 (feature request for zip name)
Fixed issue #32 (PDF preview)
Fixed issue #30 (request user - required field setting amount of coupons has no effect)
Fixed issue #29 (request user settings: added explanations)
Fixed issue #28 (wrong paging/view for requestusers)
Fixed issue #27 (wrong link to user profile in requestusers table)
Changed sourcecode here and there to prevent debug output/PHP notices
Removed restriction on amount of coupons when only generating the codes.
Added coupon cleanup confirmation screen.
Thanks Franky Just for your valuable feedback, bug reports and additional remarks!
Version 3.5.1 (build 2018050305)
Fixed issue #23 (invalid use of PARAM_RAW)
Fixed issue #24 (redirect vulnerabilities -> changed all to PARAM_LOCALURL)
Fixed issue #25 (removed use of deprecated function notify_problem)
Fixed some missing capability checks / security issues
Thanks Dan Marsden for your valuable feedback, bug reports and plugin review!
Thanks Jesús Rincón for raising issue #25
backported some of the issues to the Moodle 3.0+ release
NOTE: All other releases except one Moodle 3.0+ release and the most recent
Moodle 3.5+ release have been pulled.
Version 3.5.0 (build 2018050304)
- Fixed issue #21 (cohort_is_member fatal error: thanks Michael Neulinger)
Version 3.5.0 (build 2018050303)
Fixed faulty course / cohort ID filter
Added course groups filter possibilities
Added "timeclaimed" information to keep track of when coupons were actually claimed
Removed table sorting for courses/cohorts/groups (didn't work and should have never been part of the tables)
Added quick rudimentary check to validate whether a person is already "signed up" when entering a code.
(i.e. member in all linked cohorts or enrolled for all linked courses).
Thanks Kevin Freeborn for your very valuable feedback!
Version 3.5.0 (build 2018050302)
- Added possibility to only generate coupon codes (no PDFs will be generated, nor will they be sent!)
- Added batchid field to database to track generated batches of coupons
- Added custom batch naming when generating coupons (system automatically creates one if not provided)
- Added possibility to filter coupons on BATCH ID/name
Version 3.5.0 (build 2018050301)
- Changed internal signup to comply to Moodle 3.5.
- Added option global to use login page layout (which is a Moodle standard really, but wasn't enforced)
- Added coupon code error checking to signup form (refuse signup in case coupon code is invalid)
- Added coupon request possibilities (please refer to manual for usage description)
- Added global options for and display of help texts for custom signup and coupon input texts
- Added possibility to request coupons for course types only. Involves admin to configure both the courses and allowed users
- Removed deprecated verify_https_required() call from custom (internal) signup
Version 3.5.0 (build 2018050300)
- FIXED issue #15 ("mdb->get_record() found more than one record" when calling find_block_instance_id()).
- FIXED issue #19 where enrolment was never updated when using a new coupon after enrolment expired.
- Fixed "Sent" column in coupon overviews (displayed information based on wrong field)
- Added privacy provider
- Validated functionality for Moodle 3.5 onwards
- Minimum required Moodle version: 3.5
Version 3.3.2 (build 2017092503)
- Added role selection for coupons (course type only)
Version 3.3.1 (build 2017092501)
- Added coupon code to "progress report" for validation purposes (feature request)
- Added claimed user to "used coupons" overview for validation purposes (feature request)
Version 3.3.0 (build 2017092500)
- Fixed deprecated pix_url references (replaced by image_url)
- Validated functionality for Moodle 3.3 onwards
- Minimum required Moodle version: 3.3
Version 2017052402 (Release 3.0.3 (build 2017052402))
Fixed bug in cohort type coupons (fixed incorrect usercheck and cohort synchronisation)
Added option to display QR Code in PDF or leave it out.
Thanks to everyone for their valuable input and remarks.
Version 2017052401 (Release 3.0.2 (build 2017052401))
Resolved issue #14
Thanks to everyone for their valuable input and remarks.
Version 2017052400 (Release 3.0.1 (build 2017052400))
Added new type of coupon: extend (course) enrolment
Added webservices!
Incorporated some changes here and the in overviews
Thanks to everyone for their valuable input and remarks.
Version 2017050100 (Release 3.0.0 (build 2017050100))
Added $CFG->wwwroot on all moodle_urls
Added setting to choose default assigned role (resolve issue #12: Student role problem.
Roles were fetched by shortname = 'student', NOT foolproof)
Disabled sorting by 'owner' column in coupon overviews (resolve issue #13).
Fixed error notification when inserting to table block_coupon_courses
Added course name(s) to coupons
Changed default coupon template-main contents (language files)
Added filtering for progress reports
Added filtering for coupon overview
Code overhaul to comply to stricter Moodle coding standards (codechecker, Moodle phpdoc check)
Added course_deleted event handler
Added cohort_deleted event handler
Added custom cleaning of coupons
Added QR based coupon to PDF including processing
Added signup for QR based coupon when user is not logged on yet
Added possibility for signup with a coupon code (in block_coupon, when user is not yet logged in)
Added new manager to manage multiple coupon background
Added option to select coupon background to use
minimum required version: Moodle3 3.0
Thanks to everyone for their valuable input and remarks.
Version 2016040800 (Release 2.7.3 (build 2016040800))
raising memory limit and maximum execution time when generating coupons.
Fixed cleanup task
Fixed last page of wizard not displaying selected groups
Updated readme
Added ability to delete unused coupons.
Feedback and general remarks or ideas for improvement are still highly valued.
Version 2015010107 (Release 2.7.2 (build 2015010107))
Changed "max coupons" setting to textual input. No more hardcoded limit of 100 coupons.
Added delete option to unused coupons overview
Added settings and task to automatically clean up unused/unclaimed coupons
Thanks to anyone and everyone for their much valued feedback!
Version 201501010
4.3.2 (build 2024010200) (2024010200)
4.3.2 (build 2024010200)
Plugin type: Blocks
Frankenstyle component name: block_coupon
Version build number: 2024010200
Version release name: 4.3.2 (build 2024010200)
Maturity: Stable
Supported Moodle versions: 4.0, 4.1, 4.2, 4.3
Repository URL (Git): https://github.com/sebsoftnl/moodle-block_coupon
Repository branch:
Repository tag: 4.3.2
Issue/bug tracker URL: https://github.com/sebsoftnl/moodle-block_coupon/issues
Version 4.3.2 (build 2024010200)
- Fixed issues while installing module
- Fixed issues while claiming coupons
- Merged in changes by Rob Joyce in default translation files
Version 4.3.1 (build 2023110302)
- Fixed reported issue in upgrade process
Version 4.3.0 (build 2023110300)
- Fixed some bugs
- Added templating
- Revised webservices
- Massive code overhaul to facilitate PDF templates
- Massive overhaul in "wizard" pages for better logic and navigation
Version 4.2.3 (build 2023090101)
- Added generator flags configuration
- Added generator flags selection/limiting in coupon forms
- Fixed long existing unintended generator flags bug
Version 4.2.2 (build 2022090101)
- Fixed issue where coupon users aren't displayed in tables.
- Finally re-added the long long long lost coupon expiry.
- Small changes in codegenerator (pre-work)
Version 4.2.1 (build 2022090100)
- Changed dependency to Moodle 4.0+
- Added gitlab CI up to Moodle 4.1
- Removed Moodle versions up to 4.0 from gitlab CI
- Fixed date selector on cleanup page.
- Resolved MOODLE_INTERNAL checks.
- Clean up SOME unused vars.
- Removed the long deprecated "is_allowed_from_ajax()" calls in externallib.php
Version 4.2.0 (build 2020010816)
- Added exclusion of courses already enrolled for coursegrouping coupon types
- Added coursegrouping coupon types (choose x out of y courses)
- Added SPONSORS.md to specifically state our gratitude apart from mentioning them in the README.
- Special thanks goes out to eLearn Solutions with Boston Connect (a subsidiary of Boston City Campus)
as a sponsor of this plugin! - Added webservice call to claim coupon code. Bear in mind this is ONLY applicable
at the moment to course type coupons. Refinement is needed (as well as an overhaul of the plugin and services).
Version 4.1.0 (build 2021011000)
- Added tabs + settings for coupon request users (coupons / progressreport).
- Fixed #1: no QR code in the generated PDF (think this was fixed before, just confirming again)
- Fixed #4: Not possible to confirm account with self-registration auth method disabled (see Version 4.0.9 (build 2020010813); this is a workaround)
- Fixed #3: Extend webservices with enrolment period. Course coupons ONLY.
- Renderer moved to /classes/output
- 2 remaining renderer "full page reports" were now moved to their own controllers.
Version 4.0.10 (build 2020010815)
- Added font selection for PDF for more language support. RTL might still be an issue (fixed #5).
- Extended PDF preview with "current" font selection and current QR setting.
- Added clientreference field when requesting coupons.
- Coupon requests are no longer removed upon denial/approval, but marked as denied/finalized.
- Coupon requestability is now also implemented for cohorts.
- Implemented a helper to support \core_user\fields but also serve the old method (for Moodle pre 3.11)
- Removed maximum of 10 logo files, it is now set to -1 (unlimited).
Version 4.0.9.1 (build 2020010814)
- Fixed bug in new function introduced in 4.0.9.
Version 4.0.9 (build 2020010813)
- Fixed part of code checker compliance.
- Added method to allow signup, even when no signups are allowed in the site (disabled by default).
Version 4.0.8 (build 2020010810)
- Fixed error notification with usage in qr code.
- Fixed error notification(s) if coupon is already used.
Version 4.0.7 (build 2020010809)
- Fixed coupon type enrolment extension. Status is now forced to ACTIVE (Thanks Hiro Nakamura).
- Changed some language strings (EN only) so the period character does not end up outside of the containing paragraph.
Version 4.0.7 (build 2020010808)
- Fixed main assert_not_claimed function: reinstated exception
- Added component to generic error (input_coupon.php)
Version 4.0.7 (build 2020010807)
- Added task to remove cohort members (i.e. take care of cohort unenrolment).
- Fixed webservice call return for generate_coupons_for_cohorts.
- Fixed webservice call return for generate_coupons_for_course.
Version 4.0.6 (build 2020010806)
- Added autocompletes for cohort/cohort courses.
- Added user_deleted observer.
- Fixed notice (generate_pdf) on POST data (user requesting coupon; made field an advcheckbox).
- Fixed CSS issue... sigh.
- Undo previous work on user column (used coupons).
- Fix sorting on user column.
- Add sorting on owner column.
- Added user/claimed_on columns for personalised coupons.
- Fixed langstring 'coupon_notification_content'.
- Fixed get_string variables (in helper).
- Fixed "Curly brace syntax for accessing array elements and string offsets has
been deprecated in PHP 7.4. Found: $codealphabet{$n}" in codegenerator.
Version 4.0.6 (build 2020010805)
- Added INDICES to block_coupon.
Version 4.0.6 (build 2020010804)
- Changed course selection when generating coupons to auto-complete element.
- Changed cohort selection when generating coupons to auto-complete element.
- Added services.
- Added 10px whitespace between buttons in block.
- Set width of most default for elements to 75% (never EVER set to 100% due to autocomplete element).
- Modified course group selection to checkboxes.
- Added tab dedicated to personalised coupons (uses global setting to enable!).
- Add field to manipulate code size for coupons.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, funding of these changes, bug reports and beta testing.
Version 4.0.5 (build 2020010803)
- Added option to include PDF when sending personalised coupons.
- Modified (AGAIN) sending process of personal coupons.
Version 4.0.4.2 (build 2020010802)
- Changed length of batchid to 255.
Version 4.0.4.1 (build 2020010801)
- Updated privacy provider.
- Removed https verification from custom signup page.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, bug reports and beta testing.
Version 4.0.4 (build 2020010800)
- Validated Moodle 3.8
- Changed a few table implementations (fixes sorting bugs)
- Changed headers/sorting on tables for USER fields
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for donating to Moodle 3.8 validation, useful input and beta testing.
Version 4.0.3-RC1 (build 2019031805)
- Release candidate for beta testing
Version 4.0.2 (build 2019031804)
- Added ADVANCED global $CFG options to manipulate template bot output offsets.
- Fixed wrongful addition of "batchID" when adding any filter (used/unused coupon view)
- Fixed PHP notice in batchID filter
- Fixed some more Oracle table alias issues
- Fixed wrong links in notification context urls
- Added maillog tab. Still too many requests about mails not being sent, so we decided
to wrap Moodle's email_to_user method and log any debug output if relevant. - General code cleanup (as a result of Travis-CI)
Version 4.0.1 (build 2019031802)
Fixed param type on download page.
Added an overview to display downloadable batches (only scans for coupon archives in moodledata).
Added option to download from this overview.
Fixed issue #27 again (wrong link to user profile)
Fixed issue #38 again (wrong link to user profile, different view)
Fixed issue #37 (configurable button class for links; see global plugin configuration)
Fixed issue #36 (had already been done in build 2018050301, only noted here for automatic issue resolving)
Filter forms are now collapsed by default. Always expanded drove me nuts on larger filters/forms.
Fixed breaking LIMIT database issues affecting OracleDB ("LIMIT" clauses not supported as such)
Fixed breaking alias issues affecting OracleDB (Oracle does NOT support the "AS" keyword)
Fixed issue #39 (partial) Added filter capabilities in error report.
Fixed issue #31 (part 2: message sent twice)
Special thanks to Theodore Pylarinos for providing extremely detailed information
that helped to haunt down the bug of downloads not being found!
Special thanks to Wade Colclough from Zuken Limited for providing excellent feedback
and willingness to put in the time and effort to help fixing issues related to Oracle DB.
Version 4.0.0 (build 2019031801)
- Added correct userid identifier on requests table so the link to the user
profile points to the correct one (extension to issue #27)
Version 4.0.0 (build 2019031800)
Small change in workflow of user requested coupons
Added mailing and notification of accepted user requested coupons
Added internal Moodle notifications
Code overhaul: nearly all logic has been rewritten for maintainability reasons.
Verified workings on Moodle 3.4 (updated version.php accordingly)
AMD modules have now properly been minified
We're NO longer "following" Moodle versions.
Thanks everyone for all feedback!
Version 3.5.2 (build 2018050306)
Fixed issue(s) with CSV/Manual recipients not working.
Coupon batches now all have the same "timecreated"
Removed sorting of "action" column in coupon overviews
Custom mail function is now replaced with Moodle's own email_to_user()
Due to MANY issues where the email containing the coupons is not received, the
decision was made to change the process to sending an email containing a
download link where the generated batch can be downloaded from instead of
providing the email with an attachment.
Fixed issue #22 (we now use TCPDF's own QR Code generator)
Added/fixed validation on "request user" configuration form
Added more information to coupons requests overview table
In line with issue 32, configuration of the enrolment duration for course type
coupons has been moved to the course selection page.
Fixed issue #35 (bug in observers)
Fixed issue #34 (feature request for zip name)
Fixed issue #32 (PDF preview)
Fixed issue #30 (request user - required field setting amount of coupons has no effect)
Fixed issue #29 (request user settings: added explanations)
Fixed issue #28 (wrong paging/view for requestusers)
Fixed issue #27 (wrong link to user profile in requestusers table)
Changed sourcecode here and there to prevent debug output/PHP notices
Removed restriction on amount of coupons when only generating the codes.
Added coupon cleanup confirmation screen.
Thanks Franky Just for your valuable feedback, bug reports and additional remarks!
Version 3.5.1 (build 2018050305)
Fixed issue #23 (invalid use of PARAM_RAW)
Fixed issue #24 (redirect vulnerabilities -> changed all to PARAM_LOCALURL)
Fixed issue #25 (removed use of deprecated function notify_problem)
Fixed some missing capability checks / security issues
Thanks Dan Marsden for your valuable feedback, bug reports and plugin review!
Thanks Jesús Rincón for raising issue #25
backported some of the issues to the Moodle 3.0+ release
NOTE: All other releases except one Moodle 3.0+ release and the most recent
Moodle 3.5+ release have been pulled.
Version 3.5.0 (build 2018050304)
- Fixed issue #21 (cohort_is_member fatal error: thanks Michael Neulinger)
Version 3.5.0 (build 2018050303)
Fixed faulty course / cohort ID filter
Added course groups filter possibilities
Added "timeclaimed" information to keep track of when coupons were actually claimed
Removed table sorting for courses/cohorts/groups (didn't work and should have never been part of the tables)
Added quick rudimentary check to validate whether a person is already "signed up" when entering a code.
(i.e. member in all linked cohorts or enrolled for all linked courses).
Thanks Kevin Freeborn for your very valuable feedback!
Version 3.5.0 (build 2018050302)
- Added possibility to only generate coupon codes (no PDFs will be generated, nor will they be sent!)
- Added batchid field to database to track generated batches of coupons
- Added custom batch naming when generating coupons (system automatically creates one if not provided)
- Added possibility to filter coupons on BATCH ID/name
Version 3.5.0 (build 2018050301)
- Changed internal signup to comply to Moodle 3.5.
- Added option global to use login page layout (which is a Moodle standard really, but wasn't enforced)
- Added coupon code error checking to signup form (refuse signup in case coupon code is invalid)
- Added coupon request possibilities (please refer to manual for usage description)
- Added global options for and display of help texts for custom signup and coupon input texts
- Added possibility to request coupons for course types only. Involves admin to configure both the courses and allowed users
- Removed deprecated verify_https_required() call from custom (internal) signup
Version 3.5.0 (build 2018050300)
- FIXED issue #15 ("mdb->get_record() found more than one record" when calling find_block_instance_id()).
- FIXED issue #19 where enrolment was never updated when using a new coupon after enrolment expired.
- Fixed "Sent" column in coupon overviews (displayed information based on wrong field)
- Added privacy provider
- Validated functionality for Moodle 3.5 onwards
- Minimum required Moodle version: 3.5
Version 3.3.2 (build 2017092503)
- Added role selection for coupons (course type only)
Version 3.3.1 (build 2017092501)
- Added coupon code to "progress report" for validation purposes (feature request)
- Added claimed user to "used coupons" overview for validation purposes (feature request)
Version 3.3.0 (build 2017092500)
- Fixed deprecated pix_url references (replaced by image_url)
- Validated functionality for Moodle 3.3 onwards
- Minimum required Moodle version: 3.3
Version 2017052402 (Release 3.0.3 (build 2017052402))
Fixed bug in cohort type coupons (fixed incorrect usercheck and cohort synchronisation)
Added option to display QR Code in PDF or leave it out.
Thanks to everyone for their valuable input and remarks.
Version 2017052401 (Release 3.0.2 (build 2017052401))
Resolved issue #14
Thanks to everyone for their valuable input and remarks.
Version 2017052400 (Release 3.0.1 (build 2017052400))
Added new type of coupon: extend (course) enrolment
Added webservices!
Incorporated some changes here and the in overviews
Thanks to everyone for their valuable input and remarks.
Version 2017050100 (Release 3.0.0 (build 2017050100))
Added $CFG->wwwroot on all moodle_urls
Added setting to choose default assigned role (resolve issue #12: Student role problem.
Roles were fetched by shortname = 'student', NOT foolproof)
Disabled sorting by 'owner' column in coupon overviews (resolve issue #13).
Fixed error notification when inserting to table block_coupon_courses
Added course name(s) to coupons
Changed default coupon template-main contents (language files)
Added filtering for progress reports
Added filtering for coupon overview
Code overhaul to comply to stricter Moodle coding standards (codechecker, Moodle phpdoc check)
Added course_deleted event handler
Added cohort_deleted event handler
Added custom cleaning of coupons
Added QR based coupon to PDF including processing
Added signup for QR based coupon when user is not logged on yet
Added possibility for signup with a coupon code (in block_coupon, when user is not yet logged in)
Added new manager to manage multiple coupon background
Added option to select coupon background to use
minimum required version: Moodle3 3.0
Thanks to everyone for their valuable input and remarks.
Version 2016040800 (Release 2.7.3 (build 2016040800))
raising memory limit and maximum execution time when generating coupons.
Fixed cleanup task
Fixed last page of wizard not displaying selected groups
Updated readme
Added ability to delete unused coupons.
Feedback and general remarks or ideas for improvement are still highly valued.
Version 2015010107 (Release 2.7.2 (build 2015010107))
Changed "max coupons" setting to textual input. No more hardcoded limit of 100 coupons.
Added delete option to unused coupons overview
Added settings and task to automatically clean up unused/unclaimed coupons
Thanks to anyone and everyone for their much valued feedback!
Version 2015010102 (Release 2.7.0 (build 2015010102))
Added missing db/tasks.php
Limited applicable_formats: block can only be used on main site page and "my" dashboard view
Improved renderer (more use of html_writer)
Fixed default setting when starting coupon generator
Included settings file in /classes/task/sendcoupons.php (gave NOTICE)
Fixed a few small (non
4.3.1 (build 2023110302) (2023110302)
4.3.1 (build 2023110302)
Plugin type: Blocks
Frankenstyle component name: block_coupon
Version build number: 2023110302
Version release name: 4.3.1 (build 2023110302)
Maturity: Stable
Supported Moodle versions: 4.0, 4.1, 4.2, 4.3
Repository URL (Git): https://github.com/sebsoftnl/moodle-block_coupon
Repository branch:
Repository tag: 4.3.1
Issue/bug tracker URL: https://github.com/sebsoftnl/moodle-block_coupon/issues
Version 4.3.1 (build 2023110302)
- Fixed reported issue in upgrade process
Version 4.3.0 (build 2023110300)
- Fixed some bugs
- Added templating
- Revised webservices
- Massive code overhaul to facilitate PDF templates
- Massive overhaul in "wizard" pages for better logic and navigation
Version 4.2.3 (build 2023090101)
- Added generator flags configuration
- Added generator flags selection/limiting in coupon forms
- Fixed long existing unintended generator flags bug
Version 4.2.2 (build 2022090101)
- Fixed issue where coupon users aren't displayed in tables.
- Finally re-added the long long long lost coupon expiry.
- Small changes in codegenerator (pre-work)
Version 4.2.1 (build 2022090100)
- Changed dependency to Moodle 4.0+
- Added gitlab CI up to Moodle 4.1
- Removed Moodle versions up to 4.0 from gitlab CI
- Fixed date selector on cleanup page.
- Resolved MOODLE_INTERNAL checks.
- Clean up SOME unused vars.
- Removed the long deprecated "is_allowed_from_ajax()" calls in externallib.php
Version 4.2.0 (build 2020010816)
- Added exclusion of courses already enrolled for coursegrouping coupon types
- Added coursegrouping coupon types (choose x out of y courses)
- Added SPONSORS.md to specifically state our gratitude apart from mentioning them in the README.
- Special thanks goes out to eLearn Solutions with Boston Connect (a subsidiary of Boston City Campus)
as a sponsor of this plugin! - Added webservice call to claim coupon code. Bear in mind this is ONLY applicable
at the moment to course type coupons. Refinement is needed (as well as an overhaul of the plugin and services).
Version 4.1.0 (build 2021011000)
- Added tabs + settings for coupon request users (coupons / progressreport).
- Fixed #1: no QR code in the generated PDF (think this was fixed before, just confirming again)
- Fixed #4: Not possible to confirm account with self-registration auth method disabled (see Version 4.0.9 (build 2020010813); this is a workaround)
- Fixed #3: Extend webservices with enrolment period. Course coupons ONLY.
- Renderer moved to /classes/output
- 2 remaining renderer "full page reports" were now moved to their own controllers.
Version 4.0.10 (build 2020010815)
- Added font selection for PDF for more language support. RTL might still be an issue (fixed #5).
- Extended PDF preview with "current" font selection and current QR setting.
- Added clientreference field when requesting coupons.
- Coupon requests are no longer removed upon denial/approval, but marked as denied/finalized.
- Coupon requestability is now also implemented for cohorts.
- Implemented a helper to support \core_user\fields but also serve the old method (for Moodle pre 3.11)
- Removed maximum of 10 logo files, it is now set to -1 (unlimited).
Version 4.0.9.1 (build 2020010814)
- Fixed bug in new function introduced in 4.0.9.
Version 4.0.9 (build 2020010813)
- Fixed part of code checker compliance.
- Added method to allow signup, even when no signups are allowed in the site (disabled by default).
Version 4.0.8 (build 2020010810)
- Fixed error notification with usage in qr code.
- Fixed error notification(s) if coupon is already used.
Version 4.0.7 (build 2020010809)
- Fixed coupon type enrolment extension. Status is now forced to ACTIVE (Thanks Hiro Nakamura).
- Changed some language strings (EN only) so the period character does not end up outside of the containing paragraph.
Version 4.0.7 (build 2020010808)
- Fixed main assert_not_claimed function: reinstated exception
- Added component to generic error (input_coupon.php)
Version 4.0.7 (build 2020010807)
- Added task to remove cohort members (i.e. take care of cohort unenrolment).
- Fixed webservice call return for generate_coupons_for_cohorts.
- Fixed webservice call return for generate_coupons_for_course.
Version 4.0.6 (build 2020010806)
- Added autocompletes for cohort/cohort courses.
- Added user_deleted observer.
- Fixed notice (generate_pdf) on POST data (user requesting coupon; made field an advcheckbox).
- Fixed CSS issue... sigh.
- Undo previous work on user column (used coupons).
- Fix sorting on user column.
- Add sorting on owner column.
- Added user/claimed_on columns for personalised coupons.
- Fixed langstring 'coupon_notification_content'.
- Fixed get_string variables (in helper).
- Fixed "Curly brace syntax for accessing array elements and string offsets has
been deprecated in PHP 7.4. Found: $codealphabet{$n}" in codegenerator.
Version 4.0.6 (build 2020010805)
- Added INDICES to block_coupon.
Version 4.0.6 (build 2020010804)
- Changed course selection when generating coupons to auto-complete element.
- Changed cohort selection when generating coupons to auto-complete element.
- Added services.
- Added 10px whitespace between buttons in block.
- Set width of most default for elements to 75% (never EVER set to 100% due to autocomplete element).
- Modified course group selection to checkboxes.
- Added tab dedicated to personalised coupons (uses global setting to enable!).
- Add field to manipulate code size for coupons.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, funding of these changes, bug reports and beta testing.
Version 4.0.5 (build 2020010803)
- Added option to include PDF when sending personalised coupons.
- Modified (AGAIN) sending process of personal coupons.
Version 4.0.4.2 (build 2020010802)
- Changed length of batchid to 255.
Version 4.0.4.1 (build 2020010801)
- Updated privacy provider.
- Removed https verification from custom signup page.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, bug reports and beta testing.
Version 4.0.4 (build 2020010800)
- Validated Moodle 3.8
- Changed a few table implementations (fixes sorting bugs)
- Changed headers/sorting on tables for USER fields
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for donating to Moodle 3.8 validation, useful input and beta testing.
Version 4.0.3-RC1 (build 2019031805)
- Release candidate for beta testing
Version 4.0.2 (build 2019031804)
- Added ADVANCED global $CFG options to manipulate template bot output offsets.
- Fixed wrongful addition of "batchID" when adding any filter (used/unused coupon view)
- Fixed PHP notice in batchID filter
- Fixed some more Oracle table alias issues
- Fixed wrong links in notification context urls
- Added maillog tab. Still too many requests about mails not being sent, so we decided
to wrap Moodle's email_to_user method and log any debug output if relevant. - General code cleanup (as a result of Travis-CI)
Version 4.0.1 (build 2019031802)
Fixed param type on download page.
Added an overview to display downloadable batches (only scans for coupon archives in moodledata).
Added option to download from this overview.
Fixed issue #27 again (wrong link to user profile)
Fixed issue #38 again (wrong link to user profile, different view)
Fixed issue #37 (configurable button class for links; see global plugin configuration)
Fixed issue #36 (had already been done in build 2018050301, only noted here for automatic issue resolving)
Filter forms are now collapsed by default. Always expanded drove me nuts on larger filters/forms.
Fixed breaking LIMIT database issues affecting OracleDB ("LIMIT" clauses not supported as such)
Fixed breaking alias issues affecting OracleDB (Oracle does NOT support the "AS" keyword)
Fixed issue #39 (partial) Added filter capabilities in error report.
Fixed issue #31 (part 2: message sent twice)
Special thanks to Theodore Pylarinos for providing extremely detailed information
that helped to haunt down the bug of downloads not being found!
Special thanks to Wade Colclough from Zuken Limited for providing excellent feedback
and willingness to put in the time and effort to help fixing issues related to Oracle DB.
Version 4.0.0 (build 2019031801)
- Added correct userid identifier on requests table so the link to the user
profile points to the correct one (extension to issue #27)
Version 4.0.0 (build 2019031800)
Small change in workflow of user requested coupons
Added mailing and notification of accepted user requested coupons
Added internal Moodle notifications
Code overhaul: nearly all logic has been rewritten for maintainability reasons.
Verified workings on Moodle 3.4 (updated version.php accordingly)
AMD modules have now properly been minified
We're NO longer "following" Moodle versions.
Thanks everyone for all feedback!
Version 3.5.2 (build 2018050306)
Fixed issue(s) with CSV/Manual recipients not working.
Coupon batches now all have the same "timecreated"
Removed sorting of "action" column in coupon overviews
Custom mail function is now replaced with Moodle's own email_to_user()
Due to MANY issues where the email containing the coupons is not received, the
decision was made to change the process to sending an email containing a
download link where the generated batch can be downloaded from instead of
providing the email with an attachment.
Fixed issue #22 (we now use TCPDF's own QR Code generator)
Added/fixed validation on "request user" configuration form
Added more information to coupons requests overview table
In line with issue 32, configuration of the enrolment duration for course type
coupons has been moved to the course selection page.
Fixed issue #35 (bug in observers)
Fixed issue #34 (feature request for zip name)
Fixed issue #32 (PDF preview)
Fixed issue #30 (request user - required field setting amount of coupons has no effect)
Fixed issue #29 (request user settings: added explanations)
Fixed issue #28 (wrong paging/view for requestusers)
Fixed issue #27 (wrong link to user profile in requestusers table)
Changed sourcecode here and there to prevent debug output/PHP notices
Removed restriction on amount of coupons when only generating the codes.
Added coupon cleanup confirmation screen.
Thanks Franky Just for your valuable feedback, bug reports and additional remarks!
Version 3.5.1 (build 2018050305)
Fixed issue #23 (invalid use of PARAM_RAW)
Fixed issue #24 (redirect vulnerabilities -> changed all to PARAM_LOCALURL)
Fixed issue #25 (removed use of deprecated function notify_problem)
Fixed some missing capability checks / security issues
Thanks Dan Marsden for your valuable feedback, bug reports and plugin review!
Thanks Jesús Rincón for raising issue #25
backported some of the issues to the Moodle 3.0+ release
NOTE: All other releases except one Moodle 3.0+ release and the most recent
Moodle 3.5+ release have been pulled.
Version 3.5.0 (build 2018050304)
- Fixed issue #21 (cohort_is_member fatal error: thanks Michael Neulinger)
Version 3.5.0 (build 2018050303)
Fixed faulty course / cohort ID filter
Added course groups filter possibilities
Added "timeclaimed" information to keep track of when coupons were actually claimed
Removed table sorting for courses/cohorts/groups (didn't work and should have never been part of the tables)
Added quick rudimentary check to validate whether a person is already "signed up" when entering a code.
(i.e. member in all linked cohorts or enrolled for all linked courses).
Thanks Kevin Freeborn for your very valuable feedback!
Version 3.5.0 (build 2018050302)
- Added possibility to only generate coupon codes (no PDFs will be generated, nor will they be sent!)
- Added batchid field to database to track generated batches of coupons
- Added custom batch naming when generating coupons (system automatically creates one if not provided)
- Added possibility to filter coupons on BATCH ID/name
Version 3.5.0 (build 2018050301)
- Changed internal signup to comply to Moodle 3.5.
- Added option global to use login page layout (which is a Moodle standard really, but wasn't enforced)
- Added coupon code error checking to signup form (refuse signup in case coupon code is invalid)
- Added coupon request possibilities (please refer to manual for usage description)
- Added global options for and display of help texts for custom signup and coupon input texts
- Added possibility to request coupons for course types only. Involves admin to configure both the courses and allowed users
- Removed deprecated verify_https_required() call from custom (internal) signup
Version 3.5.0 (build 2018050300)
- FIXED issue #15 ("mdb->get_record() found more than one record" when calling find_block_instance_id()).
- FIXED issue #19 where enrolment was never updated when using a new coupon after enrolment expired.
- Fixed "Sent" column in coupon overviews (displayed information based on wrong field)
- Added privacy provider
- Validated functionality for Moodle 3.5 onwards
- Minimum required Moodle version: 3.5
Version 3.3.2 (build 2017092503)
- Added role selection for coupons (course type only)
Version 3.3.1 (build 2017092501)
- Added coupon code to "progress report" for validation purposes (feature request)
- Added claimed user to "used coupons" overview for validation purposes (feature request)
Version 3.3.0 (build 2017092500)
- Fixed deprecated pix_url references (replaced by image_url)
- Validated functionality for Moodle 3.3 onwards
- Minimum required Moodle version: 3.3
Version 2017052402 (Release 3.0.3 (build 2017052402))
Fixed bug in cohort type coupons (fixed incorrect usercheck and cohort synchronisation)
Added option to display QR Code in PDF or leave it out.
Thanks to everyone for their valuable input and remarks.
Version 2017052401 (Release 3.0.2 (build 2017052401))
Resolved issue #14
Thanks to everyone for their valuable input and remarks.
Version 2017052400 (Release 3.0.1 (build 2017052400))
Added new type of coupon: extend (course) enrolment
Added webservices!
Incorporated some changes here and the in overviews
Thanks to everyone for their valuable input and remarks.
Version 2017050100 (Release 3.0.0 (build 2017050100))
Added $CFG->wwwroot on all moodle_urls
Added setting to choose default assigned role (resolve issue #12: Student role problem.
Roles were fetched by shortname = 'student', NOT foolproof)
Disabled sorting by 'owner' column in coupon overviews (resolve issue #13).
Fixed error notification when inserting to table block_coupon_courses
Added course name(s) to coupons
Changed default coupon template-main contents (language files)
Added filtering for progress reports
Added filtering for coupon overview
Code overhaul to comply to stricter Moodle coding standards (codechecker, Moodle phpdoc check)
Added course_deleted event handler
Added cohort_deleted event handler
Added custom cleaning of coupons
Added QR based coupon to PDF including processing
Added signup for QR based coupon when user is not logged on yet
Added possibility for signup with a coupon code (in block_coupon, when user is not yet logged in)
Added new manager to manage multiple coupon background
Added option to select coupon background to use
minimum required version: Moodle3 3.0
Thanks to everyone for their valuable input and remarks.
Version 2016040800 (Release 2.7.3 (build 2016040800))
raising memory limit and maximum execution time when generating coupons.
Fixed cleanup task
Fixed last page of wizard not displaying selected groups
Updated readme
Added ability to delete unused coupons.
Feedback and general remarks or ideas for improvement are still highly valued.
Version 2015010107 (Release 2.7.2 (build 2015010107))
Changed "max coupons" setting to textual input. No more hardcoded limit of 100 coupons.
Added delete option to unused coupons overview
Added settings and task to automatically clean up unused/unclaimed coupons
Thanks to anyone and everyone for their much valued feedback!
Version 2015010102 (Release 2.7.0 (build 2015010102))
Added missing db/tasks.php
Limited applicable_formats: block can only be used on main site page and "my" dashboard view
Improved renderer (more use of html_writer)
Fixed default setting when starting coupon generator
Included settings file in /classes/task/sendcoupons.php (gave NOTICE)
Fixed a few small (non critical) bugs
Added generatoroptions and generator for cleaner code to generate coupons.
Thanks to, a.o., David Mudrák for raising issues leading to this version.
4.2.1 (build 2022090100) (2022090100)
4.2.1 (build 2022090100)
Plugin type: Blocks
Frankenstyle component name: block_coupon
Version build number: 2022090100
Version release name: 4.2.1 (build 2022090100)
Maturity: Stable
Supported Moodle versions: 4.0
Repository URL (Git): https://github.com/sebsoftnl/moodle-block_coupon
Repository branch:
Repository tag: 4.2.1_M4xx
Issue/bug tracker URL: https://github.com/sebsoftnl/moodle-block_coupon/issues
Version 4.2.1 (build 2022090100)
- Changed dependency to Moodle 4.0+
- Added gitlab CI up to Moodle 4.1
- Removed Moodle versions up to 4.0 from gitlab CI
- Fixed date selector on cleanup page.
- Resolved MOODLE_INTERNAL checks.
- Clean up SOME unused vars.
- Removed the long deprecated "is_allowed_from_ajax()" calls in externallib.php
Version 4.2.0 (build 2020010816)
- Added exclusion of courses already enrolled for coursegrouping coupon types
- Added coursegrouping coupon types (choose x out of y courses)
- Added SPONSORS.md to specifically state our gratitude apart from mentioning them in the README.
- Special thanks goes out to eLearn Solutions with Boston Connect (a subsidiary of Boston City Campus)
as a sponsor of this plugin! - Added webservice call to claim coupon code. Bear in mind this is ONLY applicable
at the moment to course type coupons. Refinement is needed (as well as an overhaul of the plugin and services).
Version 4.1.0 (build 2021011000)
- Added tabs + settings for coupon request users (coupons / progressreport).
- Fixed #1: no QR code in the generated PDF (think this was fixed before, just confirming again)
- Fixed #4: Not possible to confirm account with self-registration auth method disabled (see Version 4.0.9 (build 2020010813); this is a workaround)
- Fixed #3: Extend webservices with enrolment period. Course coupons ONLY.
- Renderer moved to /classes/output
- 2 remaining renderer "full page reports" were now moved to their own controllers.
Version 4.0.10 (build 2020010815)
- Added font selection for PDF for more language support. RTL might still be an issue (fixed #5).
- Extended PDF preview with "current" font selection and current QR setting.
- Added clientreference field when requesting coupons.
- Coupon requests are no longer removed upon denial/approval, but marked as denied/finalized.
- Coupon requestability is now also implemented for cohorts.
- Implemented a helper to support \core_user\fields but also serve the old method (for Moodle pre 3.11)
- Removed maximum of 10 logo files, it is now set to -1 (unlimited).
Version 4.0.9.1 (build 2020010814)
- Fixed bug in new function introduced in 4.0.9.
Version 4.0.9 (build 2020010813)
- Fixed part of code checker compliance.
- Added method to allow signup, even when no signups are allowed in the site (disabled by default).
Version 4.0.8 (build 2020010810)
- Fixed error notification with usage in qr code.
- Fixed error notification(s) if coupon is already used.
Version 4.0.7 (build 2020010809)
- Fixed coupon type enrolment extension. Status is now forced to ACTIVE (Thanks Hiro Nakamura).
- Changed some language strings (EN only) so the period character does not end up outside of the containing paragraph.
Version 4.0.7 (build 2020010808)
- Fixed main assert_not_claimed function: reinstated exception
- Added component to generic error (input_coupon.php)
Version 4.0.7 (build 2020010807)
- Added task to remove cohort members (i.e. take care of cohort unenrolment).
- Fixed webservice call return for generate_coupons_for_cohorts.
- Fixed webservice call return for generate_coupons_for_course.
Version 4.0.6 (build 2020010806)
- Added autocompletes for cohort/cohort courses.
- Added user_deleted observer.
- Fixed notice (generate_pdf) on POST data (user requesting coupon; made field an advcheckbox).
- Fixed CSS issue... sigh.
- Undo previous work on user column (used coupons).
- Fix sorting on user column.
- Add sorting on owner column.
- Added user/claimed_on columns for personalised coupons.
- Fixed langstring 'coupon_notification_content'.
- Fixed get_string variables (in helper).
- Fixed "Curly brace syntax for accessing array elements and string offsets has
been deprecated in PHP 7.4. Found: $codealphabet{$n}" in codegenerator.
Version 4.0.6 (build 2020010805)
- Added INDICES to block_coupon.
Version 4.0.6 (build 2020010804)
- Changed course selection when generating coupons to auto-complete element.
- Changed cohort selection when generating coupons to auto-complete element.
- Added services.
- Added 10px whitespace between buttons in block.
- Set width of most default for elements to 75% (never EVER set to 100% due to autocomplete element).
- Modified course group selection to checkboxes.
- Added tab dedicated to personalised coupons (uses global setting to enable!).
- Add field to manipulate code size for coupons.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, funding of these changes, bug reports and beta testing.
Version 4.0.5 (build 2020010803)
- Added option to include PDF when sending personalised coupons.
- Modified (AGAIN) sending process of personal coupons.
Version 4.0.4.2 (build 2020010802)
- Changed length of batchid to 255.
Version 4.0.4.1 (build 2020010801)
- Updated privacy provider.
- Removed https verification from custom signup page.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, bug reports and beta testing.
Version 4.0.4 (build 2020010800)
- Validated Moodle 3.8
- Changed a few table implementations (fixes sorting bugs)
- Changed headers/sorting on tables for USER fields
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for donating to Moodle 3.8 validation, useful input and beta testing.
Version 4.0.3-RC1 (build 2019031805)
- Release candidate for beta testing
Version 4.0.2 (build 2019031804)
- Added ADVANCED global $CFG options to manipulate template bot output offsets.
- Fixed wrongful addition of "batchID" when adding any filter (used/unused coupon view)
- Fixed PHP notice in batchID filter
- Fixed some more Oracle table alias issues
- Fixed wrong links in notification context urls
- Added maillog tab. Still too many requests about mails not being sent, so we decided
to wrap Moodle's email_to_user method and log any debug output if relevant. - General code cleanup (as a result of Travis-CI)
Version 4.0.1 (build 2019031802)
Fixed param type on download page.
Added an overview to display downloadable batches (only scans for coupon archives in moodledata).
Added option to download from this overview.
Fixed issue #27 again (wrong link to user profile)
Fixed issue #38 again (wrong link to user profile, different view)
Fixed issue #37 (configurable button class for links; see global plugin configuration)
Fixed issue #36 (had already been done in build 2018050301, only noted here for automatic issue resolving)
Filter forms are now collapsed by default. Always expanded drove me nuts on larger filters/forms.
Fixed breaking LIMIT database issues affecting OracleDB ("LIMIT" clauses not supported as such)
Fixed breaking alias issues affecting OracleDB (Oracle does NOT support the "AS" keyword)
Fixed issue #39 (partial) Added filter capabilities in error report.
Fixed issue #31 (part 2: message sent twice)
Special thanks to Theodore Pylarinos for providing extremely detailed information
that helped to haunt down the bug of downloads not being found!
Special thanks to Wade Colclough from Zuken Limited for providing excellent feedback
and willingness to put in the time and effort to help fixing issues related to Oracle DB.
Version 4.0.0 (build 2019031801)
- Added correct userid identifier on requests table so the link to the user
profile points to the correct one (extension to issue #27)
Version 4.0.0 (build 2019031800)
Small change in workflow of user requested coupons
Added mailing and notification of accepted user requested coupons
Added internal Moodle notifications
Code overhaul: nearly all logic has been rewritten for maintainability reasons.
Verified workings on Moodle 3.4 (updated version.php accordingly)
AMD modules have now properly been minified
We're NO longer "following" Moodle versions.
Thanks everyone for all feedback!
Version 3.5.2 (build 2018050306)
Fixed issue(s) with CSV/Manual recipients not working.
Coupon batches now all have the same "timecreated"
Removed sorting of "action" column in coupon overviews
Custom mail function is now replaced with Moodle's own email_to_user()
Due to MANY issues where the email containing the coupons is not received, the
decision was made to change the process to sending an email containing a
download link where the generated batch can be downloaded from instead of
providing the email with an attachment.
Fixed issue #22 (we now use TCPDF's own QR Code generator)
Added/fixed validation on "request user" configuration form
Added more information to coupons requests overview table
In line with issue 32, configuration of the enrolment duration for course type
coupons has been moved to the course selection page.
Fixed issue #35 (bug in observers)
Fixed issue #34 (feature request for zip name)
Fixed issue #32 (PDF preview)
Fixed issue #30 (request user - required field setting amount of coupons has no effect)
Fixed issue #29 (request user settings: added explanations)
Fixed issue #28 (wrong paging/view for requestusers)
Fixed issue #27 (wrong link to user profile in requestusers table)
Changed sourcecode here and there to prevent debug output/PHP notices
Removed restriction on amount of coupons when only generating the codes.
Added coupon cleanup confirmation screen.
Thanks Franky Just for your valuable feedback, bug reports and additional remarks!
Version 3.5.1 (build 2018050305)
Fixed issue #23 (invalid use of PARAM_RAW)
Fixed issue #24 (redirect vulnerabilities -> changed all to PARAM_LOCALURL)
Fixed issue #25 (removed use of deprecated function notify_problem)
Fixed some missing capability checks / security issues
Thanks Dan Marsden for your valuable feedback, bug reports and plugin review!
Thanks Jesús Rincón for raising issue #25
backported some of the issues to the Moodle 3.0+ release
NOTE: All other releases except one Moodle 3.0+ release and the most recent
Moodle 3.5+ release have been pulled.
Version 3.5.0 (build 2018050304)
- Fixed issue #21 (cohort_is_member fatal error: thanks Michael Neulinger)
Version 3.5.0 (build 2018050303)
Fixed faulty course / cohort ID filter
Added course groups filter possibilities
Added "timeclaimed" information to keep track of when coupons were actually claimed
Removed table sorting for courses/cohorts/groups (didn't work and should have never been part of the tables)
Added quick rudimentary check to validate whether a person is already "signed up" when entering a code.
(i.e. member in all linked cohorts or enrolled for all linked courses).
Thanks Kevin Freeborn for your very valuable feedback!
Version 3.5.0 (build 2018050302)
- Added possibility to only generate coupon codes (no PDFs will be generated, nor will they be sent!)
- Added batchid field to database to track generated batches of coupons
- Added custom batch naming when generating coupons (system automatically creates one if not provided)
- Added possibility to filter coupons on BATCH ID/name
Version 3.5.0 (build 2018050301)
- Changed internal signup to comply to Moodle 3.5.
- Added option global to use login page layout (which is a Moodle standard really, but wasn't enforced)
- Added coupon code error checking to signup form (refuse signup in case coupon code is invalid)
- Added coupon request possibilities (please refer to manual for usage description)
- Added global options for and display of help texts for custom signup and coupon input texts
- Added possibility to request coupons for course types only. Involves admin to configure both the courses and allowed users
- Removed deprecated verify_https_required() call from custom (internal) signup
Version 3.5.0 (build 2018050300)
- FIXED issue #15 ("mdb->get_record() found more than one record" when calling find_block_instance_id()).
- FIXED issue #19 where enrolment was never updated when using a new coupon after enrolment expired.
- Fixed "Sent" column in coupon overviews (displayed information based on wrong field)
- Added privacy provider
- Validated functionality for Moodle 3.5 onwards
- Minimum required Moodle version: 3.5
Version 3.3.2 (build 2017092503)
- Added role selection for coupons (course type only)
Version 3.3.1 (build 2017092501)
- Added coupon code to "progress report" for validation purposes (feature request)
- Added claimed user to "used coupons" overview for validation purposes (feature request)
Version 3.3.0 (build 2017092500)
- Fixed deprecated pix_url references (replaced by image_url)
- Validated functionality for Moodle 3.3 onwards
- Minimum required Moodle version: 3.3
Version 2017052402 (Release 3.0.3 (build 2017052402))
Fixed bug in cohort type coupons (fixed incorrect usercheck and cohort synchronisation)
Added option to display QR Code in PDF or leave it out.
Thanks to everyone for their valuable input and remarks.
Version 2017052401 (Release 3.0.2 (build 2017052401))
Resolved issue #14
Thanks to everyone for their valuable input and remarks.
Version 2017052400 (Release 3.0.1 (build 2017052400))
Added new type of coupon: extend (course) enrolment
Added webservices!
Incorporated some changes here and the in overviews
Thanks to everyone for their valuable input and remarks.
Version 2017050100 (Release 3.0.0 (build 2017050100))
Added $CFG->wwwroot on all moodle_urls
Added setting to choose default assigned role (resolve issue #12: Student role problem.
Roles were fetched by shortname = 'student', NOT foolproof)
Disabled sorting by 'owner' column in coupon overviews (resolve issue #13).
Fixed error notification when inserting to table block_coupon_courses
Added course name(s) to coupons
Changed default coupon template-main contents (language files)
Added filtering for progress reports
Added filtering for coupon overview
Code overhaul to comply to stricter Moodle coding standards (codechecker, Moodle phpdoc check)
Added course_deleted event handler
Added cohort_deleted event handler
Added custom cleaning of coupons
Added QR based coupon to PDF including processing
Added signup for QR based coupon when user is not logged on yet
Added possibility for signup with a coupon code (in block_coupon, when user is not yet logged in)
Added new manager to manage multiple coupon background
Added option to select coupon background to use
minimum required version: Moodle3 3.0
Thanks to everyone for their valuable input and remarks.
Version 2016040800 (Release 2.7.3 (build 2016040800))
raising memory limit and maximum execution time when generating coupons.
Fixed cleanup task
Fixed last page of wizard not displaying selected groups
Updated readme
Added ability to delete unused coupons.
Feedback and general remarks or ideas for improvement are still highly valued.
Version 2015010107 (Release 2.7.2 (build 2015010107))
Changed "max coupons" setting to textual input. No more hardcoded limit of 100 coupons.
Added delete option to unused coupons overview
Added settings and task to automatically clean up unused/unclaimed coupons
Thanks to anyone and everyone for their much valued feedback!
Version 2015010102 (Release 2.7.0 (build 2015010102))
Added missing db/tasks.php
Limited applicable_formats: block can only be used on main site page and "my" dashboard view
Improved renderer (more use of html_writer)
Fixed default setting when starting coupon generator
Included settings file in /classes/task/sendcoupons.php (gave NOTICE)
Fixed a few small (non critical) bugs
Added generatoroptions and generator for cleaner code to generate coupons.
Thanks to, a.o., David Mudrák for raising issues leading to this version.
4.2.1-Moodle_310_311 (build 2022073100) (2022073100)
4.2.1-Moodle_310_311 (build 2022073100)
Plugin type: Blocks
Frankenstyle component name: block_coupon
Version build number: 2022073100
Version release name: 4.2.1-Moodle_310_311 (build 2022073100)
Maturity: Stable
Supported Moodle versions: 3.10, 3.11
Repository URL (Git): https://github.com/sebsoftnl/moodle-block_coupon
Repository branch:
Repository tag: 4.2.1_M310_311
Issue/bug tracker URL: https://github.com/sebsoftnl/moodle-block_coupon/issues
Version 4.2.1 (build 2022080100)
- Changed dependency to Moodle 3.10+
- Added gitlab CI up to Moodle 4.2
- Removed Moodle 3.5 up to 3.9 Moodle from gitlab CI
- Fixed date selector on cleanup page.
- Fix a range of PHPCS issues (not resolving "Unexpected MOODLE_INTERNAL check" yet).
Version 4.2.0 (build 2020010816)
- Added exclusion of courses already enrolled for coursegrouping coupon types
- Added coursegrouping coupon types (choose x out of y courses)
- Added SPONSORS.md to specifically state our gratitude apart from mentioning them in the README.
- Special thanks goes out to eLearn Solutions with Boston Connect (a subsidiary of Boston City Campus)
as a sponsor of this plugin! - Added webservice call to claim coupon code. Bear in mind this is ONLY applicable
at the moment to course type coupons. Refinement is needed (as well as an overhaul of the plugin and services).
Version 4.1.0 (build 2021011000)
- Added tabs + settings for coupon request users (coupons / progressreport).
- Fixed #1: no QR code in the generated PDF (think this was fixed before, just confirming again)
- Fixed #4: Not possible to confirm account with self-registration auth method disabled (see Version 4.0.9 (build 2020010813); this is a workaround)
- Fixed #3: Extend webservices with enrolment period. Course coupons ONLY.
- Renderer moved to /classes/output
- 2 remaining renderer "full page reports" were now moved to their own controllers.
Version 4.0.10 (build 2020010815)
- Added font selection for PDF for more language support. RTL might still be an issue (fixed #5).
- Extended PDF preview with "current" font selection and current QR setting.
- Added clientreference field when requesting coupons.
- Coupon requests are no longer removed upon denial/approval, but marked as denied/finalized.
- Coupon requestability is now also implemented for cohorts.
- Implemented a helper to support \core_user\fields but also serve the old method (for Moodle pre 3.11)
- Removed maximum of 10 logo files, it is now set to -1 (unlimited).
Version 4.0.9.1 (build 2020010814)
- Fixed bug in new function introduced in 4.0.9.
Version 4.0.9 (build 2020010813)
- Fixed part of code checker compliance.
- Added method to allow signup, even when no signups are allowed in the site (disabled by default).
Version 4.0.8 (build 2020010810)
- Fixed error notification with usage in qr code.
- Fixed error notification(s) if coupon is already used.
Version 4.0.7 (build 2020010809)
- Fixed coupon type enrolment extension. Status is now forced to ACTIVE (Thanks Hiro Nakamura).
- Changed some language strings (EN only) so the period character does not end up outside of the containing paragraph.
Version 4.0.7 (build 2020010808)
- Fixed main assert_not_claimed function: reinstated exception
- Added component to generic error (input_coupon.php)
Version 4.0.7 (build 2020010807)
- Added task to remove cohort members (i.e. take care of cohort unenrolment).
- Fixed webservice call return for generate_coupons_for_cohorts.
- Fixed webservice call return for generate_coupons_for_course.
Version 4.0.6 (build 2020010806)
- Added autocompletes for cohort/cohort courses.
- Added user_deleted observer.
- Fixed notice (generate_pdf) on POST data (user requesting coupon; made field an advcheckbox).
- Fixed CSS issue... sigh.
- Undo previous work on user column (used coupons).
- Fix sorting on user column.
- Add sorting on owner column.
- Added user/claimed_on columns for personalised coupons.
- Fixed langstring 'coupon_notification_content'.
- Fixed get_string variables (in helper).
- Fixed "Curly brace syntax for accessing array elements and string offsets has
been deprecated in PHP 7.4. Found: $codealphabet{$n}" in codegenerator.
Version 4.0.6 (build 2020010805)
- Added INDICES to block_coupon.
Version 4.0.6 (build 2020010804)
- Changed course selection when generating coupons to auto-complete element.
- Changed cohort selection when generating coupons to auto-complete element.
- Added services.
- Added 10px whitespace between buttons in block.
- Set width of most default for elements to 75% (never EVER set to 100% due to autocomplete element).
- Modified course group selection to checkboxes.
- Added tab dedicated to personalised coupons (uses global setting to enable!).
- Add field to manipulate code size for coupons.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, funding of these changes, bug reports and beta testing.
Version 4.0.5 (build 2020010803)
- Added option to include PDF when sending personalised coupons.
- Modified (AGAIN) sending process of personal coupons.
Version 4.0.4.2 (build 2020010802)
- Changed length of batchid to 255.
Version 4.0.4.1 (build 2020010801)
- Updated privacy provider.
- Removed https verification from custom signup page.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, bug reports and beta testing.
Version 4.0.4 (build 2020010800)
- Validated Moodle 3.8
- Changed a few table implementations (fixes sorting bugs)
- Changed headers/sorting on tables for USER fields
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for donating to Moodle 3.8 validation, useful input and beta testing.
Version 4.0.3-RC1 (build 2019031805)
- Release candidate for beta testing
Version 4.0.2 (build 2019031804)
- Added ADVANCED global $CFG options to manipulate template bot output offsets.
- Fixed wrongful addition of "batchID" when adding any filter (used/unused coupon view)
- Fixed PHP notice in batchID filter
- Fixed some more Oracle table alias issues
- Fixed wrong links in notification context urls
- Added maillog tab. Still too many requests about mails not being sent, so we decided
to wrap Moodle's email_to_user method and log any debug output if relevant. - General code cleanup (as a result of Travis-CI)
Version 4.0.1 (build 2019031802)
Fixed param type on download page.
Added an overview to display downloadable batches (only scans for coupon archives in moodledata).
Added option to download from this overview.
Fixed issue #27 again (wrong link to user profile)
Fixed issue #38 again (wrong link to user profile, different view)
Fixed issue #37 (configurable button class for links; see global plugin configuration)
Fixed issue #36 (had already been done in build 2018050301, only noted here for automatic issue resolving)
Filter forms are now collapsed by default. Always expanded drove me nuts on larger filters/forms.
Fixed breaking LIMIT database issues affecting OracleDB ("LIMIT" clauses not supported as such)
Fixed breaking alias issues affecting OracleDB (Oracle does NOT support the "AS" keyword)
Fixed issue #39 (partial) Added filter capabilities in error report.
Fixed issue #31 (part 2: message sent twice)
Special thanks to Theodore Pylarinos for providing extremely detailed information
that helped to haunt down the bug of downloads not being found!
Special thanks to Wade Colclough from Zuken Limited for providing excellent feedback
and willingness to put in the time and effort to help fixing issues related to Oracle DB.
Version 4.0.0 (build 2019031801)
- Added correct userid identifier on requests table so the link to the user
profile points to the correct one (extension to issue #27)
Version 4.0.0 (build 2019031800)
Small change in workflow of user requested coupons
Added mailing and notification of accepted user requested coupons
Added internal Moodle notifications
Code overhaul: nearly all logic has been rewritten for maintainability reasons.
Verified workings on Moodle 3.4 (updated version.php accordingly)
AMD modules have now properly been minified
We're NO longer "following" Moodle versions.
Thanks everyone for all feedback!
Version 3.5.2 (build 2018050306)
Fixed issue(s) with CSV/Manual recipients not working.
Coupon batches now all have the same "timecreated"
Removed sorting of "action" column in coupon overviews
Custom mail function is now replaced with Moodle's own email_to_user()
Due to MANY issues where the email containing the coupons is not received, the
decision was made to change the process to sending an email containing a
download link where the generated batch can be downloaded from instead of
providing the email with an attachment.
Fixed issue #22 (we now use TCPDF's own QR Code generator)
Added/fixed validation on "request user" configuration form
Added more information to coupons requests overview table
In line with issue 32, configuration of the enrolment duration for course type
coupons has been moved to the course selection page.
Fixed issue #35 (bug in observers)
Fixed issue #34 (feature request for zip name)
Fixed issue #32 (PDF preview)
Fixed issue #30 (request user - required field setting amount of coupons has no effect)
Fixed issue #29 (request user settings: added explanations)
Fixed issue #28 (wrong paging/view for requestusers)
Fixed issue #27 (wrong link to user profile in requestusers table)
Changed sourcecode here and there to prevent debug output/PHP notices
Removed restriction on amount of coupons when only generating the codes.
Added coupon cleanup confirmation screen.
Thanks Franky Just for your valuable feedback, bug reports and additional remarks!
Version 3.5.1 (build 2018050305)
Fixed issue #23 (invalid use of PARAM_RAW)
Fixed issue #24 (redirect vulnerabilities -> changed all to PARAM_LOCALURL)
Fixed issue #25 (removed use of deprecated function notify_problem)
Fixed some missing capability checks / security issues
Thanks Dan Marsden for your valuable feedback, bug reports and plugin review!
Thanks Jesús Rincón for raising issue #25
backported some of the issues to the Moodle 3.0+ release
NOTE: All other releases except one Moodle 3.0+ release and the most recent
Moodle 3.5+ release have been pulled.
Version 3.5.0 (build 2018050304)
- Fixed issue #21 (cohort_is_member fatal error: thanks Michael Neulinger)
Version 3.5.0 (build 2018050303)
Fixed faulty course / cohort ID filter
Added course groups filter possibilities
Added "timeclaimed" information to keep track of when coupons were actually claimed
Removed table sorting for courses/cohorts/groups (didn't work and should have never been part of the tables)
Added quick rudimentary check to validate whether a person is already "signed up" when entering a code.
(i.e. member in all linked cohorts or enrolled for all linked courses).
Thanks Kevin Freeborn for your very valuable feedback!
Version 3.5.0 (build 2018050302)
- Added possibility to only generate coupon codes (no PDFs will be generated, nor will they be sent!)
- Added batchid field to database to track generated batches of coupons
- Added custom batch naming when generating coupons (system automatically creates one if not provided)
- Added possibility to filter coupons on BATCH ID/name
Version 3.5.0 (build 2018050301)
- Changed internal signup to comply to Moodle 3.5.
- Added option global to use login page layout (which is a Moodle standard really, but wasn't enforced)
- Added coupon code error checking to signup form (refuse signup in case coupon code is invalid)
- Added coupon request possibilities (please refer to manual for usage description)
- Added global options for and display of help texts for custom signup and coupon input texts
- Added possibility to request coupons for course types only. Involves admin to configure both the courses and allowed users
- Removed deprecated verify_https_required() call from custom (internal) signup
Version 3.5.0 (build 2018050300)
- FIXED issue #15 ("mdb->get_record() found more than one record" when calling find_block_instance_id()).
- FIXED issue #19 where enrolment was never updated when using a new coupon after enrolment expired.
- Fixed "Sent" column in coupon overviews (displayed information based on wrong field)
- Added privacy provider
- Validated functionality for Moodle 3.5 onwards
- Minimum required Moodle version: 3.5
Version 3.3.2 (build 2017092503)
- Added role selection for coupons (course type only)
Version 3.3.1 (build 2017092501)
- Added coupon code to "progress report" for validation purposes (feature request)
- Added claimed user to "used coupons" overview for validation purposes (feature request)
Version 3.3.0 (build 2017092500)
- Fixed deprecated pix_url references (replaced by image_url)
- Validated functionality for Moodle 3.3 onwards
- Minimum required Moodle version: 3.3
Version 2017052402 (Release 3.0.3 (build 2017052402))
Fixed bug in cohort type coupons (fixed incorrect usercheck and cohort synchronisation)
Added option to display QR Code in PDF or leave it out.
Thanks to everyone for their valuable input and remarks.
Version 2017052401 (Release 3.0.2 (build 2017052401))
Resolved issue #14
Thanks to everyone for their valuable input and remarks.
Version 2017052400 (Release 3.0.1 (build 2017052400))
Added new type of coupon: extend (course) enrolment
Added webservices!
Incorporated some changes here and the in overviews
Thanks to everyone for their valuable input and remarks.
Version 2017050100 (Release 3.0.0 (build 2017050100))
Added $CFG->wwwroot on all moodle_urls
Added setting to choose default assigned role (resolve issue #12: Student role problem.
Roles were fetched by shortname = 'student', NOT foolproof)
Disabled sorting by 'owner' column in coupon overviews (resolve issue #13).
Fixed error notification when inserting to table block_coupon_courses
Added course name(s) to coupons
Changed default coupon template-main contents (language files)
Added filtering for progress reports
Added filtering for coupon overview
Code overhaul to comply to stricter Moodle coding standards (codechecker, Moodle phpdoc check)
Added course_deleted event handler
Added cohort_deleted event handler
Added custom cleaning of coupons
Added QR based coupon to PDF including processing
Added signup for QR based coupon when user is not logged on yet
Added possibility for signup with a coupon code (in block_coupon, when user is not yet logged in)
Added new manager to manage multiple coupon background
Added option to select coupon background to use
minimum required version: Moodle3 3.0
Thanks to everyone for their valuable input and remarks.
Version 2016040800 (Release 2.7.3 (build 2016040800))
raising memory limit and maximum execution time when generating coupons.
Fixed cleanup task
Fixed last page of wizard not displaying selected groups
Updated readme
Added ability to delete unused coupons.
Feedback and general remarks or ideas for improvement are still highly valued.
Version 2015010107 (Release 2.7.2 (build 2015010107))
Changed "max coupons" setting to textual input. No more hardcoded limit of 100 coupons.
Added delete option to unused coupons overview
Added settings and task to automatically clean up unused/unclaimed coupons
Thanks to anyone and everyone for their much valued feedback!
Version 2015010102 (Release 2.7.0 (build 2015010102))
Added missing db/tasks.php
Limited applicable_formats: block can only be used on main site page and "my" dashboard view
Improved renderer (more use of html_writer)
Fixed default setting when starting coupon generator
Included settings file in /classes/task/sendcoupons.php (gave NOTICE)
Fixed a few small (non critical) bugs
Added generatoroptions and generator for cleaner code to generate coupons.
Thanks to, a.o., David Mudrák for raising issues leading to this version.
4.0.9.1 (build 2020010814) (2020010814)
4.0.9.1 (build 2020010814)
Plugin type: Blocks
Frankenstyle component name: block_coupon
Version build number: 2020010814
Version release name: 4.0.9.1 (build 2020010814)
Maturity: Stable
Supported Moodle versions: 3.10, 3.11, 3.5, 3.6, 3.7, 3.8, 3.9
Repository URL (Git): https://github.com/sebsoftnl/moodle-block_coupon
Repository branch:
Repository tag:
Issue/bug tracker URL: https://github.com/sebsoftnl/moodle-block_coupon/issues
Version 4.0.9.1 (build 2020010814)
- Fixed bug in new function introduced in 4.0.9.
Version 4.0.9 (build 2020010813)
- Fixed part of code checker compliance.
- Added method to allow signup, even when no signups are allowed in the site (disabled by default).
Version 4.0.8 (build 2020010810)
- Fixed error notification with usage in qr code.
- Fixed error notification(s) if coupon is already used.
Version 4.0.7 (build 2020010809)
- Fixed coupon type enrolment extension. Status is now forced to ACTIVE (Thanks Hiro Nakamura).
- Changed some language strings (EN only) so the period character does not end up outside of the containing paragraph.
Version 4.0.7 (build 2020010808)
- Fixed main assert_not_claimed function: reinstated exception
- Added component to generic error (input_coupon.php)
Version 4.0.7 (build 2020010807)
- Added task to remove cohort members (i.e. take care of cohort unenrolment).
- Fixed webservice call return for generate_coupons_for_cohorts.
- Fixed webservice call return for generate_coupons_for_course.
Version 4.0.6 (build 2020010806)
- Added autocompletes for cohort/cohort courses.
- Added user_deleted observer.
- Fixed notice (generate_pdf) on POST data (user requesting coupon; made field an advcheckbox).
- Fixed CSS issue... sigh.
- Undo previous work on user column (used coupons).
- Fix sorting on user column.
- Add sorting on owner column.
- Added user/claimed_on columns for personalised coupons.
- Fixed langstring 'coupon_notification_content'.
- Fixed get_string variables (in helper).
- Fixed "Curly brace syntax for accessing array elements and string offsets has
been deprecated in PHP 7.4. Found: $codealphabet{$n}" in codegenerator.
Version 4.0.6 (build 2020010805)
- Added INDICES to block_coupon.
Version 4.0.6 (build 2020010804)
- Changed course selection when generating coupons to auto-complete element.
- Changed cohort selection when generating coupons to auto-complete element.
- Added services.
- Added 10px whitespace between buttons in block.
- Set width of most default for elements to 75% (never EVER set to 100% due to autocomplete element).
- Modified course group selection to checkboxes.
- Added tab dedicated to personalised coupons (uses global setting to enable!).
- Add field to manipulate code size for coupons.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, funding of these changes, bug reports and beta testing.
Version 4.0.5 (build 2020010803)
- Added option to include PDF when sending personalised coupons.
- Modified (AGAIN) sending process of personal coupons.
Version 4.0.4.2 (build 2020010802)
- Changed length of batchid to 255.
Version 4.0.4.1 (build 2020010801)
- Updated privacy provider.
- Removed https verification from custom signup page.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, bug reports and beta testing.
Version 4.0.4 (build 2020010800)
- Validated Moodle 3.8
- Changed a few table implementations (fixes sorting bugs)
- Changed headers/sorting on tables for USER fields
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for donating to Moodle 3.8 validation, useful input and beta testing.
Version 4.0.3-RC1 (build 2019031805)
- Release candidate for beta testing
Version 4.0.2 (build 2019031804)
- Added ADVANCED global $CFG options to manipulate template bot output offsets.
- Fixed wrongful addition of "batchID" when adding any filter (used/unused coupon view)
- Fixed PHP notice in batchID filter
- Fixed some more Oracle table alias issues
- Fixed wrong links in notification context urls
- Added maillog tab. Still too many requests about mails not being sent, so we decided
to wrap Moodle's email_to_user method and log any debug output if relevant. - General code cleanup (as a result of Travis-CI)
Version 4.0.1 (build 2019031802)
Fixed param type on download page.
Added an overview to display downloadable batches (only scans for coupon archives in moodledata).
Added option to download from this overview.
Fixed issue #27 again (wrong link to user profile)
Fixed issue #38 again (wrong link to user profile, different view)
Fixed issue #37 (configurable button class for links; see global plugin configuration)
Fixed issue #36 (had already been done in build 2018050301, only noted here for automatic issue resolving)
Filter forms are now collapsed by default. Always expanded drove me nuts on larger filters/forms.
Fixed breaking LIMIT database issues affecting OracleDB ("LIMIT" clauses not supported as such)
Fixed breaking alias issues affecting OracleDB (Oracle does NOT support the "AS" keyword)
Fixed issue #39 (partial) Added filter capabilities in error report.
Fixed issue #31 (part 2: message sent twice)
Special thanks to Theodore Pylarinos for providing extremely detailed information
that helped to haunt down the bug of downloads not being found!
Special thanks to Wade Colclough from Zuken Limited for providing excellent feedback
and willingness to put in the time and effort to help fixing issues related to Oracle DB.
Version 4.0.0 (build 2019031801)
- Added correct userid identifier on requests table so the link to the user
profile points to the correct one (extension to issue #27)
Version 4.0.0 (build 2019031800)
Small change in workflow of user requested coupons
Added mailing and notification of accepted user requested coupons
Added internal Moodle notifications
Code overhaul: nearly all logic has been rewritten for maintainability reasons.
Verified workings on Moodle 3.4 (updated version.php accordingly)
AMD modules have now properly been minified
We're NO longer "following" Moodle versions.
Thanks everyone for all feedback!
Version 3.5.2 (build 2018050306)
Fixed issue(s) with CSV/Manual recipients not working.
Coupon batches now all have the same "timecreated"
Removed sorting of "action" column in coupon overviews
Custom mail function is now replaced with Moodle's own email_to_user()
Due to MANY issues where the email containing the coupons is not received, the
decision was made to change the process to sending an email containing a
download link where the generated batch can be downloaded from instead of
providing the email with an attachment.
Fixed issue #22 (we now use TCPDF's own QR Code generator)
Added/fixed validation on "request user" configuration form
Added more information to coupons requests overview table
In line with issue 32, configuration of the enrolment duration for course type
coupons has been moved to the course selection page.
Fixed issue #35 (bug in observers)
Fixed issue #34 (feature request for zip name)
Fixed issue #32 (PDF preview)
Fixed issue #30 (request user - required field setting amount of coupons has no effect)
Fixed issue #29 (request user settings: added explanations)
Fixed issue #28 (wrong paging/view for requestusers)
Fixed issue #27 (wrong link to user profile in requestusers table)
Changed sourcecode here and there to prevent debug output/PHP notices
Removed restriction on amount of coupons when only generating the codes.
Added coupon cleanup confirmation screen.
Thanks Franky Just for your valuable feedback, bug reports and additional remarks!
Version 3.5.1 (build 2018050305)
Fixed issue #23 (invalid use of PARAM_RAW)
Fixed issue #24 (redirect vulnerabilities -> changed all to PARAM_LOCALURL)
Fixed issue #25 (removed use of deprecated function notify_problem)
Fixed some missing capability checks / security issues
Thanks Dan Marsden for your valuable feedback, bug reports and plugin review!
Thanks Jesús Rincón for raising issue #25
backported some of the issues to the Moodle 3.0+ release
NOTE: All other releases except one Moodle 3.0+ release and the most recent
Moodle 3.5+ release have been pulled.
Version 3.5.0 (build 2018050304)
- Fixed issue #21 (cohort_is_member fatal error: thanks Michael Neulinger)
Version 3.5.0 (build 2018050303)
Fixed faulty course / cohort ID filter
Added course groups filter possibilities
Added "timeclaimed" information to keep track of when coupons were actually claimed
Removed table sorting for courses/cohorts/groups (didn't work and should have never been part of the tables)
Added quick rudimentary check to validate whether a person is already "signed up" when entering a code.
(i.e. member in all linked cohorts or enrolled for all linked courses).
Thanks Kevin Freeborn for your very valuable feedback!
Version 3.5.0 (build 2018050302)
- Added possibility to only generate coupon codes (no PDFs will be generated, nor will they be sent!)
- Added batchid field to database to track generated batches of coupons
- Added custom batch naming when generating coupons (system automatically creates one if not provided)
- Added possibility to filter coupons on BATCH ID/name
Version 3.5.0 (build 2018050301)
- Changed internal signup to comply to Moodle 3.5.
- Added option global to use login page layout (which is a Moodle standard really, but wasn't enforced)
- Added coupon code error checking to signup form (refuse signup in case coupon code is invalid)
- Added coupon request possibilities (please refer to manual for usage description)
- Added global options for and display of help texts for custom signup and coupon input texts
- Added possibility to request coupons for course types only. Involves admin to configure both the courses and allowed users
- Removed deprecated verify_https_required() call from custom (internal) signup
Version 3.5.0 (build 2018050300)
- FIXED issue #15 ("mdb->get_record() found more than one record" when calling find_block_instance_id()).
- FIXED issue #19 where enrolment was never updated when using a new coupon after enrolment expired.
- Fixed "Sent" column in coupon overviews (displayed information based on wrong field)
- Added privacy provider
- Validated functionality for Moodle 3.5 onwards
- Minimum required Moodle version: 3.5
Version 3.3.2 (build 2017092503)
- Added role selection for coupons (course type only)
Version 3.3.1 (build 2017092501)
- Added coupon code to "progress report" for validation purposes (feature request)
- Added claimed user to "used coupons" overview for validation purposes (feature request)
Version 3.3.0 (build 2017092500)
- Fixed deprecated pix_url references (replaced by image_url)
- Validated functionality for Moodle 3.3 onwards
- Minimum required Moodle version: 3.3
Version 2017052402 (Release 3.0.3 (build 2017052402))
Fixed bug in cohort type coupons (fixed incorrect usercheck and cohort synchronisation)
Added option to display QR Code in PDF or leave it out.
Thanks to everyone for their valuable input and remarks.
Version 2017052401 (Release 3.0.2 (build 2017052401))
Resolved issue #14
Thanks to everyone for their valuable input and remarks.
Version 2017052400 (Release 3.0.1 (build 2017052400))
Added new type of coupon: extend (course) enrolment
Added webservices!
Incorporated some changes here and the in overviews
Thanks to everyone for their valuable input and remarks.
Version 2017050100 (Release 3.0.0 (build 2017050100))
Added $CFG->wwwroot on all moodle_urls
Added setting to choose default assigned role (resolve issue #12: Student role problem.
Roles were fetched by shortname = 'student', NOT foolproof)
Disabled sorting by 'owner' column in coupon overviews (resolve issue #13).
Fixed error notification when inserting to table block_coupon_courses
Added course name(s) to coupons
Changed default coupon template-main contents (language files)
Added filtering for progress reports
Added filtering for coupon overview
Code overhaul to comply to stricter Moodle coding standards (codechecker, Moodle phpdoc check)
Added course_deleted event handler
Added cohort_deleted event handler
Added custom cleaning of coupons
Added QR based coupon to PDF including processing
Added signup for QR based coupon when user is not logged on yet
Added possibility for signup with a coupon code (in block_coupon, when user is not yet logged in)
Added new manager to manage multiple coupon background
Added option to select coupon background to use
minimum required version: Moodle3 3.0
Thanks to everyone for their valuable input and remarks.
Version 2016040800 (Release 2.7.3 (build 2016040800))
raising memory limit and maximum execution time when generating coupons.
Fixed cleanup task
Fixed last page of wizard not displaying selected groups
Updated readme
Added ability to delete unused coupons.
Feedback and general remarks or ideas for improvement are still highly valued.
Version 2015010107 (Release 2.7.2 (build 2015010107))
Changed "max coupons" setting to textual input. No more hardcoded limit of 100 coupons.
Added delete option to unused coupons overview
Added settings and task to automatically clean up unused/unclaimed coupons
Thanks to anyone and everyone for their much valued feedback!
Version 2015010102 (Release 2.7.0 (build 2015010102))
Added missing db/tasks.php
Limited applicable_formats: block can only be used on main site page and "my" dashboard view
Improved renderer (more use of html_writer)
Fixed default setting when starting coupon generator
Included settings file in /classes/task/sendcoupons.php (gave NOTICE)
Fixed a few small (non critical) bugs
Added generatoroptions and generator for cleaner code to generate coupons.
Thanks to, a.o., David Mudrák for raising issues leading to this version.
4.0.7 (build 2020010807) (2020010807)
4.0.7 (build 2020010807)
Plugin type: Blocks
Frankenstyle component name: block_coupon
Version build number: 2020010807
Version release name: 4.0.7 (build 2020010807)
Maturity: Stable
Supported Moodle versions: 3.10, 3.11, 3.5, 3.6, 3.7, 3.8, 3.9
Repository URL (Git): https://github.com/sebsoftnl/moodle-block_coupon
Repository branch:
Repository tag:
Issue/bug tracker URL: https://github.com/sebsoftnl/moodle-block_coupon/issues
Version 4.0.7 (build 2020010807)
- Added task to remove cohort members (i.e. take care of cohort unenrolment).
- Fixed webservice call return for generate_coupons_for_cohorts.
- Fixed webservice call return for generate_coupons_for_course.
Version 4.0.6 (build 2020010806)
- Added autocompletes for cohort/cohort courses.
- Added user_deleted observer.
- Fixed notice (generate_pdf) on POST data (user requesting coupon; made field an advcheckbox).
- Fixed CSS issue... sigh.
- Undo previous work on user column (used coupons).
- Fix sorting on user column.
- Add sorting on owner column.
- Added user/claimed_on columns for personalised coupons.
- Fixed langstring 'coupon_notification_content'.
- Fixed get_string variables (in helper).
- Fixed "Curly brace syntax for accessing array elements and string offsets has
been deprecated in PHP 7.4. Found: $codealphabet{$n}" in codegenerator.
Version 4.0.6 (build 2020010805)
- Added INDICES to block_coupon.
Version 4.0.6 (build 2020010804)
- Changed course selection when generating coupons to auto-complete element.
- Changed cohort selection when generating coupons to auto-complete element.
- Added services.
- Added 10px whitespace between buttons in block.
- Set width of most default for elements to 75% (never EVER set to 100% due to autocomplete element).
- Modified course group selection to checkboxes.
- Added tab dedicated to personalised coupons (uses global setting to enable!).
- Add field to manipulate code size for coupons.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, funding of these changes, bug reports and beta testing.
Version 4.0.5 (build 2020010803)
- Added option to include PDF when sending personalised coupons.
- Modified (AGAIN) sending process of personal coupons.
Version 4.0.4.2 (build 2020010802)
- Changed length of batchid to 255.
Version 4.0.4.1 (build 2020010801)
- Updated privacy provider.
- Removed https verification from custom signup page.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, bug reports and beta testing.
Version 4.0.4 (build 2020010800)
- Validated Moodle 3.8
- Changed a few table implementations (fixes sorting bugs)
- Changed headers/sorting on tables for USER fields
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for donating to Moodle 3.8 validation, useful input and beta testing.
Version 4.0.3-RC1 (build 2019031805)
- Release candidate for beta testing
Version 4.0.2 (build 2019031804)
- Added ADVANCED global $CFG options to manipulate template bot output offsets.
- Fixed wrongful addition of "batchID" when adding any filter (used/unused coupon view)
- Fixed PHP notice in batchID filter
- Fixed some more Oracle table alias issues
- Fixed wrong links in notification context urls
- Added maillog tab. Still too many requests about mails not being sent, so we decided
to wrap Moodle's email_to_user method and log any debug output if relevant. - General code cleanup (as a result of Travis-CI)
Version 4.0.1 (build 2019031802)
Fixed param type on download page.
Added an overview to display downloadable batches (only scans for coupon archives in moodledata).
Added option to download from this overview.
Fixed issue #27 again (wrong link to user profile)
Fixed issue #38 again (wrong link to user profile, different view)
Fixed issue #37 (configurable button class for links; see global plugin configuration)
Fixed issue #36 (had already been done in build 2018050301, only noted here for automatic issue resolving)
Filter forms are now collapsed by default. Always expanded drove me nuts on larger filters/forms.
Fixed breaking LIMIT database issues affecting OracleDB ("LIMIT" clauses not supported as such)
Fixed breaking alias issues affecting OracleDB (Oracle does NOT support the "AS" keyword)
Fixed issue #39 (partial) Added filter capabilities in error report.
Fixed issue #31 (part 2: message sent twice)
Special thanks to Theodore Pylarinos for providing extremely detailed information
that helped to haunt down the bug of downloads not being found!
Special thanks to Wade Colclough from Zuken Limited for providing excellent feedback
and willingness to put in the time and effort to help fixing issues related to Oracle DB.
Version 4.0.0 (build 2019031801)
- Added correct userid identifier on requests table so the link to the user
profile points to the correct one (extension to issue #27)
Version 4.0.0 (build 2019031800)
Small change in workflow of user requested coupons
Added mailing and notification of accepted user requested coupons
Added internal Moodle notifications
Code overhaul: nearly all logic has been rewritten for maintainability reasons.
Verified workings on Moodle 3.4 (updated version.php accordingly)
AMD modules have now properly been minified
We're NO longer "following" Moodle versions.
Thanks everyone for all feedback!
Version 3.5.2 (build 2018050306)
Fixed issue(s) with CSV/Manual recipients not working.
Coupon batches now all have the same "timecreated"
Removed sorting of "action" column in coupon overviews
Custom mail function is now replaced with Moodle's own email_to_user()
Due to MANY issues where the email containing the coupons is not received, the
decision was made to change the process to sending an email containing a
download link where the generated batch can be downloaded from instead of
providing the email with an attachment.
Fixed issue #22 (we now use TCPDF's own QR Code generator)
Added/fixed validation on "request user" configuration form
Added more information to coupons requests overview table
In line with issue 32, configuration of the enrolment duration for course type
coupons has been moved to the course selection page.
Fixed issue #35 (bug in observers)
Fixed issue #34 (feature request for zip name)
Fixed issue #32 (PDF preview)
Fixed issue #30 (request user - required field setting amount of coupons has no effect)
Fixed issue #29 (request user settings: added explanations)
Fixed issue #28 (wrong paging/view for requestusers)
Fixed issue #27 (wrong link to user profile in requestusers table)
Changed sourcecode here and there to prevent debug output/PHP notices
Removed restriction on amount of coupons when only generating the codes.
Added coupon cleanup confirmation screen.
Thanks Franky Just for your valuable feedback, bug reports and additional remarks!
Version 3.5.1 (build 2018050305)
Fixed issue #23 (invalid use of PARAM_RAW)
Fixed issue #24 (redirect vulnerabilities -> changed all to PARAM_LOCALURL)
Fixed issue #25 (removed use of deprecated function notify_problem)
Fixed some missing capability checks / security issues
Thanks Dan Marsden for your valuable feedback, bug reports and plugin review!
Thanks Jesús Rincón for raising issue #25
backported some of the issues to the Moodle 3.0+ release
NOTE: All other releases except one Moodle 3.0+ release and the most recent
Moodle 3.5+ release have been pulled.
Version 3.5.0 (build 2018050304)
- Fixed issue #21 (cohort_is_member fatal error: thanks Michael Neulinger)
Version 3.5.0 (build 2018050303)
Fixed faulty course / cohort ID filter
Added course groups filter possibilities
Added "timeclaimed" information to keep track of when coupons were actually claimed
Removed table sorting for courses/cohorts/groups (didn't work and should have never been part of the tables)
Added quick rudimentary check to validate whether a person is already "signed up" when entering a code.
(i.e. member in all linked cohorts or enrolled for all linked courses).
Thanks Kevin Freeborn for your very valuable feedback!
Version 3.5.0 (build 2018050302)
- Added possibility to only generate coupon codes (no PDFs will be generated, nor will they be sent!)
- Added batchid field to database to track generated batches of coupons
- Added custom batch naming when generating coupons (system automatically creates one if not provided)
- Added possibility to filter coupons on BATCH ID/name
Version 3.5.0 (build 2018050301)
- Changed internal signup to comply to Moodle 3.5.
- Added option global to use login page layout (which is a Moodle standard really, but wasn't enforced)
- Added coupon code error checking to signup form (refuse signup in case coupon code is invalid)
- Added coupon request possibilities (please refer to manual for usage description)
- Added global options for and display of help texts for custom signup and coupon input texts
- Added possibility to request coupons for course types only. Involves admin to configure both the courses and allowed users
- Removed deprecated verify_https_required() call from custom (internal) signup
Version 3.5.0 (build 2018050300)
- FIXED issue #15 ("mdb->get_record() found more than one record" when calling find_block_instance_id()).
- FIXED issue #19 where enrolment was never updated when using a new coupon after enrolment expired.
- Fixed "Sent" column in coupon overviews (displayed information based on wrong field)
- Added privacy provider
- Validated functionality for Moodle 3.5 onwards
- Minimum required Moodle version: 3.5
Version 3.3.2 (build 2017092503)
- Added role selection for coupons (course type only)
Version 3.3.1 (build 2017092501)
- Added coupon code to "progress report" for validation purposes (feature request)
- Added claimed user to "used coupons" overview for validation purposes (feature request)
Version 3.3.0 (build 2017092500)
- Fixed deprecated pix_url references (replaced by image_url)
- Validated functionality for Moodle 3.3 onwards
- Minimum required Moodle version: 3.3
Version 2017052402 (Release 3.0.3 (build 2017052402))
Fixed bug in cohort type coupons (fixed incorrect usercheck and cohort synchronisation)
Added option to display QR Code in PDF or leave it out.
Thanks to everyone for their valuable input and remarks.
Version 2017052401 (Release 3.0.2 (build 2017052401))
Resolved issue #14
Thanks to everyone for their valuable input and remarks.
Version 2017052400 (Release 3.0.1 (build 2017052400))
Added new type of coupon: extend (course) enrolment
Added webservices!
Incorporated some changes here and the in overviews
Thanks to everyone for their valuable input and remarks.
Version 2017050100 (Release 3.0.0 (build 2017050100))
Added $CFG->wwwroot on all moodle_urls
Added setting to choose default assigned role (resolve issue #12: Student role problem.
Roles were fetched by shortname = 'student', NOT foolproof)
Disabled sorting by 'owner' column in coupon overviews (resolve issue #13).
Fixed error notification when inserting to table block_coupon_courses
Added course name(s) to coupons
Changed default coupon template-main contents (language files)
Added filtering for progress reports
Added filtering for coupon overview
Code overhaul to comply to stricter Moodle coding standards (codechecker, Moodle phpdoc check)
Added course_deleted event handler
Added cohort_deleted event handler
Added custom cleaning of coupons
Added QR based coupon to PDF including processing
Added signup for QR based coupon when user is not logged on yet
Added possibility for signup with a coupon code (in block_coupon, when user is not yet logged in)
Added new manager to manage multiple coupon background
Added option to select coupon background to use
minimum required version: Moodle3 3.0
Thanks to everyone for their valuable input and remarks.
Version 2016040800 (Release 2.7.3 (build 2016040800))
raising memory limit and maximum execution time when generating coupons.
Fixed cleanup task
Fixed last page of wizard not displaying selected groups
Updated readme
Added ability to delete unused coupons.
Feedback and general remarks or ideas for improvement are still highly valued.
Version 2015010107 (Release 2.7.2 (build 2015010107))
Changed "max coupons" setting to textual input. No more hardcoded limit of 100 coupons.
Added delete option to unused coupons overview
Added settings and task to automatically clean up unused/unclaimed coupons
Thanks to anyone and everyone for their much valued feedback!
Version 2015010102 (Release 2.7.0 (build 2015010102))
Added missing db/tasks.php
Limited applicable_formats: block can only be used on main site page and "my" dashboard view
Improved renderer (more use of html_writer)
Fixed default setting when starting coupon generator
Included settings file in /classes/task/sendcoupons.php (gave NOTICE)
Fixed a few small (non critical) bugs
Added generatoroptions and generator for cleaner code to generate coupons.
Thanks to, a.o., David Mudrák for raising issues leading to this version.
4.0.6 (build 2020010806) (2020010806)
4.0.6 (build 2020010806)
Plugin type: Blocks
Frankenstyle component name: block_coupon
Version build number: 2020010806
Version release name: 4.0.6 (build 2020010806)
Maturity: Stable
Supported Moodle versions: 3.5, 3.6, 3.7, 3.8, 3.9
Repository URL (Git): https://github.com/sebsoftnl/moodle-block_coupon
Repository branch:
Repository tag:
Issue/bug tracker URL: https://github.com/sebsoftnl/moodle-block_coupon/issues
Version 4.0.6 (build 2020010806)
- Added autocompletes for cohort/cohort courses.
- Added user_deleted observer.
- Fixed notice (generate_pdf) on POST data (user requesting coupon; made field an advcheckbox).
- Fixed CSS issue... sigh.
- Undo previous work on user column (used coupons).
- Fix sorting on user column.
- Add sorting on owner column.
- Added user/claimed_on columns for personalised coupons.
- Fixed langstring 'coupon_notification_content'.
- Fixed get_string variables (in helper).
- Fixed "Curly brace syntax for accessing array elements and string offsets has
been deprecated in PHP 7.4. Found: $codealphabet{$n}" in codegenerator.
Version 4.0.6 (build 2020010805)
- Added INDICES to block_coupon.
Version 4.0.6 (build 2020010804)
- Changed course selection when generating coupons to auto-complete element.
- Changed cohort selection when generating coupons to auto-complete element.
- Added services.
- Added 10px whitespace between buttons in block.
- Set width of most default for elements to 75% (never EVER set to 100% due to autocomplete element).
- Modified course group selection to checkboxes.
- Added tab dedicated to personalised coupons (uses global setting to enable!).
- Add field to manipulate code size for coupons.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, funding of these changes, bug reports and beta testing.
Version 4.0.5 (build 2020010803)
- Added option to include PDF when sending personalised coupons.
- Modified (AGAIN) sending process of personal coupons.
Version 4.0.4.2 (build 2020010802)
- Changed length of batchid to 255.
Version 4.0.4.1 (build 2020010801)
- Updated privacy provider.
- Removed https verification from custom signup page.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, bug reports and beta testing.
Version 4.0.4 (build 2020010800)
- Validated Moodle 3.8
- Changed a few table implementations (fixes sorting bugs)
- Changed headers/sorting on tables for USER fields
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for donating to Moodle 3.8 validation, useful input and beta testing.
Version 4.0.3-RC1 (build 2019031805)
- Release candidate for beta testing
Version 4.0.2 (build 2019031804)
- Added ADVANCED global $CFG options to manipulate template bot output offsets.
- Fixed wrongful addition of "batchID" when adding any filter (used/unused coupon view)
- Fixed PHP notice in batchID filter
- Fixed some more Oracle table alias issues
- Fixed wrong links in notification context urls
- Added maillog tab. Still too many requests about mails not being sent, so we decided
to wrap Moodle's email_to_user method and log any debug output if relevant. - General code cleanup (as a result of Travis-CI)
Version 4.0.1 (build 2019031802)
Fixed param type on download page.
Added an overview to display downloadable batches (only scans for coupon archives in moodledata).
Added option to download from this overview.
Fixed issue #27 again (wrong link to user profile)
Fixed issue #38 again (wrong link to user profile, different view)
Fixed issue #37 (configurable button class for links; see global plugin configuration)
Fixed issue #36 (had already been done in build 2018050301, only noted here for automatic issue resolving)
Filter forms are now collapsed by default. Always expanded drove me nuts on larger filters/forms.
Fixed breaking LIMIT database issues affecting OracleDB ("LIMIT" clauses not supported as such)
Fixed breaking alias issues affecting OracleDB (Oracle does NOT support the "AS" keyword)
Fixed issue #39 (partial) Added filter capabilities in error report.
Fixed issue #31 (part 2: message sent twice)
Special thanks to Theodore Pylarinos for providing extremely detailed information
that helped to haunt down the bug of downloads not being found!
Special thanks to Wade Colclough from Zuken Limited for providing excellent feedback
and willingness to put in the time and effort to help fixing issues related to Oracle DB.
Version 4.0.0 (build 2019031801)
- Added correct userid identifier on requests table so the link to the user
profile points to the correct one (extension to issue #27)
Version 4.0.0 (build 2019031800)
Small change in workflow of user requested coupons
Added mailing and notification of accepted user requested coupons
Added internal Moodle notifications
Code overhaul: nearly all logic has been rewritten for maintainability reasons.
Verified workings on Moodle 3.4 (updated version.php accordingly)
AMD modules have now properly been minified
We're NO longer "following" Moodle versions.
Thanks everyone for all feedback!
Version 3.5.2 (build 2018050306)
Fixed issue(s) with CSV/Manual recipients not working.
Coupon batches now all have the same "timecreated"
Removed sorting of "action" column in coupon overviews
Custom mail function is now replaced with Moodle's own email_to_user()
Due to MANY issues where the email containing the coupons is not received, the
decision was made to change the process to sending an email containing a
download link where the generated batch can be downloaded from instead of
providing the email with an attachment.
Fixed issue #22 (we now use TCPDF's own QR Code generator)
Added/fixed validation on "request user" configuration form
Added more information to coupons requests overview table
In line with issue 32, configuration of the enrolment duration for course type
coupons has been moved to the course selection page.
Fixed issue #35 (bug in observers)
Fixed issue #34 (feature request for zip name)
Fixed issue #32 (PDF preview)
Fixed issue #30 (request user - required field setting amount of coupons has no effect)
Fixed issue #29 (request user settings: added explanations)
Fixed issue #28 (wrong paging/view for requestusers)
Fixed issue #27 (wrong link to user profile in requestusers table)
Changed sourcecode here and there to prevent debug output/PHP notices
Removed restriction on amount of coupons when only generating the codes.
Added coupon cleanup confirmation screen.
Thanks Franky Just for your valuable feedback, bug reports and additional remarks!
Version 3.5.1 (build 2018050305)
Fixed issue #23 (invalid use of PARAM_RAW)
Fixed issue #24 (redirect vulnerabilities -> changed all to PARAM_LOCALURL)
Fixed issue #25 (removed use of deprecated function notify_problem)
Fixed some missing capability checks / security issues
Thanks Dan Marsden for your valuable feedback, bug reports and plugin review!
Thanks Jesús Rincón for raising issue #25
backported some of the issues to the Moodle 3.0+ release
NOTE: All other releases except one Moodle 3.0+ release and the most recent
Moodle 3.5+ release have been pulled.
Version 3.5.0 (build 2018050304)
- Fixed issue #21 (cohort_is_member fatal error: thanks Michael Neulinger)
Version 3.5.0 (build 2018050303)
Fixed faulty course / cohort ID filter
Added course groups filter possibilities
Added "timeclaimed" information to keep track of when coupons were actually claimed
Removed table sorting for courses/cohorts/groups (didn't work and should have never been part of the tables)
Added quick rudimentary check to validate whether a person is already "signed up" when entering a code.
(i.e. member in all linked cohorts or enrolled for all linked courses).
Thanks Kevin Freeborn for your very valuable feedback!
Version 3.5.0 (build 2018050302)
- Added possibility to only generate coupon codes (no PDFs will be generated, nor will they be sent!)
- Added batchid field to database to track generated batches of coupons
- Added custom batch naming when generating coupons (system automatically creates one if not provided)
- Added possibility to filter coupons on BATCH ID/name
Version 3.5.0 (build 2018050301)
- Changed internal signup to comply to Moodle 3.5.
- Added option global to use login page layout (which is a Moodle standard really, but wasn't enforced)
- Added coupon code error checking to signup form (refuse signup in case coupon code is invalid)
- Added coupon request possibilities (please refer to manual for usage description)
- Added global options for and display of help texts for custom signup and coupon input texts
- Added possibility to request coupons for course types only. Involves admin to configure both the courses and allowed users
- Removed deprecated verify_https_required() call from custom (internal) signup
Version 3.5.0 (build 2018050300)
- FIXED issue #15 ("mdb->get_record() found more than one record" when calling find_block_instance_id()).
- FIXED issue #19 where enrolment was never updated when using a new coupon after enrolment expired.
- Fixed "Sent" column in coupon overviews (displayed information based on wrong field)
- Added privacy provider
- Validated functionality for Moodle 3.5 onwards
- Minimum required Moodle version: 3.5
Version 3.3.2 (build 2017092503)
- Added role selection for coupons (course type only)
Version 3.3.1 (build 2017092501)
- Added coupon code to "progress report" for validation purposes (feature request)
- Added claimed user to "used coupons" overview for validation purposes (feature request)
Version 3.3.0 (build 2017092500)
- Fixed deprecated pix_url references (replaced by image_url)
- Validated functionality for Moodle 3.3 onwards
- Minimum required Moodle version: 3.3
Version 2017052402 (Release 3.0.3 (build 2017052402))
Fixed bug in cohort type coupons (fixed incorrect usercheck and cohort synchronisation)
Added option to display QR Code in PDF or leave it out.
Thanks to everyone for their valuable input and remarks.
Version 2017052401 (Release 3.0.2 (build 2017052401))
Resolved issue #14
Thanks to everyone for their valuable input and remarks.
Version 2017052400 (Release 3.0.1 (build 2017052400))
Added new type of coupon: extend (course) enrolment
Added webservices!
Incorporated some changes here and the in overviews
Thanks to everyone for their valuable input and remarks.
Version 2017050100 (Release 3.0.0 (build 2017050100))
Added $CFG->wwwroot on all moodle_urls
Added setting to choose default assigned role (resolve issue #12: Student role problem.
Roles were fetched by shortname = 'student', NOT foolproof)
Disabled sorting by 'owner' column in coupon overviews (resolve issue #13).
Fixed error notification when inserting to table block_coupon_courses
Added course name(s) to coupons
Changed default coupon template-main contents (language files)
Added filtering for progress reports
Added filtering for coupon overview
Code overhaul to comply to stricter Moodle coding standards (codechecker, Moodle phpdoc check)
Added course_deleted event handler
Added cohort_deleted event handler
Added custom cleaning of coupons
Added QR based coupon to PDF including processing
Added signup for QR based coupon when user is not logged on yet
Added possibility for signup with a coupon code (in block_coupon, when user is not yet logged in)
Added new manager to manage multiple coupon background
Added option to select coupon background to use
minimum required version: Moodle3 3.0
Thanks to everyone for their valuable input and remarks.
Version 2016040800 (Release 2.7.3 (build 2016040800))
raising memory limit and maximum execution time when generating coupons.
Fixed cleanup task
Fixed last page of wizard not displaying selected groups
Updated readme
Added ability to delete unused coupons.
Feedback and general remarks or ideas for improvement are still highly valued.
Version 2015010107 (Release 2.7.2 (build 2015010107))
Changed "max coupons" setting to textual input. No more hardcoded limit of 100 coupons.
Added delete option to unused coupons overview
Added settings and task to automatically clean up unused/unclaimed coupons
Thanks to anyone and everyone for their much valued feedback!
Version 2015010102 (Release 2.7.0 (build 2015010102))
Added missing db/tasks.php
Limited applicable_formats: block can only be used on main site page and "my" dashboard view
Improved renderer (more use of html_writer)
Fixed default setting when starting coupon generator
Included settings file in /classes/task/sendcoupons.php (gave NOTICE)
Fixed a few small (non critical) bugs
Added generatoroptions and generator for cleaner code to generate coupons.
Thanks to, a.o., David Mudrák for raising issues leading to this version.
4.0.4.2 not found-release [patch version]" (build 2020010802)" (2020010802)
4.0.4.2 not found-release [patch version]" (build 2020010802)"
Plugin type: Blocks
Frankenstyle component name: block_coupon
Version build number: 2020010802
Version release name: 4.0.4.2 not found-release [patch version]" (build 2020010802)"
Maturity: Stable
Supported Moodle versions: 3.4, 3.5, 3.6, 3.7, 3.8
Repository URL (Git): https://bitbucket.org/sebsoft/moodle-block_coupon
Repository branch:
Repository tag:
Issue/bug tracker URL: https://github.com/sebsoftnl/moodle-block_coupon/issues
Version 4.0.4.1 (build 2020010802)
- Changed length of batchid to 255.
Version 4.0.4.1 (build 2020010801)
- Updated privacy provider.
- Removed https verification from custom signup page.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, bug reports and beta testing.
Version 4.0.4 (build 2020010800)
- Validated Moodle 3.8
- Changed a few table implementations (fixes sorting bugs)
- Changed headers/sorting on tables for USER fields
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for donating to Moodle 3.8 validation, useful input and beta testing.
Version 4.0.3-RC1 (build 2019031805)
- Release candidate for beta testing
Version 4.0.2 (build 2019031804)
- Added ADVANCED global $CFG options to manipulate template bot output offsets.
- Fixed wrongful addition of "batchID" when adding any filter (used/unused coupon view)
- Fixed PHP notice in batchID filter
- Fixed some more Oracle table alias issues
- Fixed wrong links in notification context urls
- Added maillog tab. Still too many requests about mails not being sent, so we decided
to wrap Moodle's email_to_user method and log any debug output if relevant. - General code cleanup (as a result of Travis-CI)
Version 4.0.1 (build 2019031802)
Fixed param type on download page.
Added an overview to display downloadable batches (only scans for coupon archives in moodledata).
Added option to download from this overview.
Fixed issue #27 again (wrong link to user profile)
Fixed issue #38 again (wrong link to user profile, different view)
Fixed issue #37 (configurable button class for links; see global plugin configuration)
Fixed issue #36 (had already been done in build 2018050301, only noted here for automatic issue resolving)
Filter forms are now collapsed by default. Always expanded drove me nuts on larger filters/forms.
Fixed breaking LIMIT database issues affecting OracleDB ("LIMIT" clauses not supported as such)
Fixed breaking alias issues affecting OracleDB (Oracle does NOT support the "AS" keyword)
Fixed issue #39 (partial) Added filter capabilities in error report.
Fixed issue #31 (part 2: message sent twice)
Special thanks to Theodore Pylarinos for providing extremely detailed information
that helped to haunt down the bug of downloads not being found!
Special thanks to Wade Colclough from Zuken Limited for providing excellent feedback
and willingness to put in the time and effort to help fixing issues related to Oracle DB.
Version 4.0.0 (build 2019031801)
- Added correct userid identifier on requests table so the link to the user
profile points to the correct one (extension to issue #27)
Version 4.0.0 (build 2019031800)
Small change in workflow of user requested coupons
Added mailing and notification of accepted user requested coupons
Added internal Moodle notifications
Code overhaul: nearly all logic has been rewritten for maintainability reasons.
Verified workings on Moodle 3.4 (updated version.php accordingly)
AMD modules have now properly been minified
We're NO longer "following" Moodle versions.
Thanks everyone for all feedback!
Version 3.5.2 (build 2018050306)
Fixed issue(s) with CSV/Manual recipients not working.
Coupon batches now all have the same "timecreated"
Removed sorting of "action" column in coupon overviews
Custom mail function is now replaced with Moodle's own email_to_user()
Due to MANY issues where the email containing the coupons is not received, the
decision was made to change the process to sending an email containing a
download link where the generated batch can be downloaded from instead of
providing the email with an attachment.
Fixed issue #22 (we now use TCPDF's own QR Code generator)
Added/fixed validation on "request user" configuration form
Added more information to coupons requests overview table
In line with issue 32, configuration of the enrolment duration for course type
coupons has been moved to the course selection page.
Fixed issue #35 (bug in observers)
Fixed issue #34 (feature request for zip name)
Fixed issue #32 (PDF preview)
Fixed issue #30 (request user - required field setting amount of coupons has no effect)
Fixed issue #29 (request user settings: added explanations)
Fixed issue #28 (wrong paging/view for requestusers)
Fixed issue #27 (wrong link to user profile in requestusers table)
Changed sourcecode here and there to prevent debug output/PHP notices
Removed restriction on amount of coupons when only generating the codes.
Added coupon cleanup confirmation screen.
Thanks Franky Just for your valuable feedback, bug reports and additional remarks!
Version 3.5.1 (build 2018050305)
Fixed issue #23 (invalid use of PARAM_RAW)
Fixed issue #24 (redirect vulnerabilities -> changed all to PARAM_LOCALURL)
Fixed issue #25 (removed use of deprecated function notify_problem)
Fixed some missing capability checks / security issues
Thanks Dan Marsden for your valuable feedback, bug reports and plugin review!
Thanks Jesús Rincón for raising issue #25
backported some of the issues to the Moodle 3.0+ release
NOTE: All other releases except one Moodle 3.0+ release and the most recent
Moodle 3.5+ release have been pulled.
Version 3.5.0 (build 2018050304)
- Fixed issue #21 (cohort_is_member fatal error: thanks Michael Neulinger)
Version 3.5.0 (build 2018050303)
Fixed faulty course / cohort ID filter
Added course groups filter possibilities
Added "timeclaimed" information to keep track of when coupons were actually claimed
Removed table sorting for courses/cohorts/groups (didn't work and should have never been part of the tables)
Added quick rudimentary check to validate whether a person is already "signed up" when entering a code.
(i.e. member in all linked cohorts or enrolled for all linked courses).
Thanks Kevin Freeborn for your very valuable feedback!
Version 3.5.0 (build 2018050302)
- Added possibility to only generate coupon codes (no PDFs will be generated, nor will they be sent!)
- Added batchid field to database to track generated batches of coupons
- Added custom batch naming when generating coupons (system automatically creates one if not provided)
- Added possibility to filter coupons on BATCH ID/name
Version 3.5.0 (build 2018050301)
- Changed internal signup to comply to Moodle 3.5.
- Added option global to use login page layout (which is a Moodle standard really, but wasn't enforced)
- Added coupon code error checking to signup form (refuse signup in case coupon code is invalid)
- Added coupon request possibilities (please refer to manual for usage description)
- Added global options for and display of help texts for custom signup and coupon input texts
- Added possibility to request coupons for course types only. Involves admin to configure both the courses and allowed users
- Removed deprecated verify_https_required() call from custom (internal) signup
Version 3.5.0 (build 2018050300)
- FIXED issue #15 ("mdb->get_record() found more than one record" when calling find_block_instance_id()).
- FIXED issue #19 where enrolment was never updated when using a new coupon after enrolment expired.
- Fixed "Sent" column in coupon overviews (displayed information based on wrong field)
- Added privacy provider
- Validated functionality for Moodle 3.5 onwards
- Minimum required Moodle version: 3.5
Version 3.3.2 (build 2017092503)
- Added role selection for coupons (course type only)
Version 3.3.1 (build 2017092501)
- Added coupon code to "progress report" for validation purposes (feature request)
- Added claimed user to "used coupons" overview for validation purposes (feature request)
Version 3.3.0 (build 2017092500)
- Fixed deprecated pix_url references (replaced by image_url)
- Validated functionality for Moodle 3.3 onwards
- Minimum required Moodle version: 3.3
Version 2017052402 (Release 3.0.3 (build 2017052402))
Fixed bug in cohort type coupons (fixed incorrect usercheck and cohort synchronisation)
Added option to display QR Code in PDF or leave it out.
Thanks to everyone for their valuable input and remarks.
Version 2017052401 (Release 3.0.2 (build 2017052401))
Resolved issue #14
Thanks to everyone for their valuable input and remarks.
Version 2017052400 (Release 3.0.1 (build 2017052400))
Added new type of coupon: extend (course) enrolment
Added webservices!
Incorporated some changes here and the in overviews
Thanks to everyone for their valuable input and remarks.
Version 2017050100 (Release 3.0.0 (build 2017050100))
Added $CFG->wwwroot on all moodle_urls
Added setting to choose default assigned role (resolve issue #12: Student role problem.
Roles were fetched by shortname = 'student', NOT foolproof)
Disabled sorting by 'owner' column in coupon overviews (resolve issue #13).
Fixed error notification when inserting to table block_coupon_courses
Added course name(s) to coupons
Changed default coupon template-main contents (language files)
Added filtering for progress reports
Added filtering for coupon overview
Code overhaul to comply to stricter Moodle coding standards (codechecker, Moodle phpdoc check)
Added course_deleted event handler
Added cohort_deleted event handler
Added custom cleaning of coupons
Added QR based coupon to PDF including processing
Added signup for QR based coupon when user is not logged on yet
Added possibility for signup with a coupon code (in block_coupon, when user is not yet logged in)
Added new manager to manage multiple coupon background
Added option to select coupon background to use
minimum required version: Moodle3 3.0
Thanks to everyone for their valuable input and remarks.
Version 2016040800 (Release 2.7.3 (build 2016040800))
raising memory limit and maximum execution time when generating coupons.
Fixed cleanup task
Fixed last page of wizard not displaying selected groups
Updated readme
Added ability to delete unused coupons.
Feedback and general remarks or ideas for improvement are still highly valued.
Version 2015010107 (Release 2.7.2 (build 2015010107))
Changed "max coupons" setting to textual input. No more hardcoded limit of 100 coupons.
Added delete option to unused coupons overview
Added settings and task to automatically clean up unused/unclaimed coupons
Thanks to anyone and everyone for their much valued feedback!
Version 2015010102 (Release 2.7.0 (build 2015010102))
Added missing db/tasks.php
Limited applicable_formats: block can only be used on main site page and "my" dashboard view
Improved renderer (more use of html_writer)
Fixed default setting when starting coupon generator
Included settings file in /classes/task/sendcoupons.php (gave NOTICE)
Fixed a few small (non critical) bugs
Added generatoroptions and generator for cleaner code to generate coupons.
Thanks to, a.o., David Mudrák for raising issues leading to this version.
4.0.4.1 not found-release [patch version]" (build 2020010801)" (2020010801)
4.0.4.1 not found-release [patch version]" (build 2020010801)"
Plugin type: Blocks
Frankenstyle component name: block_coupon
Version build number: 2020010801
Version release name: 4.0.4.1 not found-release [patch version]" (build 2020010801)"
Maturity: Stable
Supported Moodle versions: 3.5, 3.6, 3.7, 3.8
Repository URL (Git): https://bitbucket.org/sebsoft/moodle-block_coupon
Repository branch:
Repository tag:
Issue/bug tracker URL: https://github.com/sebsoftnl/moodle-block_coupon/issues
Version 4.0.4.1 (build 2020010801)
- Updated privacy provider.
- Removed https verification from custom signup page.
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for useful input, bug reports and beta testing.
Version 4.0.4 (build 2020010800)
- Validated Moodle 3.8
- Changed a few table implementations (fixes sorting bugs)
- Changed headers/sorting on tables for USER fields
Special thanks to Gemma Lesterhuis (Lesterhuis Training & Consultancy)
for donating to Moodle 3.8 validation, useful input and beta testing.
Version 4.0.3-RC1 (build 2019031805)
- Release candidate for beta testing
Version 4.0.2 (build 2019031804)
- Added ADVANCED global $CFG options to manipulate template bot output offsets.
- Fixed wrongful addition of "batchID" when adding any filter (used/unused coupon view)
- Fixed PHP notice in batchID filter
- Fixed some more Oracle table alias issues
- Fixed wrong links in notification context urls
- Added maillog tab. Still too many requests about mails not being sent, so we decided
to wrap Moodle's email_to_user method and log any debug output if relevant. - General code cleanup (as a result of Travis-CI)
Version 4.0.1 (build 2019031802)
Fixed param type on download page.
Added an overview to display downloadable batches (only scans for coupon archives in moodledata).
Added option to download from this overview.
Fixed issue #27 again (wrong link to user profile)
Fixed issue #38 again (wrong link to user profile, different view)
Fixed issue #37 (configurable button class for links; see global plugin configuration)
Fixed issue #36 (had already been done in build 2018050301, only noted here for automatic issue resolving)
Filter forms are now collapsed by default. Always expanded drove me nuts on larger filters/forms.
Fixed breaking LIMIT database issues affecting OracleDB ("LIMIT" clauses not supported as such)
Fixed breaking alias issues affecting OracleDB (Oracle does NOT support the "AS" keyword)
Fixed issue #39 (partial) Added filter capabilities in error report.
Fixed issue #31 (part 2: message sent twice)
Special thanks to Theodore Pylarinos for providing extremely detailed information
that helped to haunt down the bug of downloads not being found!
Special thanks to Wade Colclough from Zuken Limited for providing excellent feedback
and willingness to put in the time and effort to help fixing issues related to Oracle DB.
Version 4.0.0 (build 2019031801)
- Added correct userid identifier on requests table so the link to the user
profile points to the correct one (extension to issue #27)
Version 4.0.0 (build 2019031800)
Small change in workflow of user requested coupons
Added mailing and notification of accepted user requested coupons
Added internal Moodle notifications
Code overhaul: nearly all logic has been rewritten for maintainability reasons.
Verified workings on Moodle 3.4 (updated version.php accordingly)
AMD modules have now properly been minified
We're NO longer "following" Moodle versions.
Thanks everyone for all feedback!
Version 3.5.2 (build 2018050306)
Fixed issue(s) with CSV/Manual recipients not working.
Coupon batches now all have the same "timecreated"
Removed sorting of "action" column in coupon overviews
Custom mail function is now replaced with Moodle's own email_to_user()
Due to MANY issues where the email containing the coupons is not received, the
decision was made to change the process to sending an email containing a
download link where the generated batch can be downloaded from instead of
providing the email with an attachment.
Fixed issue #22 (we now use TCPDF's own QR Code generator)
Added/fixed validation on "request user" configuration form
Added more information to coupons requests overview table
In line with issue 32, configuration of the enrolment duration for course type
coupons has been moved to the course selection page.
Fixed issue #35 (bug in observers)
Fixed issue #34 (feature request for zip name)
Fixed issue #32 (PDF preview)
Fixed issue #30 (request user - required field setting amount of coupons has no effect)
Fixed issue #29 (request user settings: added explanations)
Fixed issue #28 (wrong paging/view for requestusers)
Fixed issue #27 (wrong link to user profile in requestusers table)
Changed sourcecode here and there to prevent debug output/PHP notices
Removed restriction on amount of coupons when only generating the codes.
Added coupon cleanup confirmation screen.
Thanks Franky Just for your valuable feedback, bug reports and additional remarks!
Version 3.5.1 (build 2018050305)
Fixed issue #23 (invalid use of PARAM_RAW)
Fixed issue #24 (redirect vulnerabilities -> changed all to PARAM_LOCALURL)
Fixed issue #25 (removed use of deprecated function notify_problem)
Fixed some missing capability checks / security issues
Thanks Dan Marsden for your valuable feedback, bug reports and plugin review!
Thanks Jesús Rincón for raising issue #25
backported some of the issues to the Moodle 3.0+ release
NOTE: All other releases except one Moodle 3.0+ release and the most recent
Moodle 3.5+ release have been pulled.
Version 3.5.0 (build 2018050304)
- Fixed issue #21 (cohort_is_member fatal error: thanks Michael Neulinger)
Version 3.5.0 (build 2018050303)
Fixed faulty course / cohort ID filter
Added course groups filter possibilities
Added "timeclaimed" information to keep track of when coupons were actually claimed
Removed table sorting for courses/cohorts/groups (didn't work and should have never been part of the tables)
Added quick rudimentary check to validate whether a person is already "signed up" when entering a code.
(i.e. member in all linked cohorts or enrolled for all linked courses).
Thanks Kevin Freeborn for your very valuable feedback!
Version 3.5.0 (build 2018050302)
- Added possibility to only generate coupon codes (no PDFs will be generated, nor will they be sent!)
- Added batchid field to database to track generated batches of coupons
- Added custom batch naming when generating coupons (system automatically creates one if not provided)
- Added possibility to filter coupons on BATCH ID/name
Version 3.5.0 (build 2018050301)
- Changed internal signup to comply to Moodle 3.5.
- Added option global to use login page layout (which is a Moodle standard really, but wasn't enforced)
- Added coupon code error checking to signup form (refuse signup in case coupon code is invalid)
- Added coupon request possibilities (please refer to manual for usage description)
- Added global options for and display of help texts for custom signup and coupon input texts
- Added possibility to request coupons for course types only. Involves admin to configure both the courses and allowed users
- Removed deprecated verify_https_required() call from custom (internal) signup
Version 3.5.0 (build 2018050300)
- FIXED issue #15 ("mdb->get_record() found more than one record" when calling find_block_instance_id()).
- FIXED issue #19 where enrolment was never updated when using a new coupon after enrolment expired.
- Fixed "Sent" column in coupon overviews (displayed information based on wrong field)
- Added privacy provider
- Validated functionality for Moodle 3.5 onwards
- Minimum required Moodle version: 3.5
Version 3.3.2 (build 2017092503)
- Added role selection for coupons (course type only)
Version 3.3.1 (build 2017092501)
- Added coupon code to "progress report" for validation purposes (feature request)
- Added claimed user to "used coupons" overview for validation purposes (feature request)
Version 3.3.0 (build 2017092500)
- Fixed deprecated pix_url references (replaced by image_url)
- Validated functionality for Moodle 3.3 onwards
- Minimum required Moodle version: 3.3
Version 2017052402 (Release 3.0.3 (build 2017052402))
Fixed bug in cohort type coupons (fixed incorrect usercheck and cohort synchronisation)
Added option to display QR Code in PDF or leave it out.
Thanks to everyone for their valuable input and remarks.
Version 2017052401 (Release 3.0.2 (build 2017052401))
Resolved issue #14
Thanks to everyone for their valuable input and remarks.
Version 2017052400 (Release 3.0.1 (build 2017052400))
Added new type of coupon: extend (course) enrolment
Added webservices!
Incorporated some changes here and the in overviews
Thanks to everyone for their valuable input and remarks.
Version 2017050100 (Release 3.0.0 (build 2017050100))
Added $CFG->wwwroot on all moodle_urls
Added setting to choose default assigned role (resolve issue #12: Student role problem.
Roles were fetched by shortname = 'student', NOT foolproof)
Disabled sorting by 'owner' column in coupon overviews (resolve issue #13).
Fixed error notification when inserting to table block_coupon_courses
Added course name(s) to coupons
Changed default coupon template-main contents (language files)
Added filtering for progress reports
Added filtering for coupon overview
Code overhaul to comply to stricter Moodle coding standards (codechecker, Moodle phpdoc check)
Added course_deleted event handler
Added cohort_deleted event handler
Added custom cleaning of coupons
Added QR based coupon to PDF including processing
Added signup for QR based coupon when user is not logged on yet
Added possibility for signup with a coupon code (in block_coupon, when user is not yet logged in)
Added new manager to manage multiple coupon background
Added option to select coupon background to use
minimum required version: Moodle3 3.0
Thanks to everyone for their valuable input and remarks.
Version 2016040800 (Release 2.7.3 (build 2016040800))
raising memory limit and maximum execution time when generating coupons.
Fixed cleanup task
Fixed last page of wizard not displaying selected groups
Updated readme
Added ability to delete unused coupons.
Feedback and general remarks or ideas for improvement are still highly valued.
Version 2015010107 (Release 2.7.2 (build 2015010107))
Changed "max coupons" setting to textual input. No more hardcoded limit of 100 coupons.
Added delete option to unused coupons overview
Added settings and task to automatically clean up unused/unclaimed coupons
Thanks to anyone and everyone for their much valued feedback!
Version 2015010102 (Release 2.7.0 (build 2015010102))
Added missing db/tasks.php
Limited applicable_formats: block can only be used on main site page and "my" dashboard view
Improved renderer (more use of html_writer)
Fixed default setting when starting coupon generator
Included settings file in /classes/task/sendcoupons.php (gave NOTICE)
Fixed a few small (non critical) bugs
Added generatoroptions and generator for cleaner code to generate coupons.
Thanks to, a.o., David Mudrák for raising issues leading to this version.
4.0.4 not found-release" (build 2020010800)" (2020010800)
4.0.4 not found-release" (build 2020010800)"
Plugin type: Blocks
Frankenstyle component name: block_coupon
Version build number: 2020010800
Version release name: 4.0.4 not found-release" (build 2020010800)"
Maturity: Stable
Supported Moodle versions: 3.4, 3.5, 3.6, 3.7, 3.8
Repository URL (Git): https://bitbucket.org/sebsoft/moodle-block_coupon
Repository branch:
Repository tag:
Issue/bug tracker URL: https://github.com/sebsoftnl/moodle-block_coupon/issues
Version 4.0.4 (build 2020010800)
- Validated Moodle 3.8
- Changed a few table implementations (fixes sorting bugs)
- Changed headers/sorting on tables for USER fields
Special thanks to Gemma Lesterhuis of LT&C for contributing to this plugin and making sure we could do a release for Moodle 3.8 earlier.
Version 4.0.3-RC1 (build 2019031805)
- Release candidate for beta testing
Version 4.0.2 (build 2019031804)
- Added ADVANCED global $CFG options to manipulate template bot output offsets.
- Fixed wrongful addition of "batchID" when adding any filter (used/unused coupon view)
- Fixed PHP notice in batchID filter
- Fixed some more Oracle table alias issues
- Fixed wrong links in notification context urls
- Added maillog tab. Still too many requests about mails not being sent, so we decided
to wrap Moodle's email_to_user method and log any debug output if relevant. - General code cleanup (as a result of Travis-CI)
Version 4.0.1 (build 2019031802)
Fixed param type on download page.
Added an overview to display downloadable batches (only scans for coupon archives in moodledata).
Added option to download from this overview.
Fixed issue #27 again (wrong link to user profile)
Fixed issue #38 again (wrong link to user profile, different view)
Fixed issue #37 (configurable button class for links; see global plugin configuration)
Fixed issue #36 (had already been done in build 2018050301, only noted here for automatic issue resolving)
Filter forms are now collapsed by default. Always expanded drove me nuts on larger filters/forms.
Fixed breaking LIMIT database issues affecting OracleDB ("LIMIT" clauses not supported as such)
Fixed breaking alias issues affecting OracleDB (Oracle does NOT support the "AS" keyword)
Fixed issue #39 (partial) Added filter capabilities in error report.
Fixed issue #31 (part 2: message sent twice)
Special thanks to Theodore Pylarinos for providing extremely detailed information
that helped to haunt down the bug of downloads not being found!
Special thanks to Wade Colclough from Zuken Limited for providing excellent feedback
and willingness to put in the time and effort to help fixing issues related to Oracle DB.
Version 4.0.0 (build 2019031801)
- Added correct userid identifier on requests table so the link to the user
profile points to the correct one (extension to issue #27)
Version 4.0.0 (build 2019031800)
Small change in workflow of user requested coupons
Added mailing and notification of accepted user requested coupons
Added internal Moodle notifications
Code overhaul: nearly all logic has been rewritten for maintainability reasons.
Verified workings on Moodle 3.4 (updated version.php accordingly)
AMD modules have now properly been minified
We're NO longer "following" Moodle versions.
Thanks everyone for all feedback!
Version 3.5.2 (build 2018050306)
Fixed issue(s) with CSV/Manual recipients not working.
Coupon batches now all have the same "timecreated"
Removed sorting of "action" column in coupon overviews
Custom mail function is now replaced with Moodle's own email_to_user()
Due to MANY issues where the email containing the coupons is not received, the
decision was made to change the process to sending an email containing a
download link where the generated batch can be downloaded from instead of
providing the email with an attachment.
Fixed issue #22 (we now use TCPDF's own QR Code generator)
Added/fixed validation on "request user" configuration form
Added more information to coupons requests overview table
In line with issue 32, configuration of the enrolment duration for course type
coupons has been moved to the course selection page.
Fixed issue #35 (bug in observers)
Fixed issue #34 (feature request for zip name)
Fixed issue #32 (PDF preview)
Fixed issue #30 (request user - required field setting amount of coupons has no effect)
Fixed issue #29 (request user settings: added explanations)
Fixed issue #28 (wrong paging/view for requestusers)
Fixed issue #27 (wrong link to user profile in requestusers table)
Changed sourcecode here and there to prevent debug output/PHP notices
Removed restriction on amount of coupons when only generating the codes.
Added coupon cleanup confirmation screen.
Thanks Franky Just for your valuable feedback, bug reports and additional remarks!
Version 3.5.1 (build 2018050305)
Fixed issue #23 (invalid use of PARAM_RAW)
Fixed issue #24 (redirect vulnerabilities -> changed all to PARAM_LOCALURL)
Fixed issue #25 (removed use of deprecated function notify_problem)
Fixed some missing capability checks / security issues
Thanks Dan Marsden for your valuable feedback, bug reports and plugin review!
Thanks Jesús Rincón for raising issue #25
backported some of the issues to the Moodle 3.0+ release
NOTE: All other releases except one Moodle 3.0+ release and the most recent
Moodle 3.5+ release have been pulled.
Version 3.5.0 (build 2018050304)
- Fixed issue #21 (cohort_is_member fatal error: thanks Michael Neulinger)
Version 3.5.0 (build 2018050303)
Fixed faulty course / cohort ID filter
Added course groups filter possibilities
Added "timeclaimed" information to keep track of when coupons were actually claimed
Removed table sorting for courses/cohorts/groups (didn't work and should have never been part of the tables)
Added quick rudimentary check to validate whether a person is already "signed up" when entering a code.
(i.e. member in all linked cohorts or enrolled for all linked courses).
Thanks Kevin Freeborn for your very valuable feedback!
Version 3.5.0 (build 2018050302)
- Added possibility to only generate coupon codes (no PDFs will be generated, nor will they be sent!)
- Added batchid field to database to track generated batches of coupons
- Added custom batch naming when generating coupons (system automatically creates one if not provided)
- Added possibility to filter coupons on BATCH ID/name
Version 3.5.0 (build 2018050301)
- Changed internal signup to comply to Moodle 3.5.
- Added option global to use login page layout (which is a Moodle standard really, but wasn't enforced)
- Added coupon code error checking to signup form (refuse signup in case coupon code is invalid)
- Added coupon request possibilities (please refer to manual for usage description)
- Added global options for and display of help texts for custom signup and coupon input texts
- Added possibility to request coupons for course types only. Involves admin to configure both the courses and allowed users
- Removed deprecated verify_https_required() call from custom (internal) signup
Version 3.5.0 (build 2018050300)
- FIXED issue #15 ("mdb->get_record() found more than one record" when calling find_block_instance_id()).
- FIXED issue #19 where enrolment was never updated when using a new coupon after enrolment expired.
- Fixed "Sent" column in coupon overviews (displayed information based on wrong field)
- Added privacy provider
- Validated functionality for Moodle 3.5 onwards
- Minimum required Moodle version: 3.5
Version 3.3.2 (build 2017092503)
- Added role selection for coupons (course type only)
Version 3.3.1 (build 2017092501)
- Added coupon code to "progress report" for validation purposes (feature request)
- Added claimed user to "used coupons" overview for validation purposes (feature request)
Version 3.3.0 (build 2017092500)
- Fixed deprecated pix_url references (replaced by image_url)
- Validated functionality for Moodle 3.3 onwards
- Minimum required Moodle version: 3.3
Version 2017052402 (Release 3.0.3 (build 2017052402))
Fixed bug in cohort type coupons (fixed incorrect usercheck and cohort synchronisation)
Added option to display QR Code in PDF or leave it out.
Thanks to everyone for their valuable input and remarks.
Version 2017052401 (Release 3.0.2 (build 2017052401))
Resolved issue #14
Thanks to everyone for their valuable input and remarks.
Version 2017052400 (Release 3.0.1 (build 2017052400))
Added new type of coupon: extend (course) enrolment
Added webservices!
Incorporated some changes here and the in overviews
Thanks to everyone for their valuable input and remarks.
Version 2017050100 (Release 3.0.0 (build 2017050100))
Added $CFG->wwwroot on all moodle_urls
Added setting to choose default assigned role (resolve issue #12: Student role problem.
Roles were fetched by shortname = 'student', NOT foolproof)
Disabled sorting by 'owner' column in coupon overviews (resolve issue #13).
Fixed error notification when inserting to table block_coupon_courses
Added course name(s) to coupons
Changed default coupon template-main contents (language files)
Added filtering for progress reports
Added filtering for coupon overview
Code overhaul to comply to stricter Moodle coding standards (codechecker, Moodle phpdoc check)
Added course_deleted event handler
Added cohort_deleted event handler
Added custom cleaning of coupons
Added QR based coupon to PDF including processing
Added signup for QR based coupon when user is not logged on yet
Added possibility for signup with a coupon code (in block_coupon, when user is not yet logged in)
Added new manager to manage multiple coupon background
Added option to select coupon background to use
minimum required version: Moodle3 3.0
Thanks to everyone for their valuable input and remarks.
Version 2016040800 (Release 2.7.3 (build 2016040800))
raising memory limit and maximum execution time when generating coupons.
Fixed cleanup task
Fixed last page of wizard not displaying selected groups
Updated readme
Added ability to delete unused coupons.
Feedback and general remarks or ideas for improvement are still highly valued.
Version 2015010107 (Release 2.7.2 (build 2015010107))
Changed "max coupons" setting to textual input. No more hardcoded limit of 100 coupons.
Added delete option to unused coupons overview
Added settings and task to automatically clean up unused/unclaimed coupons
Thanks to anyone and everyone for their much valued feedback!
Version 2015010102 (Release 2.7.0 (build 2015010102))
Added missing db/tasks.php
Limited applicable_formats: block can only be used on main site page and "my" dashboard view
Improved renderer (more use of html_writer)
Fixed default setting when starting coupon generator
Included settings file in /classes/task/sendcoupons.php (gave NOTICE)
Fixed a few small (non critical) bugs
Added generatoroptions and generator for cleaner code to generate coupons.
Thanks to, a.o., David Mudrák for raising issues leading to this version.
4.0.0 (build 2019031800) (2019031800)
4.0.0 (build 2019031800)
Plugin type: Blocks
Frankenstyle component name: block_coupon
Version build number: 2019031800
Version release name: 4.0.0 (build 2019031800)
Maturity: Stable
Supported Moodle versions: 3.4, 3.5, 3.6
Repository URL (Git): https://bitbucket.org/sebsoft/moodle-block_coupon
Repository branch:
Repository tag:
Issue/bug tracker URL: https://github.com/sebsoftnl/moodle-block_coupon/issues
Version 4.0.0 (build 2019031800)
Small change in workflow of user requested coupons
Added mailing and notification of accepted user requested coupons
Added internal Moodle notifications
Code overhaul: nearly all logic has been rewritten for maintainability reasons.
Verified workings on Moodle 3.4 (updated version.php accordingly)
AMD modules have now properly been minified
We're NO longer "following" Moodle versions.
Thanks everyone for all feedback!
Version 3.5.2 (build 2018050306)
Fixed issue(s) with CSV/Manual recipients not working.
Coupon batches now all have the same "timecreated"
Removed sorting of "action" column in coupon overviews
Custom mail function is now replaced with Moodle's own email_to_user()
Due to MANY issues where the email containing the coupons is not received, the
decision was made to change the process to sending an email containing a
download link where the generated batch can be downloaded from instead of
providing the email with an attachment.
Fixed issue #22 (we now use TCPDF's own QR Code generator)
Added/fixed validation on "request user" configuration form
Added more information to coupons requests overview table
In line with issue 32, configuration of the enrolment duration for course type
coupons has been moved to the course selection page.
Fixed issue #35 (bug in observers)
Fixed issue #34 (feature request for zip name)
Fixed issue #32 (PDF preview)
Fixed issue #30 (request user - required field setting amount of coupons has no effect)
Fixed issue #29 (request user settings: added explanations)
Fixed issue #28 (wrong paging/view for requestusers)
Fixed issue #27 (wrong link to user profile in requestusers table)
Changed sourcecode here and there to prevent debug output/PHP notices
Removed restriction on amount of coupons when only generating the codes.
Added coupon cleanup confirmation screen.
Thanks Franky Just for your valuable feedback, bug reports and additional remarks!
Version 3.5.1 (build 2018050305)
Fixed issue #23 (invalid use of PARAM_RAW)
Fixed issue #24 (redirect vulnerabilities -> changed all to PARAM_LOCALURL)
Fixed issue #25 (removed use of deprecated function notify_problem)
Fixed some missing capability checks / security issues
Thanks Dan Marsden for your valuable feedback, bug reports and plugin review!
Thanks Jesús Rincón for raising issue #25
backported some of the issues to the Moodle 3.0+ release
NOTE: All other releases except one Moodle 3.0+ release and the most recent
Moodle 3.5+ release have been pulled.
Version 3.5.0 (build 2018050304)
- Fixed issue #21 (cohort_is_member fatal error: thanks Michael Neulinger)
Version 3.5.0 (build 2018050303)
Fixed faulty course / cohort ID filter
Added course groups filter possibilities
Added "timeclaimed" information to keep track of when coupons were actually claimed
Removed table sorting for courses/cohorts/groups (didn't work and should have never been part of the tables)
Added quick rudimentary check to validate whether a person is already "signed up" when entering a code.
(i.e. member in all linked cohorts or enrolled for all linked courses).
Thanks Kevin Freeborn for your very valuable feedback!
Version 3.5.0 (build 2018050302)
- Added possibility to only generate coupon codes (no PDFs will be generated, nor will they be sent!)
- Added batchid field to database to track generated batches of coupons
- Added custom batch naming when generating coupons (system automatically creates one if not provided)
- Added possibility to filter coupons on BATCH ID/name
Version 3.5.0 (build 2018050301)
- Changed internal signup to comply to Moodle 3.5.
- Added option global to use login page layout (which is a Moodle standard really, but wasn't enforced)
- Added coupon code error checking to signup form (refuse signup in case coupon code is invalid)
- Added coupon request possibilities (please refer to manual for usage description)
- Added global options for and display of help texts for custom signup and coupon input texts
- Added possibility to request coupons for course types only. Involves admin to configure both the courses and allowed users
- Removed deprecated verify_https_required() call from custom (internal) signup
Version 3.5.0 (build 2018050300)
- FIXED issue #15 ("mdb->get_record() found more than one record" when calling find_block_instance_id()).
- FIXED issue #19 where enrolment was never updated when using a new coupon after enrolment expired.
- Fixed "Sent" column in coupon overviews (displayed information based on wrong field)
- Added privacy provider
- Validated functionality for Moodle 3.5 onwards
- Minimum required Moodle version: 3.5
Version 3.3.2 (build 2017092503)
- Added role selection for coupons (course type only)
Version 3.3.1 (build 2017092501)
- Added coupon code to "progress report" for validation purposes (feature request)
- Added claimed user to "used coupons" overview for validation purposes (feature request)
Version 3.3.0 (build 2017092500)
- Fixed deprecated pix_url references (replaced by image_url)
- Validated functionality for Moodle 3.3 onwards
- Minimum required Moodle version: 3.3
Version 2017052402 (Release 3.0.3 (build 2017052402))
Fixed bug in cohort type coupons (fixed incorrect usercheck and cohort synchronisation)
Added option to display QR Code in PDF or leave it out.
Thanks to everyone for their valuable input and remarks.
Version 2017052401 (Release 3.0.2 (build 2017052401))
Resolved issue #14
Thanks to everyone for their valuable input and remarks.
Version 2017052400 (Release 3.0.1 (build 2017052400))
Added new type of coupon: extend (course) enrolment
Added webservices!
Incorporated some changes here and the in overviews
Thanks to everyone for their valuable input and remarks.
Version 2017050100 (Release 3.0.0 (build 2017050100))
Added $CFG->wwwroot on all moodle_urls
Added setting to choose default assigned role (resolve issue #12: Student role problem.
Roles were fetched by shortname = 'student', NOT foolproof)
Disabled sorting by 'owner' column in coupon overviews (resolve issue #13).
Fixed error notification when inserting to table block_coupon_courses
Added course name(s) to coupons
Changed default coupon template-main contents (language files)
Added filtering for progress reports
Added filtering for coupon overview
Code overhaul to comply to stricter Moodle coding standards (codechecker, Moodle phpdoc check)
Added course_deleted event handler
Added cohort_deleted event handler
Added custom cleaning of coupons
Added QR based coupon to PDF including processing
Added signup for QR based coupon when user is not logged on yet
Added possibility for signup with a coupon code (in block_coupon, when user is not yet logged in)
Added new manager to manage multiple coupon background
Added option to select coupon background to use
minimum required version: Moodle3 3.0
Thanks to everyone for their valuable input and remarks.
Version 2016040800 (Release 2.7.3 (build 2016040800))
raising memory limit and maximum execution time when generating coupons.
Fixed cleanup task
Fixed last page of wizard not displaying selected groups
Updated readme
Added ability to delete unused coupons.
Feedback and general remarks or ideas for improvement are still highly valued.
Version 2015010107 (Release 2.7.2 (build 2015010107))
Changed "max coupons" setting to textual input. No more hardcoded limit of 100 coupons.
Added delete option to unused coupons overview
Added settings and task to automatically clean up unused/unclaimed coupons
Thanks to anyone and everyone for their much valued feedback!
Version 2015010102 (Release 2.7.0 (build 2015010102))
Added missing db/tasks.php
Limited applicable_formats: block can only be used on main site page and "my" dashboard view
Improved renderer (more use of html_writer)
Fixed default setting when starting coupon generator
Included settings file in /classes/task/sendcoupons.php (gave NOTICE)
Fixed a few small (non critical) bugs
Added generatoroptions and generator for cleaner code to generate coupons.
Thanks to, a.o., David Mudrák for raising issues leading to this version.
3.0.4 (build 2017052403) (2017052403)
3.0.4 (build 2017052403)
Plugin type: Blocks
Frankenstyle component name: block_coupon
Version build number: 2017052403
Version release name: 3.0.4 (build 2017052403)
Maturity: Stable
Supported Moodle versions: 3.0, 3.1, 3.2, 3.3
Repository URL (Git): https://bitbucket.org/sebsoft/moodle-block_coupon
Repository branch:
Repository tag:
Issue/bug tracker URL: https://github.com/sebsoftnl/moodle-block_coupon/issues
SEBSOFT COUPON PLUGIN
The Sebsoft Coupon Plugin offers you the possibility to create coupons for various levels
of course access. Using a coupon code, users will be enrolled into courses that are attached to the coupon.
There are a few different ways of generating coupons:
Course level: this means one or more course(s) need to be selected for which the coupon is valid.
Once the coupon code is entered by a user, he or she will be enroled in every course the coupon
is attached to.
A nice extra feature is, when groups are configured for a certain course, you can configure which
course group the coupon is for. When a user claims the coupon, he or she will be added to that specific
group in the course. This makes it possible to separate coupon users from regular users.
You could also make specific course groups every time you generate a batch of new coupons, so there's
some way of matching a batch of coupons to a group of users. The possibilities are numerous.
Cohort level: this means one or more cohort(s) need to be selected for which the coupon is valid.
Once the coupon code is entered by a user, he or she will be added as a cohort member for every
cohort the coupon is attached to.
NOTE: When generating cohort level coupons, there is a possibility to "connect" extra courses to
a given cohort. One MUST know that upon doing this, the courses will at that point be added to
the cohort enrolment sync. Without knowing this little fact, it could be "unexpected" behavior,
even though it's a logical step.
Furthermore, coupons can be generated on two "access" levels:
Personalized. The base of this, is either a CSV is uploaded, or a CSV is given directly in a textbox.
The needed user information for every coupon to be generated will be the user's name, email address
and gender.
These coupons will then be generated and sent off to the appropriate users using a background task.
Bulk: The base of this is simple: you generate a certain amount of access coupons, which will then
be emailed to the pre-configured recipient or (if allowed) to an emailaddress that can be freely entered.
WARNING:
Wherever possible, please use PNG images.
Also, whenever possible, do NOT use images that have an alpha channel.
This will MASSIVELY slow down processing time, due to internal conversion of images by TCPDF.
On our tests, for a 300 DPI image on A4 format (2480 x 3508 pixels) with an alpha channel,
rendering a single PDF took around 25 seconds. Taking the alpha channel out of the image,
rendering a single PDF was reduced to around 3 seconds.
Furthermore, whenever possible, have the coupon generator create a single PDF with all
coupons (this is only applicable when generating coupons in "bulk" mode). The process of
generating coupons has been optimized to only "use" the image 1 time when creating any amount
of coupons in a single PDF. If you choose the option to create a seperate PDF for every coupon,
the image will have to be rendered for each and every PDF.
This has 2 major downfalls:
- Every PDF will roughly have a slightly bigger size than the image size (in our tests, 350 - 400 kB per PDF)
- Every PDF takes the full amount of time to render.
Effectively, this means the following (using fictitious sizes):
10 coupons, single PDF -> result is around 400 kB, rendering takes around 3-4 seconds.
10 coupons, seperate PDFs -> result is around 4 MB, rendering takes around 35-40 seconds.
INSTALLATION INSTRUCTIONS
- Copy the coupon folder to your blocks directory.
- Go to the moodle admin pages (you will probably be confronted with it anyway) and install the plugin
- Configure the main settings for the plugin.
- We're set up for usage!
PLACEMENT OF THE PLUGIN
There are only two pages you can add the coupon block on. This is the site's frontpage
or the user dashboard (my) page. The main reason for this is because the block is the
"frontend" for users to enter their coupon or voucher code.
Administrators and users with the correct capabilities will also see the links to
the coupon administration pages and the coupon generator page.
GENERAL CONSIDERATIONS
There's two main configurations to consider when generating coupons.
For course type coupons, this plugin attempts to enrol a user through use of Moodle's
internal function "enrol_try_internal_enrol".
The Moodle documentation shows it will attempt to enrol you using manual enrolment.
For this reason manual enrolment MUST be enabled for these courses.
For cohort type coupons, a user is made a member of a cohort. That's all there is to it.
Surprise though, if you want to actually make a user have access to a course, you
probably want to configure cohort enrolment for the course.
For those paying attention, creating cohort type coupons thus enables a simple
way of enrolling users into multiple courses at once just by configuring the right
cohort enrolments in multiple courses.
That's still not to say course coupons can't be used in a similar way (using meta courses).
3.5.0 (build 2018050304) (2018050304)
3.5.0 (build 2018050304)
Plugin type: Blocks
Frankenstyle component name: block_coupon
Version build number: 2018050304
Version release name: 3.5.0 (build 2018050304)
Maturity: Stable
Supported Moodle versions: 3.5, 3.6
Repository URL (Git): https://bitbucket.org/sebsoft/moodle-block_coupon
Repository branch:
Repository tag:
Issue/bug tracker URL: https://github.com/sebsoftnl/moodle-block_coupon/issues
SEBSOFT COUPON PLUGIN
The Sebsoft Coupon Plugin offers you the possibility to create coupons for various levels
of course access. Using a coupon code, users will be enrolled into courses that are attached to the coupon.
There are a few different ways of generating coupons:
Course level: this means one or more course(s) need to be selected for which the coupon is valid.
Once the coupon code is entered by a user, he or she will be enroled in every course the coupon
is attached to.
A nice extra feature is, when groups are configured for a certain course, you can configure which
course group the coupon is for. When a user claims the coupon, he or she will be added to that specific
group in the course. This makes it possible to separate coupon users from regular users.
You could also make specific course groups every time you generate a batch of new coupons, so there's
some way of matching a batch of coupons to a group of users. The possibilities are numerous.
Cohort level: this means one or more cohort(s) need to be selected for which the coupon is valid.
Once the coupon code is entered by a user, he or she will be added as a cohort member for every
cohort the coupon is attached to.
NOTE: When generating cohort level coupons, there is a possibility to "connect" extra courses to
a given cohort. One MUST know that upon doing this, the courses will at that point be added to
the cohort enrolment sync. Without knowing this little fact, it could be "unexpected" behavior,
even though it's a logical step.
Furthermore, coupons can be generated on two "access" levels:
Personalized. The base of this, is either a CSV is uploaded, or a CSV is given directly in a textbox.
The needed user information for every coupon to be generated will be the user's name, email address
and gender.
These coupons will then be generated and sent off to the appropriate users using a background task.
Bulk: The base of this is simple: you generate a certain amount of access coupons, which will then
be emailed to the pre-configured recipient or (if allowed) to an emailaddress that can be freely entered.
WARNING:
Wherever possible, please use PNG images.
Also, whenever possible, do NOT use images that have an alpha channel.
This will MASSIVELY slow down processing time, due to internal conversion of images by TCPDF.
On our tests, for a 300 DPI image on A4 format (2480 x 3508 pixels) with an alpha channel,
rendering a single PDF took around 25 seconds. Taking the alpha channel out of the image,
rendering a single PDF was reduced to around 3 seconds.
Furthermore, whenever possible, have the coupon generator create a single PDF with all
coupons (this is only applicable when generating coupons in "bulk" mode). The process of
generating coupons has been optimized to only "use" the image 1 time when creating any amount
of coupons in a single PDF. If you choose the option to create a seperate PDF for every coupon,
the image will have to be rendered for each and every PDF.
This has 2 major downfalls:
- Every PDF will roughly have a slightly bigger size than the image size (in our tests, 350 - 400 kB per PDF)
- Every PDF takes the full amount of time to render.
Effectively, this means the following (using fictitious sizes):
10 coupons, single PDF -> result is around 400 kB, rendering takes around 3-4 seconds.
10 coupons, seperate PDFs -> result is around 4 MB, rendering takes around 35-40 seconds.
INSTALLATION INSTRUCTIONS
- Copy the coupon folder to your blocks directory.
- Go to the moodle admin pages (you will probably be confronted with it anyway) and install the plugin
- Configure the main settings for the plugin.
- We're set up for usage!
PLACEMENT OF THE PLUGIN
There are only two pages you can add the coupon block on. This is the site's frontpage
or the user dashboard (my) page. The main reason for this is because the block is the
"frontend" for users to enter their coupon or voucher code.
Administrators and users with the correct capabilities will also see the links to
the coupon administration pages and the coupon generator page.
GENERAL CONSIDERATIONS
There's two main configurations to consider when generating coupons.
For course type coupons, this plugin attempts to enrol a user through use of Moodle's
internal function "enrol_try_internal_enrol".
The Moodle documentation shows it will attempt to enrol you using manual enrolment.
For this reason manual enrolment MUST be enabled for these courses.
For cohort type coupons, a user is made a member of a cohort. That's all there is to it.
Surprise though, if you want to actually make a user have access to a course, you
probably want to configure cohort enrolment for the course.
For those paying attention, creating cohort type coupons thus enables a simple
way of enrolling users into multiple courses at once just by configuring the right
cohort enrolments in multiple courses.
That's still not to say course coupons can't be used in a similar way (using meta courses).