/cubi/openbiz/bin/easy/EasyForm.php
PHP | 2404 lines | 1658 code | 212 blank | 534 comment | 298 complexity | 26cbc3f42d50feb7ce3e51bd5605dc8e MD5 | raw file
Possible License(s): GPL-2.0, LGPL-3.0
Large files files are truncated, but you can click here to view the full file
- <?php
- /**
- * PHPOpenBiz Framework
- *
- * LICENSE
- *
- * This source file is subject to the BSD license that is bundled
- * with this package in the file LICENSE.txt.
- *
- * @package openbiz.bin.easy
- * @copyright Copyright (c) 2005-2011, Rocky Swen
- * @license http://www.opensource.org/licenses/bsd-license.php
- * @link http://www.phpopenbiz.org/
- * @version $Id: EasyForm.php 4203 2011-06-01 07:33:23Z rockys $
- */
- //include_once(OPENBIZ_BIN."/easy/Panel.php");
- //include_once(OPENBIZ_BIN."/easy/FormRenderer.php");
- //include_once(OPENBIZ_BIN."/util/QueryStringParam.php");
- /**
- * EasyForm class - contains form object metadata functions
- *
- * @package openbiz.bin.easy
- * @author Rocky Swen
- * @copyright Copyright (c) 2005-2009
- * @access public
- */
- class EasyForm extends MetaObject implements iSessionObject
- {
- public $DATAFORMAT = 'RECORD';
- // metadata vars are public, necessary for metadata inheritance
- public $m_Title;
- public $m_Icon;
- public $m_Description;
- public $m_jsClass;
- public $m_DataObjName;
- public $m_Height;
- public $m_Width;
- public $m_DefaultForm;
-
- public $m_CanUpdateRecord;
- public $m_DirectMethodList = null; //list of method that can directly from browser
- public $m_Panels;
- /**
- * Name of inherited form (meta-form)
- *
- * @var string
- */
- public $m_InheritFrom;
-
- /**
- * Data Panel object
- *
- * @var Panel
- */
- public $m_DataPanel;
- /**
- * Action Panel object
- * @var Panel
- */
- public $m_ActionPanel;
- /**
- * Navigation Panel object
- * @var Panel
- */
- public $m_NavPanel;
- /**
- * Search Panel object
- * @var Panel
- */
- public $m_SearchPanel;
- public $m_TemplateEngine;
- public $m_TemplateFile;
- public $m_FormType;
- public $m_SubForms = null;
- public $m_EventName;
- public $m_Range = 10;
- public $m_CacheLifeTime = 0;
- public $m_FormParams;
- // parent form is the form that trigger the popup. "this" form is a popup form
- public $m_ParentFormName;
- // the form that drives navigation - the 1st form deplayed in the view
- public $m_DefaultFormName = null;
- public $m_Errors; // errors array (error_element, error_message)
- public $m_Notices; // list of notice messages
- // basic form vars
- protected $m_DataObj;
- protected $m_RecordId = null;
- public $m_ActiveRecord = null;
- public $m_FormInputs = null;
- public $m_SearchRule = null;
- public $m_FixSearchRule = null; // FixSearchRule is the search rule always applying on the search
-
- public $m_SortRule = null;
-
- protected $m_DefaultFixSearchRule = null;
- protected $m_Referer = "";
- public $m_MessageFile = null;
- protected $m_hasError = false;
- protected $m_ValidateErrors = array();
- protected $queryParams = array();
- // vars for grid(list)
- protected $m_CurrentPage = 1;
- protected $m_StartItem = 1;
- public $m_TotalPages = 1;
- protected $m_TotalRecords = 0;
- protected $m_RecordSet = null;
- protected $m_RefreshData = false;
- protected $m_Resource = "";
- protected $m_Messages;
- protected $m_InvokingElement = null;
-
- public $m_AutoRefresh=0;
-
- public $m_ReferenceFormName; //switch from which form
- protected $m_RecordAllowAccess = true;
- /**
- * Initialize BizForm with xml array
- *
- * @param array $xmlArr
- * @return void
- */
- function __construct(&$xmlArr)
- {
- $this->readMetadata($xmlArr);
- //echo $_GET['referer'];
- $this->inheritParentObj();
- }
- public function allowAccess($access=null)
- {
- if(!$this->m_RecordAllowAccess)
- {
- /**
- * if the record is now allowed to access, then deny form render
- * instead of display an empty form
- */
- return false;
- }
- $result = parent::allowAccess($access);
- return $result ;
- }
-
- /**
- * Read array meta data, and store to meta object
- *
- * @param array $xmlArr
- * @return void
- */
- protected function readMetadata(&$xmlArr)
- {
- parent::readMetaData($xmlArr);
- $this->m_InheritFrom = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["INHERITFROM"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["INHERITFROM"] : null;
- $this->m_Title = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["TITLE"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["TITLE"] : null;
- $this->m_Icon = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["ICON"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["ICON"] : null;
- $this->m_Description = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["DESCRIPTION"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["DESCRIPTION"] : null;
- $this->m_jsClass = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["JSCLASS"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["JSCLASS"] : null;
- $this->m_Height = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["HEIGHT"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["HEIGHT"] : null;
- $this->m_Width = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["WIDTH"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["WIDTH"] : null;
- $this->m_DefaultForm = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["DEFAULTFORM"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["DEFAULTFORM"] : null;
- $this->m_TemplateEngine = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["TEMPLATEENGINE"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["TEMPLATEENGINE"] : null;
- $this->m_TemplateFile = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["TEMPLATEFILE"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["TEMPLATEFILE"] : null;
- $this->m_FormType = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["FORMTYPE"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["FORMTYPE"] : null;
- $this->m_Range = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["PAGESIZE"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["PAGESIZE"] : $this->m_Range;
- $this->m_FixSearchRule = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["SEARCHRULE"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["SEARCHRULE"] : null;
- $this->m_SortRule = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["SORTRULE"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["SORTRULE"] : null;
- $this->m_DefaultFixSearchRule = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["SEARCHRULE"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["SEARCHRULE"] : null;
-
- $this->m_Name = $this->prefixPackage($this->m_Name);
- if ($this->m_InheritFrom == '@sourceMeta') $this->m_InheritFrom = '@'.$this->m_Name;
- else $this->m_InheritFrom = $this->prefixPackage($this->m_InheritFrom);
- $this->m_DataObjName = $this->prefixPackage($xmlArr["EASYFORM"]["ATTRIBUTES"]["BIZDATAOBJ"]);
- if (isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["DIRECTMETHOD"]))
- $this->m_DirectMethodList = explode(",", strtolower(str_replace(" ", "",$xmlArr["EASYFORM"]["ATTRIBUTES"]["DIRECTMETHOD"])));
- $this->m_DataPanel = new Panel($xmlArr["EASYFORM"]["DATAPANEL"]["ELEMENT"],"",$this);
- $this->m_ActionPanel = new Panel($xmlArr["EASYFORM"]["ACTIONPANEL"]["ELEMENT"],"",$this);
- $this->m_NavPanel = new Panel($xmlArr["EASYFORM"]["NAVPANEL"]["ELEMENT"],"",$this);
- $this->m_SearchPanel = new Panel($xmlArr["EASYFORM"]["SEARCHPANEL"]["ELEMENT"],"",$this);
- $this->m_Panels = array($this->m_DataPanel, $this->m_ActionPanel, $this->m_NavPanel, $this->m_SearchPanel);
- $this->m_FormType = strtoupper($this->m_FormType);
- $this->m_EventName = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["EVENTNAME"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["EVENTNAME"] : null;
- $this->m_MessageFile = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["MESSAGEFILE"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["MESSAGEFILE"] : null;
- $this->m_Messages = Resource::loadMessage($this->m_MessageFile , $this->m_Package);
- $this->m_CacheLifeTime = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["CACHELIFETIME"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["CACHELIFETIME"] : "0";
- $this->m_CurrentPage = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["STARTPAGE"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["STARTPAGE"] : 1;
- $this->m_StartItem = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["STARTITEM"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["STARTITEM"] : 1;
- $this->m_AutoRefresh = isset($xmlArr["EASYFORM"]["ATTRIBUTES"]["AUTOREFRESH"]) ? $xmlArr["EASYFORM"]["ATTRIBUTES"]["AUTOREFRESH"] : 0;
-
- // parse access
- if ($this->m_Access)
- {
- $arr = explode (".", $this->m_Access);
- $this->m_Resource = $arr[0];
- }
- if ($this->m_jsClass == "jbForm" && strtoupper($this->m_FormType) == "LIST") $this->m_jsClass = "Openbiz.TableForm";
- if ($this->m_jsClass == "jbForm") $this->m_jsClass = "Openbiz.Form";
-
- $this->translate(); // translate for multi-language support
- }
- /**
- * Inherit from parent object. Name, Package, Class cannot be inherited
- *
- * @return void
- */
- protected function inheritParentObj()
- {
- if (!$this->m_InheritFrom) return;
- $parentObj = BizSystem::getObject($this->m_InheritFrom);
- $this->m_Title = $this->m_Title ? $this->m_Title : $parentObj->m_Title;
- $this->m_Icon = $this->m_Icon ? $this->m_Icon : $parentObj->m_Icon;
- $this->m_Description = $this->m_Description ? $this->m_Description : $parentObj->m_Description;
- $this->m_jsClass = $this->m_jsClass ? $this->m_jsClass : $parentObj->m_jsClass;
- $this->m_Height = $this->m_Height ? $this->m_Height : $parentObj->m_Height;
- $this->m_Width = $this->m_Width ? $this->m_Width : $parentObj->m_Width;
- $this->m_DefaultForm = $this->m_DefaultForm ? $this->m_DefaultForm : $parentObj->m_DefaultForm;
- $this->m_TemplateEngine = $this->m_TemplateEngine ? $this->m_TemplateEngine : $parentObj->m_TemplateEngine;
- $this->m_TemplateFile = $this->m_TemplateFile ? $this->m_TemplateFile : $parentObj->m_TemplateFile;
- $this->m_FormType = $this->m_FormType ? $this->m_FormType : $parentObj->m_FormType;
- $this->m_Range = $this->m_Range ? $this->m_Range : $parentObj->m_Range;
- $this->m_FixSearchRule = $this->m_FixSearchRule ? $this->m_FixSearchRule : $parentObj->m_FixSearchRule;
- $this->m_DefaultFixSearchRule = $this->m_DefaultFixSearchRule ? $this->m_DefaultFixSearchRule : $parentObj->m_DefaultFixSearchRule;
- $this->m_DataObjName = $this->m_DataObjName ? $this->m_DataObjName : $parentObj->m_DataObjName;
- $this->m_DirectMethodList = $this->m_DirectMethodList ? $this->m_DirectMethodList : $parentObj->m_DirectMethodList;
- $this->m_EventName = $this->m_EventName ? $this->m_EventName : $parentObj->m_EventName;
- $this->m_MessageFile = $this->m_MessageFile ? $this->m_MessageFile : $parentObj->m_MessageFile;
- $this->m_Messages = Resource::loadMessage($this->m_MessageFile , $this->m_Package);
- $this->m_CacheLifeTime = $this->m_CacheLifeTime ? $this->m_CacheLifeTime : $parentObj->m_CacheLifeTime;
- $this->m_CurrentPage = $this->m_CurrentPage ? $this->m_CurrentPage : $parentObj->m_CurrentPage;
- $this->m_StartItem = $this->m_StartItem ? $this->m_StartItem : $parentObj->m_StartItem;
-
- $this->m_DataPanel->merge($parentObj->m_DataPanel);
- $this->m_ActionPanel->merge($parentObj->m_ActionPanel);
- $this->m_NavPanel->merge($parentObj->m_NavPanel);
- $this->m_SearchPanel->merge($parentObj->m_SearchPanel);
- if($this->m_DataPanel->current()){
- foreach ($this->m_DataPanel as $elem)
- $elem->adjustFormName($this->m_Name);
- }
- if($this->m_ActionPanel->current()){
- foreach ($this->m_ActionPanel as $elem)
- $elem->adjustFormName($this->m_Name);
- }
- if($this->m_NavPanel->current()){
- foreach ($this->m_NavPanel as $elem)
- $elem->adjustFormName($this->m_Name);
- }
- if($this->m_SearchPanel->current()){
- foreach ($this->m_SearchPanel as $elem)
- $elem->adjustFormName($this->m_Name);
- }
- $this->m_Panels = array($this->m_DataPanel, $this->m_ActionPanel, $this->m_NavPanel, $this->m_SearchPanel);
- }
-
- /**
- * Get message, and translate it
- *
- * @param string $messageId message Id
- * @param array $params
- * @return string message string
- */
- public function getMessage($messageId, $params=array())
- {
- $message = isset($this->m_Messages[$messageId]) ? $this->m_Messages[$messageId] : constant($messageId);
- //$message = I18n::getInstance()->translate($message);
- $message = I18n::t($message, $messageId, $this->getModuleName($this->m_Name));
- $msg = @vsprintf($message,$params);
- if(!$msg){ //maybe in translation missing some %s can cause it returns null
- $msg = $message;
- }
- return $msg;
- }
- public function canDisplayForm()
- {
-
- if($this->getDataObj()->m_DataPermControl=='Y')
- {
- switch(strtolower($this->m_FormType))
- {
- default:
- case 'list':
- return true;
- break;
- case 'detail':
- $permCode=1;
- break;
-
- case 'edit':
- $permCode=2;
- break;
- }
- $svcObj = BizSystem::GetService(DATAPERM_SERVICE);
- $result = $svcObj->checkDataPerm($this->fetchData(),$permCode,$this->getDataObj());
- if($result == false)
- {
- return false;
- }
- }
- return true;
- }
- public function canDeleteRecord($rec)
- {
-
- if($this->getDataObj()->m_DataPermControl=='Y')
- {
- $svcObj = BizSystem::GetService(DATAPERM_SERVICE);
- $result = $svcObj->checkDataPerm($rec,3,$this->getDataObj());
- if($result == false)
- {
- return false;
- }
- }
- return true;
- }
-
-
- /**
- * Get/Retrieve Session data of this object
- *
- * @param SessionContext $sessionContext
- * @return void
- */
- public function getSessionVars($sessionContext)
- {
- $sessionContext->getObjVar($this->m_Name, "RecordId", $this->m_RecordId);
- $sessionContext->getObjVar($this->m_Name, "FixSearchRule", $this->m_FixSearchRule);
- $sessionContext->getObjVar($this->m_Name, "SearchRule", $this->m_SearchRule);
- $sessionContext->getObjVar($this->m_Name, "QueryParams", $this->queryParams);
- $sessionContext->getObjVar($this->m_Name, "SubForms", $this->m_SubForms);
- $sessionContext->getObjVar($this->m_Name, "ParentFormName", $this->m_ParentFormName);
- $sessionContext->getObjVar($this->m_Name, "DefaultFormName", $this->m_DefaultFormName);
- $sessionContext->getObjVar($this->m_Name, "CurrentPage", $this->m_CurrentPage);
- $sessionContext->getObjVar($this->m_Name, "PageSize", $this->m_Range);
- $sessionContext->getObjVar($this->m_Name, "ReferenceFormName", $this->m_ReferenceFormName);
- $sessionContext->getObjVar($this->m_Name, "SearchPanelValues", $this->m_SearchPanelValues);
- }
- /**
- * Save object variable to session context
- *
- * @param SessionContext $sessionContext
- * @return void
- */
- public function setSessionVars($sessionContext)
- {
- $sessionContext->setObjVar($this->m_Name, "RecordId", $this->m_RecordId);
- $sessionContext->setObjVar($this->m_Name, "FixSearchRule", $this->m_FixSearchRule);
- $sessionContext->setObjVar($this->m_Name, "SearchRule", $this->m_SearchRule);
- $sessionContext->setObjVar($this->m_Name, "QueryParams", $this->queryParams);
- $sessionContext->setObjVar($this->m_Name, "SubForms", $this->m_SubForms);
- $sessionContext->setObjVar($this->m_Name, "ParentFormName", $this->m_ParentFormName);
- $sessionContext->setObjVar($this->m_Name, "DefaultFormName", $this->m_DefaultFormName);
- $sessionContext->setObjVar($this->m_Name, "CurrentPage", $this->m_CurrentPage);
- $sessionContext->setObjVar($this->m_Name, "PageSize", $this->m_Range);
- $sessionContext->setObjVar($this->m_Name, "ReferenceFormName", $this->m_ReferenceFormName);
- $sessionContext->setObjVar($this->m_Name, "SearchPanelValues", $this->m_SearchPanelValues);
- }
- /**
- * Invoke the action passed from browser
- *
- * @return mixed the function result, or false on error.
- */
- public function invoke()
- {
- $argList = func_get_args();
- $param1 = array_shift($argList);
- // first one is element:eventhandler
- list ($elementName, $eventHandlerName) = explode(":", $param1);
- $element = $this->getElement($elementName);
- $eventHandler = $element->m_EventHandlers->get($eventHandlerName);
- $this->m_InvokingElement = array($element, $eventHandler);
- // find the matching function
- list($funcName, $funcParams) = $eventHandler->parseFunction($eventHandler->m_OrigFunction);
- // call the function with rest parameters
- return call_user_func_array(array($this, $funcName), $argList);
- }
-
- /**
- * Validate request from client (browser)
- *
- * @param string $methodName called from the client
- * @return boolean
- */
- public function validateRequest($methodName)
- {
- $methodName = strtolower($methodName);
-
- if ($methodName == "selectrecord" || $methodName == "invoke" || $methodName="sortrecord")
- return true;
- // element, eventhandler
- list($element, $eventHandler) = $this->getInvokingElement();
- if ($element && $eventHandler)
- {
- if (stripos($eventHandler->m_OrigFunction, $methodName)===0)
- return true;
- }
- // scan elements to match method
- foreach ($this->m_Panels as $panel)
- {
- foreach ($panel as $elem)
- if ($elem->matchRemoteMethod($methodName)) return true;
- }
- if (is_array($this->m_DirectMethodList))
- {
- foreach ($this->m_DirectMethodList as $value)
- {
- if ($methodName == $value) return true;
- }
- }
- return false;
- }
- /**
- * Get object property
- * This method get element object if propertyName is "Elements[elementName]" format.
- *
- * @param string $propertyName
- * @return <type>
- */
- public function getProperty($propertyName)
- {
- $ret = parent::getProperty($propertyName);
- if ($ret !== null) return $ret;
- $pos1 = strpos($propertyName, "[");
- $pos2 = strpos($propertyName, "]");
- if ($pos1>0 && $pos2>$pos1)
- {
- $propType = substr($propertyName, 0, $pos1);
- $elementName = substr($propertyName, $pos1+1,$pos2-$pos1-1);
- switch(strtolower($propType))
- {
- case 'param':
- case 'params':
- $result = $this->m_FormParams[$elementName];
- break;
- default:
-
- $result = $this->getElement($elementName);
- break;
- }
- return $result;
- }
- }
- /**
- * Get object instance of {@link BizDataObj} defined in it's metadata file
- *
- * @return BizDataObj
- */
- public function getDataObj()
- {
- if (!$this->m_DataObj)
- {
- if ($this->m_DataObjName)
- $this->m_DataObj = BizSystem::objectFactory()->getObject($this->m_DataObjName);
- if($this->m_DataObj)
- $this->m_DataObj->m_BizFormName = $this->m_Name;
- else
- {
- //BizSystem::clientProxy()->showErrorMessage("Cannot get DataObj of ".$this->m_DataObjName.", please check your metadata file.");
- return null;
- }
- }
- return $this->m_DataObj;
- }
- /**
- * Set data object {@link BizDataObj} with specified instant from parameter
- *
- * @param BizDataObj $dataObj
- * @return void
- */
- final public function setDataObj($dataObj)
- {
- $this->m_DataObj = $dataObj;
- }
- /**
- * Get output attributs as array
- *
- * @return array array of attributs
- * @todo rename to getOutputAttribute or getAttribute (2.5?)
- */
- public function outputAttrs()
- {
- $output['name'] = $this->m_Name;
- $output['title'] = Expression::evaluateExpression($this->m_Title, $this);
- $output['icon'] = $this->m_Icon;
- $output['hasSubform'] = $this->m_SubForms ? 1 : 0;
- $output['currentPage'] = $this->m_CurrentPage;
- $output['currentRecordId'] = $this->m_RecordId;
- $output['totalPages'] = $this->m_TotalPages;
- $output['totalRecords'] = $this->m_TotalRecords;
- $output['description'] = str_replace('\n', "<br />", Expression::evaluateExpression($this->m_Description,$this));
- $output['elementSets'] = $this->getElementSet();
- $output['tabSets'] = $this->getTabSet();
- $output['ActionElementSets'] = $this->getElementSet($this->m_ActionPanel);
- if($output['icon'])
- {
- if(preg_match("/{.*}/si",$output['icon']))
- {
- $output['icon'] = Expression::evaluateExpression($output['icon'], null);
- }
- else
- {
- $output['icon'] = THEME_URL . "/" . Resource::getCurrentTheme() . "/images/".$output['icon'];
- }
- }
- return $output;
- }
- /**
- * Handle the error from {@link BizDataObj::getErrorMessage} method,
- * report the error as an alert window and log.
- *
- * @param int $errCode
- * @return void
- */
- public function processDataObjError($errCode = 0)
- {
- $errorMsg = $this->getDataObj()->getErrorMessage();
- BizSystem::log(LOG_ERR, "DATAOBJ", "DataObj error = ".$errorMsg);
- BizSystem::clientProxy()->showErrorMessage($errorMsg);
- }
- /**
- * Process error of form object
- *
- * @param array $errors
- * @return string - HTML text of this form's read mode
- */
- public function processFormObjError($errors)
- {
- $this->m_Errors = $errors;
- $this->m_hasError = true;
- return $this->rerender();
- }
- /**
- * Handle the exception from DataObj method,
- * report the error as an alert window
- *
- * @param int $errCode
- * @return string
- */
- public function processBDOException($e)
- {
- $errorMsg = $e->getMessage();
- BizSystem::log(LOG_ERR, "DATAOBJ", "DataObj error = ".$errorMsg);
- //BizSystem::clientProxy()->showClientAlert($errorMsg); //showErrorMessage($errorMsg);
- //BizSystem::clientProxy()->showErrorMessage($errorMsg);
- $e->no_exit=true;
- OB_ErrorHandler::ExceptionHandler($e);
- }
- /**
- * Set the sub forms of this form. This form is parent of other forms
- *
- * @param string $subForms - sub controls string with format: ctrl1;ctrl2...
- * @return void
- */
- final public function setSubForms($subForms)
- {
- // sub controls string with format: ctrl1;ctrl2...
- if (!$subForms || strlen($subForms) < 1)
- {
- $this->m_SubForms = null;
- return;
- }
- $subFormArr = explode(";", $subForms);
- unset($this->m_SubForms);
- foreach ($subFormArr as $subForm)
- {
- $this->m_SubForms[] = $this->prefixPackage($subForm);
- }
- }
- /**
- * Get view object
- *
- * @global BizSystem $g_BizSystem
- * @return EasyView
- */
- public function getViewObject()
- {
- global $g_BizSystem;
- $viewName = $g_BizSystem->getCurrentViewName();
- if (!$viewName) return null;
- $viewObj = BizSystem::getObject($viewName);
- return $viewObj;
- }
- /**
- * Get sub form of this form
- *
- * @return EasyForm
- */
- public function getSubForms()
- {
- // ask view to give its subforms if not set yet
- return $this->m_SubForms;
- }
- /**
- * Get an element object
- *
- * @param string $elementName - name of the control
- * @return Element
- */
- public function getElement($elementName)
- {
- if ($this->m_DataPanel->get($elementName)) return $this->m_DataPanel->get($elementName);
- if ($this->m_ActionPanel->get($elementName)) return $this->m_ActionPanel->get($elementName);
- if ($this->m_NavPanel->get($elementName)) return $this->m_NavPanel->get($elementName);
- if ($this->m_SearchPanel->get($elementName)) return $this->m_SearchPanel->get($elementName);
- if($this->m_WizardPanel)
- {
- if ($this->m_WizardPanel->get($elementName)) return $this->m_WizardPanel->get($elementName);
- }
- }
-
- public function getElementSet($panel = null)
- {
- if(!$panel){
- $panel = $this->m_DataPanel;
- }
- $setArr = array();
- $panel->rewind();
- while($panel->valid())
- {
- $elem = $panel->current();
- $panel->next();
- if($elem->m_ElementSet && $elem->canDisplayed()){
- //is it in array
- if(in_array($elem->m_ElementSet,$setArr)){
- continue;
- }else{
- array_push($setArr,$elem->m_ElementSet);
- }
- }
- }
- return $setArr;
- }
-
- public function getTabSet($panel = null)
- {
- if(!$panel){
- $panel = $this->m_DataPanel;
- }
- $setArr = array();
- $tabSetArr = array();
- $panel->rewind();
- while($panel->valid())
- {
- $elem = $panel->current();
- $panel->next();
- if($elem->m_TabSet && $elem->canDisplayed()){
- //is it in array
- if(in_array($elem->m_TabSet,$setArr)){
- continue;
- }else{
- $setArr[$elem->m_TabSetCode]=$elem->m_TabSet;
- }
- }
- }
- foreach($setArr as $tabsetCode=>$tabset)
- {
- $elemSetArr = array();
- $panel->rewind();
- while($panel->valid())
- {
- $elem = $panel->current();
- $panel->next();
- if($elem->m_ElementSet && $elem->canDisplayed()){
- //is it in array
- if( $elem->m_TabSetCode!= $tabsetCode ||
- in_array($elem->m_ElementSet,$elemSetArr)){
- continue;
- }else{
- array_push($elemSetArr,$elem->m_ElementSet);
- }
- }
- }
- $tabSetArr[$tabsetCode]['SetName'] = $tabset;
- $tabSetArr[$tabsetCode]['Elems'] = $elemSetArr;
- }
- return $tabSetArr;
- }
- /**
- * Get error elements
- *
- * @param array $fields
- * @return array
- */
- public function getErrorElements($fields)
- {
- $errElements = array();
- foreach ($fields as $field=>$error)
- {
- $element = $this->m_DataPanel->getByField($field);
- $errElements[$element->m_Name]=$error;
- }
- return $errElements;
- }
- /**
- * Popup a selection EasyForm in a dynamically generated EasyView
- *
- * @param string $viewName
- * @param string $formName
- * @param string $elementName
- * @return void
- * @access remote
- */
- public function loadPicker($formName, $elementName="")
- {
- // set the ParentFormName and ParentCtrlName of the popup form
- /* @var $pickerForm EasyForm */
- $pickerForm = BizSystem::objectFactory()->getObject($formName);
- if ($elementName != "")
- {
- // set the picker map as well
- $element = $this->getElement($elementName);
- $pickerMap = $element->m_PickerMap;
- }
- $currentRecord = $this->readInputRecord();
- $pickerForm->setParentForm($this->m_Name);
- $pickerForm->setParentFormData($this->m_Name, $elementName, $pickerMap);
- $pickerForm->m_ParentFormRecord = $currentRecord;
- BizSystem::clientProxy()->redrawForm("DIALOG", $pickerForm->render());
- }
-
- public function loadDialog($formName, $id=null,$transId=false)
- {
- $paramFields = array();
- if ($id!=null)
- $paramFields["Id"] = $id;
- if ($transId!=false)
- $paramFields["Id"] = $this->m_RecordId;
- $this->_showForm($formName, "Dialog", $paramFields);
- }
-
- public function setParentForm($parentFormName)
- {
- $this->m_ParentFormName = $parentFormName;
- }
- /**
- * Call/Invoke service method, this EasyForm name is passed to the method
- *
- * @param string $class
- * @param string $method
- * @param string $param
- * @return mixed - return value of the service method
- */
- public function callService($class, $method, $param = null)
- {
- $service = BizSystem::getService($class);
- if($param){
- return $service->$method($param);
- }else{
- return $service->$method($this->m_Name);
- }
- }
- /**
- * Set request parameters
- *
- * @param array $paramFields
- * @return void
- */
- public function setRequestParams($paramFields)
- {
- if ($paramFields)
- {
- $this->m_FixSearchRule=null; // reset fixsearchrule to clean the previous one in session
- foreach($paramFields as $fieldName=>$val)
- {
- $element = $this->m_DataPanel->getByField($fieldName);
- if($element->m_AllowURLParam=='Y')
- {
- if(!$this->getDataObj())return;
- if($this->getDataObj()->getField($fieldName)){
- if($this->getDataObj()->getField($fieldName)->checkValueType($val))
- {
- $this->setFixSearchRule("[$fieldName]='$val'");
- }
- }
- }
- }
- }
- }
- public function setCurrentPage($pageid)
- {
- $this->m_CurrentPage = $pageid;
- }
- /**
- * Close the popup window
- *
- * @return void
- */
- public function close()
- {
- BizSystem::clientProxy()->closePopup();
- }
- /**
- * Render parent form
- *
- * @return void
- */
- public function renderParent()
- {
- /* @var $parentForm EasyForm */
- $parentForm = BizSystem::objectFactory()->getObject($this->m_ParentFormName);
- $parentForm->rerender();
- }
- /**
- * Set the dependent search rule of the bizform, this search rule will apply on its BizDataObj.
- * The dependent search rule (session var) will always be with bizform until it get set to other value
- *
- * @param string $rule - search rule has format "[fieldName1] opr1 Value1 AND/OR [fieldName2] opr2 Value2"
- * @param boolean $cleanActualRule
- * @return void
- */
- public function setFixSearchRule($rule = null, $cleanActualRule = true)
- {
- if ($cleanActualRule)
- $this->m_FixSearchRule = $this->m_DefaultFixSearchRule;
-
- if ($this->m_FixSearchRule && $rule)
- {
- if (strpos($this->m_FixSearchRule, $rule) === false)
- {
- $this->m_FixSearchRule = $this->m_FixSearchRule . " AND " . $rule;
- }
- }
- if (!$this->m_FixSearchRule && $rule){
- $this->m_FixSearchRule = $rule;
- }
- }
- /**
- * Fetch record set
- *
- * @return array array of record
- */
- public function fetchDataSet()
- {
- $dataObj = $this->getDataObj();
- if (!$dataObj) return null;
-
- if ($this->m_RefreshData)
- $dataObj->resetRules();
- else
- $dataObj->clearSearchRule();
- if ($this->m_FixSearchRule)
- {
- if ($this->m_SearchRule)
- $searchRule = $this->m_SearchRule . " AND " . $this->m_FixSearchRule;
- else
- $searchRule = $this->m_FixSearchRule;
- }
- else
- $searchRule = $this->m_SearchRule;
- $dataObj->setQueryParameters($this->queryParams);
- $dataObj->setSearchRule($searchRule);
- if($this->m_StartItem>1)
- {
- $dataObj->setLimit($this->m_Range, $this->m_StartItem);
- }
- else
- {
- $dataObj->setLimit($this->m_Range, ($this->m_CurrentPage-1)*$this->m_Range);
- }
- if($this->m_SortRule && $this->m_SortRule != $this->getDataObj()->m_SortRule)
- {
- $dataObj->setSortRule($this->m_SortRule);
- }
- $resultRecords = $dataObj->fetch();
- $this->m_TotalRecords = $dataObj->count();
- if ($this->m_Range && $this->m_Range > 0)
- $this->m_TotalPages = ceil($this->m_TotalRecords/$this->m_Range);
- $selectedIndex = 0;
-
- //if current page is large than total pages ,then reset current page to last page
- if($this->m_CurrentPage>$this->m_TotalPages && $this->m_TotalPages>0)
- {
- $this->m_CurrentPage = $this->m_TotalPages;
- $dataObj->setLimit($this->m_Range, ($this->m_CurrentPage-1)*$this->m_Range);
- $resultRecords = $dataObj->fetch();
- }
-
- $this->getDataObj()->setActiveRecord($resultRecords[$selectedIndex]);
- if(!$this->m_RecordId)
- {
- $this->m_RecordId = $resultRecords[0]["Id"];
- }else{
- $foundRecordId = false;
- foreach($resultRecords as $record)
- {
- if($this->m_RecordId==$record['Id'])
- {
- $foundRecordId = true;
- }
- }
- if($foundRecordId == false)
- {
- $this->m_RecordId=$result[0]['Id'];
- }
- }
-
- return $resultRecords;
- }
- /**
- * Fetch single record
- *
- * @return array one record array
- */
- public function fetchData()
- {
- // if has valid active record, return it, otherwise do a query
- if ($this->m_ActiveRecord != null)
- return $this->m_ActiveRecord;
-
- $dataObj = $this->getDataObj();
- if ($dataObj == null) return;
- if (strtoupper($this->m_FormType) == "NEW")
- return $this->getNewRecord();
-
- if (!$this->m_FixSearchRule && !$this->m_SearchRule){
- //if its a default sub form,even no search rule, but can still fetch a default record
- if(!is_array($this->getDataObj()->m_Association)){
- //only if its a default sub form and without any association then return emply array
- return array();
- }
- }else{
- if ($this->m_RefreshData) $dataObj->resetRules();
- else $dataObj->clearSearchRule();
-
- if ($this->m_FixSearchRule)
- {
- if ($this->m_SearchRule)
- $searchRule = $this->m_SearchRule . " AND " . $this->m_FixSearchRule;
- else
- $searchRule = $this->m_FixSearchRule;
- }
-
- $dataObj->setSearchRule($searchRule);
- $dataObj->setLimit(1);
- }
- $resultRecords = $dataObj->fetch();
- if(!count($resultRecords))
- {
- $this->m_RecordAllowAccess=false;
- }
- $this->m_RecordId = $resultRecords[0]['Id'];
- $this->setActiveRecord($resultRecords[0]);
-
- if($this->getDataObj()){
- $this->m_CanUpdateRecord = (int)$this->getDataObj()->canUpdateRecord();
- }
- return $resultRecords[0];
- }
- /**
- * Goto page specified by $page parameter, and ReRender
- * If page not specified, goto page 1
- *
- * @param number $page
- */
- public function gotoPage($page=1)
- {
- $tgtPage = intval($page);
- if ($tgtPage == 0) $tgtPage = 1;
- $this->m_CurrentPage = $tgtPage;
- $this->rerender();
- }
- public function gotoSelectedPage($elemName)
- {
- $page = BizSystem::clientProxy()->getFormInputs(str_replace(".","_", $this->m_Name).'_'.$elemName);
- $this->gotoPage($page);
- }
- public function setPageSize($elemName)
- {
- $pagesize = BizSystem::clientProxy()->getFormInputs(str_replace(".","_", $this->m_Name).'_'.$elemName);
- $this->m_Range=$pagesize;
- $this->UpdateForm();
- }
- /**
- * Sort Record, for list form
- *
- * @param string $sortCol column name to sort
- * @param string $order 'dec' (decending) or 'asc' (ascending)
- * @access remote
- * @return void
- */
- public function sortRecord($sortCol, $order='ASC')
- {
- $element = $this->getElement($sortCol);
- // turn off the OnSort flag of the old onsort field
- $element->setSortFlag(null);
- // turn on the OnSort flag of the new onsort field
- if ($order == "ASC")
- $order = "DESC";
- else
- $order = "ASC";
- $element->setSortFlag($order);
- // change the sort rule and issue the query
- $this->getDataObj()->setSortRule("[" . $element->m_FieldName . "] " . $order);
- // move to 1st page
- $this->m_CurrentPage = 1;
- $this->m_SortRule = "";
- $this->rerender();
- }
- /**
- * Run Search
- *
- * @return void
- */
- public function runSearch()
- {
- static $isSearchHelperLoaded = false;
-
- if (!$isSearchHelperLoaded) {
- include_once(OPENBIZ_BIN."/easy/SearchHelper.php");
- $isSearchHelperLoaded = true;
- }
- $searchRule = "";
- $this->queryParams = array();
- foreach ($this->m_SearchPanel as $element)
- {
- $searchStr = '';
- if(method_exists($element,"getSearchRule")){
- $searchStr = $element->getSearchRule();
- }else{
- if (!$element->m_FieldName)
- continue;
-
- $value = BizSystem::clientProxy()->getFormInputs($element->m_Name);
- if($element->m_FuzzySearch=="Y")
- {
- $value="*$value*";
- }
- if ($value!='')
- {
- //$searchStr = inputValToRule($element->m_FieldName, $value, $this);
- $this->queryParams[$element->m_FieldName] = $value;
- }
- }
- //BizSystem::clientProxy()->showClientAlert($searchStr);
- if($searchStr){
- if ($searchRule == "")
- $searchRule .= $searchStr;
- else
- $searchRule .= " AND " . $searchStr;
- }
- }
- $this->m_SearchRule = $searchRule;
- $this->m_RefreshData = true;
- $this->m_CurrentPage = 1;
- BizSystem::log(LOG_DEBUG,"FORMOBJ",$this->m_Name."::runSearch(), SearchRule=".$this->m_SearchRule);
- $recArr = $this->readInputRecord();
-
- $this->m_SearchPanelValues = $recArr;
-
- $this->runEventLog();
- $this->rerender();
- }
- /**
- * Reset search
- *
- * @return void
- */
- public function resetSearch()
- {
- $this->m_SearchRule = "";
- $this->m_RefreshData = true;
- $this->m_CurrentPage = 1;
- $this->runEventLog();
- $this->rerender();
- }
-
- public function setSearchRule($searchRule, $queryParams=null)
- {
- $this->m_SearchRule = $searchRule;
- $this->queryParams = $queryParams;
- $this->m_RefreshData = true;
- $this->m_CurrentPage = 1;
- }
-
- /**
- * New record, be default, just redirect to the new record page
- *
- * @return void
- */
- public function newRecord()
- {
- $this->processPostAction();
- }
- /**
- * Copy record to new record *
- *
- * @param mixed $id id of record that want to copy,
- * it parameter not passed, id is '_selectedId'
- * @return void
- */
- public function copyRecord($id=null)
- {
- if ($id==null || $id=='')
- $id = BizSystem::clientProxy()->getFormInputs('_selectedId');
- if (!$id)
- {
- BizSystem::clientProxy()->showClientAlert($this->getMessage("PLEASE_EDIT_A_RECORD"));
- return;
- }
- $this->getActiveRecord($id);
- $this->processPostAction();
- }
- /**
- * Edit Record
- * NOTE: append fld:Id=$id to the redirect page url
- *
- * @param mixed $id
- * @return void
- */
- public function editRecord($id=null)
- {
- if ($id==null || $id=='')
- $id = BizSystem::clientProxy()->getFormInputs('_selectedId');
-
- if (!isset($id))
- {
- BizSystem::clientProxy()->showClientAlert($this->getMessage("PLEASE_EDIT_A_RECORD"));
- return;
- }
- // update the active record with new update record
- $this->getActiveRecord($id);
- $this->processPostAction();
- }
- /**
- * Show form
- *
- * @param string $formName
- * @param string $target target type: Popup or other
- * @param array $paramFields
- * @return void
- */
- protected function _showForm($formName, $target, $paramFields)
- {
-
- $formName_org = $formName;
- if (!$this->m_DefaultFormName)
- $this->m_DefaultFormName = $this->m_Name;
- if ($formName == null)
- {
- if($this->m_ReferenceFormName == null)
- {
- $formName = $this->m_DefaultFormName;
- }else{
- if($formName = $this->m_ReferenceFormName){
- //this judgement is for anti endless loop between swtich forms
- $formObj = BizSystem::objectFactory()->getObject($this->m_ReferenceFormName);
- if($formObj->m_ReferenceFormName == $this->m_Name){
- $formName = $this->m_DefaultFormName;
- }else{
- $formName = $this->m_ReferenceFormName;
- }
- }
- }
- }
- //if($this->getViewObject()->isInFormRefLibs($formName))
- {
- // get the form object
- /* @var $formObj EasyForm */
- $formObj = BizSystem::objectFactory()->getObject($formName);
- $formObj->m_DefaultFormName = $this->m_DefaultFormName;
- if($formName_org){
- //RefenerenceForm records where the from switch from
- if( $this->m_FormType!='EDIT' &&
- $this->m_FormType!='NEW' &&
- $this->m_FormType!='COPY' ){
- $formObj->m_ReferenceFormName = $this->m_Name;
- }
- }
-
- //if has more than Id field as params then $clearFixSearchRule is false, means join all where rules
- $paramTemp = $paramFields;
- unset($paramTemp['Id']);
- if(count($paramTemp)){
- $clearFixSearchRule = false;
- }else{
- $clearFixSearchRule = true;
- }
- foreach($paramFields as $fieldName=>$val){
- $formObj->m_FormParams[$fieldName] = $val;
- $formObj->setFixSearchRule("[$fieldName]='$val'",$clearFixSearchRule);
- if($fieldName=="Id"){
- $formObj->setRecordId($val);
- }
- }
- if(!$formObj->canDisplayForm())
- {
- $formObj->m_ErrorMessage = $this->getMessage("FORM_OPERATION_NOT_PERMITTED",$formObj->m_Name);
-
- if (strtoupper($this->m_FormType) == "LIST"){
- BizSystem::log(LOG_ERR, "DATAOBJ", "DataObj error = ".$errorMsg);
- BizSystem::clientProxy()->showClientAlert($formObj->m_ErrorMessage);
- }else{
- $this->processFormObjError(array($formObj->m_ErrorMessage));
- }
-
- return false;
- }
-
- switch ($target)
- {
- case "Popup":
- $formObj->setParentForm($this->m_Name);
- echo $formObj->render();
- break;
- case "Dialog":
- $formObj->setParentForm($this->m_Name);
- BizSystem::clientProxy()->redrawForm("DIALOG", $formObj->render());
- break;
- default:
- BizSystem::clientProxy()->redrawForm($this->m_Name, $formObj->render());
- }
- }
- }
- /**
- * Delete Record
- * NOTE: use redirectpage attr of eventhandler to redirect or redirect to previous page by default
- *
- * @param string $id
- * @return void
- */
- public function deleteRecord($id=null)
- {
- if ($id==null || $id=='')
- $id = BizSystem::clientProxy()->getFormInputs('_selectedId');
- $selIds = BizSystem::clientProxy()->getFormInputs('row_selections', false);
- if ($selIds == null)
- $selIds[] = $id;
- foreach ($selIds as $id)
- {
- $dataRec = $this->getDataObj()->fetchById($id);
- $this->getDataObj()->setActiveRecord($dataRec);
-
- if(!$this->canDeleteRecord($dataRec))
- {
- $this->m_ErrorMessage = $this->getMessage("FORM_OPERATION_NOT_PERMITTED",$this->m_Name);
- if (strtoupper($this->m_FormType) == "LIST"){
- BizSystem::log(LOG_ERR, "DATAOBJ", "DataObj error = ".$errorMsg);
- BizSystem::clientProxy()->showClientAlert($this->m_ErrorMessage);
- }else{
- $this->processFormObjError(array($this->m_ErrorMessage));
- }
- return;
- }
-
- // take care of exception
- try
- {
- $dataRec->delete();
- } catch (BDOException $e)
- {
- // call $this->processBDOException($e);
- $this->processBDOException($e);
- return;
- }
- }
- if (strtoupper($this->m_FormType) == "LIST")
- $this->rerender();
- $this->runEventLog();
- $this->processPostAction();
- }
- /**
- * Remove the record out of the associate relationship
- *
- * @return void
- */
- public function removeRecord ($id=null)
- {
- if ($id==null || $id=='')
- $id = BizSystem::clientProxy()->getFormInputs('_selectedId');
- $selIds = BizSystem::clientProxy()->getFormInputs('row_selections', false);
- if ($selIds == null)
- $selIds[] = $id;
- foreach ($selIds as $id)
- {
-
- $rec = $this->getDataObj()->fetchById($id);
- $ok = $this->getDataObj()->removeRecord($rec, $bPrtObjUpdated);
- if (! $ok)
- return $this->processDataObjError($ok);
- }
- $this->runEventLog();
- $this->rerender();
- if($this->m_ParentFormName)
- {
- $this->renderParent();
- }
- }
- /**
- * Select Record
- *
- * @param string $recId
- * @access remote
- * @return void
- */
- public function selectRecord($recId)
- {
- if ($recId==null || $recId=='')
- $recId = BizSystem::clientProxy()->getFormInputs('_selectedId');
- $this->m_RecordId = $recId;
- if($this->getDataObj()){
- $this->getDataObj()->setActiveRecordId($this->m_RecordId);
- }
- $this->rerender(false); // not redraw the this form, but draw the subforms
- //$this->rerender();
- }
- /**
- * Get element Id
- *
- * @return mixed
- */
- public function getElementID()
- {
- $id = $this->m_DataPanel->getByField('Id')->getValue();
- if($id)
- {
- return (int)$id;
- }
- else
- {
- return (int)$this->m_RecordId;
- }
- }
- /**
- * Save input and redirect page to a new view
- * use redirectpage attr of eventhandler to redirect or redirect to previous page by default
- * NOTE: For Edit/New form type
- *
- * @return void
- */
- public function saveRecord()
- {
- if (strtoupper($this->m_FormType) == "NEW")
- {
- $this->insertRecord();
- }
- else
- {
- $this->updateRecord();
- }
- }
- /**
- * Update record
- *
- * @return mixed
- */
- public function updateRecord()
- {
- $currentRec = $this->fetchData();
- $recArr = $this->readInputRecord();
- $this->setActiveRecord($recArr);
- if (count($recArr) != 0){
-
- try
- {
- $this->ValidateForm();
- }
- catch (ValidationException $e)
- {
- $this->processFormObjError($e->m_Errors);
- return;
- }
-
- if ($this->_doUpdate($recArr, $currentRec) == false)
- return;
-
- $this->commitFormElements(); // commit change in FormElement
- }
-
- // in case of popup form, close it, then rerender the parent form
- if ($this->m_ParentFormName)
- {
- $this->close();
- $this->renderParent();
- }
-
- $this->processPostAction();
- }
-
- public function updateFieldValueAdd($id,$fld_name,$value,$min,$max)
- {
- if($value>=$max){
- $value = $min;
- }else{
- $value++;
- }
- return $this->updateFieldValue($id,$fld_name,$value);
- }
-
- public function updateFieldValueXor($id,$fld_name,$value)
- {
- if($value>0){
- $value_xor = 0;
- }else{
- $value_xor = 1;
- }
- return $this->updateFieldValue($id,$fld_name,$value_xor);
- }
-
- /**
- * Update record
- *
- * @return mixed
- */
- public function updateFieldValue($Id,$fld_name,$value)
- {
-
- $element = $this->m_DataPanel->get($fld_name);
- $fieldname = $element->m_FieldName;
- $currentRec = $this->getActiveRecord($Id);
- $recArr = $this->getActiveRecord($Id);
- $recArr[$fieldname]=$value;
- if ($this->_doUpdate($recArr, $currentRec) == false)
- return;
- $this->UpdateForm();
- }
- /**
- * Do update record
- *
- …
Large files files are truncated, but you can click here to view the full file