Form edit (spec)

From RPM Wiki

This page is not complete yet.
Table of contents

Summary

We refer to editing the values of fields in a form as editing the form, or the form edit.

  • The form edit interface is primarily accessed by clicking "Edit" in the "Info" web box on the form details page.
  • It is also accessed by the "Special edit" and form set (Repeating fields) add and edit links.
  • Starting a form may also use this interface and that's called the "Initial edit"
  • The same underlying code is used for editing custom fields.

Built-in fields

These fields are only shown on form edit, not the initial edit or form set add/edit.

Form number

  • Processing
    • Remove all characters that aren't a number or letter (includes stripping all white space)
    • Change all lowercase letters to uppercase.
    • Truncate any remaining text to 23 character max
  • Then validate
    • Must be unique. Error: "A unique number is required."
    • Can't be null: "A number is required."
  • May be edited by staff users only. Not shown on edit page for agent users.
  • The numeric value is used for sorting. Only the last 15 digits are used for sorting purposes if the number is longer.

Form owner

  • A drop-down of staff user participants
  • Only staff users can change the form owner

Status level (spec)

  • Status level changes that affect a field group show the change in available fields immediately
  • Agent user access to edit the status level is set in the template permissions.
  • Individual status levels may be set to be not user selectable.

References

Hierarchy

(TODO) - spec existing functionality including clearing out child values automatically when parent values are filled in.

Customer reference

Selected on a different page.

  • In other words to fill in a customer fields I will click "Edit" on the form details page, then click "Select a customer" then close that wizard with "Finish" then click "OK" on the edit form page. The new customer choice is only saved when I click OK on edit form page.

Commission item reference

Edited on a separate page.

  • User enters an item ID. Permissions of the item aren't checked for the current user. They are allowed to enter an item they can’t see, however when the form details are displayed the item won't be a link for them then.
  • Ignore spaces & capitalization when finding the item ID. This also means "fixing" the user’s input when saving the ID.
    • Example: There is an item with the ID "n123456". If the user enters "N 123 456" then clicks "OK", RPM will find the correct item and back on the form edit page they'll see the ID of "n123456". If they edit it again they’ll see "n123456" in the text box. In other words, their input has been changed.
  • If the commission run parent field is filled in then the item must belong to that run.
    • When showing the parent error it means RPM the user's input will have been "fixed" if needed (see above).
  • If the parent is empty then allow items from any run and fill in the parent on return to the edit form page.
  • Errors:
    • "A valid commission item ID is required or leave blank for none."
    • "Item must belong to the {comm.. run} run."

Shared fields

  • Display during edit.

All fields

Required fields

  • Required fields are highlighted and checked instantly by JavaScript. They are checked again on the server side.
  • The required check is only enforced if the field is visible and editable for the user doing the edit.

Security

  • (TODO)

Display

  • (TODO)

Field groups

The Field group feature affects how some fields are displayed. See the details of that feature for specifications. (TODO) - Spec existing functionality.

Custom fields

(TODO) - spec how editing custom fields uses a reduced functionality version of this same code

Repeating fields

(TODO) - add some detail here on how sets apply to the edit functionality

Initial edit

(TODO) - add some detail here on how form edit is used during form start

After OK

(TODO) - fully spec everything that happens after the edit

  • Validation
  • Auto archive
  • Status triggers
  • Set unread and email
  • Global actions
  • Reconcile flag
  • Form history

Edit lock

When a form is under edit lock, the edit page can not be used. This means users can't edit the fields, form number, or status level.

  • Currently only applied by the Approval module which can indicate that the form should be locked when it's at a status level eligible for approvals.
  • The edit link is still shown, but if the form is locked it will redirect to the error page
    • Error: "This form is locked" followed by a list control that displays the reasons it is locked. Again, currently the only reason will be the approval module. [that spec (http://rpmsoftware.com/wiki/index.php/Approval_module#Edit_lock|See)] for the message.
  • The lock also applies to the add, edit, and delete links for repeating fields.

Special edit

There is a special edit mode available to users with the processes.design privilege. All restrictions are removed.

  • Every field is shown in edit mode regardless of field groups or security permissions.
  • Bypasses the edit lock (see above)
  • "Required" is not enforced except for the form number (which must always be required)
  • Other validation is still done (money, int, etc.)
  • All status levels are available regardless of the status level user selectable setting or approval lock.
  • While in special edit a prominent warning is shown.
  • This is a new link, "Special edit", in the form toolbar beside "Setup". The regular edit is still shown in the Info box and still functions the normal way.
  • Edits the master form only, not repeating fields
  • New form history method: "Special"

Architecture

(TODO)

  • Shared code, field object inheritance

Security

For security rules on editing the status level and fields see the appropriate section above.

Staff users

  • Must be a participant and have access to this form.

Agency user

  • Must be a participant and have access to this form
  • Can not edit form number or owner.

History

  • Mercury: Predecessor, "Project Management" added
  • Venus: Process management as we know it added
  • Mars: Minor changes including "Select a customer" improvements
  • Pathfinder: Number edit, new item reference method (by ID)
  • Judge: Complete overhaul including code refactor. Form edit replaces previously separate form start wizard.

Future

Warning: Just an idea at this point
  • Edit shared fields

Errors

Clicking "OK" will start a check of the page to ensure all required fields are filled in and there are no invalid fields.

  • Shared and required fields are highlighted
  • After "OK", fields with errors (invalid, required & null) are highlighted strongly and an error message is displayed. The error message contains a count for each error type. This count is a link and clicking it filters the list of fields to show only the fields with the error (and their parents if they have any). A new link appears, "Show all", to go back to seeing all fields.
    • Example: "2 required fields are empty."
    • Example: "1 field is invalid
  • This page was last modified 18:29, 24 Oct 2008.
  • This page has been accessed 3738 times.