Skip to content

Computer Validations

tomolimo edited this page Dec 17, 2019 · 9 revisions

Computer Validations Tutorial

This tutorial implies that the plugin is installed and enabled. See Install and enable

Beware that this tutorial screen copies are from GLPi version 9.1, but for older versions functionalities are identical.

Edit

  1. Start your preferred browser
  2. Start a GLPi session with an account with 'config rights' (in order to be able to switch to 'Edit mode' and to edit Form Validation settings).
  3. Go to 'form Validation' configuration in menu: 'Setup > Form Validations'
  4. Add a new page
  5. Give a name like 'Computer validations', set Child Entities to 'Yes' (if you are using entities), set 'Active' to 'Yes', and be sure that 'Asset - Computers' is selected in the 'Associated item type' dropdown. You may also add some comments like 'This is my Computer Form Validation set'.
  6. Click 'Add' to add this new page.
  7. You are now ready to switch to 'Edit mode'
  8. Go to your own settings, and switch to 'Edit mode'. the 'Edit mode' is valid only for you, and only during your current GLPi session. It will be reset to 'Normal mode' as soon as you logout from GLPi.
  9. Go to 'Computer' creation form
  10. move your mouse over the fields, and you'll see that the selectable fields will be shown in a light blue
  11. with a click on the field you want to be validated (here on the 'Name') you'll be able to select the 'error sign' (= HTML element that will show the error sign if field is not validated). A click on that error sign element will move you to the next step (the selection of the element that will show the mandatory sign). Please note that the mouse click is on the border of the error sign element and not in the middle.
  12. Select now the mandatory sign element (= HTML element that will show the mandatory sign)
  13. Please note that at anytime you may go back to first step with a press on the ESCAPE key.
  14. After mandatory sign selection, automatically, information on the form and on the field are stored in DB. You may check this if you go to the Form Validation settings.
  15. Remember that by default field formulas are for empty field values. So if you let it like that, the plugin will prevent a computer creation with an empty name.
  16. If you click on a field already under validation, then the mandatory sign will be hidden (same than deselecting the 'Force Mandatory sign' flag on the Field form settings.
  17. A second click on a field already under validation will de-activate the field and it will no longer be validated. The field is not deleted from DB, and you may re-activate it by going to the Field form settings, or like mentioned in next step.
  18. you may add it again under validation by restarting to the select step (step 10).

Test

  1. You may now test your configuration by switching back to 'Normal mode' ('Edit mode' set to No).
  2. And try to create a Computer with an empty name, and you should get the following message

To go further

You may need to add validations for Computers also when editing an existing computer

See also

Mandatory Formulas

Formulas

Helper Functions

Clone this wiki locally