Skip to content

Allow external download for supplier orders and invoices and expose direct-download variables#14

Open
mapiolca wants to merge 1 commit into22.0from
2026-03-02-add-substitutions-for-download-urls
Open

Allow external download for supplier orders and invoices and expose direct-download variables#14
mapiolca wants to merge 1 commit into22.0from
2026-03-02-add-substitutions-for-download-urls

Conversation

@mapiolca
Copy link
Copy Markdown
Owner

@mapiolca mapiolca commented Mar 2, 2026

Motivation

  • Provide the ability to generate and expose direct-download links for supplier-side documents (supplier orders and supplier invoices) and make this feature configurable from the admin UI.

Description

  • Add admin toggles SUPPLIER_ORDER_ALLOW_EXTERNAL_DOWNLOAD and SUPPLIER_INVOICE_ALLOW_EXTERNAL_DOWNLOAD in supplier_order.php and supplier_invoice.php using ajax_constantonoff to control external sharing.
  • Update CommonObject to set the ECM share key when element is order_supplier or invoice_supplier and the corresponding global flags are enabled so generated documents can be shared externally.
  • Add substitution variables __DIRECTDOWNLOAD_URL_SUPPLIER_ORDER__ and __DIRECTDOWNLOAD_URL_SUPPLIER_INVOICE__ in getCommonSubstitutionArray() and populate them using the object's getLastMainDocLink() when allowed.

Testing

  • No automated tests were added for this change.
  • Performed PHP syntax checks (php -l) on the modified files and they passed without syntax errors.
  • Existing automated test suite was not modified as part of this change.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant