mwhitlaw wrote on Wednesday, August 11, 2010:
I’ve noticed that the JavaScript function ‘ChangeDate’ that is generated for the Calendar
has a problem when using OpenEMR on a server that is being ProxyPass’ed to from a primary server.
It looks like a templating tool is hardcoding into the ‘ChangeDate’ function the full url
that is being used by the function. This doesn’t work in my current setup because the users are being
proxied through a primary apache server that use ProxyPass to get them to the stand alone instance of OEMR
associated with the url they are using.
For example:
http://primary/oemr1 --ProxyPass /oemr1 http://oemr1/openemr --> http://oemr1/openemr
http://primary/oemr1 <–ReverseProxyPass /oemr1 http://oemr1/openemr – http://oemr1/openemr
This setup allows for clean separation of OEMR instances while still allowing access to the separate instances
through the primary server and distinguishing the instances by the url (ie. http://primary/oemr1, http://primary/oemr2, … )
After manually setting $web_root = ‘/oemr1’ in globals.php, this all works nicely
except for this Calendar (and Print), because the the JavaScript gets hardcoded with
var ChangeDate = function(eObj) {
baseURL = "http://oemr1/openemr/interface/main/calendar/index.php?module=PostCalendar&func=view&plview…… "
….
}
Instead of:
var ChangeDate = function(eObj) {
baseURL = "http://primary/oemr1/interface/main/calendar/index.php?module=PostCalendar&func=view&plview…… "
….
}
I’ve been able to see that this code snippet is generated by some sort of templating engine, and that the templates
are compiled at setup time. I am assuming that the url is getting hardcoded into the compiled template at setup.
Is there a way to put the beginning of the url into a variable in somewhere like globals.php,
similar to $webserver_root and $web_root
something like :
$web_server = ‘http://primary’
This way $web_server.$web_root would resolve to http://primary/oemr1
OR
Is there a way to tell setup that I’m working through a different web sever and url, so that it hardcodes the correct values?
Thanks,
Mike