Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes

EasyForm Class Reference

Inheritance diagram for EasyForm:
Inheritance graph
[legend]
Collaboration diagram for EasyForm:
Collaboration graph
[legend]

Public Member Functions

 __construct (&$xmlArr)
 allowAccess ($access=null)
 canDisplayForm ()
 canDeleteRecord ($rec)
 getSessionVars ($sessionContext)
 setSessionVars ($sessionContext)
 invoke ()
 validateRequest ($methodName)
 getProperty ($propertyName)
 getDataObj ()
 setDataObj ($dataObj)
 outputAttrs ()
 processDataObjError ($errCode=0)
 processFormObjError ($errors)
 processBDOException ($e)
 setSubForms ($subForms)
 getViewObject ()
 getSubForms ()
 getElement ($elementName)
 getElementSet ($panel=null)
 getTabSet ($panel=null)
 getErrorElements ($fields)
 loadPicker ($formName, $elementName="")
 loadDialog ($formName, $id=null, $transId=false)
 callService ($class, $method, $param=null)
 setRequestParams ($paramFields)
 setCurrentPage ($pageid)
 close ()
 renderParent ()
 setFixSearchRule ($rule=null, $cleanActualRule=true)
 fetchDataSet ()
 fetchData ()
 gotoPage ($page=1)
 gotoSelectedPage ($elemName)
 setPageSize ($elemName)
 sortRecord ($sortCol, $order='ASC')
 runSearch ()
 resetSearch ()
 setSearchRule ($searchRule, $searchRuleBindValues=null)
 newRecord ()
 copyRecord ($id=null)
 editRecord ($id=null)
 deleteRecord ($id=null)
 removeRecord ()
 selectRecord ($recId)
 getElementID ()
 saveRecord ()
 updateRecord ()
 updateFieldValueAdd ($id, $fld_name, $value, $min, $max)
 updateFieldValueXor ($id, $fld_name, $value)
 updateFieldValue ($Id, $fld_name, $value)
 insertRecord ()
 cancel ()
 updateForm ()
 autoSuggest ($input)
 setFormInputs ($inputArr=null)
 render ()
 rerender ($redrawForm=true, $hasRecordChange=true)
 switchForm ($formName=null, $id=null, $params=null, $target=null)
 parentSwitchForm ($formName=null, $id=null, $params=null, $target=null)
 targetSwitchForm ($targetForm, $formName=null, $id=null, $params=null, $target=null)
 getActiveRecord ($recId=null)
 getRecordId ()
 setRecordId ($val)

Data Fields

 $DATAFORMAT = 'RECORD'
 $m_Title
 $m_Icon
 $m_Description
 $m_jsClass
 $m_DataObjName
 $m_Height
 $m_Width
 $m_DefaultForm
 $m_CanUpdateRecord
 $m_DirectMethodList = null
 $m_Panels
 $m_InheritFrom
 $m_DataPanel
 $m_ActionPanel
 $m_NavPanel
 $m_SearchPanel
 $m_TemplateEngine
 $m_TemplateFile
 $m_FormType
 $m_SubForms = null
 $m_EventName
 $m_Range = 10
 $m_CacheLifeTime = 0
 $m_FormParams
 $m_ParentFormName
 $m_DefaultFormName = null
 $m_QueryStringParam
 $m_Errors
 $m_Notices
 $m_ActiveRecord = null
 $m_FormInputs = null
 $m_SearchRule = null
 $m_FixSearchRule = null
 $m_SortRule = null
 $m_MessageFile = null
 $m_TotalPages = 1
 $m_AutoRefresh = 0
 $m_ReferenceFormName

Protected Member Functions

 readMetadata (&$xmlArr)
 inheritParentObj ()
 getMessage ($messageId, $params=array())
 _showForm ($formName, $target, $paramFields)
 _doUpdate ($inputRecord, $currentRecord)
 _doInsert ($inputRecord)
 validateForm ($cleanError=true)
 readInputRecord ()
 readInputs ()
 getNewRecord ()
 renderContextMenu ()
 rerenderSubForms ()
 renderHTML ()
 getEventLogMsg ()
 getOnEventElements ()
 runEventLog ()
 getRedirectPage ()
 getInvokingElement ()
 processPostAction ()
 setActiveRecord ($record)
 setClientScripts ()
 translate ()
 getTransKey ($name)

