Extension:Mantis

The Mantis extension allows users to display a list of MantisBT tickets on a page.

By default it shows a color-coded table of open tickets. The following options can be customized:


 * table header on/off
 * colors on/off
 * length of summary text
 * date format
 * specify tickets by bugid
 * display tickets by status
 * display tickets by severity
 * display tickets by category
 * display tickets by project
 * sort by a column (ascending and descending)
 * show only certain columns
 * limit the output
 * suppress error and informational messages
 * add comments to tickets

Installation

 * Grab the code via git:
 * Add the following code at the bottom of your LocalSettings.php:
 * ✅ – Navigate to "Special:Version" on your wiki to verify that the extension is successfully installed.

Configuration
By default the following options are set by this extension:

You may change each one of these parameters by including it with your specified value into your  below the initialization of this extension.

Set  to the root of the Mantis web page, e.g.  . If you don't set it or leave it empty, the Id field will not have a link to the Mantis ticket.

If you have customized or added additional fields to your MantisBT environment, you should change the last 4 parameters accordingly. The correct strings can be found in the file   in your Mantis directory.

Usage
This extension can be used with XML-like syntax in the wiki edit view. The parameters control what data and how it will be displayed. See the following sections for information on each parameter. By default it will show a color-coded table of open tickets.



To display the last 3 'assigned' tickets without header and colorized rows with columns Id, Status, Updated, and Summary:

status = assigned header = false color = false count = 3 show  = id, status, updated, summary



Parameters
Parameters are set in the format. Whitespaces are ignored.

bugid
specifies a single ticket or a list of tickets (separated by comma). If only a single ticket is specified,  and   are turned off automatically. They can be turned on again, by setting them explicitly. If the ticket is (or the tickets are) not found, an informational message is displayed unless  is set to.

