-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow 'function' fields in email and pdf templates #4266
base: develop
Are you sure you want to change the base?
Conversation
65d0682
to
95f8224
Compare
Codecov Report
@@ Coverage Diff @@
## develop #4266 +/- ##
==========================================
Coverage ? 11%
Complexity ? 41385
==========================================
Files ? 3378
Lines ? 245629
Branches ? 0
==========================================
Hits ? 27035
Misses ? 218594
Partials ? 0 |
fix last page when modulus is zero
Fixed salesagility#6720 - Remove old recaptcha files
* Update command to allow for cache directory specified in config * Remove warnings/errors when no cached directory present * Update to have namespace "cache" so we can add other cache commands later * Leave alias for current command * Use provided toolsets required by robo for implementation * Print cleaned directories * Confirm before cleaning directory * Allow for force override
…-notes # Conflicts: # modules/Campaigns/Campaign.php # modules/Campaigns/views/view.detail.php # modules/Notes/vardefs.php
…gn-notes Add ability to have Notes on a Campaign
…e-command-config-cache-dir Allow for clean cache command to use config'd cache_dir (plus clean up)
# Conflicts: # modules/AOS_PDF_Templates/PDF_Lib/classes/bmp.php # modules/AOS_PDF_Templates/PDF_Lib/classes/cssmgr.php # modules/AOS_PDF_Templates/PDF_Lib/classes/directw.php # modules/AOS_PDF_Templates/PDF_Lib/classes/form.php # modules/AOS_PDF_Templates/PDF_Lib/classes/gif.php # modules/AOS_PDF_Templates/PDF_Lib/classes/grad.php # modules/AOS_PDF_Templates/PDF_Lib/classes/indic.php # modules/AOS_PDF_Templates/PDF_Lib/classes/svg.php # modules/AOS_PDF_Templates/PDF_Lib/classes/tocontents.php # modules/AOS_PDF_Templates/PDF_Lib/classes/ttfontsuni.php # modules/AOS_PDF_Templates/PDF_Lib/classes/wmf.php # modules/AOS_PDF_Templates/PDF_Lib/mpdf.php # modules/AOS_PDF_Templates/PDF_Lib/mpdfi/fpdi_pdf_parser.php # modules/AOS_PDF_Templates/PDF_Lib/mpdfi/pdf_context.php # modules/AOS_PDF_Templates/PDF_Lib/mpdfi/pdf_parser.php
# Conflicts: # composer.lock # files.md5 # include/HTMLPurifier/HTMLPurifier.standalone.php # include/HTMLPurifier/standalone/HTMLPurifier/Lexer/PH5P.php # include/SugarCharts/Jit/FlashCanvas/canvas2png.js # include/SugarCharts/Jit/FlashCanvas/flashcanvas.js # include/SugarCharts/Jit/js/Jit/jit.js # include/SugarCharts/Jit/js/sugarCharts.js # include/pclzip/pclzip.lib.php # include/utils/zip_utils.php # lib/Robo/Plugin/Commands/CleanCacheCommands.php # modules/AOS_PDF_Templates/PDF_Lib/classes/barcode.php # modules/AOS_PDF_Templates/PDF_Lib/classes/bmp.php # modules/AOS_PDF_Templates/PDF_Lib/classes/cssmgr.php # modules/AOS_PDF_Templates/PDF_Lib/classes/directw.php # modules/AOS_PDF_Templates/PDF_Lib/classes/form.php # modules/AOS_PDF_Templates/PDF_Lib/classes/gif.php # modules/AOS_PDF_Templates/PDF_Lib/classes/grad.php # modules/AOS_PDF_Templates/PDF_Lib/classes/indic.php # modules/AOS_PDF_Templates/PDF_Lib/classes/meter.php # modules/AOS_PDF_Templates/PDF_Lib/classes/svg.php # modules/AOS_PDF_Templates/PDF_Lib/classes/tocontents.php # modules/AOS_PDF_Templates/PDF_Lib/classes/ttfontsuni.php # modules/AOS_PDF_Templates/PDF_Lib/classes/ttfontsuni_analysis.php # modules/AOS_PDF_Templates/PDF_Lib/classes/wmf.php # modules/AOS_PDF_Templates/PDF_Lib/compress.php # modules/AOS_PDF_Templates/PDF_Lib/config.php # modules/AOS_PDF_Templates/PDF_Lib/config_cp.php # modules/AOS_PDF_Templates/PDF_Lib/config_fonts.php # modules/AOS_PDF_Templates/PDF_Lib/font/ccourier.php # modules/AOS_PDF_Templates/PDF_Lib/font/ccourierb.php # modules/AOS_PDF_Templates/PDF_Lib/font/ccourierbi.php # modules/AOS_PDF_Templates/PDF_Lib/font/ccourieri.php # modules/AOS_PDF_Templates/PDF_Lib/font/chelvetica.php # modules/AOS_PDF_Templates/PDF_Lib/font/chelveticab.php # modules/AOS_PDF_Templates/PDF_Lib/font/chelveticabi.php # modules/AOS_PDF_Templates/PDF_Lib/font/chelveticai.php # modules/AOS_PDF_Templates/PDF_Lib/font/csymbol.php # modules/AOS_PDF_Templates/PDF_Lib/font/ctimes.php # modules/AOS_PDF_Templates/PDF_Lib/font/ctimesb.php # modules/AOS_PDF_Templates/PDF_Lib/font/ctimesbi.php # modules/AOS_PDF_Templates/PDF_Lib/font/ctimesi.php # modules/AOS_PDF_Templates/PDF_Lib/font/czapfdingbats.php # modules/AOS_PDF_Templates/PDF_Lib/graph.php # modules/AOS_PDF_Templates/PDF_Lib/includes/CJKdata.php # modules/AOS_PDF_Templates/PDF_Lib/includes/functions.php # modules/AOS_PDF_Templates/PDF_Lib/includes/ind_bn_1_001.volt.php # modules/AOS_PDF_Templates/PDF_Lib/includes/ind_gu_1_001.volt.php # modules/AOS_PDF_Templates/PDF_Lib/includes/ind_hi_1_001.volt.php # modules/AOS_PDF_Templates/PDF_Lib/includes/ind_kn_1_001.volt.php # modules/AOS_PDF_Templates/PDF_Lib/includes/ind_ml_1_001.volt.php # modules/AOS_PDF_Templates/PDF_Lib/includes/ind_or_1_001.volt.php # modules/AOS_PDF_Templates/PDF_Lib/includes/ind_pa_1_001.volt.php # modules/AOS_PDF_Templates/PDF_Lib/includes/ind_ta_1_001.volt.php # modules/AOS_PDF_Templates/PDF_Lib/includes/ind_te_1_001.volt.php # modules/AOS_PDF_Templates/PDF_Lib/includes/out.php # modules/AOS_PDF_Templates/PDF_Lib/includes/subs_core.php # modules/AOS_PDF_Templates/PDF_Lib/includes/subs_win-1252.php # modules/AOS_PDF_Templates/PDF_Lib/includes/upperCase.php # modules/AOS_PDF_Templates/PDF_Lib/mpdf.php # modules/AOS_PDF_Templates/PDF_Lib/mpdfi/filters/FilterASCII85.php # modules/AOS_PDF_Templates/PDF_Lib/mpdfi/filters/FilterLZW.php # modules/AOS_PDF_Templates/PDF_Lib/mpdfi/fpdi_pdf_parser.php # modules/AOS_PDF_Templates/PDF_Lib/mpdfi/pdf_context.php # modules/AOS_PDF_Templates/PDF_Lib/mpdfi/pdf_parser.php # modules/AOS_PDF_Templates/PDF_Lib/patterns/de.php # modules/AOS_PDF_Templates/PDF_Lib/patterns/en.php # modules/AOS_PDF_Templates/PDF_Lib/patterns/es.php # modules/AOS_PDF_Templates/PDF_Lib/patterns/fi.php # modules/AOS_PDF_Templates/PDF_Lib/patterns/fr.php # modules/AOS_PDF_Templates/PDF_Lib/patterns/it.php # modules/AOS_PDF_Templates/PDF_Lib/patterns/nl.php # modules/AOS_PDF_Templates/PDF_Lib/patterns/pl.php # modules/AOS_PDF_Templates/PDF_Lib/patterns/sv.php # modules/AOS_PDF_Templates/PDF_Lib/utils/UnicodeRanges.php # modules/AOS_PDF_Templates/PDF_Lib/utils/font_collections.php # modules/AOS_PDF_Templates/PDF_Lib/utils/font_coverage.php # modules/AOS_PDF_Templates/PDF_Lib/utils/font_dump.php # modules/AOS_PDF_Templates/PDF_Lib/utils/font_names.php # modules/Emails/include/ListView/DeleteEmailAction.js # modules/UpgradeWizard/silentUpgrade_step1.php
Please resolve the conflicts on this pull request bringing it up to date. |
# Conflicts: # include/nusoap/class.soap_parser.php # include/nusoap/class.xmlschema.php
This probably isn't necessary and can be removed?
How do I check the clahub agreement? I have signed the agreement myself already. How can the "commit's parents" not have signed the CLA if I base on the SA SuiteCRM develop branch? |
73a6ddd
to
9eaacf6
Compare
Hi @HVStechnik, the issue with the CLAHub is that your commit is coming from what Git sees as two different authors, "HVStechnik" and "Max Wilckens". I would suggest either editing the author of the last commit and force pushing back up or doing a rebase (This may be of some assistance: https://www.git-tower.com/learn/git/faq/change-author-name-email) Let me know if you run into any difficulties, I can rebase this for you with just the "HVStechnik" account as the author if that makes it easier. Thanks! |
Thanks @Dillon-Brown, I managed to change the author, but now travis fails. I think that the php5.6 build currently fails for all new pull requests.... |
…ctors Remove PHP4 style constructors
…html-purifier-file Remove HTMLPurifier ConfigForm.js file.
E-mails send by the Workflow module based on an Email template do not contain function fields (source = 'function' in vardef definition). Those fields are not automatically calculated, when the bean is initiated and the db row retrieved. For standard views the function fields are calculated during displaying. For email templates they however stayed blank. Update the templateParser.php file within the AOS_PDF_Templates module in order to calculate function fields while creating the replacement array for the template markers. The solution is similar to the calculation of those fields in /include/EditView/EditView2.php lines 1000 to 1040
@Dillon-Brown it would be nice to merge this one, I think it's low risk and useful. You don't have to label it "Enhancement", in my opinion, since it's technically a bug to have fields that conform to a spec, and render well in some views but fail when sent via email. This doesn't require the extra "Enhancement" review, I believe... |
@pgorod I reviewed the custom function options once again and got a bit confused: Within the vardefs there are three different versions of how to include a custom function to calculate a field value:
I would very much recommend to simplify this a little bit: After having done this review, I think we might want to leverage the callFunction function in EditView that does exactly the same as implemented by this PR. Would it be an option to move that function to SugarBean.php and call it whenever a custom function field needs to be evaluated? PS: This does not make this PR less usefull ;-) |
@HVStechnik thanks for taking the time to study this. I guess some reorganization would be beneficial. We'd have to be careful not to make the changes break any existing customizations that people might have out there, relying on one of these mechanisms. Another thing that would be quite useful would be to improve (or start?) some Documentation about this... I don't think there's any place really teaching how to use this. |
|
1998a13
to
7e9bf41
Compare
Issue
E-mails send by the Workflow module based on an Email template do not contain function fields (source = 'function' in vardef definition). Those fields are not automatically calculated, when the bean is initiated and the db row retrieved. For standard views the function fields are calculated during displaying. For email templates they however stayed blank.
Solution
Update the templateParser.php file within the AOS_PDF_Templates module in order to calculate function fields while creating the replacement array for the template markers.
The solution is similar to the calculation of those fields in /include/EditView/EditView2.php lines 1000 to 1040
How To Test This
Create an email template including a function field from a vardef and try to send it automatically.
Types of changes
Final checklist
Thanks to pgorod for guiding me through my first git pull request!