Protected Attributes

 $m_DataObj
 $m_RecordId = null
 $m_DefaultFixSearchRule = null
 $m_SearchRuleBindValues
 $m_Referer = ""
 $m_hasError = false
 $m_ValidateErrors = array()
 $m_CurrentPage = 1
 $m_StartItem = 1
 $m_TotalRecords = 0
 $m_RecordSet = null
 $m_RefreshData = false
 $m_Resource = ""
 $m_Messages
 $m_InvokingElement = null
 $m_RecordAllowAccess = true

Detailed Description

Definition at line 28 of file EasyForm.php.


Constructor & Destructor Documentation

__construct ( &$  xmlArr )

Initialize BizForm with xml array

Parameters:
array$xmlArr
Returns:
void

Reimplemented from MetaObject.

Definition at line 136 of file EasyForm.php.

Here is the call graph for this function:


Member Function Documentation

_doInsert ( inputRecord ) [protected]

Do insert record

Parameters:
array$inputRecord
Returns:
void

Definition at line 1580 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_doUpdate ( inputRecord,
currentRecord 
) [protected]

Do update record

Parameters:
array$inputRecord
array$currentRecord
Returns:
void

Definition at line 1500 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_showForm ( formName,
target,
paramFields 
) [protected]

Show form

Parameters:
string$formName
string$targettarget type: Popup or other
array$paramFields
Returns:
void

Definition at line 1194 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

allowAccess ( access = null )

Check is allow access?

BizSystem $g_BizSystem

Parameters:
<type>$access
Returns:
<type>

if the record is now allowed to access, then deny form render instead of display an empty form

Reimplemented from MetaObject.

Definition at line 143 of file EasyForm.php.

Here is the caller graph for this function:

autoSuggest ( input )

Generate list for AutoSuggest element Also supports elements that have hidden values

Parameters:
string$input- the search string used to filter the list
Todo:
rename to createAutoSuggestList or createAutoSuggest(v2.5?)
Returns:
void

Definition at line 1649 of file EasyForm.php.

Here is the call graph for this function:

callService ( class,
method,
param = null 
)

Call/Invoke service method, this EasyForm name is passed to the method

Parameters:
string$class
string$method
string$param
Returns:
mixed - return value of the service method

Definition at line 774 of file EasyForm.php.

Here is the call graph for this function:

cancel (  )

Cancel input and do page redirection

Returns:
void

Reimplemented in EasyFormWizard.

Definition at line 1621 of file EasyForm.php.

Here is the call graph for this function:

close (  )

Close the popup window

Returns:
void

Definition at line 822 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

copyRecord ( id = null )

Copy record to new record *

Parameters:
mixed$idid of record that want to copy, it parameter not passed, id is '_selectedId'
Returns:
void

Definition at line 1148 of file EasyForm.php.

Here is the call graph for this function:

deleteRecord ( id = null )

Delete Record NOTE: use redirectpage attr of eventhandler to redirect or redirect to previous page by default

Parameters:
string$id
Returns:
void

Definition at line 1285 of file EasyForm.php.

Here is the call graph for this function:

editRecord ( id = null )

Edit Record NOTE: append fld:Id=$id to the redirect page url

Parameters:
mixed$id
Returns:
void

Definition at line 1169 of file EasyForm.php.

Here is the call graph for this function:

fetchData (  )

Fetch single record

Returns:
array one record array

Definition at line 948 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

fetchDataSet (  )

Fetch record set

Returns:
array array of record

Reimplemented in EasyFormGrouping, and EasyFormTree.

Definition at line 869 of file EasyForm.php.

Here is the call graph for this function:

getActiveRecord ( recId = null )

Get activeRecord

Parameters:
mixed$recId
Returns:
array - record array

Definition at line 2234 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getDataObj (  )

Get object instance of BizDataObj defined in it's metadata file

Returns:
BizDataObj

Definition at line 479 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getElement ( elementName )

Get an element object

Parameters:
string$elementName- name of the control
Returns:
Element

Definition at line 636 of file EasyForm.php.

Here is the caller graph for this function:

getElementID (  )

Get element Id

Returns:
mixed

Definition at line 1382 of file EasyForm.php.

getErrorElements ( fields )

Get error elements

Parameters:
array$fields
Returns:
array

Definition at line 718 of file EasyForm.php.

Here is the caller graph for this function:

getEventLogMsg (  ) [protected]

Get event log message

Returns:
mixed string or null

Definition at line 2058 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getInvokingElement (  ) [protected]

Get the element that issues the call.

Returns:
array element object and event handler name

