Redmine Web Forms

This plugin manages Redmine Web Forms as an alternative to create new issues, like Forms, or internet surveys.

It creates a new entry in the admin menu to manage webforms.

Forms

  1. Forms have an unique identifier. It will be part of their URL, so only characters that could be part of the url are allowed.

  2. Forms have a title, and a description (introductions, tips, what it is for).

  3. Forms will eventually create an issue of selected type, on selected project, with selected status. Forms are kept in maintenance mode until their project, tracker and initial status are selected.

  4. Optionally, a form may add the user taking it to a selected role on the project, or include the user in a Redmine group. If these fields are left blank, the form will still show up for users that already have permission to create the issue in its project. For other users it would show as if in maintenance mode.

  5. Forms may have Custom Fields and Questions, described below:

Custom Fields

  1. Custom fields are fields that the Form creator want to fill automatically with a default form value.

  2. Custom fields may have an (html) identifier.

  3. Custom fields values set in the html are ignored when submitting the form (values comes from the database).

Questions

  1. Questions are values the Form creator would want to manipulate.

  2. Questions have a description (the actual question text) that would show in the Form.

  3. Questions may fill an issue custom field directly if specified which.

  4. If not specified, the answer would take form of a text input or list, if possible values are specified.

  5. Questions may have an (html) identifier.

  6. Questions may have onchange javascript.

  7. Questions may be initially hidden.

Javascript

  1. You can use jquery. Get value like this:

$(this).val()

$('#<identifier>').val()
  1. If you would like to address the user in your scripts there are some hidden user fields you can use. Their ids are:

* author_name for the full name
* author_mail for the main email
* author_cf_<number> for the user custom fields
  1. To hide/show and element, refer to its closest ‘.box’:

$('#<identifier>').closest('.box')

Examples of onchange javascript:

if ($(this).val() == 1){
  $('#test').closest('.box').show();
  $('#test').focus()
} else {
  $('#test').val('').closest('.box').hide()
};

if ($(this).val().toLowerCase().includes('test')){
  $('#test').closest('.box').show();
  $('#test').focus()
} else {
  $('#test').val('').closest('.box').hide()
};

Usage:

  1. Go to Admininstration > Webforms, click on New webform

  2. Enter Identifier (name that goes in the URL), Title and Description (the form headers)

  3. When an user answers the form, Redmine will create an issue. In Options, enter its Project, Tracker and Status

  4. You may fill javascript functions to be added to the javascript section of the page

  5. You may fill javascript to be executed when document is ready, and before submit

  6. The form will be “In maintenance” if the user doesn’t have permission to create it. Optionally, in “Add user…” you can give him a role in the project or put him in a group

* The form will still be "In maintenance" if the role/group doesn't give the user permission to create the issue

* In Admininstration > Webforms, the column "Adds user" checks if the role or group gives the user permission to create the issue
  1. Add New custom field(s)

A Custom fields is always hidden in the webform. It allows you to assign values to fields on the issue. Values here, if valid, overwrite anything else when creating the form.

1. Enter the custom field and value to assign to it in the new issue

1. Enter an identifier if you want to read this value using javascript
  1. Add Question(s)

Questions are very flexible. They can refer to a field on the issue directly or indirectly.

1. You may add a Text to the question in Description

1. If you chose a custom field, the question will refer to a custom field directly, and use this field restrictions

1. If no custom field is selected, you may assign possible values to create a list of options, one on each line

1. Assign an Identifier if you want to manipulate this question using javascript

1. On onchange, enter the javascript to be executed when the value of this question changes

1. Check Hidden if this question will initially appear hidden (can be shown using javascript)

1. Check Required accordingly (note: hidden questions should not be required, it may block submit)

Add as many custom fields and questions as needed. You can drag them around to change their order.

Submit.