webERP Forum

Full Version: User Report Size - Leftover Code?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
We set the Report Size for each User but it appears this data is ignored.

If you search on $PageSize you will see it is commented out in the following scripts:

+ PDFStarter.php
+ InventoryPlanning.php
+ InventoryPlanningPreSupplier.php
+ MailInventoryValuation.php
+ PrintCustOrder.php

I assume this some sort of leftover legacy code that is no longer used/needed. Should it be removed?
It appears that you're talking about these, searching the entire code base:

[Image: zn946e.jpg]

I say go ahead and delete those entries. There is a comment above some of those about a constructor change to the Cpdf, so that is apparently the "old way".
If $PaperSize is not set by the individual report then PDFStarter.php (which should be called by all reports) will use the users default paper size. However quickly greping through the scripts it looks like most reports do define their own $PaperSize.

Thanks
Tim
Also... Even though report size is set to "Letter" for our Users hyperlinks still show "A4" in the text string.
Hi Paul, to what links are you referring?
Tim
(01-10-2018 11:22 PM)falkoner Wrote: [ -> ]Hi Paul, to what links are you referring?
Tim

Tim... Sorry about ambiguity...

A good example is a reprint of a Dispatch Note:

[attachment=677]

Looks like "A4" is hard-coded into the script via _('A4') in the message string.

This occurs in the following scripts:

+ EmailConfirmation.php
+ PrintCustOrder.php
+ PrintCustOrder_generic.php
Looking at PrintCustOrder_generic.php (I assume the others are similar) then the A4 is in the text description of the link, but not passed as a parameter. However line 145 is $PaperSize = 'A4_Landscape'; which as I said in a previous post forces that size on the report. If that line is commented out then webERP will use the size set in the user profile.

Thanks
Tim
(01-11-2018 01:58 AM)falkoner Wrote: [ -> ]Looking at PrintCustOrder_generic.php (I assume the others are similar) then the A4 is in the text description of the link, but not passed as a parameter. However line 145 is $PaperSize = 'A4_Landscape'; which as I said in a previous post forces that size on the report. If that line is commented out then webERP will use the size set in the user profile.

Thanks
Tim

Thank you for having a look at this.

$PaperSize = 'A4... also occurs in:

+ PDFQuotationPortrait.php
+ FixedAssetRegister.php
+ PDFQuotation.php
Also... In other scrips we have $PaperSize = 'Letter';

+ PDFCOA.php
+ PDFProdSpec.php
Commenting out $PaperSize = ... lines results in a layout mess for me as my prefs are set to "Letter".

Perhaps the user-specific report size in preferences is some sort of unfinished work?
Yes. As I (maybe badly) describe here (http://www.weberp.org/forum/showthread.p...#pid13850) PDFStarter.php (which is the base for the PDF reports - except for a very few rogue ones that don't use the proper method) will take the users paper size _only_ if the calling script doesn't define it's own with a $PageSize assignment. However it seems most do make this assignment. Only trial and error will tell you whether this assignment is necessary. I suspect mostly developers tested it on one paper size and didn't bother to test it on others Smile

One problem with open source is that sometimes developers will scratch their own itch ignoring others.

Tim
Just out of curiosity... Is "Letter" paper size used outside of the USA? If not we ought to change PDFCOA.php and PDFProdSpec.php to A4 paper size.

While I realize webERP is made "for the world" it is likely best if all reports are consistent in terms of paper size. If the majority of users are using A4 then why not make all reports A4 to be consistent?
"By 1977, A4 was the standard letter format in 88 of 148 countries. Today the standard has been adopted by all countries in the world except the United States and Canada. In Mexico, Costa Rica, Colombia, Venezuela, Chile, and the Philippines, the US letter format is still in common use, despite their official adoption of the ISO standard."

Since it appears most of the world does NOT use Letter I think we should change PDFCOA.php and PDFProdSpec.php to A4.
Pages: 1 2
Reference URL's