Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hard-Coded Database Name - SOLVED
12-08-2017, 07:08 AM (This post was last modified: 12-09-2017 04:34 AM by VortecCPI.)
Post: #1
Hard-Coded Database Name - SOLVED
We still have a hard-coded Database name in two (2) files. These must be changed from $DatabaseName='weberp' to $DatabaseName = $_SESSION['DatabaseName']

PDFSalesBySalesperson.php:
Line 4: $DatabaseName='weberp';

PDFWeeklyOrdersn.php:
Line 4: $DatabaseName='weberp';

And to be consistent why not append "Recipients" to the end of the GetMailList argument in these two files to match the other four?

$Recipients = GetMailList('salesbysalesperson'); > $Recipients = GetMailList('SalesBySalespersonRecipients');

$Recipients = GetMailList('WeeklyOrders'); > $Recipients = GetMailList('WeeklyOrdersRecipients');

https://www.linkedin.com/in/eclipsepaulbecker
Visit this user's website Find all posts by this user
Quote this message in a reply
01-08-2018, 10:14 AM (This post was last modified: 01-08-2018 10:16 AM by TurboPT.)
Post: #2
RE: Hard-Coded Database Name - SOLVED
Paul, there are some interesting things that I discovered based on your findings here! (Have you tried these files, out of curiosity?)
  1. The variable $DatabaseName seems to have no use in either script, nor with any sub-included files. So, these two entries can very likely be removed.
  2. There is nothing about the 'Mailing Group Maintenance' script that adds a 'Recipients' suffix to any new entries -- as the groups are entered as-is, or user-defined. The "other four" that you mentioned are created by:
    • the weberp demo database SQL [file: sql/mysql/country_sql/demo.sql]
    • the non-demo weberp 4.10-4.11 update SQL [file: sql/mysql/upgrade4.10-4.11.sql]
    As a side note, I do NOT see anywhere that the 'salesbysalesperson' or the 'WeeklyOrders' is created as real mail groups??
  3. Also, while investigating item #2, both files sub-include: 'includes/PDFWeeklyOrdersPageHeader.inc' -- however, the PDFWeeklyOrdersPageHeader.inc file does NOT exist in the includes/ directory or in the root directory. I also checked the online web-erp trunk and it is not there either. There IS, however, a file in the includes/ directory named PDFWOPageHeader.inc, but this file apparently for 'Work Orders' and not 'Weekly Orders', so there might be a missing file?

...so, I'm guessing that these files apparently have no use? I'm not aware of any complaints with those two files.

Phil/Tim: ... any thoughts on these findings?
Find all posts by this user
Quote this message in a reply
01-08-2018, 12:10 PM
Post: #3
RE: Hard-Coded Database Name - SOLVED
Re 1 yes $DatabaseName is redundant now - they can go!!

I think Exson did the mailing groups work - so perhaps best placed to advise on 2.

Paul B's solution looks like a good idea to me.

Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Visit this user's website Find all posts by this user
Quote this message in a reply
01-08-2018, 12:30 PM
Post: #4
RE: Hard-Coded Database Name - SOLVED
Phil, any idea about item 3?

There appears to be a missing file?
Find all posts by this user
Quote this message in a reply
01-08-2018, 12:34 PM
Post: #5
RE: Hard-Coded Database Name - SOLVED
Looks like it was Andrew Galuski commit - and he's not committed the include.

Phil Daintree
webERP Admin
Logic Works Ltd
http://www.logicworks.co.nz
Visit this user's website Find all posts by this user
Quote this message in a reply
01-08-2018, 05:59 PM
Post: #6
RE: Hard-Coded Database Name - SOLVED
Paul, I wasn't happy with these two reports at the time so didn't include them in my code. I seem to remember I had some correspondence with Andrew about them but right now I can't seem to find it.

Tim
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)