*************** *** 508,514 **** */ public function _run_search(&$resultRecords, $clearSearchRule=true) { - if (!$this->m_DataObjName) return; $dataobj = $this->GetDataObj(); --- 508,513 ---- */ public function _run_search(&$resultRecords, $clearSearchRule=true) { if (!$this->m_DataObjName) return; $dataobj = $this->GetDataObj(); *************** *** 520,529 **** } if ($clearSearchRule) $dataobj->ClearSearchRule(); - $dataobj->SetSearchRule($this->m_SearchRule); $dataobj->SetPageRange($this->m_Range); - return $dataobj->RunSearch($resultRecords); } --- 519,526 ---- } if ($clearSearchRule) $dataobj->ClearSearchRule(); $dataobj->SetSearchRule($this->m_SearchRule); $dataobj->SetPageRange($this->m_Range); return $dataobj->RunSearch($resultRecords); } *************** *** 576,582 **** $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 } --- 573,578 ---- $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 } *************** *** 884,901 **** // 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 = 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 = explode(" OR ", $val); $retStr = null; foreach($inputArr as $v) $retStr .= ($retStr) ? " OR ".$this->InputValToRule($field, $v) : $this->InputValToRule($field, $v); --- 880,895 ---- // search for starting ' and closing ' pair, check if sql key word in the pair $val = trim($inputVal); // check " AND ", " OR " if (($pos=strpos(strtoupper($val), " AND "))!==false) { + $inputArr = spliti(" 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); $retStr = null; foreach($inputArr as $v) $retStr .= ($retStr) ? " OR ".$this->InputValToRule($field, $v) : $this->InputValToRule($field, $v); *************** *** 1204,1217 **** 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(); } return; } --- 1198,1209 ---- 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(); } return; } *************** *** 1233,1239 **** global $g_BizSystem; $mode = $this->GetDisplayMode()->GetMode(); foreach($this->m_SubForms as $subForm) { - $formObj = $g_BizSystem->GetObjectFactory()->GetObject($subForm); $formObj->SetPostActionOff(); if ($mode == MODE_N) { // parent form on new mode $formObj->SetPrtCommitPending(true); --- 1225,1231 ---- global $g_BizSystem; $mode = $this->GetDisplayMode()->GetMode(); foreach($this->m_SubForms as $subForm) { + $formObj = $g_BizSystem->GetObjectFactory()->GetObject($subForm); $formObj->SetPostActionOff(); if ($mode == MODE_N) { // parent form on new mode $formObj->SetPrtCommitPending(true); *************** *** 1292,1300 **** $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; --- 1285,1291 ---- $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; *************** *** 1308,1314 **** $fields[$key]["control"] = $val; } } - return $fields; } --- 1299,1304 ---- $fields[$key]["control"] = $val; } } return $fields; } *************** *** 1353,1359 **** 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()); --- 1343,1349 ---- 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()); *************** *** 1532,1538 **** public function GetDefaultRecordArr() { foreach ($this->m_var as $fldCtrl) { - $recArr[$fldCtrl->m_BizFieldName] = $fldCtrl->GetDefaultValue(); } return $recArr; } --- 1522,1528 ---- public function GetDefaultRecordArr() { foreach ($this->m_var as $fldCtrl) { + $recArr[$fldCtrl->m_BizFieldName] = $fldCtrl->GetDefaultValue(); } return $recArr; }