Index: bin/BizSystem.php =================================================================== --- bin/BizSystem.php (revision 578) +++ bin/BizSystem.php (working copy) @@ -222,7 +222,7 @@ // todo: only for mysql $db->query("SET NAMES 'utf8'"); - $this->m_DbConnection[$rDBName] = $db; + $this->m_DBConnection[$rDBName] = $db; return $db; } Index: bin/BizFormPopup.php =================================================================== --- bin/BizFormPopup.php (revision 578) +++ bin/BizFormPopup.php (working copy) @@ -102,10 +102,10 @@ private function parsePickerMap($pickerMap) { $returnList = array(); - $pickerList = split(",", $pickerMap); + $pickerList = explode(",", $pickerMap); foreach ($pickerList as $pair) { - $ctrlMap = split(":", $pair); + $ctrlMap = explode(":", $pair); $ctrlMap[0] = trim($ctrlMap[0]); $ctrlMap[1] = trim($ctrlMap[1]); $returnList[] = $ctrlMap; Index: bin/BizForm.php =================================================================== --- bin/BizForm.php (revision 578) +++ bin/BizForm.php (working copy) @@ -237,7 +237,7 @@ // __this is ctrlname:eventhandlername $ctrlname_ehname = $g_BizSystem->GetClientProxy()->GetFormInputs("__this"); if (!$ctrlname_ehname) return null; - list($ctrlname, $ehname) = split(":", $ctrlname_ehname); + list($ctrlname, $ehname) = explode(":", $ctrlname_ehname); $ctrlobj = $this->GetControl($ctrlname); if (!$ctrlobj) return null; $postAction = $ctrlobj->GetPostAction($ehname); // need to get postaction of eventhandler @@ -407,7 +407,7 @@ $this->m_SubForms = null; return; } - $subFormArr = split(";", $subForms); + $subFormArr = explode(";", $subForms); unset($this->m_SubForms); foreach ($subFormArr as $subForm) { $this->m_SubForms[] = $this->PrefixPackage($subForm); @@ -508,6 +508,7 @@ */ public function _run_search(&$resultRecords, $clearSearchRule=true) { + if (!$this->m_DataObjName) return; $dataobj = $this->GetDataObj(); @@ -519,8 +520,10 @@ } if ($clearSearchRule) $dataobj->ClearSearchRule(); + $dataobj->SetSearchRule($this->m_SearchRule); $dataobj->SetPageRange($this->m_Range); + return $dataobj->RunSearch($resultRecords); } @@ -573,6 +576,7 @@ $this->m_CursorIndex = $cursorIndex; // clean the activerecord when record is changed $this->m_ActiveRecord = null; + return $this->ReRender(false); // not redraw the this form, but draw the subforms } @@ -880,16 +884,18 @@ // search for starting ' and closing ' pair, check if sql key word in the pair $val = trim($inputVal); + $val = preg_replace ("/AND/i" , "AND" , $val); + $val = preg_replace ("/OR/i" , "OR" , $val); // check " AND ", " OR " if (($pos=strpos(strtoupper($val), " AND "))!==false) { - $inputArr = spliti(" AND ", $val); + $inputArr = explode(" AND ", $val); $retStr = null; foreach($inputArr as $v) $retStr .= ($retStr) ? " AND ".$this->InputValToRule($field, $v) : $this->InputValToRule($field, $v); return $retStr; } else if (($pos=strpos(strtoupper($val), " OR "))!==false) { - $inputArr = spliti(" OR ", $val); + $inputArr = explode(" OR ", $val); $retStr = null; foreach($inputArr as $v) $retStr .= ($retStr) ? " OR ".$this->InputValToRule($field, $v) : $this->InputValToRule($field, $v); @@ -1198,12 +1204,14 @@ global $g_BizSystem; if ($redrawForm) { + if ($g_BizSystem->GetClientProxy()->HasFormRerendered($this->m_Name) == false) $g_BizSystem->GetClientProxy()->ReDrawForm($this->m_Name, $this->RenderHTML()); } if ($hasRecordChange) { - $this->ReRenderSubForms(); + + $this->ReRenderSubForms(); } return; } @@ -1225,7 +1233,7 @@ global $g_BizSystem; $mode = $this->GetDisplayMode()->GetMode(); foreach($this->m_SubForms as $subForm) { - $formObj = $g_BizSystem->GetObjectFactory()->GetObject($subForm); + $formObj = $g_BizSystem->GetObjectFactory()->GetObject($subForm); $formObj->SetPostActionOff(); if ($mode == MODE_N) { // parent form on new mode $formObj->SetPrtCommitPending(true); @@ -1273,7 +1281,6 @@ $smarty->assign_by_ref("navbar", $this->m_NavBar->Render()); //$smarty->assign_by_ref("contextmenu", $this->RenderContextMenu()); - return $smarty->fetch($dispmode->m_TemplateFile) . "\n" . $this->RenderShortcutKeys() . "\n" . $this->RenderContextMenu(); @@ -1293,7 +1300,9 @@ $this->m_CursorIDMap[0] = $resultRecords[0]["Id"]; } + $columns = $this->m_RecordRow->RenderColumn(); + foreach($columns as $key=>$val) { $fields[$key]["label"] = $val; $fields[$key]["required"] = $this->GetControl($key)->m_Required; @@ -1307,6 +1316,7 @@ $fields[$key]["control"] = $val; } } + return $fields; } @@ -1351,7 +1361,7 @@ if ($this->m_QueryONRender) if (!$this->_run_search($resultRecords, $this->m_ClearSearchRule)) return $this->ProcessDataObjError($ok); - + $dispmode = $this->GetDisplayMode(); $hasSub = $this->m_SubForms ? 0 : 1; //$this->SetDisplayMode($dispmode->GetMode()); @@ -1530,7 +1540,7 @@ public function GetDefaultRecordArr() { foreach ($this->m_var as $fldCtrl) { - $recArr[$fldCtrl->m_BizFieldName] = $fldCtrl->GetDefaultValue(); + $recArr[$fldCtrl->m_BizFieldName] = $fldCtrl->GetDefaultValue(); } return $recArr; } @@ -1694,7 +1704,7 @@ $this->m_InitMode = isset($xmlArr["ATTRIBUTES"]["INITMODE"]) ? $xmlArr["ATTRIBUTES"]["INITMODE"] : null; if (isset($xmlArr["ATTRIBUTES"]["FORMATSTYLE"])) { $this->m_FormatStyle = array(); - $this->m_FormatStyle = split(",",$xmlArr["ATTRIBUTES"]["FORMATSTYLE"]); + $this->m_FormatStyle = explode(",",$xmlArr["ATTRIBUTES"]["FORMATSTYLE"]); } } Index: bin/BizDataObj.php =================================================================== --- bin/BizDataObj.php (revision 578) +++ bin/BizDataObj.php (working copy) @@ -409,8 +409,8 @@ private function CompKeyRuleToSql($compColum, $compValue) { - $colArr = split(",", $compColum); - $valArr = split(CK_CONNECTOR, $compValue); + $colArr = explode(",", $compColum); + $valArr = explode(CK_CONNECTOR, $compValue); $sql = ""; for ($i=0; $i < count($colArr); $i++) { @@ -734,6 +734,7 @@ $dbtype = $dbinfo["Driver"]; $sql_col = ""; $sql_val = ""; + //print_r ($sqlArr); foreach($sqlArr as $col=>$val) { $fldname = $this->m_BizRecord->GetFieldByColumn($col); if ($this->GetField($fldname)->IsLobField()) // special value for blob/clob type Index: bin/service/chartService.php =================================================================== --- bin/service/chartService.php (revision 578) +++ bin/service/chartService.php (working copy) @@ -112,7 +112,7 @@ //$graph->img->SetAntiAliasing(); $graph->SetScale("textlin"); $graph->yaxis->scale->SetGrace(10); - list($m1, $m2, $m3, $m4) = split(',', $xmlArr["ATTRIBUTES"]["MARGIN"]); + list($m1, $m2, $m3, $m4) = explode(',', $xmlArr["ATTRIBUTES"]["MARGIN"]); $graph->img->SetMargin($m1, $m2, $m3, $m4); // get the data set @@ -246,7 +246,7 @@ if ($chartType == 'GroupBar' or $chartType == 'AccBar') { $children = $xmlArr['ATTRIBUTES']['CHILDREN']; - $childList = split(",",$children); + $childList = explode(",",$children); foreach($childList as $child) { $childPlotList[] = $this->m_PlotList[$child]; } @@ -291,7 +291,7 @@ $plot->SetHeight($height); $plot->SetAngle($angle); } - list($c1, $c2) = split(',', $center); + list($c1, $c2) = explode(',', $center); $plot->SetCenter($c1,$c2); $plot->SetSize($size); @@ -310,7 +310,7 @@ function DrawString(&$g,$font=null,$color=null) { if ($font) { - list($ft,$fs,$size) = split(",",$font); + list($ft,$fs,$size) = explode(",",$font); $g->SetFont($this->GetFont($ft),$this->GetFontStyle($fs),$size); } if ($color) $g->SetColor($color); @@ -328,7 +328,7 @@ $this->DrawString($g,$font,$color); if ($fcolor) $g->SetFillColor($fcolor); if ($pos) { - list($x,$y,$hap,$vap) = split(",",$pos); + list($x,$y,$hap,$vap) = explode(",",$pos); $g->SetPos($x,$y,$hap,$vap); } if ($layout && $layout == 'HOR') { Index: bin/service/doTriggerService.php =================================================================== --- bin/service/doTriggerService.php (revision 578) +++ bin/service/doTriggerService.php (working copy) @@ -185,7 +185,7 @@ static private function MakeArray($string) { if (!$string) return null; - $arr = split(";", $string); + $arr = explode(";", $string); $size = count($arr); for ($i=0; $i<$size; $i++) $arr[$i] = trim($arr[$i]); Index: bin/FieldControl.php =================================================================== --- bin/FieldControl.php (revision 578) +++ bin/FieldControl.php (working copy) @@ -180,7 +180,7 @@ { // get the raw date value by unformatting it or geting the raw data from dataobj $format = $this->GetFormObj()->GetDataObj()->GetField($this->m_BizFieldName)->m_Format; - $val = parent::Render(); + $val = parent::Render(); $showTime = 'false'; $img = ""; $val .= "m_Name."', '".$format."', ".$showTime.", true); return false;\" onmousemove='window.status=\"Select a date\"' onmouseout='window.status=\"\"'>" . $img . ""; @@ -206,11 +206,11 @@ { // get the folder image and leave image $origImg = $this->m_Image; - list($img1, $img2) = split(";", $this->m_Image); + list($img1, $img2) = explode(";", $this->m_Image); $img1 = trim($img1); $img2 = trim($img2); // get expand function $origFunc = $this->m_Function; - list($f1, $f2) = split(";", $this->m_Function); + list($f1, $f2) = explode(";", $this->m_Function); $f1 = trim($f1); $f2 = trim($f2); // if the record has child Index: bin/BizField.php =================================================================== --- bin/BizField.php (revision 578) +++ bin/BizField.php (working copy) @@ -51,7 +51,7 @@ protected function UseDefaultFormat() { - if ($this->m_Type == "Date") $this->m_Format = '%Y-%m-%d'; + if ($this->m_Type == "Date") $this->m_Format = '%Y-%m-%d'; else if ($this->m_Type == "Datetime") $this->m_Format = '%Y-%m-%d %H:%M:%S'; }