Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
User Report Size - Leftover Code?
01-10-2018, 05:41 AM, (This post was last modified: 01-10-2018, 06:20 AM by VortecCPI.)
#1
User Report Size - Leftover Code?
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?
https://www.linkedin.com/in/eclipsepaulbecker
Reply
01-10-2018, 07:48 AM, (This post was last modified: 01-10-2018, 07:54 AM by TurboPT.)
#2
RE: User Report Size - Leftover Code?
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".
Reply
01-10-2018, 08:09 AM,
#3
RE: User Report Size - Leftover Code?
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
Reply
01-10-2018, 10:23 PM,
#4
RE: User Report Size - Leftover Code?
Also... Even though report size is set to "Letter" for our Users hyperlinks still show "A4" in the text string.
https://www.linkedin.com/in/eclipsepaulbecker
Reply
01-10-2018, 11:22 PM,
#5
RE: User Report Size - Leftover Code?
Hi Paul, to what links are you referring?
Tim
Reply
01-11-2018, 01:06 AM, (This post was last modified: 01-11-2018, 01:14 AM by VortecCPI.)
#6
RE: User Report Size - Leftover Code?
(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:

   

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
https://www.linkedin.com/in/eclipsepaulbecker
Reply
01-11-2018, 01:58 AM,
#7
RE: User Report Size - Leftover Code?
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
Reply
01-11-2018, 02:02 AM, (This post was last modified: 01-11-2018, 02:55 AM by VortecCPI.)
#8
RE: User Report Size - Leftover Code?
(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?
https://www.linkedin.com/in/eclipsepaulbecker
Reply
01-11-2018, 02:19 AM,
#9
RE: User Report Size - Leftover Code?
Yes. As I (maybe badly) describe here (http://www.weberp.org/forum/showthread.p...0#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
Reply
01-11-2018, 02:47 AM, (This post was last modified: 01-11-2018, 02:52 AM by VortecCPI.)
#10
RE: User Report Size - Leftover Code?
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.
https://www.linkedin.com/in/eclipsepaulbecker
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)