Formcreator

Formcreator is a plugin for creating simple form of access to users.

Installation

In order to take advantage of the dynamic function (Select - question onChange, Select - Section onChange), you are forced to change GLPI.
To do this, you must do as explained here : link

In the file /inc/html.class.php, modify the function "header" in this way :

static function header($title, $url='', $sector="none", $item="none", $option="", $onload="") {
    global $CFG_GLPI, $LANG, $PLUGIN_HOOKS, $HEADER_LOADED, $DB;

    // Print a nice HTML-head for every page
    if ($HEADER_LOADED) {
     return;
    }
    $HEADER_LOADED = true;
    self::includeHeader($title);
    // Body
    echo "<body";
    if (!empty($onload)) {
        echo " onload='$onload'";
    }
    echo ">";
    // Generate array for menu and check right
    .....

The administration is in 3 parts:

  • Questions related to the form
  • Tickets targets
  • Sections (group of questions)

For each forms created, you must specified the language of it. The form will only be seen by those who have the same language (in profile) as selected.

Questions

You can add several types of questions:
  • Text field
  • Dropdown list
  • Checkbox
  • Textarea
  • File Upload
  • Validation of
  • Multiplication of two fields
  • Select - Question onChange
  • Select - Section onChange
  1. Text Field : a simple text field where you can check the contents of a personal expression via pre-defined or customized. It will be automatically checked if the expression is right or not. If it's not, the fields will be colored.
    There is 5 pre-defined regex :
    • Required => force the required of the field
    • Alphabetical => only letters are accepted
    • Numeric => only numbers are accepted
    • Email => only email format is accepted
    • Date => open a calendar

  1. Dropdown list : like the name, simply a dropdown list

  1. Checkbox : like the name, simply a checkbox

  1. TextArea : like the name, simply a TextArea

  1. File Upload : like the name, simply a file upload (one file per question)
  1. Validation of : it will create in the form a text field to enter a comment and choose a validator.
    When creating the ticket, request validation will be created.

  1. Two fields sum : it will create two fields : a dropdown list and with a text field and you can enter an attributable value.

  1. Select - Question onChange : based on a dropdown list, you can specify what question(s) will be hidden or visible

  1. Select - Section onChange : based on a dropdown list, you can specify what section(s) will be hidden or visible

Ticket Target

You can define multiple tickets for the same target form. You can configure the ticket and its contents.
The tag ##full_form## by default include all questions / answers (except type "Sending file request validation").
If you have the possibility to use the tag question / answers as you like, in the content, like in the title of it.

Once the person has completed the form, one or more tickets will be created.

Sections

You can create sections, it is only to create groups of questions in the display form with a title and a description.

User side

The user selects the form that he wants to fill in the list (according to the forms available for the entity and the language specification of it).

It responds to the form, which will create the ticket target set by the administrator. Send a document and / or create a demand for validation if fields of these types exist.

1.JPG (18.9 KB) nicotontige, 08/23/2012 11:35 AM

3.JPG (38.8 KB) nicotontige, 08/23/2012 11:35 AM

4.JPG (27.1 KB) nicotontige, 08/23/2012 11:35 AM

textfield.jpg - Text Field choice (21.4 KB) nicotontige, 11/23/2012 04:37 PM

question_onchange.jpg - Question onChange choice (20.9 KB) nicotontige, 11/23/2012 04:39 PM

section_onchange.jpg - Section onChange choice (19.6 KB) nicotontige, 11/23/2012 04:39 PM

dropdown_list.jpg - Dropdown list choice (15.4 KB) nicotontige, 11/23/2012 04:39 PM

checkbox.jpg - Checkbox choice (15.4 KB) nicotontige, 11/23/2012 04:39 PM

textarea.jpg - Textarea choice (15.1 KB) nicotontige, 11/23/2012 04:39 PM

validation.jpg - Validation choice (15.1 KB) nicotontige, 11/23/2012 04:39 PM

multplication.jpg - Multiplication choice (17.6 KB) nicotontige, 11/23/2012 04:39 PM

user_side.JPG - user side (37.8 KB) nicotontige, 11/23/2012 05:10 PM