Class: I2CE PageForm (Development): Difference between revisions

From IHRIS Wiki
No edit summary
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{otherversions|Class: I2CE_PageForm}}
{{otherversions|Class: I2CE_PageForm}}
This article describes the ''abstract'' class ''I2CE_PageForm'' .
This article describes the ''abstract'' class ''I2CE_PageForm'' .
*Extends the class: [[Class: I2CE_Page (Development) | I2CE_Page]].
*Extends the class: [[Class: I2CE_PageFormBase (Development) | I2CE_PageFormBase]].
*Child Classes:
*Child Classes:
** [[Class: iHRIS_PageFormDataElement (Development) | iHRIS_PageFormDataElement]]
** [[Class: iHRIS_PageFormDataSet (Development) | iHRIS_PageFormDataSet]]
** [[Class: iHRIS_PageViewDHIS (Development) | iHRIS_PageViewDHIS]]
** [[Class: I2CE_PageFormLists (Development) | I2CE_PageFormLists]]
** [[Class: I2CE_PageFormLists (Development) | I2CE_PageFormLists]]
*** [[Class: iHRIS_PageFormLists (Development) | iHRIS_PageFormLists]]
*** [[Class: I2CE_Page_CustomReport_ArchiveMenu (Development) | I2CE_Page_CustomReport_ArchiveMenu]]
** [[Class: iHRIS_Page_SelfService_Apply (Development) | iHRIS_Page_SelfService_Apply]]
** [[Class: iHRIS_PageFormParentPerson (Development) | iHRIS_PageFormParentPerson]]
** [[Class: iHRIS_PageFormParentPerson (Development) | iHRIS_PageFormParentPerson]]
*** [[Class: iHRIS_PageFormContact (Development) | iHRIS_PageFormContact]]
*** [[Class: iHRIS_PageFormContact (Development) | iHRIS_PageFormContact]]
*** [[Class: iHRIS_Page_UserMap (Development) | iHRIS_Page_UserMap]]
*** [[Class: iHRIS_PageFormChangePosition (Development) | iHRIS_PageFormChangePosition]]
*** [[Class: iHRIS_PageFormDeparture (Development) | iHRIS_PageFormDeparture]]
*** [[Class: iHRIS_PageFormDeparture (Development) | iHRIS_PageFormDeparture]]
*** [[Class: iHRIS_PageFormMakeOffer (Development) | iHRIS_PageFormMakeOffer]]
*** [[Class: iHRIS_PageFormMakeOffer (Development) | iHRIS_PageFormMakeOffer]]
Line 13: Line 19:
*** [[Class: iHRIS_PageFormPersonManage (Development) | iHRIS_PageFormPersonManage]]
*** [[Class: iHRIS_PageFormPersonManage (Development) | iHRIS_PageFormPersonManage]]
*** [[Class: iHRIS_PageFormPersonQualify (Development) | iHRIS_PageFormPersonQualify]]
*** [[Class: iHRIS_PageFormPersonQualify (Development) | iHRIS_PageFormPersonQualify]]
** [[Class: iHRIS_Page_SelfService_Register (Development) | iHRIS_Page_SelfService_Register]]
** [[Class: I2CE_PageForm_UserRequestEmail (Development) | I2CE_PageForm_UserRequestEmail]]
** [[Class: I2CE_PageFormParentUser (Development) | I2CE_PageFormParentUser]]
*** [[Class: iHRIS_PageFormParentUser (Development) | iHRIS_PageFormParentUser]]
** [[Class: I2CE_PageFormUser (Development) | I2CE_PageFormUser]]
** [[Class: I2CE_PageFormUser (Development) | I2CE_PageFormUser]]
*** [[Class: iHRIS_PageFormUser (Development) | iHRIS_PageFormUser]]
*** [[Class: iHRIS_PageFormUser (Development) | iHRIS_PageFormUser]]
** [[Class: I2CE_PageFormAuto (Development) | I2CE_PageFormAuto]]
*** [[Class: I2CE_PageAutoListEdit (Development) | I2CE_PageAutoListEdit]]
** [[Class: I2CE_PageFormParent (Development) | I2CE_PageFormParent]]
** [[Class: iHRIS_PageFormSalary (Development) | iHRIS_PageFormSalary]]
** [[Class: iHRIS_PageFormSalary (Development) | iHRIS_PageFormSalary]]
** [[Class: iHRIS_PageFormFacilityInstitution (Development) | iHRIS_PageFormFacilityInstitution]]
** [[Class: iHRIS_PageFormFacilityInstitution (Development) | iHRIS_PageFormFacilityInstitution]]
Line 26: Line 39:
** [[Class: iHRIS_PageFormTrainingProgram (Development) | iHRIS_PageFormTrainingProgram]]
** [[Class: iHRIS_PageFormTrainingProgram (Development) | iHRIS_PageFormTrainingProgram]]
** [[Class: iHRIS_PageForm_Person_Scheduled_Training_Course (Development) | iHRIS_PageForm_Person_Scheduled_Training_Course]]
** [[Class: iHRIS_PageForm_Person_Scheduled_Training_Course (Development) | iHRIS_PageForm_Person_Scheduled_Training_Course]]
** [[Class: iHRIS_Page_FormExam (Development) | iHRIS_Page_FormExam]]
** [[Class: iHRIS_PageFormParentTrainingInstitution (Development) | iHRIS_PageFormParentTrainingInstitution]]
** [[Class: iHRIS_PageFormParentTrainingInstitution (Development) | iHRIS_PageFormParentTrainingInstitution]]
** [[Class: iHRIS_PageForm_Evaluate_Course_Competencies (Development) | iHRIS_PageForm_Evaluate_Course_Competencies]]
** [[Class: iHRIS_PageForm_Evaluate_Course_Competencies (Development) | iHRIS_PageForm_Evaluate_Course_Competencies]]
*Location: Part of the module [[I2CE Module List (Development)#forms|forms]] in the package [https://launchpad.net/i2ce I2CE] 4.0-dev
*Location: Part of the module [[I2CE Module List (Development)#forms|forms]] in the package [https://launchpad.net/i2ce I2CE] 4.1-dev
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L37 modules/Forms/lib/I2CE_PageForm.php] on line 37
*Source: Defined in the file [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L37 modules/Forms/lib/I2CE_PageForm.php] on line 37
*Author: Luke Duncan <lduncan@intrahealth.org>
*Author: Luke Duncan <lduncan@intrahealth.org>
*Since: v1.0.0
*Since: v1.0.0
Line 55: Line 69:
===$objects===
===$objects===
The objects related to this page.  Using the PAGE_FORM_EDIT constants to determine the key for the array and the values will either be a [[Class: I2CE_Form (Development) | ]] or an array of [[Class: I2CE_Form (Development) | ]]s.
The objects related to this page.  Using the PAGE_FORM_EDIT constants to determine the key for the array and the values will either be a [[Class: I2CE_Form (Development) | ]] or an array of [[Class: I2CE_Form (Development) | ]]s.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L66 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 66
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L66 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 66
*Type: protected [http://www.php.net/manual/en/language.types.array.php array ] $objects
*Type: protected [http://www.php.net/manual/en/language.types.array.php array ] $objects


===$node_ids===
===$node_ids===
The node id's of objects related to this page.
The node id's of objects related to this page.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L71 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 71
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L71 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 71
*Type: protected [http://www.php.net/manual/en/language.types.array.php array ] $node_ids
*Type: protected [http://www.php.net/manual/en/language.types.array.php array ] $node_ids
===$editing===
A flag to determine if the page is being edited for the dynamic lists.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L76 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 76
*Type: private [http://www.php.net/manual/en/language.types.boolean.php boolean ] $editing
===$factory===
The factory object that creates new instances of forms
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L81 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 81
*Type: protected [[Class: I2CE_FormFactory (Development) | I2CE_FormFactory]] $factory
===$usesConfimPage===
@var protected boolean $usesConfirmPage
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L412 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 412
*Type: protected $usesConfimPage
===$formAttributes===
an associative array of attributes to set for the form
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L424 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 424
*Type: protected [http://www.php.net/manual/en/language.types.array.php array ] $formAttributes


==Methods==
==Methods==
===__construct()===
===__construct()===
Create a new instance of a form page. This will call the constructor for all Page objects and then set up some additional member variables for forms. @param string $title The title for this page. @param string $defaultHTMLFile The default HTML file for this page. @param mixed $access The role required to access this page. @param array $files The list of template files to load for this page.
Create a new instance of a form page. This will call the constructor for all Page objects and then set up some additional member variables for forms. @param string $title The title for this page. @param string $defaultHTMLFile The default HTML file for this page. @param mixed $access The role required to access this page. @param array $files The list of template files to load for this page.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L93 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 93
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L83 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 83
*Signature: public function __construct($args,$request_remainder,$get,$post)
*Signature: public function __construct($args,$request_remainder,$get,$post)
*Parameters:
*Parameters:
Line 95: Line 89:
**$post  
**$post  
***Default Value: null
***Default Value: null
===action()===
===getChildObjects()===
Perform the actions of the page. The default method sets up a form object to display the form and confirmation pages for the given object.  It handles everything necessary for editing and saving a single object.  Some forms may need to override this if the actions are more complex. Or more simple.
Get the child objects we are editing on the page
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L324 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 324
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L169 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 169
*Signature: protected function action()
*Signature: public function getChildObjects($form)
===displayControls()===
Display the save or confirm buttons as needed. If the page is a confirmation view then the save / edit button template will be displayed. Otherwise the confirm and return buttons will be shown.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L212 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 212
*Signature: protected function displayControls($save,$show_edit)
*Parameters:
*Parameters:
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $save <br/>Flag to show the save button. (Defaults to false)
** [http://www.php.net/manual/en/language.types.string.php string ] $form <br/>the name of the form
***Default Value: false
*Returns: mixed.<br/>array of obects
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $show_edit <br/>(defaults to true) @global array
***Default Value: true
===getParent()===
===getParent()===
Return the parent object for this form.
Return the parent object for this form.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L161 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 161
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L134 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 134
*Signature: protected function getParent()
*Signature: protected function getParent()
*Returns: [[Class: I2CE_Form (Development) | I2CE_Form]]
*Returns: [[Class: I2CE_Form (Development) | I2CE_Form]]
===getPrimary()===
===getPrimary()===
Return the primary object being edited.
Return the primary object being edited.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L154 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 154
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L127 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 127
*Signature: protected function getPrimary()
*Signature: protected function getPrimary()
*Returns: [[Class: I2CE_Form (Development) | I2CE_Form]]
*Returns: [[Class: I2CE_Form (Development) | I2CE_Form]]
===getSecondaryObjects()===
Get the objects we are editing on the page
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L187 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 187
*Signature: public function getSecondaryObjects($form)
*Parameters:
** [http://www.php.net/manual/en/language.types.string.php string ] $form <br/>the name of the form
*Returns: mixed.<br/>array of obects
===hasInvalid()===
===hasInvalid()===
Checks to see if any of the forms on this page have invalid messages
Checks to see if any of the forms on this page have invalid messages
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L373 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 373
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L301 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 301
*Signature: public function hasInvalid()
*Signature: public function hasInvalid()
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===invalidMessage()===
===invalidMessage()===
Add the form_error template to the page if the template is marked as invalid.
Add the form_error template to the page if the template is marked as invalid.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L399 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 399
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L326 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 326
*Signature: public function invalidMessage()
*Signature: public function invalidMessage()
===isConfirm()===
Checks to see if the page is a confirmation page.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L468 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 468
*Signature: protected function isConfirm($validate)
*Parameters:
**$validate
***Default Value: true
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===isEdit()===
Checks to see if the page is being submitted as an edit operation.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L455 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 455
*Signature: protected function isEdit($validate)
*Parameters:
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $validate <br/>Flag to also check to be sure the form data is valid.
***Default Value: true
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===isEditing()===
Check to see if this page is an editing page and already has data populated.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L123 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 123
*Signature: final protected function isEditing()
*Returns: boolean;
===isSave()===
Checks to see if the page is being submitted as a save operation.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L442 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 442
*Signature: protected function isSave($validate)
*Parameters:
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $validate <br/>Flag to also check to be sure the form data is valid.
***Default Value: true
*Returns: [http://www.php.net/manual/en/language.types.boolean.php boolean ]
===loadObjects()===
===loadObjects()===
Create and load any necessary objects for this form. This method must be written for each class extending this class.
Create and load any necessary objects for this form. This method must be written for each class extending this class.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L234 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 234
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L206 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 206
*Signature: protected function loadObjects()
*Signature: protected function loadObjects()
===save()===
===save()===
Save the objects to the database. Save the default object being edited b @global array
Save the objects to the database. Save the default object being edited b @global array
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L298 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 298
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L275 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 275
*Signature: protected function save()
*Signature: protected function save()
===setDisplayData()===
Set the data to be displayed for the outside of the form field elements. Set up the static data to be displayed in the template.  The default method doesn't do anything, but sub-classes may need to override this method. *
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L199 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 199
*Signature: protected function setDisplayData()
===setEditing()===
Set this page to be an editing page for the dynamic lists.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L116 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 116
*Signature: final protected function setEditing()
===setForm()===
===setForm()===
Set the I2CE_Form object in the page template. This method will pass the edit object to the page template so that it can process all the form variables.
Set the I2CE_Form object in the page template. This method will pass the edit object to the page template so that it can process all the form variables.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L170 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 170
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L143 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 143
*Signature: protected function setForm()
*Signature: protected function setForm()
===setFormAttributes()===
Set any attributes for the form
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L431 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 431
*Signature: public function setFormAttributes($formAttributes)
*Parameters:
** [http://www.php.net/manual/en/language.types.array.php array ] $formAttributes <br/>an associative array of attributes to set for the form. Keys are attributes, values are values.
===setObject()===
===setObject()===
Add an object to the objects being edited or displayed by this page.
Add an object to the objects being edited or displayed by this page.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L135 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 135
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L105 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 105
*Signature: final protected function setObject($object,$type,$node_id)
*Signature: final public function setObject($object,$type,$node_id,$set_form)
*Parameters:
*Parameters:
** [[Class: I2CE_Form (Development) | I2CE_Form]] $object
** [[Class: I2CE_Form (Development) | I2CE_Form]] $object
** integer $type <br/>The type of object being added from EDIT constants.
** integer $type <br/>The type of object being added from EDIT constants.
***Default Value: self::EDIT_PRIMARY
***Default Value: self::EDIT_PRIMARY
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $node_id <br/>a tring which gives the node id for which this object applies to. also can be the DOMNode. Defaults to null meaning that it applies to the whole page
** [http://www.php.net/manual/en/language.pseudo-types.php mixed ] $node_id <br/>a tring which gives the node id for which this object applies to. also can be the DOMNode.
***Default Value: null  
***Default Value: null
===usesConfirmPage()===
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $set_form <br/>Set to true to set the form at this point. Defaults to null meaning that it applies to the whole page
Set whether or not we use the confirm page when submitting the form
***Default Value: false
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L417 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 417
*Signature: public function usesConfirmPage($val)
*Parameters:
** [http://www.php.net/manual/en/language.types.boolean.php boolean ] $val <br/>True if we use a confirm page
===validate()===
===validate()===
Run the validation methods for all the objects being edited. If this is a form submit then run the validation methods for the default object being edited.  The default method calls the [[Class: I2CE_Form (Development) | ::validate() validate]] method on the  object.
Run the validation methods for all the objects being edited. If this is a form submit then run the validation methods for the default object being edited.  The default method calls the [[Class: I2CE_Form (Development) | ::validate() validate]] method on the  object.
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.0-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L275 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 275
*Defined in [http://bazaar.launchpad.net/~intrahealth+informatics/i2ce/4.1-dev/annotate/head:/modules/Forms/lib/I2CE_PageForm.php#L248 i2ce/modules/Forms/lib/I2CE_PageForm.php] on line 248
*Signature: protected function validate()
*Signature: protected function validate()
==Inherited Methods==
==Inherited Methods==
===usesConfirmPage()===
This public method is inherited from [[Class: I2CE_PageFormBase (Development)#usesConfirmPage() | I2CE_PageFormBase->usesConfirmPage()]]
===action()===
This protected method is inherited from [[Class: I2CE_PageFormBase (Development)#action() | I2CE_PageFormBase->action()]]
===action_display()===
This protected method is inherited from [[Class: I2CE_PageFormBase (Development)#action_display() | I2CE_PageFormBase->action_display()]]
===action_save()===
This protected method is inherited from [[Class: I2CE_PageFormBase (Development)#action_save() | I2CE_PageFormBase->action_save()]]
===canSave()===
This protected method is inherited from [[Class: I2CE_PageFormBase (Development)#canSave() | I2CE_PageFormBase->canSave()]]
===checkActionPermission()===
This protected method is inherited from [[Class: I2CE_PageFormBase (Development)#checkActionPermission() | I2CE_PageFormBase->checkActionPermission()]]
===displayControls()===
This protected method is inherited from [[Class: I2CE_PageFormBase (Development)#displayControls() | I2CE_PageFormBase->displayControls()]]
===initPage()===
This protected method is inherited from [[Class: I2CE_PageFormBase (Development)#initPage() | I2CE_PageFormBase->initPage()]]
===isConfirm()===
This protected method is inherited from [[Class: I2CE_PageFormBase (Development)#isConfirm() | I2CE_PageFormBase->isConfirm()]]
===isEdit()===
This protected method is inherited from [[Class: I2CE_PageFormBase (Development)#isEdit() | I2CE_PageFormBase->isEdit()]]
===isEditing()===
This protected method is inherited from [[Class: I2CE_PageFormBase (Development)#isEditing() | I2CE_PageFormBase->isEditing()]]
===isSave()===
This protected method is inherited from [[Class: I2CE_PageFormBase (Development)#isSave() | I2CE_PageFormBase->isSave()]]
===setDisplayData()===
This protected method is inherited from [[Class: I2CE_PageFormBase (Development)#setDisplayData() | I2CE_PageFormBase->setDisplayData()]]
===setEditing()===
This protected method is inherited from [[Class: I2CE_PageFormBase (Development)#setEditing() | I2CE_PageFormBase->setEditing()]]
===_flattenRequestVars()===
===_flattenRequestVars()===
This public method is inherited from [[Class: I2CE_Page (Development)#_flattenRequestVars() | I2CE_Page->_flattenRequestVars()]]
This public method is inherited from [[Class: I2CE_Page (Development)#_flattenRequestVars() | I2CE_Page->_flattenRequestVars()]]
Line 223: Line 213:
===getTemplate()===
===getTemplate()===
This public method is inherited from [[Class: I2CE_Page (Development)#getTemplate() | I2CE_Page->getTemplate()]]
This public method is inherited from [[Class: I2CE_Page (Development)#getTemplate() | I2CE_Page->getTemplate()]]
===getTitle()===
This public method is inherited from [[Class: I2CE_Page (Development)#getTitle() | I2CE_Page->getTitle()]]
===getURLRoot()===
This public method is inherited from [[Class: I2CE_Page (Development)#getURLRoot() | I2CE_Page->getURLRoot()]]


===getUser()===
===getUser()===
Line 289: Line 285:
===actionCommandLine()===
===actionCommandLine()===
This protected method is inherited from [[Class: I2CE_Page (Development)#actionCommandLine() | I2CE_Page->actionCommandLine()]]
This protected method is inherited from [[Class: I2CE_Page (Development)#actionCommandLine() | I2CE_Page->actionCommandLine()]]
===displayCommandLine()===
This protected method is inherited from [[Class: I2CE_Page (Development)#displayCommandLine() | I2CE_Page->displayCommandLine()]]
===displayWeb()===
This protected method is inherited from [[Class: I2CE_Page (Development)#displayWeb() | I2CE_Page->displayWeb()]]


===getAccess()===
===getAccess()===
This protected method is inherited from [[Class: I2CE_Page (Development)#getAccess() | I2CE_Page->getAccess()]]
This protected method is inherited from [[Class: I2CE_Page (Development)#getAccess() | I2CE_Page->getAccess()]]
===getTitle()===
This protected method is inherited from [[Class: I2CE_Page (Development)#getTitle() | I2CE_Page->getTitle()]]


===initializeTemplate()===
===initializeTemplate()===
Line 301: Line 300:
===loadHTMLTemplates()===
===loadHTMLTemplates()===
This protected method is inherited from [[Class: I2CE_Page (Development)#loadHTMLTemplates() | I2CE_Page->loadHTMLTemplates()]]
This protected method is inherited from [[Class: I2CE_Page (Development)#loadHTMLTemplates() | I2CE_Page->loadHTMLTemplates()]]
===setActiveMenu()===
This protected method is inherited from [[Class: I2CE_Page (Development)#setActiveMenu() | I2CE_Page->setActiveMenu()]]


===setupGetPost()===
===setupGetPost()===
Line 308: Line 310:
This public method is inherited from [[Class: I2CE_Fuzzy (Development)#_hasMethod() | I2CE_Fuzzy->_hasMethod()]]
This public method is inherited from [[Class: I2CE_Fuzzy (Development)#_hasMethod() | I2CE_Fuzzy->_hasMethod()]]
==Inherited Variables==
==Inherited Variables==
===$editing===
Theis protected variable is inherited from [[Class: I2CE_PageFormBase (Development)#$editing | I2CE_PageFormBase->$editing]]
===$factory===
Theis protected variable is inherited from [[Class: I2CE_PageFormBase (Development)#$factory | I2CE_PageFormBase->$factory]]
===$button_templates===
Theis protected variable is inherited from [[Class: I2CE_PageFormBase (Development)#$button_templates | I2CE_PageFormBase->$button_templates]]
===$checked_validation===
Theis protected variable is inherited from [[Class: I2CE_PageFormBase (Development)#$checked_validation | I2CE_PageFormBase->$checked_validation]]
===$usesConfimPage===
Theis protected variable is inherited from [[Class: I2CE_PageFormBase (Development)#$usesConfimPage | I2CE_PageFormBase->$usesConfimPage]]
===$template===
===$template===
Theis protected variable is inherited from [[Class: I2CE_Page (Development)#$template | I2CE_Page->$template]]
Theis protected variable is inherited from [[Class: I2CE_Page (Development)#$template | I2CE_Page->$template]]
Line 319: Line 336:
===$user===
===$user===
Theis protected variable is inherited from [[Class: I2CE_Page (Development)#$user | I2CE_Page->$user]]
Theis protected variable is inherited from [[Class: I2CE_Page (Development)#$user | I2CE_Page->$user]]
===$redirect===
Theis protected variable is inherited from [[Class: I2CE_Page (Development)#$redirect | I2CE_Page->$redirect]]


===$post===
===$post===
Line 340: Line 360:
===$permissionParser===
===$permissionParser===
Theis protected variable is inherited from [[Class: I2CE_Page (Development)#$permissionParser | I2CE_Page->$permissionParser]]
Theis protected variable is inherited from [[Class: I2CE_Page (Development)#$permissionParser | I2CE_Page->$permissionParser]]
===$root_url===
Theis protected variable is inherited from [[Class: I2CE_Page (Development)#$root_url | I2CE_Page->$root_url]]


===$page===
===$page===
Line 364: Line 387:
===addColorPickerTriple()===
===addColorPickerTriple()===
This method is inherited from [[Class: I2CE_Page (Development)#addColorPickerTriple() | I2CE_Page->addColorPickerTriple()]]
This method is inherited from [[Class: I2CE_Page (Development)#addColorPickerTriple() | I2CE_Page->addColorPickerTriple()]]
===addReportSelector()===
This method is inherited from [[Class: I2CE_Page (Development)#addReportSelector() | I2CE_Page->addReportSelector()]]


===addDatePicker()===
===addDatePicker()===
Line 370: Line 396:
===selectOptionsImmediate()===
===selectOptionsImmediate()===
This method is inherited from [[Class: I2CE_Page (Development)#selectOptionsImmediate() | I2CE_Page->selectOptionsImmediate()]]
This method is inherited from [[Class: I2CE_Page (Development)#selectOptionsImmediate() | I2CE_Page->selectOptionsImmediate()]]
===setDisplayData()===
This method is inherited from [[Class: I2CE_Page (Development)#setDisplayData() | I2CE_Page->setDisplayData()]]


===setDisplayDataImmediate()===
===setDisplayDataImmediate()===
Line 388: Line 417:
===setClassValues()===
===setClassValues()===
This method is inherited from [[Class: I2CE_Page (Development)#setClassValues() | I2CE_Page->setClassValues()]]
This method is inherited from [[Class: I2CE_Page (Development)#setClassValues() | I2CE_Page->setClassValues()]]
===useDropDown()===
This method is inherited from [[Class: I2CE_Page (Development)#useDropDown() | I2CE_Page->useDropDown()]]


===addOption()===
===addOption()===
Line 400: Line 432:
===addAutoCompleteInputTree()===
===addAutoCompleteInputTree()===
This method is inherited from [[Class: I2CE_Page (Development)#addAutoCompleteInputTree() | I2CE_Page->addAutoCompleteInputTree()]]
This method is inherited from [[Class: I2CE_Page (Development)#addAutoCompleteInputTree() | I2CE_Page->addAutoCompleteInputTree()]]
===getForm()===
This method is inherited from [[Class: I2CE_Page (Development)#getForm() | I2CE_Page->getForm()]]


===getField()===
===getField()===
Line 409: Line 444:
===isReview()===
===isReview()===
This method is inherited from [[Class: I2CE_Page (Development)#isReview() | I2CE_Page->isReview()]]
This method is inherited from [[Class: I2CE_Page (Development)#isReview() | I2CE_Page->isReview()]]
===setShowForm()===
This method is inherited from [[Class: I2CE_Page (Development)#setShowForm() | I2CE_Page->setShowForm()]]
===showForm()===
This method is inherited from [[Class: I2CE_Page (Development)#showForm() | I2CE_Page->showForm()]]


===makeJumper()===
===makeJumper()===
This method is inherited from [[Class: I2CE_Page (Development)#makeJumper() | I2CE_Page->makeJumper()]]
This method is inherited from [[Class: I2CE_Page (Development)#makeJumper() | I2CE_Page->makeJumper()]]
===makeScalingJumper()===
This method is inherited from [[Class: I2CE_Page (Development)#makeScalingJumper() | I2CE_Page->makeScalingJumper()]]


===menuSelect()===
===menuSelect()===
Line 427: Line 459:
===addAjaxUpdate()===
===addAjaxUpdate()===
This method is inherited from [[Class: I2CE_Page (Development)#addAjaxUpdate() | I2CE_Page->addAjaxUpdate()]]
This method is inherited from [[Class: I2CE_Page (Development)#addAjaxUpdate() | I2CE_Page->addAjaxUpdate()]]
===addAjaxLoad()===
This method is inherited from [[Class: I2CE_Page (Development)#addAjaxLoad() | I2CE_Page->addAjaxLoad()]]


===addAjaxToggle()===
===addAjaxToggle()===

Latest revision as of 09:16, 6 May 2015


This article describes the abstract class I2CE_PageForm .

Handles all page display and operations for forms. This class extends the class and adds some default methods and variables for form templates that will interface with a object to update the database. The loadObjects () method must be overwritten for all objects extending this abstract class. @abstract

Constants

I2CE_PageForm::EDIT_PRIMARY

Constant values for the type of object being set to be edited for this page: Primary

The primary object is the main object being edited by this page.  There can only be one.

Defined as: 1

I2CE_PageForm::EDIT_PARENT

Constant values for the type of object being set to be edited for this page: Parent

The parent for the primary and secondary objects being edited by this page.  The can only be one.

Defined as: 2

I2CE_PageForm::EDIT_SECONDARY

Constant values for the type of object being set to be edited for this page: Secondary

Any secondary objects being edited by this page.  They share the parent of the primary.  Multiple objects
can be added.

Defined as: 3

I2CE_PageForm::EDIT_CHILD

Constant values for the type of object being set to be edited for this page: Children

Any child objects of the primary object will use this type.  Multiple objects can be added.

Defined as: 4

Variables

$objects

The objects related to this page. Using the PAGE_FORM_EDIT constants to determine the key for the array and the values will either be a or an array of s.

$node_ids

The node id's of objects related to this page.

Methods

__construct()

Create a new instance of a form page. This will call the constructor for all Page objects and then set up some additional member variables for forms. @param string $title The title for this page. @param string $defaultHTMLFile The default HTML file for this page. @param mixed $access The role required to access this page. @param array $files The list of template files to load for this page.

  • Defined in i2ce/modules/Forms/lib/I2CE_PageForm.php on line 83
  • Signature: public function __construct($args,$request_remainder,$get,$post)
  • Parameters:
    • $args
    • $request_remainder
    • $get
      • Default Value: null
    • $post
      • Default Value: null

getChildObjects()

Get the child objects we are editing on the page

getParent()

Return the parent object for this form.

getPrimary()

Return the primary object being edited.

getSecondaryObjects()

Get the objects we are editing on the page

hasInvalid()

Checks to see if any of the forms on this page have invalid messages

invalidMessage()

Add the form_error template to the page if the template is marked as invalid.

loadObjects()

Create and load any necessary objects for this form. This method must be written for each class extending this class.

save()

Save the objects to the database. Save the default object being edited b @global array

setForm()

Set the I2CE_Form object in the page template. This method will pass the edit object to the page template so that it can process all the form variables.

setObject()

Add an object to the objects being edited or displayed by this page.

  • Defined in i2ce/modules/Forms/lib/I2CE_PageForm.php on line 105
  • Signature: final public function setObject($object,$type,$node_id,$set_form)
  • Parameters:
    • I2CE_Form $object
    • integer $type
      The type of object being added from EDIT constants.
      • Default Value: self::EDIT_PRIMARY
    • mixed $node_id
      a tring which gives the node id for which this object applies to. also can be the DOMNode.
      • Default Value: null
    • boolean $set_form
      Set to true to set the form at this point. Defaults to null meaning that it applies to the whole page
      • Default Value: false

validate()

Run the validation methods for all the objects being edited. If this is a form submit then run the validation methods for the default object being edited. The default method calls the  ::validate() validate method on the object.

Inherited Methods

usesConfirmPage()

This public method is inherited from I2CE_PageFormBase->usesConfirmPage()

action()

This protected method is inherited from I2CE_PageFormBase->action()

action_display()

This protected method is inherited from I2CE_PageFormBase->action_display()

action_save()

This protected method is inherited from I2CE_PageFormBase->action_save()

canSave()

This protected method is inherited from I2CE_PageFormBase->canSave()

checkActionPermission()

This protected method is inherited from I2CE_PageFormBase->checkActionPermission()

displayControls()

This protected method is inherited from I2CE_PageFormBase->displayControls()

initPage()

This protected method is inherited from I2CE_PageFormBase->initPage()

isConfirm()

This protected method is inherited from I2CE_PageFormBase->isConfirm()

isEdit()

This protected method is inherited from I2CE_PageFormBase->isEdit()

isEditing()

This protected method is inherited from I2CE_PageFormBase->isEditing()

isSave()

This protected method is inherited from I2CE_PageFormBase->isSave()

setDisplayData()

This protected method is inherited from I2CE_PageFormBase->setDisplayData()

setEditing()

This protected method is inherited from I2CE_PageFormBase->setEditing()

_flattenRequestVars()

This public method is inherited from I2CE_Page->_flattenRequestVars()

display()

This public method is inherited from I2CE_Page->display()

fixupRequestVariables()

This public method is inherited from I2CE_Page->fixupRequestVariables()

flattenRequestVars()

This public method is inherited from I2CE_Page->flattenRequestVars()

get()

This public method is inherited from I2CE_Page->get()

getAccessedBaseURL()

This public method is inherited from I2CE_Page->getAccessedBaseURL()

getTemplate()

This public method is inherited from I2CE_Page->getTemplate()

getTitle()

This public method is inherited from I2CE_Page->getTitle()

getURLRoot()

This public method is inherited from I2CE_Page->getURLRoot()

getUser()

This public method is inherited from I2CE_Page->getUser()

get_exists()

This public method is inherited from I2CE_Page->get_exists()

hasPermission()

This public method is inherited from I2CE_Page->hasPermission()

isGet()

This public method is inherited from I2CE_Page->isGet()

isPost()

This public method is inherited from I2CE_Page->isPost()

module()

This public method is inherited from I2CE_Page->module()

page()

This public method is inherited from I2CE_Page->page()

pageRemainder()

This public method is inherited from I2CE_Page->pageRemainder()

pageRoot()

This public method is inherited from I2CE_Page->pageRoot()

post()

This public method is inherited from I2CE_Page->post()

post_exists()

This public method is inherited from I2CE_Page->post_exists()

redirect()

This public method is inherited from I2CE_Page->redirect()

request()

This public method is inherited from I2CE_Page->request()

request_exists()

This public method is inherited from I2CE_Page->request_exists()

rewrittenURLs()

This public method is inherited from I2CE_Page->rewrittenURLs()

session_req()

This public method is inherited from I2CE_Page->session_req()

session_req_exists()

This public method is inherited from I2CE_Page->session_req_exists()

setAccess()

This public method is inherited from I2CE_Page->setAccess()

setIsPost()

This public method is inherited from I2CE_Page->setIsPost()

setRedirect()

This public method is inherited from I2CE_Page->setRedirect()

_display()

This protected method is inherited from I2CE_Page->_display()

actionCommandLine()

This protected method is inherited from I2CE_Page->actionCommandLine()

displayCommandLine()

This protected method is inherited from I2CE_Page->displayCommandLine()

displayWeb()

This protected method is inherited from I2CE_Page->displayWeb()

getAccess()

This protected method is inherited from I2CE_Page->getAccess()

initializeTemplate()

This protected method is inherited from I2CE_Page->initializeTemplate()

loadHTMLTemplates()

This protected method is inherited from I2CE_Page->loadHTMLTemplates()

setActiveMenu()

This protected method is inherited from I2CE_Page->setActiveMenu()

setupGetPost()

This protected method is inherited from I2CE_Page->setupGetPost()

_hasMethod()

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

Inherited Variables

$editing

Theis protected variable is inherited from I2CE_PageFormBase->$editing

$factory

Theis protected variable is inherited from I2CE_PageFormBase->$factory

$button_templates

Theis protected variable is inherited from I2CE_PageFormBase->$button_templates

$checked_validation

Theis protected variable is inherited from I2CE_PageFormBase->$checked_validation

$usesConfimPage

Theis protected variable is inherited from I2CE_PageFormBase->$usesConfimPage

$template

Theis protected variable is inherited from I2CE_Page->$template

$defaultHTMLFile

Theis protected variable is inherited from I2CE_Page->$defaultHTMLFile

$role

Theis protected variable is inherited from I2CE_Page->$role

$user

Theis protected variable is inherited from I2CE_Page->$user

$redirect

Theis protected variable is inherited from I2CE_Page->$redirect

$post

Theis protected variable is inherited from I2CE_Page->$post

$get

Theis protected variable is inherited from I2CE_Page->$get

$page_root

Theis protected variable is inherited from I2CE_Page->$page_root

$page_remainder

Theis protected variable is inherited from I2CE_Page->$page_remainder

$args

Theis protected variable is inherited from I2CE_Page->$args

$request_remainder

Theis protected variable is inherited from I2CE_Page->$request_remainder

$permissionParser

Theis protected variable is inherited from I2CE_Page->$permissionParser

$root_url

Theis protected variable is inherited from I2CE_Page->$root_url

$page

Theis protected variable is inherited from I2CE_Page->$page

$module

Theis protected variable is inherited from I2CE_Page->$module

$is_post

Theis protected variable is inherited from I2CE_Page->$is_post

$session_req

Theis protected variable is inherited from I2CE_Page->$session_req

Inherited Fuzzy Methods

launchBackgroundProcess()

This method is inherited from I2CE_Page->launchBackgroundProcess()

launchBackgroundPHPScript()

This method is inherited from I2CE_Page->launchBackgroundPHPScript()

launchBackgroundPage()

This method is inherited from I2CE_Page->launchBackgroundPage()

addColorPickerTriple()

This method is inherited from I2CE_Page->addColorPickerTriple()

addReportSelector()

This method is inherited from I2CE_Page->addReportSelector()

addDatePicker()

This method is inherited from I2CE_Page->addDatePicker()

selectOptionsImmediate()

This method is inherited from I2CE_Page->selectOptionsImmediate()

setDisplayData()

This method is inherited from I2CE_Page->setDisplayData()

setDisplayDataImmediate()

This method is inherited from I2CE_Page->setDisplayDataImmediate()

addFormWorm()

This method is inherited from I2CE_Page->addFormWorm()

getClassValue()

This method is inherited from I2CE_Page->getClassValue()

loadClassValues()

This method is inherited from I2CE_Page->loadClassValues()

setClassValue()

This method is inherited from I2CE_Page->setClassValue()

setClassValues()

This method is inherited from I2CE_Page->setClassValues()

useDropDown()

This method is inherited from I2CE_Page->useDropDown()

addOption()

This method is inherited from I2CE_Page->addOption()

addOptions()

This method is inherited from I2CE_Page->addOptions()

addAutoCompleteInputTreeById()

This method is inherited from I2CE_Page->addAutoCompleteInputTreeById()

addAutoCompleteInputTree()

This method is inherited from I2CE_Page->addAutoCompleteInputTree()

getForm()

This method is inherited from I2CE_Page->getForm()

getField()

This method is inherited from I2CE_Page->getField()

setReview()

This method is inherited from I2CE_Page->setReview()

isReview()

This method is inherited from I2CE_Page->isReview()

makeJumper()

This method is inherited from I2CE_Page->makeJumper()

makeScalingJumper()

This method is inherited from I2CE_Page->makeScalingJumper()

menuSelect()

This method is inherited from I2CE_Page->menuSelect()

addUpdateSelect()

This method is inherited from I2CE_Page->addUpdateSelect()

addAjaxUpdate()

This method is inherited from I2CE_Page->addAjaxUpdate()

addAjaxLoad()

This method is inherited from I2CE_Page->addAjaxLoad()

addAjaxToggle()

This method is inherited from I2CE_Page->addAjaxToggle()

addAjaxRequestFunction()

This method is inherited from I2CE_Page->addAjaxRequestFunction()

addAjaxCompleteFunction()

This method is inherited from I2CE_Page->addAjaxCompleteFunction()

addAjaxToggleOnFunction()

This method is inherited from I2CE_Page->addAjaxToggleOnFunction()

addAjaxToggleOffFunction()

This method is inherited from I2CE_Page->addAjaxToggleOffFunction()

hasAjax()

This method is inherited from I2CE_Page->hasAjax()

setDataTypePriority()

This method is inherited from I2CE_Page->setDataTypePriority()

setData()

This method is inherited from I2CE_Page->setData()

getData()

This method is inherited from I2CE_Page->getData()

getDefaultData()

This method is inherited from I2CE_Page->getDefaultData()

removeData()

This method is inherited from I2CE_Page->removeData()

getDataNames()

This method is inherited from I2CE_Page->getDataNames()

ensureNode()

This method is inherited from I2CE_Page->ensureNode()

userMessage()

This method is inherited from I2CE_Fuzzy->userMessage()