Roo.php
authorEdward <edward@roojs.com>
Tue, 3 Dec 2013 11:23:53 +0000 (19:23 +0800)
committerEdward <edward@roojs.com>
Tue, 3 Dec 2013 11:23:53 +0000 (19:23 +0800)
Roo.php

diff --git a/Roo.php b/Roo.php
index 6f440aa..68ec626 100644 (file)
--- a/Roo.php
+++ b/Roo.php
@@ -30,12 +30,14 @@ class Pman_Xtuple_Roo extends Pman_Roo
     
     function get($tab)
     {
-        if (isset($_REQUEST['_roo_office'])) {
+        $do = DB_DataObject::factory('Person');
+        $ourdb = substr($do->database(),-2);
+        
+        if (isset($_REQUEST['_roo_office']) && $_REQUEST['_roo_office'] != $ourdb) {
             return $this->relay('GET',$tab, $_REQUEST['_roo_office']);
         }
         
-        
-        if ($this->isMain()) {
+        if (isset($_REQUEST['_roo_office']) || $this->isMain()) {
             return parent::get($tab);
         }
         
@@ -44,11 +46,14 @@ class Pman_Xtuple_Roo extends Pman_Roo
     
     function post($tab)
     {
-        if (isset($_REQUEST['_roo_office'])) {
+        $do = DB_DataObject::factory('Person');
+        $ourdb = substr($do->database(),-2);
+        
+        if (isset($_REQUEST['_roo_office']) && $_REQUEST['_roo_office'] != $ourdb) {
             return $this->relay('POST',$tab, $_REQUEST['_roo_office']);
         }
         
-        if ($this->isMain()) {
+        if (isset($_REQUEST['_roo_office']) || $this->isMain()) {
             return parent::post($tab);
         }    
         $this->relay('POST', $tab);