Javascript Notes
Contents
Use of Javascript
Javascript is currently used to:
- In most display and data entry blocks: Open/close tables (the toggles)
- Drawing new/update: Manage the drawing code entry (syncronize the drawing horizontal vs. vertical code fields)
- Revision new/update: Manage the revision code entry (syncronize the drawing horizontal vs. vertical code fields)
- On change in the document (and comment) input forms
- Set focus (set for certain inputs form, mainly in the login form)
To manage the hiding/display of cascading selects in V12.x. See: MultiClassification
- In revision new/update: to manage entry of approval/release comments
- Informing the server if the client has Javascript enabled
Issues
- Our Javascript currently assumes a single form on a page, this could cause problems if we want to have a search box in our page header.
- - See app/js/drawmgt.js, search for forms[0]
- We should add names for our forms
Managing Approval/Release Comment Fields
This applies to approval and release work flow steps for revisions. It is implemented for the new/update input forms.
Javascript Functionality
When the status Approved with Corrections (C) or Rejected (R) is selected, then the corresponding comment field should be displayed. When any other status value is selected then the display of the comment field is suppressed.
When the status Not Required (N) is selected, then the corresponding initials field should be set to -select-.
Other Supporting Functionality
- Values for the initials/status/comment fields are checked by app/config/Setting-Validations.php
Display of comment fields (in the revision detail) only occurs when the comment field contains text. This is handled by an if statement in the smart template.
Field Naming
The following fields are defined in the Revisions table:
Initials Field
Status Field
Comment Field
approver1Id
approval1StatusIs
approval1Comment
approver2Id
approval2StatusIs
approval2Comment
approver3Id
approval3StatusIs
approval3Comment
approver4Id
approval4StatusIs
approval4Comment
releaseId
releaseStatusIs
release4Comment
The fields are also present in the Comments table, but the workflow templates that would display these fields have not yet been implemented.