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 have an unique identifier. It will be part of their URL, so only characters that could be part of the url are allowed.
-
Forms have a title, and a description (introductions, tips, what it is for).
-
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.
-
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.
-
Forms may have Custom Fields and Questions, described below:
-
Custom fields are fields that the Form creator want to fill automatically with a default form value.
-
Custom fields may have an (html) identifier.
-
Custom fields values set in the html are ignored when submitting the form (values comes from the database).
-
Questions are values the Form creator would want to manipulate.
-
Questions have a description (the actual question text) that would show in the Form.
-
Questions may fill an issue custom field directly if specified which.
-
If not specified, the answer would take form of a text input or list, if possible values are specified.
-
Questions may have an (html) identifier.
-
Questions may have onchange javascript.
-
Questions may be initially hidden.
-
You can use jquery. Get value like this:
$(this).val() $('#<identifier>').val()
-
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
-
To hide/show and element, refer to its closest ‘.box’:
$('#<identifier>').closest('.box')
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() };
-
Go to Admininstration > Webforms, click on New webform
-
Enter Identifier (name that goes in the URL), Title and Description (the form headers)
-
When an user answers the form, Redmine will create an issue. In Options, enter its Project, Tracker and Status
-
You may fill javascript functions to be added to the javascript section of the page
-
You may fill javascript to be executed when document is ready, and before submit
-
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
-
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
-
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.