Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Print.php
index 00edffb..8c12126 100644 (file)
--- a/Print.php
+++ b/Print.php
@@ -132,6 +132,7 @@ class Pman_Xtuple_Print extends Pman
             $cmd[] = '-'.$k . ($v === true   ? '' : '='. $v);
             
         }
+        
         $cmd = implode(' ', $cmd) ;
         //$cmd = implode(' ', $cmd) . ' ' . (strlen($ocfg['template']) ? escapeshellarg($template) : '');
         if (isseT($_REQUEST['_debug'])) {
@@ -139,7 +140,7 @@ class Pman_Xtuple_Print extends Pman
             exit;
         }
         
-       // echo $cmd;exit;
+//        echo $cmd;exit;
         $res = `$cmd`;
         // var_dump( $res);
         
@@ -156,7 +157,7 @@ class Pman_Xtuple_Print extends Pman
     }
     function syncDB($cfg) 
     {
-        $roo = HTML_FlexyFramework::get()->page;
+        $dir = HTML_FlexyFramework::get()->Pman;
         
         $do = DB_DataObject::Factory('invchead');
         
@@ -167,10 +168,11 @@ class Pman_Xtuple_Print extends Pman
         $template  = '';
         if (isset($cfg['template'])) {
             
-            $template = '/report_templates'. '/'.$cfg['template']. '.xml';
-            print_r(dirname($template));exit;
+            $template = realpath(dirname(__FILE__).'/report_templates'). '/'.$cfg['template']. '.xml';
             
-            print_r(file_get_contents($template));exit;
+            if(isset($dir['report_template_dir'])){
+                $template = realpath($dir['report_template_dir']). '/'.$cfg['template']. '.xml';
+            }
             
             unset($cfg['template']);
         }