From: skaill <sk...@ro...> - 2004-09-09 09:52:17
|
I've noticed this type of thing in some scripts... $title =3D 'Receive Controlled Items'; $PageSecurity =3D 11; /* Session started in header.inc for password checking and authorisation = level check */ include('includes/DefinePOClass.php'); include('includes/DefineSerialItems.php'); include('includes/session.inc'); include('includes/header.inc'); If $title was moved below session.inc and above header.inc that would be = good for $title. However, DefineSerialItems.php has a string in it = which means it also needs to be after session.inc. session.inc never uses any includes before it and verifies access so I'm = thinking session.inc should always be the first include anyway. Can you = confirm this Phil? Steve |
From: Phil D. <we...@pa...> - 2004-09-09 10:27:13
|
That makes sense Steve. I think it may be more interesting with PDF report scripts (not that they will work in multi-language) since the LanguageSetup.php is included in PDFStarter_ros.php and we need to handle errors with html so header.inc gets included before any html output. Phil On Thu, 2004-09-09 at 21:53, skaill wrote: > I've noticed this type of thing in some scripts... > > $title = 'Receive Controlled Items'; > $PageSecurity = 11; > > /* Session started in header.inc for password checking and > authorisation level check */ > include('includes/DefinePOClass.php'); > include('includes/DefineSerialItems.php'); > include('includes/session.inc'); > include('includes/header.inc'); > > If $title was moved below session.inc and above header.inc that would > be good for $title. However, DefineSerialItems.php has a string in it > which means it also needs to be after session.inc. > > session.inc never uses any includes before it and verifies access so > I'm thinking session.inc should always be the first include anyway. > Can you confirm this Phil? > > Steve |
From: skaill <sk...@ro...> - 2004-09-20 21:34:52
|
Here's another about moving $title... below session.inc but above header.inc... ----- Original Message ----- From: "Phil Daintree" <we...@pa...> To: <web...@li...> Sent: Thursday, September 09, 2004 6:28 AM Subject: Re: [Web-erp-developers] Multilanguage - includes > That makes sense Steve. > > I think it may be more interesting with PDF report scripts (not that > they will work in multi-language) since the LanguageSetup.php is > included in PDFStarter_ros.php and we need to handle errors with html so > header.inc gets included before any html output. > > Phil > > On Thu, 2004-09-09 at 21:53, skaill wrote: > > I've noticed this type of thing in some scripts... > > > > $title = 'Receive Controlled Items'; > > $PageSecurity = 11; > > > > /* Session started in header.inc for password checking and > > authorisation level check */ > > include('includes/DefinePOClass.php'); > > include('includes/DefineSerialItems.php'); > > include('includes/session.inc'); > > include('includes/header.inc'); > > > > If $title was moved below session.inc and above header.inc that would > > be good for $title. However, DefineSerialItems.php has a string in it > > which means it also needs to be after session.inc. > > > > session.inc never uses any includes before it and verifies access so > > I'm thinking session.inc should always be the first include anyway. > > Can you confirm this Phil? > > > > Steve > > > > ------------------------------------------------------- > This SF.Net email is sponsored by BEA Weblogic Workshop > FREE Java Enterprise J2EE developer tools! > Get your free copy of BEA WebLogic Workshop 8.1 today. > http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click > _______________________________________________ > Web-erp-developers mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/web-erp-developers |
From: Jesse P. <je...@st...> - 2004-09-12 19:39:24
|
This is gonna be a fun one. I did the translation fixes on ConfirmDispatch_Invoice yesterday and tried to start ConfirmDispatchControlled_Invoice. I quickly ran into a problem that I have finally tracked down today courtesy of var_dump. Turns out something I knew, but neglected to think about... and web-erp is, probably intentionally, written correctly. The problem is that when you use class based objects, such as cart in DefineCartClass.php, the class needs to exist *before* the session is started if you are going to use that object as a session variable. Since the repercussions of it can be strange (things won't just break), it would be a really good idea to pull all the files the order has been changed in and fix them soon. That essentially puts us at needing to do something like this on every page this happens... just in general would probably be good. ------------------------------------------------------------------------------------------------------------------------ include('includes/DefinePOClass.php'); include('includes/DefineSerialItems.php'); $PageSecurity = 11; /* Session started in header.inc for password checking and authorisation level check */ include('includes/session.inc'); $title = 'Receive Controlled Items'; include('includes/header.inc'); ------------------------------------------------------------------------------------------------------------------------ That, however creates a smaller problem in that the strings in the DefineXXX files can not be translated if the _() function does not exist. I can see a few solutions: * require_once() for the language file include, and putting that line in session and all the files that may be included before it. (easiest) * including all files that may be necessary in session.inc (bad idea) * changing classes to remove strings so translation is moot (probably more correct) thoughts? jesse skaill wrote: > I've noticed this type of thing in some scripts... > > $title = 'Receive Controlled Items'; > $PageSecurity = 11; > > /* Session started in header.inc for password checking and > authorisation level check */ > include('includes/DefinePOClass.php'); > include('includes/DefineSerialItems.php'); > include('includes/session.inc'); > include('includes/header.inc'); > If $title was moved below session.inc and above header.inc that would > be good for $title. However, DefineSerialItems.php has a string in it > which means it also needs to be after session.inc. > > session.inc never uses any includes before it and verifies access so > I'm thinking session.inc should always be the first include anyway. > Can you confirm this Phil? > > Steve |
From: Daintrees <p.d...@pa...> - 2004-09-12 20:02:08
|
I hit the same snag yesterday with Credit_Invoice.php Or option 4 include LanguageSetup.php in every script at the beginning. This is more visible and prevents having to delve through several layers of includes. I will do this and change session.inc Thanks Jesse Phil ----- Original Message ----- From: "Jesse Peterson" <je...@st...> To: <web...@li...> Sent: Monday, September 13, 2004 7:39 AM Subject: Re: [Web-erp-developers] Multilanguage - includes > This is gonna be a fun one. I did the translation fixes on > ConfirmDispatch_Invoice yesterday and tried to start > ConfirmDispatchControlled_Invoice. I quickly ran into a problem that I > have finally tracked down today courtesy of var_dump. Turns out > something I knew, but neglected to think about... and web-erp is, > probably intentionally, written correctly. > > The problem is that when you use class based objects, such as cart in > DefineCartClass.php, the class needs to exist *before* the session is > started if you are going to use that object as a session variable. > Since the repercussions of it can be strange (things won't just break), > it would be a really good idea to pull all the files the order has been > changed in and fix them soon. > > That essentially puts us at needing to do something like this on every > page this happens... just in general would probably be good. > -------------------------------------------------------------------------- ---------------------------------------------- > include('includes/DefinePOClass.php'); > include('includes/DefineSerialItems.php'); > $PageSecurity = 11; > /* Session started in header.inc for password checking and authorisation > level check */ > include('includes/session.inc'); > $title = 'Receive Controlled Items'; > > include('includes/header.inc'); > -------------------------------------------------------------------------- ---------------------------------------------- > > That, however creates a smaller problem in that the strings in the > DefineXXX files can not be translated if the _() function does not > exist. I can see a few solutions: > * require_once() for the language file include, and putting that line in > session and all the files that may be included before it. (easiest) > * including all files that may be necessary in session.inc (bad idea) > * changing classes to remove strings so translation is moot (probably > more correct) > > thoughts? > > > jesse > > > skaill wrote: > > > I've noticed this type of thing in some scripts... > > > > $title = 'Receive Controlled Items'; > > $PageSecurity = 11; > > > > /* Session started in header.inc for password checking and > > authorisation level check */ > > include('includes/DefinePOClass.php'); > > include('includes/DefineSerialItems.php'); > > include('includes/session.inc'); > > include('includes/header.inc'); > > If $title was moved below session.inc and above header.inc that would > > be good for $title. However, DefineSerialItems.php has a string in it > > which means it also needs to be after session.inc. > > > > session.inc never uses any includes before it and verifies access so > > I'm thinking session.inc should always be the first include anyway. > > Can you confirm this Phil? > > > > Steve > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 > Project Admins to receive an Apple iPod Mini FREE for your judgement on > who ports your project to Linux PPC the best. Sponsored by IBM. > Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php > _______________________________________________ > Web-erp-developers mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/web-erp-developers > |
From: skaill <sk...@ro...> - 2004-09-12 20:20:39
|
So, I guess that means we need to download the latest cvs after you do it, Phil and before doing any more multilanguage conversion. We will need to include LanguageSetup.php at the beginning of each script we do from now on, right? Steve ----- Original Message ----- From: "Daintrees" <p.d...@pa...> To: <web...@li...> Sent: Sunday, September 12, 2004 4:04 PM Subject: Re: [Web-erp-developers] Multilanguage - includes > I hit the same snag yesterday with Credit_Invoice.php > > Or option 4 include LanguageSetup.php in every script at the beginning. > This is more visible and prevents having to delve through several layers of > includes. > I will do this and change session.inc > > Thanks Jesse > > Phil > > ----- Original Message ----- > From: "Jesse Peterson" <je...@st...> > To: <web...@li...> > Sent: Monday, September 13, 2004 7:39 AM > Subject: Re: [Web-erp-developers] Multilanguage - includes > > > > This is gonna be a fun one. I did the translation fixes on > > ConfirmDispatch_Invoice yesterday and tried to start > > ConfirmDispatchControlled_Invoice. I quickly ran into a problem that I > > have finally tracked down today courtesy of var_dump. Turns out > > something I knew, but neglected to think about... and web-erp is, > > probably intentionally, written correctly. > > > > The problem is that when you use class based objects, such as cart in > > DefineCartClass.php, the class needs to exist *before* the session is > > started if you are going to use that object as a session variable. > > Since the repercussions of it can be strange (things won't just break), > > it would be a really good idea to pull all the files the order has been > > changed in and fix them soon. > > > > That essentially puts us at needing to do something like this on every > > page this happens... just in general would probably be good. > > -------------------------------------------------------------------------- > ---------------------------------------------- > > include('includes/DefinePOClass.php'); > > include('includes/DefineSerialItems.php'); > > $PageSecurity = 11; > > /* Session started in header.inc for password checking and authorisation > > level check */ > > include('includes/session.inc'); > > $title = 'Receive Controlled Items'; > > > > include('includes/header.inc'); > > -------------------------------------------------------------------------- > ---------------------------------------------- > > > > That, however creates a smaller problem in that the strings in the > > DefineXXX files can not be translated if the _() function does not > > exist. I can see a few solutions: > > * require_once() for the language file include, and putting that line in > > session and all the files that may be included before it. (easiest) > > * including all files that may be necessary in session.inc (bad idea) > > * changing classes to remove strings so translation is moot (probably > > more correct) > > > > thoughts? > > > > > > jesse > > > > > > skaill wrote: > > > > > I've noticed this type of thing in some scripts... > > > > > > $title = 'Receive Controlled Items'; > > > $PageSecurity = 11; > > > > > > /* Session started in header.inc for password checking and > > > authorisation level check */ > > > include('includes/DefinePOClass.php'); > > > include('includes/DefineSerialItems.php'); > > > include('includes/session.inc'); > > > include('includes/header.inc'); > > > If $title was moved below session.inc and above header.inc that would > > > be good for $title. However, DefineSerialItems.php has a string in it > > > which means it also needs to be after session.inc. > > > > > > session.inc never uses any includes before it and verifies access so > > > I'm thinking session.inc should always be the first include anyway. > > > Can you confirm this Phil? > > > > > > Steve > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 > > Project Admins to receive an Apple iPod Mini FREE for your judgement on > > who ports your project to Linux PPC the best. Sponsored by IBM. > > Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php > > _______________________________________________ > > Web-erp-developers mailing list > > Web...@li... > > https://lists.sourceforge.net/lists/listinfo/web-erp-developers > > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 > Project Admins to receive an Apple iPod Mini FREE for your judgement on > who ports your project to Linux PPC the best. Sponsored by IBM. > Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php > _______________________________________________ > Web-erp-developers mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/web-erp-developers |
From: skaill <sk...@ro...> - 2004-09-12 20:17:25
|
What about pulling the language stuff out of session.inc and having a separate script for it. In this way language.inc can be above everything including class includes. I'm thinking if we don't do it then any class that uses strings will not be translated. Steve ----- Original Message ----- From: "Jesse Peterson" <je...@st...> To: <web...@li...> Sent: Sunday, September 12, 2004 3:39 PM Subject: Re: [Web-erp-developers] Multilanguage - includes > This is gonna be a fun one. I did the translation fixes on > ConfirmDispatch_Invoice yesterday and tried to start > ConfirmDispatchControlled_Invoice. I quickly ran into a problem that I > have finally tracked down today courtesy of var_dump. Turns out > something I knew, but neglected to think about... and web-erp is, > probably intentionally, written correctly. > > The problem is that when you use class based objects, such as cart in > DefineCartClass.php, the class needs to exist *before* the session is > started if you are going to use that object as a session variable. > Since the repercussions of it can be strange (things won't just break), > it would be a really good idea to pull all the files the order has been > changed in and fix them soon. > > That essentially puts us at needing to do something like this on every > page this happens... just in general would probably be good. > -------------------------------------------------------------------------- ---------------------------------------------- > include('includes/DefinePOClass.php'); > include('includes/DefineSerialItems.php'); > $PageSecurity = 11; > /* Session started in header.inc for password checking and authorisation > level check */ > include('includes/session.inc'); > $title = 'Receive Controlled Items'; > > include('includes/header.inc'); > -------------------------------------------------------------------------- ---------------------------------------------- > > That, however creates a smaller problem in that the strings in the > DefineXXX files can not be translated if the _() function does not > exist. I can see a few solutions: > * require_once() for the language file include, and putting that line in > session and all the files that may be included before it. (easiest) > * including all files that may be necessary in session.inc (bad idea) > * changing classes to remove strings so translation is moot (probably > more correct) > > thoughts? > > > jesse > > > skaill wrote: > > > I've noticed this type of thing in some scripts... > > > > $title = 'Receive Controlled Items'; > > $PageSecurity = 11; > > > > /* Session started in header.inc for password checking and > > authorisation level check */ > > include('includes/DefinePOClass.php'); > > include('includes/DefineSerialItems.php'); > > include('includes/session.inc'); > > include('includes/header.inc'); > > If $title was moved below session.inc and above header.inc that would > > be good for $title. However, DefineSerialItems.php has a string in it > > which means it also needs to be after session.inc. > > > > session.inc never uses any includes before it and verifies access so > > I'm thinking session.inc should always be the first include anyway. > > Can you confirm this Phil? > > > > Steve > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 > Project Admins to receive an Apple iPod Mini FREE for your judgement on > who ports your project to Linux PPC the best. Sponsored by IBM. > Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php > _______________________________________________ > Web-erp-developers mailing list > Web...@li... > https://lists.sourceforge.net/lists/listinfo/web-erp-developers |