Coupon

Blocks ::: block_coupon
Maintained by Sebsoft BV, Rogier van Dongen
Part of set Coupon Suite.
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.

Coupon 4.4.1 (build 2024100102)

Moodle 4.2, 4.3, 4.4, 4.5
Released: ಸೋಮವಾರ, 14 ಅಕ್ಟೋಬರ್ 2024, 7:10 PM
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
* 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.
-----

Version information

Version build number
2024100102
Version release name
4.4.1 (build 2024100102)
Maturity
Stable version
MD5 Sum
55f8d86a9896cec63a13b79078f5738f
Supported software
Moodle 4.2, Moodle 4.3, Moodle 4.4, Moodle 4.5
  • Latest release for Moodle 4.2
  • Latest release for Moodle 4.3
  • Latest release for Moodle 4.4
  • Latest release for Moodle 4.5

Version control information

Version control system (VCS)
GIT
VCS repository URL
VCS tag
4.4.1

Default installation instructions for plugins of the type Blocks

  1. Make sure you have all the required versions.
  2. Download and unpack the block folder.
  3. Place the folder (eg "myblock") in the "blocks" subdirectory.
  4. Visit http://yoursite.com/admin to complete the installation
  5. Turn editing on in any home or course page.
  6. Add the block to the page
  7. Visit the config link in the block for more options.