From bb0c7702e7f2698aa73c94c891e74ef7d97e5e97 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Thu, 12 Jan 2012 05:18:54 -0500
Subject: [PATCH] Allow subqueries of strings in remote API.

---
 interface/lib/classes/tform.inc.php |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/interface/lib/classes/tform.inc.php b/interface/lib/classes/tform.inc.php
index 673a7d7..5610162 100644
--- a/interface/lib/classes/tform.inc.php
+++ b/interface/lib/classes/tform.inc.php
@@ -150,6 +150,8 @@
 				if(isset($wb_global)) unset($wb_global);
 				
                 $this->wordbook = $wb;
+				
+				$this->dateformat = $app->lng('conf_format_dateshort');
 
                 return true;
         }
@@ -362,7 +364,12 @@
                         $record = $this->decode($record,$tab);
                         if(is_array($record)) {
                                 foreach($this->formDef['tabs'][$tab]['fields'] as $key => $field) {
-                                        $val = $record[$key];
+								
+                                        if(isset($record[$key])) {
+											$val = $record[$key];
+										} else {
+											$val = '';
+										}
 
                                         // If Datasource is set, get the data from there
                                         if(isset($field['datasource']) && is_array($field['datasource'])) {
@@ -476,7 +483,11 @@
                                         break;
 
                                         default:
+											if(isset($record[$key])) {
                                                 $new_record[$key] = htmlspecialchars($record[$key]);
+											} else {
+												$new_record[$key] = '';
+											}
                                         }
                                 }
                         }

--
Gitblit v1.9.1