ericferon / glpi-statecheck

GLPI plugin for checking form fields, based on rules
GNU General Public License v2.0
4 stars 4 forks source link

Statecheck

Statecheck Plugin for GLPI

This plugin let you check the validity of form fields. For instance you can make a field mandatory or not, depending on some value in another field

For that purpose, you define one or more rules :

Several rules may be defined for 1 state, with different supplementary conditions.

To use the statecheck plugin :

  1. In the menu Dropdowns->Statecheck->Tables, define the object class on which you want to perform checks :
    • Name : the DB table name in which your objects are stored
    • Class : the PHP class name
    • State table: the DB table name in which the "states" are defined
    • State class : the PHP class name of this State table
    • Frontname : the form name (that is : the last part of the URL path - without the php suffix - where you insert/update/delete objects)
  2. Create some rules in glpi via the menu Administration->Statecheck Rules

For instance, you may decide that, depending on the field "Status", you want to check some field values of a dataflow form.
If you want to create a rule for checking that

you must perform the following steps :

  1. Create an entry in the configuration table to define once the dataflow object, via the menu Dropdowns->Statecheck->Tables : see screenshot example1
  2. Create the rule, via the menu Administration->Statecheck Rules->+ : the target state is "In specification" ; see screenshot example2
  3. Create the additional criteria on the field "Protocol", via the tab "Criteria" and "Add a new criteria" : see screenshot example3
  4. Specify the checks, via the tab "Actions" and "Add a new check" : "Name" is not empty and "Flow Group" is not emty ; see screenshot example4

You may define several rules, that will apply to one form.
For instance, you may decide that any dataflow in the status "In specification" must have the fields "Protocol" and "Description" filled (even if the protocol is not "Tibco").
To perform the creation of this rule, you repeat the steps 2 and 4 only, because

So,

The final result, applying both rules, is shown in example5 : the mandatory fields are highlighted in red
Contributions for translation in your language are welcome to https://explore.transifex.com/ericferon/glpi-statecheck/

Plugins Integrations