Class: I2CE Module Forms: Difference between revisions

From IHRIS Wiki
No edit summary
No edit summary
Line 2: Line 2:
*Extends the class: [[Class: I2CE_Module | I2CE_Module]].
*Extends the class: [[Class: I2CE_Module | I2CE_Module]].
*Location: Part of the module [[I2CE Module List#forms|forms]] in the package [https://launchpad.net/i2ce I2CE]
*Location: Part of the module [[I2CE Module List#forms|forms]] in the package [https://launchpad.net/i2ce I2CE]
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.1-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php modules/Forms/lib/I2CE_Module_Forms.php]
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php#L26 modules/Forms/lib/I2CE_Module_Forms.php] on line 26
*Author: Luke Duncan <lduncan@intrahealth.org> carl leitner <litlfred@ibiblio.org>
*Author: Luke Duncan <lduncan@intrahealth.org> carl leitner <litlfred@ibiblio.org>
*Since: v1.0.0
*Since: v1.0.0
Line 8: Line 8:
===$isReview===
===$isReview===
A flag to determine if the page is a confirmation form. This will cause the form display to make all elements "hidden" and display the values as text for a confirmation view.
A flag to determine if the page is a confirmation form. This will cause the form display to make all elements "hidden" and display the values as text for a confirmation view.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php#L178 i2ce/modules/Forms/lib/I2CE_Module_Forms.php] on line 178
*Type: protected [http://www.php.net/manual/en/language.types.boolean.php boolean ] $isReview
*Type: protected [http://www.php.net/manual/en/language.types.boolean.php boolean ] $isReview


===$showForm===
===$showForm===
A flag to determine if the page is a form and should display the form elements. If this is false then instead of adding in form elements for form fields the value will be displayed.
A flag to determine if the page is a form and should display the form elements. If this is false then instead of adding in form elements for form fields the value will be displayed.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php#L185 i2ce/modules/Forms/lib/I2CE_Module_Forms.php] on line 185
*Type: protected $showForm
*Type: protected $showForm


==Methods==
==Methods==
===__construct()===
===__construct()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php#L217 i2ce/modules/Forms/lib/I2CE_Module_Forms.php] on line 217
*Signature: public function __construct()
*Signature: public function __construct()
===createDateIndexOnLastEntry()===
===createDateIndexOnLastEntry()===
Checks to make sure there is an index on the date column last_entry table named date.  If it does not exist it adds it.
Checks to make sure there is an index on the date column last_entry table named date.  If it does not exist it adds it.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php#L143 i2ce/modules/Forms/lib/I2CE_Module_Forms.php] on line 143
*Signature: protected function createDateIndexOnLastEntry()
*Signature: protected function createDateIndexOnLastEntry()
===getCLIHooks()===
===getCLIHooks()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php#L51 i2ce/modules/Forms/lib/I2CE_Module_Forms.php] on line 51
*Signature: static public function getCLIHooks()
*Signature: static public function getCLIHooks()
===getField()===
===getField()===
returns the indicated field from the indicated form that is responsible for the data  in this node.
returns the indicated field from the indicated form that is responsible for the data  in this node.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php#L249 i2ce/modules/Forms/lib/I2CE_Module_Forms.php] on line 249
*Signature: public function getField($template,$form_field,$node)
*Signature: public function getField($template,$form_field,$node)
*Parameters:
*Parameters:
Line 32: Line 38:
*Returns: I2CE_Field
*Returns: I2CE_Field
===getHooks()===
===getHooks()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php#L29 i2ce/modules/Forms/lib/I2CE_Module_Forms.php] on line 29
*Signature: static public function getHooks()
*Signature: static public function getHooks()
===getMethods()===
===getMethods()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php#L83 i2ce/modules/Forms/lib/I2CE_Module_Forms.php] on line 83
*Signature: static public function getMethods()
*Signature: static public function getMethods()
===hasPermission_form()===
===hasPermission_form()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php#L103 i2ce/modules/Forms/lib/I2CE_Module_Forms.php] on line 103
*Signature: protected function hasPermission_form($calling_args)
*Signature: protected function hasPermission_form($calling_args)
*Parameters:
*Parameters:
**$calling_args  
**$calling_args  
===invisibleClass()===
===invisibleClass()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php#L58 i2ce/modules/Forms/lib/I2CE_Module_Forms.php] on line 58
*Signature: public function invisibleClass($class_name)
*Signature: public function invisibleClass($class_name)
*Parameters:
*Parameters:
Line 45: Line 55:
===isReview()===
===isReview()===
Get the review status
Get the review status
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php#L196 i2ce/modules/Forms/lib/I2CE_Module_Forms.php] on line 196
*Signature: public function isReview($template)
*Signature: public function isReview($template)
*Parameters:
*Parameters:
Line 50: Line 61:
===processForms()===
===processForms()===
Process any form elements on the page. This method will parse all form elements on the page to replace the values if they are known. There are three type of form directives for a span.  The first two are as follows <span type='form' name='form_name:form_field_name'></span> and <span type='form' name='form_name->method_name(args)'></span> In each case we find the form with form name 'form_name'. In the first case, we  call the processDom() method for the form field identified by form_field_name. For the seconcd case we call the method_name method of the form with the arguments specified by args. The last case is for <span type='form' name='form_field_name'></span> In this case is like the first case except that the form used is the default form for this page.
Process any form elements on the page. This method will parse all form elements on the page to replace the values if they are known. There are three type of form directives for a span.  The first two are as follows <span type='form' name='form_name:form_field_name'></span> and <span type='form' name='form_name->method_name(args)'></span> In each case we find the form with form name 'form_name'. In the first case, we  call the processDom() method for the form field identified by form_field_name. For the seconcd case we call the method_name method of the form with the arguments specified by args. The last case is for <span type='form' name='form_field_name'></span> In this case is like the first case except that the form used is the default form for this page.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php#L289 i2ce/modules/Forms/lib/I2CE_Module_Forms.php] on line 289
*Signature: public function processForms($page)
*Signature: public function processForms($page)
*Parameters:
*Parameters:
**$page  
**$page  
===setForm()===
===setForm()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php#L226 i2ce/modules/Forms/lib/I2CE_Module_Forms.php] on line 226
*Signature: public function setForm($template,$form,$node)
*Signature: public function setForm($template,$form,$node)
*Parameters:
*Parameters:
Line 61: Line 74:
***Default Value: null
***Default Value: null
===setFormPriority()===
===setFormPriority()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php#L71 i2ce/modules/Forms/lib/I2CE_Module_Forms.php] on line 71
*Signature: public function setFormPriority($page)
*Signature: public function setFormPriority($page)
*Parameters:
*Parameters:
Line 66: Line 80:
===setReview()===
===setReview()===
Set the isReview  variable to true.
Set the isReview  variable to true.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php#L190 i2ce/modules/Forms/lib/I2CE_Module_Forms.php] on line 190
*Signature: public function setReview($template)
*Signature: public function setReview($template)
*Parameters:
*Parameters:
Line 71: Line 86:
===setShowForm()===
===setShowForm()===
Set the showForm  flag to true.
Set the showForm  flag to true.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php#L204 i2ce/modules/Forms/lib/I2CE_Module_Forms.php] on line 204
*Signature: public function setShowForm($template)
*Signature: public function setShowForm($template)
*Parameters:
*Parameters:
**$template  
**$template  
===showForm()===
===showForm()===
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php#L212 i2ce/modules/Forms/lib/I2CE_Module_Forms.php] on line 212
*Signature: public function showForm($template)
*Signature: public function showForm($template)
*Parameters:
*Parameters:
Line 81: Line 98:
===upgrade()===
===upgrade()===
Upgrade module method
Upgrade module method
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php#L128 i2ce/modules/Forms/lib/I2CE_Module_Forms.php] on line 128
*Signature: public function upgrade($old_vers,$new_vers)
*Signature: public function upgrade($old_vers,$new_vers)
*Parameters:
*Parameters:
Line 87: Line 105:
===validate_formfield()===
===validate_formfield()===
Hooked Function to check if a fieldObj is valid
Hooked Function to check if a fieldObj is valid
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0.2-release/annotate/head:/modules/Forms/lib/I2CE_Module_Forms.php#L43 i2ce/modules/Forms/lib/I2CE_Module_Forms.php] on line 43
*Signature: public function validate_formfield($fieldObj)
*Signature: public function validate_formfield($fieldObj)
*Parameters:
*Parameters:

Revision as of 08:51, 10 November 2009

This article describes the class I2CE_Module_Forms.

Variables

$isReview

A flag to determine if the page is a confirmation form. This will cause the form display to make all elements "hidden" and display the values as text for a confirmation view.

$showForm

A flag to determine if the page is a form and should display the form elements. If this is false then instead of adding in form elements for form fields the value will be displayed.

Methods

__construct()

createDateIndexOnLastEntry()

Checks to make sure there is an index on the date column last_entry table named date. If it does not exist it adds it.

getCLIHooks()

getField()

returns the indicated field from the indicated form that is responsible for the data in this node.

  • Defined in i2ce/modules/Forms/lib/I2CE_Module_Forms.php on line 249
  • Signature: public function getField($template,$form_field,$node)
  • Parameters:
    • $template
    • string $form_field
      The form name and field name separataed by a colon. Example $form_field = "salary:begin";
    • mixed $node
      Specfies the node at which the data is set. If $node is a DOMNode then it is the node. If null (default) then the data applies to the whole. Otherwise $node should specify the ID of some node in the DOM.
      • Default Value: null
  • Returns: I2CE_Field

getHooks()

getMethods()

hasPermission_form()

invisibleClass()

isReview()

Get the review status

processForms()

Process any form elements on the page. This method will parse all form elements on the page to replace the values if they are known. There are three type of form directives for a span. The first two are as follows and method_name(args)'> In each case we find the form with form name 'form_name'. In the first case, we call the processDom() method for the form field identified by form_field_name. For the seconcd case we call the method_name method of the form with the arguments specified by args. The last case is for In this case is like the first case except that the form used is the default form for this page.

setForm()

setFormPriority()

setReview()

Set the isReview variable to true.

setShowForm()

Set the showForm flag to true.

showForm()

upgrade()

Upgrade module method

validate_formfield()

Hooked Function to check if a fieldObj is valid

Inherited Methods

action_configure()

This public method is inherited from I2CE_Module->action_configure()

action_disable()

This public method is inherited from I2CE_Module->action_disable()

action_enable()

This public method is inherited from I2CE_Module->action_enable()

action_initialize()

This public method is inherited from I2CE_Module->action_initialize()

conflict_external()

This public method is inherited from I2CE_Module->conflict_external()

getCLIMethods()

This public method is inherited from I2CE_Module->getCLIMethods()

getConfig()

This public method is inherited from I2CE_Module->getConfig()

post_update()

This public method is inherited from I2CE_Module->post_update()

pre_upgrade()

This public method is inherited from I2CE_Module->pre_upgrade()

requirement_external()

This public method is inherited from I2CE_Module->requirement_external()

_hasMethod()

This public method is inherited from I2CE_Fuzzy->_hasMethod()

Inherited Fuzzy Methods

launchBackgroundProcess()

This method is inherited from I2CE_Module->launchBackgroundProcess()

launchBackgroundPHPScript()

This method is inherited from I2CE_Module->launchBackgroundPHPScript()

launchBackgroundPage()

This method is inherited from I2CE_Module->launchBackgroundPage()

userMessage()

This method is inherited from I2CE_Fuzzy->userMessage()