Definition at line 2172 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getMessage ( messageId,
params = array() 
) [protected]

Get message, and translate it

Parameters:
string$messageIdmessage Id
array$params
Returns:
string message string

Definition at line 285 of file EasyForm.php.

Here is the caller graph for this function:

getNewRecord (  ) [protected]

Get new record

Returns:
array

Definition at line 1844 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getOnEventElements (  ) [protected]

Get on event elements

Returns:
array element list

Definition at line 2077 of file EasyForm.php.

Here is the caller graph for this function:

getProperty ( propertyName )

Get object property This method get element object if propertyName is "Elements[elementName]" format.

Parameters:
string$propertyName
Returns:
<type>

Reimplemented from MetaObject.

Definition at line 448 of file EasyForm.php.

Here is the call graph for this function:

getRedirectPage (  ) [protected]

return redirect page and target array

Returns:
array {redirectPage, $target}

Definition at line 2110 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

getSessionVars ( sessionContext )

Get/Retrieve Session data of this object

Parameters:
SessionContext$sessionContext
Returns:
void

Implements iSessionObject.

Reimplemented in EasyFormWizard, and PickerForm.

Definition at line 348 of file EasyForm.php.

getSubForms (  )

Get sub form of this form

Returns:
EasyForm

Definition at line 624 of file EasyForm.php.

getViewObject (  )

Get view object

BizSystem $g_BizSystem

Returns:
EasyView

Definition at line 610 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

gotoPage ( page = 1 )

Goto page specified by $page parameter, and ReRender If page not specified, goto page 1

Parameters:
number$page

Definition at line 1007 of file EasyForm.php.

Here is the call graph for this function:

inheritParentObj (  ) [protected]

Inherit from parent object. Name, Package, Class cannot be inherited

Returns:
void

Definition at line 227 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

insertRecord (  )

Insert new record

Returns:
mixed

Definition at line 1542 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

invoke (  )

Invoke the action passed from browser

Returns:
mixed the function result, or false on error.

Definition at line 389 of file EasyForm.php.

Here is the call graph for this function:

loadPicker ( formName,
elementName = "" 
)

Popup a selection EasyForm in a dynamically generated EasyView

Parameters:
string$viewName
string$formName
string$elementName
Returns:
void remote

Definition at line 738 of file EasyForm.php.

Here is the call graph for this function:

newRecord (  )

New record, be default, just redirect to the new record page

Returns:
void

Definition at line 1136 of file EasyForm.php.

Here is the call graph for this function:

outputAttrs (  )

Get output attributs as array

Returns:
array array of attributs
Todo:
rename to getOutputAttribute or getAttribute (2.5?)

Reimplemented in EasyFormGrouping, and EasyFormWizard.

Definition at line 513 of file EasyForm.php.

Here is the call graph for this function:

processBDOException ( e )

Handle the exception from DataObj method, report the error as an alert window

Parameters:
int$errCode
Returns:
string

Definition at line 575 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

processDataObjError ( errCode = 0 )

Handle the error from BizDataObj::getErrorMessage method, report the error as an alert window and log.

Parameters:
int$errCode
Returns:
void

Definition at line 548 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

processFormObjError ( errors )

Process error of form object

Parameters:
array$errors
Returns:
string - HTML text of this form's read mode

Definition at line 561 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

processPostAction (  ) [protected]

Process Post Action

Returns:
void

Definition at line 2192 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

readInputRecord (  ) [protected]

Read user input data from UI

Returns:
array - record array

Definition at line 1755 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

readInputs (  ) [protected]

Read inputs

Returns:
array array of input

Definition at line 1793 of file EasyForm.php.

Here is the call graph for this function:

readMetadata ( &$  xmlArr ) [protected]

Read array meta data, and store to meta object

Parameters:
array$xmlArr
Returns:
void

Reimplemented from MetaObject.

Reimplemented in EasyFormGrouping, and EasyFormTree.

Definition at line 163 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

removeRecord (  )

Remove the record out of the associate relationship

Returns:
void

Definition at line 1333 of file EasyForm.php.

Here is the call graph for this function:

render (  )

Render this form (return html content), called by EasyView's render method (called when form is loaded). Query is issued before returning the html content.

Returns:
string - HTML text of this form's read mode

Reimplemented in EasyFormWizard.

Definition at line 1875 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

renderContextMenu (  ) [protected]

Render context menu code

Returns:
string html code for context menu

Definition at line 1927 of file EasyForm.php.

