Adding Forms and Fields: Difference between revisions
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
<source lang="xml"> | <source lang="xml"> | ||
<?xml version="1.0"?> | <?xml version="1.0"?> | ||
<!DOCTYPE I2CEConfiguration SYSTEM "I2CE_Configuration.dtd"> | <!DOCTYPE I2CEConfiguration SYSTEM "I2CE_Configuration.dtd"> | ||
<I2CEConfiguration name="ProfDevelopment | <I2CEConfiguration name='ProfDevelopment'> | ||
<metadata> | |||
<displayName>Professional Development</displayName> | |||
<category>Application Component</category> | |||
<description>Adds in two new forms for tracking professional development</description> | |||
<version>3.1.4</version> | |||
<path name='classes'> | |||
<value>./lib</value> | |||
</path> | |||
<path name='templates'> | |||
<value>./templates</value> | |||
</path> | |||
<priority>325</priority> | |||
</metadata> | |||
<configurationGroup name='ProfDevelopment' path='/I2CE'> | |||
<displayName>Professional Development</displayName> | |||
<configurationGroup name='forms' path='/modules/forms'> | |||
<displayName>Forms</displayName> | |||
<description>Information about the forms made available by ProfDevelopment</description> | |||
<configurationGroup name='forms'> | |||
<displayName>Forms available to the form factory</displayName> | |||
<status>advanced:true</status> | |||
<status>required:true</status> | |||
<!-- This section is to add a new form called person_profdev with the associated | |||
class. The class will be defined in the classes section below. --> | |||
<configurationGroup name='person_profdev'> | |||
<displayName>Person Professional Development</displayName> | |||
<description>The Person Professional Development Form</description> | |||
<configuration name='class' values='single'> | |||
<displayName>Class Name</displayName> | |||
<description>The name of the class providing the form</description> | |||
<value>iHRIS_PersonProfDevelopment</value> | |||
</configuration> | |||
<configuration name='display' values='single'> | |||
<displayName>Display name</displayName> | |||
<description>The display name for this form</description> | |||
<value>Person Professional Development</value> | |||
</configuration> | |||
</configurationGroup> <!-- person_profdev --> | |||
<!-- This section is to add a new form called person_continuous_profdev with the associated | |||
class. The class will be defined in the classes section below. --> | |||
<configurationGroup name='person_continuous_profdev'> | |||
<displayName>Person Continuous Professional Development</displayName> | |||
<description>The Person Continuous Professional Development Form</description> | |||
<configuration name='class' values='single'> | |||
<displayName>Class Name</displayName> | |||
<description>The name of the class providing the form</description> | |||
<value>iHRIS_PersonContinuousProfDev</value> | |||
</configuration> | |||
<configuration name='display' values='single'> | |||
<displayName>Display name</displayName> | |||
<description>The display name for this form</description> | |||
<value>Person Continuous Professional Development</value> | |||
</configuration> | |||
</configurationGroup> <!-- person_continuous_profdev --> | |||
<!-- This section will modify the existing information for the person form to include | |||
two new child forms which are the new forms created for this module. --> | |||
<configurationGroup name='person_meta' path='/modules/forms/forms/person/meta'> | |||
<displayName>MetaData on the form</displayName> | |||
<configuration name='child_forms' values='many' > | |||
<status>uniquemerge:true</status> | |||
<displayName>Child Forms</displayName> | |||
<value>person_profdev</value> | |||
<value>person_continuous_profdev</value> | |||
</configuration> | |||
</configurationGroup> <!-- person_meta --> | |||
</configurationGroup> <!-- End /modules/forms/forms--> | |||
<configurationGroup name="formClasses" > | |||
<displayName>Form Class Configuration</displayName> | |||
<!-- This section will define the person_profdev form class with all the fields and field types. | |||
This class will be created dynamically since no extra funcationality needs to be added for it. --> | |||
<configurationGroup name="iHRIS_PersonProfDevelopment"> | |||
<displayName>Configuration for the class 'iHRIS_PersonProfDevelopment'</displayName> | |||
<configuration name="extends"> | |||
<displayName>The class this form extends</displayName> | |||
<value>I2CE_Form</value> | |||
</configuration> | |||
<configurationGroup name="fields"> | |||
<displayName>The fields defined for this form.</displayName> | |||
<configurationGroup name="year"> | |||
<displayName>The fields 'year'</displayName> | |||
<configuration name="formfield"> | |||
<displayName>The form field type</displayName> | |||
<value>DATE_Y</value> | |||
</configuration> | |||
<configuration name="headers" type="delimited"> | |||
<displayName>The headers for this field.</displayName> | |||
<value>default:Year</value> | |||
</configuration> | |||
<configuration name="default_eval"> | |||
<displayName>The default value for this field as an eval() string</displayName> | |||
<value>I2CE_Date::now()</value> | |||
</configuration> | |||
</configurationGroup> <!-- year --> | |||
<configurationGroup name="course"> | |||
<displayName>The fields 'course'</displayName> | |||
<configuration name="formfield"> | |||
<displayName>The form field type</displayName> | |||
<value>STRING_LINE</value> | |||
</configuration> | |||
<configuration name="headers" type="delimited"> | |||
<displayName>The headers for this field.</displayName> | |||
<value>default:Course</value> | |||
</configuration> | |||
</configurationGroup> <!-- course --> | |||
<configurationGroup name="duration"> | |||
<displayName>The fields 'duration'</displayName> | |||
<configuration name="formfield"> | |||
<displayName>The form field type</displayName> | |||
<value>INT</value> | |||
</configuration> | |||
<configuration name="headers" type="delimited"> | |||
<displayName>The headers for this field.</displayName> | |||
<value>default:Duration (in Days)</value> | |||
</configuration> | |||
</configurationGroup> <!-- duration --> | |||
<configurationGroup name="certification"> | |||
<displayName>The fields 'certification'</displayName> | |||
<configuration name="formfield"> | |||
<displayName>The form field type</displayName> | |||
<value>STRING_LINE</value> | |||
</configuration> | |||
<configuration name="headers" type="delimited"> | |||
<displayName>The headers for this field.</displayName> | |||
<value>default:Certification</value> | |||
</configuration> | |||
</configurationGroup> <!-- certification --> | |||
</configurationGroup> <!-- fields --> | |||
</configurationGroup> <!-- iHRIS_PersonProfDevelopment --> | |||
<!-- This section will define the person_continuous_profdev form class with all the | |||
fields and field types. | |||
This class will be created dynamically since no extra funcationality needs to be added for it. --> | |||
<configurationGroup name="iHRIS_PersonContinuousProfDev"> | |||
<displayName>Configuration for the class 'iHRIS_PersonContinuousProfDev'</displayName> | |||
<configuration name="extends"> | |||
<displayName>The class this form extends</displayName> | |||
<value>I2CE_Form</value> | |||
</configuration> | |||
<configurationGroup name="fields"> | |||
<displayName>The fields defined for this form.</displayName> | |||
<configurationGroup name="work_training_1"> | |||
<displayName>The fields 'work_training_1'</displayName> | |||
<configuration name="formfield"> | |||
<displayName>The form field type</displayName> | |||
<value>STRING_LINE</value> | |||
</configuration> | |||
<configuration name="headers" type="delimited"> | |||
<displayName>The headers for this field.</displayName> | |||
<value>default:Training Priority 1</value> | |||
</configuration> | |||
</configurationGroup> <!-- work_training_1 --> | |||
<configurationGroup name="work_training_2"> | |||
<displayName>The fields 'work_training_2'</displayName> | |||
<configuration name="formfield"> | |||
<displayName>The form field type</displayName> | |||
<value>STRING_LINE</value> | |||
</configuration> | |||
<configuration name="headers" type="delimited"> | |||
<displayName>The headers for this field.</displayName> | |||
<value>default:Training Priority 2</value> | |||
</configuration> | |||
</configurationGroup> <!-- work_training_2 --> | |||
<configurationGroup name="work_training_3"> | |||
<displayName>The fields 'work_training_3'</displayName> | |||
<configuration name="formfield"> | |||
<displayName>The form field type</displayName> | |||
<value>STRING_LINE</value> | |||
</configuration> | |||
<configuration name="headers" type="delimited"> | |||
<displayName>The headers for this field.</displayName> | |||
<value>default:Training Priority 3</value> | |||
</configuration> | |||
</configurationGroup> <!-- work_training_3 --> | |||
<configurationGroup name="personal_training_1"> | |||
<displayName>The fields 'personal_training_1'</displayName> | |||
<configuration name="formfield"> | |||
<displayName>The form field type</displayName> | |||
<value>STRING_LINE</value> | |||
</configuration> | |||
<configuration name="headers" type="delimited"> | |||
<displayName>The headers for this field.</displayName> | |||
<value>default:Priority 1</value> | |||
</configuration> | |||
</configurationGroup> <!-- personal_training_1 --> | |||
<configurationGroup name="personal_training_2"> | |||
<displayName>The fields 'personal_training_2'</displayName> | |||
<configuration name="formfield"> | |||
<displayName>The form field type</displayName> | |||
<value>STRING_LINE</value> | |||
</configuration> | |||
<configuration name="headers" type="delimited"> | |||
<displayName>The headers for this field.</displayName> | |||
<value>default:Priority 2</value> | |||
</configuration> | |||
</configurationGroup> <!-- personal_training_2 --> | |||
<configurationGroup name="personal_training_3"> | |||
<displayName>The fields 'personal_training_3'</displayName> | |||
<configuration name="formfield"> | |||
<displayName>The form field type</displayName> | |||
<value>STRING_LINE</value> | |||
</configuration> | |||
<configuration name="headers" type="delimited"> | |||
<displayName>The headers for this field.</displayName> | |||
<value>default:Priority 3</value> | |||
</configuration> | |||
</configurationGroup> <!-- personal_training_3 --> | |||
</configurationGroup> <!-- fields --> | |||
</configurationGroup> <!-- iHRIS_PersonContinuousProfDev--> | |||
</configurationGroup> <!-- End /modules/forms/formClasses --> | |||
</configurationGroup> <!-- End /modules/forms --> | |||
<configurationGroup name='page'> | |||
<displayName>Pages</displayName> | |||
<description>Information about various pages made available by the system</description> | |||
<status>required:true</status> | |||
<!-- This section will override the default class used for viewing a person. The class can then | |||
be created in this module's lib directory to add in new funcationality. --> | |||
<configuration name='view_class' path='/I2CE/page/view/class'> | |||
<displayName>Page Class</displayName> | |||
<description>Change the class responsible for displaying this page for this module</description> | |||
<status>overwrite:true</status> | |||
<value>iHRIS_PageViewManageProfDev</value> | |||
</configuration> | |||
<!-- This section will create the person_profdev page so that new professional development | |||
forms can be created and assigned to a person's record. --> | |||
<configurationGroup name='person_profdev'> | |||
<displayName>Person Professional Development Page</displayName> | |||
<description> The page 'person_profdev' which has the action of: Add/Update Professional Development</description> | |||
<configuration name='class' values='single'> | |||
<displayName>Page Class</displayName> | |||
<description>The class responsible for displaying this page</description> | |||
<status>required:true</status> | |||
<value>iHRIS_PageFormParentPerson</value> | |||
</configuration> | |||
<configuration name='style' values='single'> | |||
<displayName>Page Style</displayName> | |||
<description>The Page Style</description> | |||
<value>ihris_common_page_form_parent_person</value> | |||
</configuration> | |||
<configurationGroup name='args'> | |||
<displayName>Page Options</displayName> | |||
<description>The options that control the access and display of all pages</description> | |||
<configuration name='title' values='single'> | |||
<displayName>Page Title</displayName> | |||
<description>Page Title</description> | |||
<status>required:true</status> | |||
<value>Add/Update Professional Development</value> | |||
</configuration> | |||
<configuration name='page_form' values='single'> | |||
<displayName>Form</displayName> | |||
<description>The form this page is using</description> | |||
<status>required:true</status> | |||
<value>person_profdev</value> | |||
</configuration> | |||
</configurationGroup> | |||
</configurationGroup> <!-- person_profdev --> | |||
<!-- This section will create the person_continuous_profdev page so that a new continuous professional | |||
development form can be created and assigned to a person's record. --> | |||
<configurationGroup name='person_continuous_profdev'> | |||
<displayName>Person Continuous Professional Development Page</displayName> | |||
<description> The page 'person_continuous_profdev' which has the action of: Add/Update Continuous Professional Development</description> | |||
<configuration name='class' values='single'> | |||
<displayName>Page Class</displayName> | |||
<description>The class responsible for displaying this page</description> | |||
<status>required:true</status> | |||
<value>iHRIS_PageFormParentPerson</value> | |||
</configuration> | |||
<configuration name='style' values='single'> | |||
<displayName>Page Style</displayName> | |||
<description>The Page Style</description> | |||
<value>ihris_common_page_form_parent_person</value> | |||
</configuration> | |||
<configurationGroup name='args'> | |||
<displayName>Page Options</displayName> | |||
<description>The options that control the access and display of all pages</description> | |||
<configuration name='title' values='single'> | |||
<displayName>Page Title</displayName> | |||
<description>Page Title</description> | |||
<status>required:true</status> | |||
<value>Add/Update Continuous Professional Development</value> | |||
</configuration> | |||
<configuration name='page_form' values='single'> | |||
<displayName>Form</displayName> | |||
<description>The form this page is using</description> | |||
<status>required:true</status> | |||
<value>person_continuous_profdev</value> | |||
</configuration> | |||
</configurationGroup> | |||
</configurationGroup> <!-- person_continuous_profdev --> | |||
</configurationGroup> <!-- page --> | |||
</configurationGroup> <!-- ProfDevelopment --> | |||
</I2CEConfiguration> | </I2CEConfiguration> | ||
</source> | </source> | ||
Line 15: | Line 336: | ||
== Step 2: Modify the View Page == | == Step 2: Modify the View Page == | ||
Copy the Manage view page from the ihris-manage lib directory (iHRIS_PageViewManage.php) to the module lib directory and rename it iHRIS_PageViewManagePD.php. Modify the list of child forms to include person_profdev and person_continuous_profdev. | Copy the Manage view page from the ihris-manage lib directory (iHRIS_PageViewManage.php) to the module lib directory and rename it iHRIS_PageViewManagePD.php. Modify the list of child forms to include person_profdev and person_continuous_profdev. This is just a code block from the original page. Only make the changes between the comments. | ||
<source type="php"> | |||
$child_forms = array( "benefit", "employment", | |||
"education", "person_language", "person_competency", | |||
// Added these two new forms for the Professional Development module | |||
"person_profdev", "person_continuous_profdev" | |||
// End of additions | |||
); | |||
$global = array( 'person' => true, 'person_position' => true ); | |||
</source> | |||
<source type="php"> | |||
if ( !array_key_exists( "demographic", $this->person->children ) ) { | |||
$this->template->addFile( "view_demographic_link.html", "tbody" ); | |||
} | |||
// Added the following to display a continuous professional development link when | |||
// there isn't an existing form associated with this record. | |||
if ( !array_key_exists( "person_continuous_profdev", $this->person->children ) ) { | |||
$this->template->appendFileById( "view_person_continuous_profdev_link.html", "span", "profdev_links" ); | |||
} | |||
// End of additions | |||
Copy the view.html template file from the ihris-manage templates directory to the module templates directory. Make the following changes: | $contacts = array("TYPE_PERSONAL","TYPE_WORK","TYPE_EMERGENCY","TYPE_OTHER"); | ||
$this->showContacts($contacts,$contact_seen,'hr_staff'); | |||
</source> | |||
Copy the view.html template file from the ihris-manage templates directory to the module templates directory. Make the following changes after the Qualifications section. The changes are surround by comments. | |||
<source type="html"> | |||
<div class="recordsData"> | |||
<h3><a name="jump_qualification">Qualifications</a></h3> | |||
<p class="editRecordsData"><a href="" class="hide" title="Hide" onclick="return hideDiv('qualification', this);">Hide</a> | |||
<span role='hr_staff' type="form" name="person:id" href="person_language?parent=" text="Add Language Proficiency"></span> | |||
<span type='module' name='simple-competency' ifenabled='true'> | |||
<span role='hr_staff' type="form" name="person:id" href="person_competency?parent=" text="Add Competency"></span> | |||
<span role='hr_staff' type="form" name="person:id" href="person_competency_history?parent=" text="Competency Evaluations"></span> | |||
</span> | |||
</p> | |||
<div id="qualification"> | |||
<div id="person_language" /> | |||
<div id="person_competency" /> | |||
</div> <!-- qualification --> | |||
<br style="clear: both;" /> | |||
</div> <!-- recordsData --> | |||
<!-- New professional development section for the Professional Development module --> | |||
<div class="recordsData"> | |||
<h3><a name="jump_profdev">Professional Development</a></h3> | |||
<p class="editRecordsData" id="profdev_links"><a href="" class="hide" title="Hide" onclick="return hideDiv('profdev', this );">Hide</a> | |||
<span role='hr_staff' type="form" name="person:id" href="person_profdev?parent=" text="Add Professional Development"></span> | |||
</p> | |||
<div id="person_profdev"></div> | |||
<div id="person_continuous_profdev"></div> | |||
<br style="clear: both;" /> | |||
</div> <!-- recordsData --> | |||
<!-- End of Professional Development additions --> | |||
</source> | |||
Copy the menu_view_person.html template file from the ihris-manage templates directory to the module templates directory. Make the following changes: | Copy the menu_view_person.html template file from the ihris-manage templates directory to the module templates directory. Make the following changes: | ||
<source type="html"> | |||
<li><a href="#jump_qualification" onclick="if(prevAnchor) prevAnchor.className=''; this.className='active'; prevAnchor=this;">Qualifications</a></li> | |||
<!-- Additions for the Professional Development module --> | |||
<li><a href="#jump_profdev" onclick="if(prevAnchor) prevAnchor.className=''; this.className='active'; prevAnchor=this;">Professional Development</a></li> | |||
<!-- End of additions --> | |||
</source> | |||
== Step 3: Add in the Professional Development templates == | == Step 3: Add in the Professional Development templates == | ||
In the templates directory create the following files and contents: | In the templates directory create the following files and contents: | ||
=== view_person_profdev.html === | |||
<source type="html"> | |||
<div> | |||
<div class="editRecord"> | |||
<p>Edit This Information</p> | |||
<ul> | |||
<li role='hr_staff'><span type="form" name="person_profdev:id" href="person_profdev?id=" parent="true" text="Update this Information"></span></li> | |||
</ul> | |||
</div> <!-- editRecord --> | |||
<div class="dataTable"> | |||
<table border="0" cellspacing="0" cellpadding="0"> | |||
<tr> | |||
<th colspan="2">Other Training</th> | |||
</tr> | |||
<span type="form" name="person_profdev:year" showhead="default"></span> | |||
<span type="form" name="person_profdev:course" showhead="default" class="even"></span> | |||
<span type="form" name="person_profdev:duration" showhead="default"></span> | |||
<span type="form" name="person_profdev:certification" showhead="default" class="even"></span> | |||
</table> | |||
</div> <!-- dataTable --> | |||
</div> | |||
</source> | |||
=== form_person_profdev.html === | |||
<source type="html"> | |||
<tbody id="person_form"> | |||
<tr> | |||
<th colspan="2">Other Training (of more than 7 days)</th> | |||
</tr> | |||
<tr> | |||
<td> | |||
<span type="form" name="person_profdev:year" showhead="default"></span> | |||
<span type="form" name="person_profdev:course" showhead="default"></span> | |||
</td><td> | |||
<span type="form" name="person_profdev:duration" showhead="default"></span> | |||
<span type="form" name="person_profdev:certification" showhead="default"></span> | |||
</td> | |||
</tr> | |||
</tbody> | |||
</source> | |||
=== view_person_continuous_profdev.html === | |||
<source type="html"> | |||
<div> | |||
<div class="editRecord"> | |||
<p>Edit This Information</p> | |||
<ul> | |||
<li role='hr_staff'><span type="form" ifset="person_continuous_profdev:id" name="person_continuous_profdev:id" href="demographic?id=" parent="true" text="Update this Information" /></li> | |||
</ul> | |||
</div> <!-- editRecord --> | |||
<div class="dataTable"> | |||
<table border="0" cellspacing="0" cellpadding="0"> | |||
<tbody> | |||
<tr> | |||
<th colspan="2">Training needs that would improve everyday work</th> | |||
</tr> | |||
<span type="form" name="person_continuous_profdev:work_training_1" showhead="default"></span> | |||
<span type="form" name="person_continuous_profdev:work_training_2" showhead="default" class="even"></span> | |||
<span type="form" name="person_continuous_profdev:work_training_3" showhead="default"></span> | |||
<tr> | |||
<th colspan="2">Training needs for personal development</th> | |||
</tr> | |||
<span type="form" name="person_continuous_profdev:personal_training_1" showhead="default"></span> | |||
<span type="form" name="person_continuous_profdev:personal_training_2" showhead="default"></span> | |||
<span type="form" name="person_continuous_profdev:personal_training_3" showhead="default"></span> | |||
</tbody> | |||
</table> | |||
</div> <!-- dataTable --> | |||
</div> | |||
</source> | |||
=== view_person_continuous_profdev_link.html === | |||
<source type="html"> | |||
<span role='hr_staff' type="form" name="person:id" href="person_continuous_profdev?parent=" text="Add Continuous Professional Development"></span></source> | |||
=== form_person_continuous_profdev.html === | |||
<source type="html"> | |||
<tbody> | |||
<tr> | |||
<th>Training needs that would improve everyday work</th> | |||
<th>Training needs for personal development</th> | |||
</tr> | |||
<tr id="list_fields"> | |||
<td> | |||
<span type="form" name="person_continuous_profdev:work_training_1" showhead="default"></span> | |||
<span type="form" name="person_continuous_profdev:work_training_2" showhead="default"></span> | |||
<span type="form" name="person_continuous_profdev:work_training_3" showhead="default"></span> | |||
</td> | |||
<td> | |||
<span type="form" name="person_continuous_profdev:personal_training_1" showhead="default"></span> | |||
<span type="form" name="person_continuous_profdev:personal_training_2" showhead="default"></span> | |||
<span type="form" name="person_continuous_profdev:personal_training_3" showhead="default"></span> | |||
</td> | |||
</tr> | |||
</tbody> | |||
</source> | |||
== Step 4: Enable the module in the site config file == | == Step 4: Enable the module in the site config file == | ||
Edit your site configuration file and add in the following line: | Edit your site configuration file and add in the following line below any requirements and above the paths: | ||
<source lang="xml"> | <source lang="xml"> | ||
<enable name="ProfDevelopment" /> | <enable name="ProfDevelopment" /> | ||
</source> | </source> |
Revision as of 15:26, 14 February 2009
This will describe how to add a new module to iHRIS Manage to add in two new forms for tracking Professional Development for an employee. These instructions could be modified for iHRIS Qualify with a few minor changes.
Step 1: Create the module
Change into your site's modules directory and create a new directory called ProfDevelopment and change into this directory. Create lib and templates directory in the module directory. Create and edit a new file called ProfDevelopment.xml with the following contents:
<source lang="xml">
<?xml version="1.0"?> <!DOCTYPE I2CEConfiguration SYSTEM "I2CE_Configuration.dtd"> <I2CEConfiguration name='ProfDevelopment'>
<metadata> <displayName>Professional Development</displayName> <category>Application Component</category> <description>Adds in two new forms for tracking professional development</description> <version>3.1.4</version> <path name='classes'> <value>./lib</value> </path> <path name='templates'> <value>./templates</value> </path> <priority>325</priority> </metadata> <configurationGroup name='ProfDevelopment' path='/I2CE'> <displayName>Professional Development</displayName> <configurationGroup name='forms' path='/modules/forms'> <displayName>Forms</displayName> <description>Information about the forms made available by ProfDevelopment</description> <configurationGroup name='forms'> <displayName>Forms available to the form factory</displayName> <status>advanced:true</status> <status>required:true</status>
<configurationGroup name='person_profdev'> <displayName>Person Professional Development</displayName> <description>The Person Professional Development Form</description> <configuration name='class' values='single'> <displayName>Class Name</displayName> <description>The name of the class providing the form</description> <value>iHRIS_PersonProfDevelopment</value> </configuration> <configuration name='display' values='single'> <displayName>Display name</displayName> <description>The display name for this form</description> <value>Person Professional Development</value> </configuration> </configurationGroup>
<configurationGroup name='person_continuous_profdev'> <displayName>Person Continuous Professional Development</displayName> <description>The Person Continuous Professional Development Form</description> <configuration name='class' values='single'> <displayName>Class Name</displayName> <description>The name of the class providing the form</description> <value>iHRIS_PersonContinuousProfDev</value> </configuration> <configuration name='display' values='single'> <displayName>Display name</displayName> <description>The display name for this form</description> <value>Person Continuous Professional Development</value> </configuration> </configurationGroup>
<configurationGroup name='person_meta' path='/modules/forms/forms/person/meta'> <displayName>MetaData on the form</displayName> <configuration name='child_forms' values='many' > <status>uniquemerge:true</status> <displayName>Child Forms</displayName> <value>person_profdev</value> <value>person_continuous_profdev</value> </configuration> </configurationGroup> </configurationGroup> <configurationGroup name="formClasses" > <displayName>Form Class Configuration</displayName>
<configurationGroup name="iHRIS_PersonProfDevelopment"> <displayName>Configuration for the class 'iHRIS_PersonProfDevelopment'</displayName> <configuration name="extends"> <displayName>The class this form extends</displayName> <value>I2CE_Form</value> </configuration> <configurationGroup name="fields"> <displayName>The fields defined for this form.</displayName>
<configurationGroup name="year"> <displayName>The fields 'year'</displayName> <configuration name="formfield"> <displayName>The form field type</displayName> <value>DATE_Y</value> </configuration> <configuration name="headers" type="delimited"> <displayName>The headers for this field.</displayName> <value>default:Year</value> </configuration> <configuration name="default_eval"> <displayName>The default value for this field as an eval() string</displayName> <value>I2CE_Date::now()</value> </configuration> </configurationGroup> <configurationGroup name="course"> <displayName>The fields 'course'</displayName> <configuration name="formfield"> <displayName>The form field type</displayName> <value>STRING_LINE</value> </configuration> <configuration name="headers" type="delimited"> <displayName>The headers for this field.</displayName> <value>default:Course</value> </configuration> </configurationGroup> <configurationGroup name="duration"> <displayName>The fields 'duration'</displayName> <configuration name="formfield"> <displayName>The form field type</displayName> <value>INT</value> </configuration> <configuration name="headers" type="delimited"> <displayName>The headers for this field.</displayName> <value>default:Duration (in Days)</value> </configuration> </configurationGroup> <configurationGroup name="certification"> <displayName>The fields 'certification'</displayName> <configuration name="formfield"> <displayName>The form field type</displayName> <value>STRING_LINE</value> </configuration> <configuration name="headers" type="delimited"> <displayName>The headers for this field.</displayName> <value>default:Certification</value> </configuration> </configurationGroup>
</configurationGroup> </configurationGroup>
<configurationGroup name="iHRIS_PersonContinuousProfDev"> <displayName>Configuration for the class 'iHRIS_PersonContinuousProfDev'</displayName> <configuration name="extends"> <displayName>The class this form extends</displayName> <value>I2CE_Form</value> </configuration> <configurationGroup name="fields"> <displayName>The fields defined for this form.</displayName>
<configurationGroup name="work_training_1"> <displayName>The fields 'work_training_1'</displayName> <configuration name="formfield"> <displayName>The form field type</displayName> <value>STRING_LINE</value> </configuration> <configuration name="headers" type="delimited"> <displayName>The headers for this field.</displayName> <value>default:Training Priority 1</value> </configuration> </configurationGroup> <configurationGroup name="work_training_2"> <displayName>The fields 'work_training_2'</displayName> <configuration name="formfield"> <displayName>The form field type</displayName> <value>STRING_LINE</value> </configuration> <configuration name="headers" type="delimited"> <displayName>The headers for this field.</displayName> <value>default:Training Priority 2</value> </configuration> </configurationGroup> <configurationGroup name="work_training_3"> <displayName>The fields 'work_training_3'</displayName> <configuration name="formfield"> <displayName>The form field type</displayName> <value>STRING_LINE</value> </configuration> <configuration name="headers" type="delimited"> <displayName>The headers for this field.</displayName> <value>default:Training Priority 3</value> </configuration> </configurationGroup>
<configurationGroup name="personal_training_1"> <displayName>The fields 'personal_training_1'</displayName> <configuration name="formfield"> <displayName>The form field type</displayName> <value>STRING_LINE</value> </configuration> <configuration name="headers" type="delimited"> <displayName>The headers for this field.</displayName> <value>default:Priority 1</value> </configuration> </configurationGroup> <configurationGroup name="personal_training_2"> <displayName>The fields 'personal_training_2'</displayName> <configuration name="formfield"> <displayName>The form field type</displayName> <value>STRING_LINE</value> </configuration> <configuration name="headers" type="delimited"> <displayName>The headers for this field.</displayName> <value>default:Priority 2</value> </configuration> </configurationGroup> <configurationGroup name="personal_training_3"> <displayName>The fields 'personal_training_3'</displayName> <configuration name="formfield"> <displayName>The form field type</displayName> <value>STRING_LINE</value> </configuration> <configuration name="headers" type="delimited"> <displayName>The headers for this field.</displayName> <value>default:Priority 3</value> </configuration> </configurationGroup>
</configurationGroup> </configurationGroup>
</configurationGroup> </configurationGroup> <configurationGroup name='page'> <displayName>Pages</displayName> <description>Information about various pages made available by the system</description> <status>required:true</status>
<configuration name='view_class' path='/I2CE/page/view/class'> <displayName>Page Class</displayName> <description>Change the class responsible for displaying this page for this module</description> <status>overwrite:true</status> <value>iHRIS_PageViewManageProfDev</value> </configuration>
<configurationGroup name='person_profdev'> <displayName>Person Professional Development Page</displayName> <description> The page 'person_profdev' which has the action of: Add/Update Professional Development</description> <configuration name='class' values='single'> <displayName>Page Class</displayName> <description>The class responsible for displaying this page</description> <status>required:true</status> <value>iHRIS_PageFormParentPerson</value> </configuration> <configuration name='style' values='single'> <displayName>Page Style</displayName> <description>The Page Style</description> <value>ihris_common_page_form_parent_person</value> </configuration> <configurationGroup name='args'> <displayName>Page Options</displayName> <description>The options that control the access and display of all pages</description> <configuration name='title' values='single'> <displayName>Page Title</displayName> <description>Page Title</description> <status>required:true</status> <value>Add/Update Professional Development</value> </configuration> <configuration name='page_form' values='single'> <displayName>Form</displayName> <description>The form this page is using</description> <status>required:true</status> <value>person_profdev</value> </configuration> </configurationGroup> </configurationGroup>
<configurationGroup name='person_continuous_profdev'> <displayName>Person Continuous Professional Development Page</displayName> <description> The page 'person_continuous_profdev' which has the action of: Add/Update Continuous Professional Development</description> <configuration name='class' values='single'> <displayName>Page Class</displayName> <description>The class responsible for displaying this page</description> <status>required:true</status> <value>iHRIS_PageFormParentPerson</value> </configuration> <configuration name='style' values='single'> <displayName>Page Style</displayName> <description>The Page Style</description> <value>ihris_common_page_form_parent_person</value> </configuration> <configurationGroup name='args'> <displayName>Page Options</displayName> <description>The options that control the access and display of all pages</description> <configuration name='title' values='single'> <displayName>Page Title</displayName> <description>Page Title</description> <status>required:true</status> <value>Add/Update Continuous Professional Development</value> </configuration> <configuration name='page_form' values='single'> <displayName>Form</displayName> <description>The form this page is using</description> <status>required:true</status> <value>person_continuous_profdev</value> </configuration> </configurationGroup> </configurationGroup>
</configurationGroup> </configurationGroup>
</I2CEConfiguration>
</source>
Step 2: Modify the View Page
Copy the Manage view page from the ihris-manage lib directory (iHRIS_PageViewManage.php) to the module lib directory and rename it iHRIS_PageViewManagePD.php. Modify the list of child forms to include person_profdev and person_continuous_profdev. This is just a code block from the original page. Only make the changes between the comments.
<source type="php">
$child_forms = array( "benefit", "employment", "education", "person_language", "person_competency",
// Added these two new forms for the Professional Development module
"person_profdev", "person_continuous_profdev"
// End of additions );
$global = array( 'person' => true, 'person_position' => true );
</source>
<source type="php">
if ( !array_key_exists( "demographic", $this->person->children ) ) { $this->template->addFile( "view_demographic_link.html", "tbody" ); }
// Added the following to display a continuous professional development link when
// there isn't an existing form associated with this record. if ( !array_key_exists( "person_continuous_profdev", $this->person->children ) ) { $this->template->appendFileById( "view_person_continuous_profdev_link.html", "span", "profdev_links" ); }
// End of additions
$contacts = array("TYPE_PERSONAL","TYPE_WORK","TYPE_EMERGENCY","TYPE_OTHER"); $this->showContacts($contacts,$contact_seen,'hr_staff');
</source>
Copy the view.html template file from the ihris-manage templates directory to the module templates directory. Make the following changes after the Qualifications section. The changes are surround by comments.
<source type="html">
<a name="jump_qualification">Qualifications</a>
<a href="" class="hide" title="Hide" onclick="return hideDiv('qualification', this);">Hide</a>
<a name="jump_profdev">Professional Development</a>
<a href="" class="hide" title="Hide" onclick="return hideDiv('profdev', this );">Hide</a>
</source>
Copy the menu_view_person.html template file from the ihris-manage templates directory to the module templates directory. Make the following changes:
<source type="html">
Step 3: Add in the Professional Development templates
In the templates directory create the following files and contents:
view_person_profdev.html
<source type="html">
Edit This Information
Other Training |
---|
</source>
form_person_profdev.html
<source type="html"> <tbody id="person_form">
Other Training (of more than 7 days)
</tbody> </source>
view_person_continuous_profdev.html
<source type="html">
Edit This Information
Training needs that would improve everyday work | |
---|---|
Training needs for personal development |
</source>
view_person_continuous_profdev_link.html
<source type="html"> </source>
form_person_continuous_profdev.html
<source type="html"> <tbody>
Training needs that would improve everyday work Training needs for personal development
</tbody> </source>
Step 4: Enable the module in the site config file
Edit your site configuration file and add in the following line below any requirements and above the paths:
<source lang="xml"> <enable name="ProfDevelopment" /> </source>