{| class="wikitable" ! scope="row" style="text-align:left; padding-left:5px; padding-right:5px;" |Parameter ! scope="row" style="text-align:left; padding-left:5px; padding-right:5px;" |Value(s) ! scope="row" style="text-align:left; padding-left:5px; padding-right:5px;" | Default The parameter can be set to  or , whereas   and   are aliases for  , and   and   are aliases for. If the input value is not recognized, it will be ignored and the default value will be used.
 * style="padding-left:5px; padding-right:5px;"                             |
 * style="padding-left:5px; padding-right:5px;"                             |a Mantis ticket id [, a Mantis ticket id, a Mantis ticket id, ...]
 * style="padding-left:5px; padding-right:5px;"                             |   decides, if a table header will be displayed. The default value is   unless a single   is specified.

color
decides, if the table will be color-coded. The default value is  unless a single   is specified. The parameter can be set to  or , whereas   and   are aliases for  , and   and   are aliases for. If the input value is not recognized, it will be ignored and the default value will be used.

status
determines which tickets will be shown in the table. The default value is, which are all tickets that are not. In a standard Mantis environment, the following values are valid:,  ,  ,  ,  ,  ,  , and. If the input value is not recognized, it will be ignored and the default value will be used.

If you have a customized, the status names listed in the parameter are valid values.

severity
allows to filter tickets by severity. In a standard Mantis environment, the following values are valid:,  ,  ,  ,  ,  ,  , and.

If you have a customized, the severity names listed in the parameter are valid values.

{| class="wikitable" ! scope="row" style="text-align:left; padding-left:5px; padding-right:5px;" |Parameter ! scope="row" style="text-align:left; padding-left:5px; padding-right:5px;" |Value(s) ! scope="row" style="text-align:left; padding-left:5px; padding-right:5px;" | Default
 * style="padding-left:5px; padding-right:5px;"                             |
 * style="padding-left:5px; padding-right:5px;"                             |
 * style="padding-left:5px; padding-right:5px;"                             |   allows to filter tickets by category. Only category names defined in the database are valid. If the input value is not recognized, it will be ignored.

{| class="wikitable" ! scope="row" style="text-align:left; padding-left:5px; padding-right:5px;" |Parameter ! scope="row" style="text-align:left; padding-left:5px; padding-right:5px;" |Value(s) ! scope="row" style="text-align:left; padding-left:5px; padding-right:5px;" | Default
 * style="padding-left:5px; padding-right:5px;"                             |
 * style="padding-left:5px; padding-right:5px;"                             |category name [, category name, category name, ...]
 * style="padding-left:5px; padding-right:5px;"                             |   allows to filter tickets by project. Only project names defined in the database are valid. If the input value is not recognized, it will be ignored.

{| class="wikitable" ! scope="row" style="text-align:left; padding-left:5px; padding-right:5px;" |Parameter ! scope="row" style="text-align:left; padding-left:5px; padding-right:5px;" |Value(s) ! scope="row" style="text-align:left; padding-left:5px; padding-right:5px;" | Default
 * style="padding-left:5px; padding-right:5px;"                             |
 * style="padding-left:5px; padding-right:5px;"                             |project name [, project name, project name, ...]
 * style="padding-left:5px; padding-right:5px;"                             |   restricts the number of results that are shown. There is no default value. If the input value is not recognized, it will be ignored.

{| class="wikitable" ! scope="row" style="text-align:left; padding-left:5px; padding-right:5px;" |Parameter ! scope="row" style="text-align:left; padding-left:5px; padding-right:5px;" |Value(s) ! scope="row" style="text-align:left; padding-left:5px; padding-right:5px;" | Default
 * style="padding-left:5px; padding-right:5px;"                             |
 * style="padding-left:5px; padding-right:5px;"                             |number of results to show
 * style="padding-left:5px; padding-right:5px;"                             |   specifies the format of the date that will be shown in the columns Updated and Created. The default value is.

orderby
determines by which column the table is sorted. The default value is, which is the date the ticket was last updated. Valid values are,  ,  ,  ,  ,  ,  ,  ,  , and. If the input value is not recognized, it will be ignored and the default value will be used. Instead of, the aliases   or   may be used.

Note:,  , and   are sorted by their numerical value (see  Configuration), not their name.

order
decides the sort direction. The value can be  (default, most recent to oldest, z to a) or   (oldest to most recent, a to z). is an alias for, and   is an alias for. If the input value is not recognized, it will be ignored and the default value will be used.

summarylength
specifies the length of the summary text to display. If set, the summary text is cut off at the specified length. There is no default value. If the input value is not recognized, it will be ignored.

{| class="wikitable" ! scope="row" style="text-align:left; padding-left:5px; padding-right:5px;" |Parameter ! scope="row" style="text-align:left; padding-left:5px; padding-right:5px;" |Value(s) ! scope="row" style="text-align:left; padding-left:5px; padding-right:5px;" | Default
 * style="padding-left:5px; padding-right:5px;"                             |
 * style="padding-left:5px; padding-right:5px;"                             |max length of summary text
 * style="padding-left:5px; padding-right:5px;"                             |   hides database errors, like connection errors. The value can be   (hide errors) or   (default, show errors).   and   are aliases for , and   and   are aliases for  . If the input value is not recognized, it will be ignored and the default value will be used.

suppressinfo
hides informational messages, e.g. that no ticket with a specified  was found or that there are no tickets with a certain. The value can be  (hide informational messages) or   (default, show informational messages). and  are aliases for , and   and   are aliases for. If the input value is not recognized, it will be ignored and the default value will be used.

show
specifies which columns are shown in the table. By default the following columns are shown:,  ,  ,  ,  ,  , and. Valid values are,  ,  ,  ,  ,  ,  ,  , and. If the input value is not recognized, it will be ignored. Are all of the input values invalid, the default columns are shown.

comment
makes it possible to add comments to tickets. They are specified by using the following format:, where   can be any character. The following 3 expressions, which will add the comment to ticket number 42, are equivalent: comment.42 = Answer to the Ultimate Question of Life, The Universe, and Everything comment#42 = Answer to the Ultimate Question of Life, The Universe, and Everything comment/42 = Answer to the Ultimate Question of Life, The Universe, and Everything