renderHTML (  ) [protected]

Render html content of this form

Returns:
string - HTML text of this form's read mode

Definition at line 2012 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

renderParent (  )

Render parent form

Returns:
void

Definition at line 832 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

rerender ( redrawForm = true,
hasRecordChange = true 
)

Rerender this form (form is rendered already) .

Parameters:
boolean$redrawForm- whether render this form again or not, optional default true
boolean$hasRecordChange- if record change, need to render subforms, optional default true
Returns:
string - HTML text of this form's read mode

Definition at line 1973 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

rerenderSubForms (  ) [protected]

Rerender sub forms who has dependecy on this form. This method is called when parent form's change affect the sub forms

Returns:
void

Definition at line 1992 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

resetSearch (  )

Reset search

Returns:
void

Definition at line 1114 of file EasyForm.php.

Here is the call graph for this function:

runEventLog (  ) [protected]

Run event log

Returns:
void

Definition at line 2093 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

runSearch (  )

Run Search

Returns:
void

Definition at line 1060 of file EasyForm.php.

Here is the call graph for this function:

saveRecord (  )

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

Returns:
void

Definition at line 1402 of file EasyForm.php.

Here is the call graph for this function:

selectRecord ( recId )

Select Record

Parameters:
string$recIdremote
Returns:
void

Definition at line 1365 of file EasyForm.php.

Here is the call graph for this function:

setActiveRecord ( record ) [protected]

Set active record

Parameters:
array$record
Returns:
void

Definition at line 2277 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

setClientScripts (  ) [protected]

Set client scripts, auto add javascripts code to the page

Returns:
void

Definition at line 2302 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

setDataObj ( dataObj ) [final]

Set data object BizDataObj with specified instant from parameter

Parameters:
BizDataObj$dataObj
Returns:
void

Definition at line 502 of file EasyForm.php.

setFixSearchRule ( rule = null,
cleanActualRule = true 
)

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

Parameters:
string$rule- search rule has format "[fieldName1] opr1 Value1 AND/OR [fieldName2] opr2 Value2"
boolean$cleanActualRule
Returns:
void

Definition at line 847 of file EasyForm.php.

Here is the caller graph for this function:

setRequestParams ( paramFields )

Set request parameters

Parameters:
array$paramFields
Returns:
void

Definition at line 790 of file EasyForm.php.

Here is the call graph for this function:

setSessionVars ( sessionContext )

Save object variable to session context

Parameters:
SessionContext$sessionContext
Returns:
void

Implements iSessionObject.

Reimplemented in EasyFormWizard, and PickerForm.

Definition at line 369 of file EasyForm.php.

setSubForms ( subForms ) [final]

Set the sub forms of this form. This form is parent of other forms

Parameters:
string$subForms- sub controls string with format: ctrl1;ctrl2...
Returns:
void

Definition at line 588 of file EasyForm.php.

Here is the call graph for this function:

sortRecord ( sortCol,
order = 'ASC' 
)

Sort Record, for list form

Parameters:
string$sortColcolumn name to sort
string$order'dec' (decending) or 'asc' (ascending) remote
Returns:
void

Definition at line 1033 of file EasyForm.php.

Here is the call graph for this function:

switchForm ( formName = null,
id = null,
params = null,
target = null 
)

Switch to other form

Parameters:
string$formNameto-be-swtiched form name. if empty, then switch to default form
string$idid value of the target form
Returns:
void remote

Definition at line 2139 of file EasyForm.php.

Here is the call graph for this function:

updateFieldValue ( Id,
fld_name,
value 
)

Update record

Returns:
mixed

Definition at line 1481 of file EasyForm.php.

Here is the call graph for this function:

updateForm (  )

Update form controls

Returns:
void remote

Definition at line 1632 of file EasyForm.php.

Here is the call graph for this function:

updateRecord (  )

Update record

Returns:
mixed

Definition at line 1419 of file EasyForm.php.

Here is the call graph for this function:

Here is the caller graph for this function:

validateForm ( cleanError = true ) [protected]

Validate input on EasyForm level default form validation do nothing. developers need to override this method to implement their logic

Returns:
boolean

Definition at line 1703 of file EasyForm.php.

Here is the call graph for this function:

validateRequest ( methodName )

Validate request from client (browser)

Parameters:
string$methodNamecalled from the client
Returns:
boolean

Definition at line 410 of file EasyForm.php.

Here is the call graph for this function:


The documentation for this class was generated from the following file: