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