Make RemoteRequest.js work inside the staff client as well as the OPAC
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 21 Aug 2008 01:56:29 +0000 (01:56 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 21 Aug 2008 01:56:29 +0000 (01:56 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@10384 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/opac/common/js/RemoteRequest.js

index a9ef9cc..53d1830 100644 (file)
@@ -59,9 +59,14 @@ function destroyRequest(r) {
 var rrId = 0;
 function RemoteRequest( service, method ) {
 
-
+       /* dojo is currently only available in the OPAC */
+       try {
+               this.locale     = dojo.config.locale;
+       }
+       catch (e) {
+               this.locale = null;
+       }
        this.service    = service;
-       this.locale             = dojo.config.locale;
        this.method             = method;
        this.xmlhttp    = false;
        this.name               = null;
@@ -85,7 +90,11 @@ function RemoteRequest( service, method ) {
        }
 
        if(!this.params) { this.params = ""; }
-       this.param_string = "service=" + service + "&locale=" + locale + "&method=" + method + this.params;
+
+       this.param_string = "service=" + service + "&method=" + method + this.params;
+       if (this.locale != null) {
+               this.param_string = this.param_string + "&locale=" + this.locale;
+       }
        if( this.buildXMLRequest() == null ) alert("Browser is not supported!");
 
 }