Extension:Mantis/cs
![]() Stav rozšíření: stabilníCategory:Stable extensions/cs |
|
---|---|
Implementace | ZnačkaCategory:Tag extensions/cs |
Popis | Zobrazí (přizpůsobitelný) seznam lístků MantisBT |
Autoři | Helmut K. C. Tessarek (tessusdiskuse) |
Nejnovější verze | 2.1.1 (2019-06-18) |
Zásady kompatibility | Větev master zachovává zpětnou kompatibilitu. |
MediaWiki | 1.25+Category:Extensions with manual MediaWiki version |
PHP | 5.4+ |
Změny v databázi | Ne |
Licence | GNU General Public License 2.0 nebo novější |
Stáhnout | GitHub: Poznámka: |
$wgMantisConf[] |
|
<mantis> |
|
Rozšíření Mantis umožňuje uživatelům zobrazit seznam tiketů MantisBT na stránce.
Ve výchozím nastavení zobrazuje barevně odlišenou tabulku otevřených tiketů. Následující možnosti lze přizpůsobit:
- zapnutí/vypnutí záhlaví tabulky
- barvy zapnuté/ vypnuté
- délka souhrnného textu
- formát data
- určit tiket podle
- chyby ID
- stav
- náročnost
- kategorie
- projekt
- uživatelské jméno
- verze (podporováno filtrování rozsahu)
- cílová verze (podporováno filtrování rozsahu)
- opraveno ve verzi (podporováno filtrování rozsahu)
- rozhodnutí
- řazení podle více sloupců s individuálním pořadím řazení
- zobrazit pouze určité sloupce
- omezit výkon
- potlačit chybová a informační hlášení
- změnit názvy záhlaví pro sloupce
- změnit zarovnání sloupců
- přidat komentáře k tiketům
Instalace
Toto rozšíření je pro databáze Mantis běžící na MySQL.
- Získejte kód přes Git:
cd extensions git clone https://github.com/tessus/mwExtensionMantis.git Mantis
- Přidejte následující kód na konec vašeho LocalSettings.php:
require_once( "$IP/extensions/Mantis/Mantis.php" );
Dokončeno – Přejděte na
Special:Version
na své wiki a ověřte, že je rozšíření úspěšně nainstalováno.
Nastavení
Ve výchozím nastavení jsou tímto rozšířením nastaveny následující možnosti:
$wgMantisConf['DBserver'] = 'localhost'; // Mantis database server
$wgMantisConf['DBport'] = NULL; // Mantis database port
$wgMantisConf['DBname'] = ''; // Mantis database name
$wgMantisConf['DBuser'] = '';
$wgMantisConf['DBpassword'] = '';
$wgMantisConf['DBprefix'] = ''; // Table prefix
$wgMantisConf['Url'] = ''; // Mantis Root Page
$wgMantisConf['MaxCacheTime'] = 60*60*0; // How long to cache pages in seconds
$wgMantisConf['PriorityString'] = '10:none,20:low,30:normal,40:high,50:urgent,60:immediate';
$wgMantisConf['StatusString'] = '10:new,20:feedback,30:acknowledged,40:confirmed,50:assigned,80:resolved,90:closed';
$wgMantisConf['StatusColors'] = '10:fcbdbd,20:e3b7eb,30:ffcd85,40:fff494,50:c2dfff,80:d2f5b0,90:c9ccc4';
$wgMantisConf['SeverityString'] = '10:feature,20:trivial,30:text,40:tweak,50:minor,60:major,70:crash,80:block';
$wgMantisConf['ResolutionString'] = '10:open,20:fixed,30:reopened,40:unable to duplicate,50:not fixable,60:duplicate,70:not a bug,80:suspended,90:wont fix';
Každý z těchto parametrů můžete změnit tak, že jej zahrnete s vámi zadanou hodnotou do vašeho LocalSettings.php
pod inicializací tohoto rozšíření.
Nastavte $wgMantisConf['Url']
na kořen webové stránky Mantis, např. https://www.example.com/mantis
.
Pokud jej nenastavíte nebo jej ponecháte prázdné, pole ID nebude mít odkaz na lístek Mantis.
Pokud jste do svého prostředí MantisBT přizpůsobili nebo přidali další pole, měli byste odpovídajícím způsobem změnit posledních 5 parametrů.
Správné řetězce ($g_priority_enum_string
, $g_status_enum_string
, $g_status_colors
, $g_severity_enum_string
, $g_resolution_enum_string
) lze nalézt v souboru config_defaults_inc.php
ve vašem adresáři Mantis.
Úvahy o výkonu
Některé filtry používají sloupce, pro které v databázi Mantis neexistují žádné odpovídající indexy.
Totéž je true
pro sloupce, které lze použít v orderby
k seřazení výstupu.
Pokud zaznamenáte problémy s výkonem, promluvte si s administrátorem databáze Mantis. Ve většině případů by výkon neměl být problémem, pokud nemáte v databázi Mantis miliony chyb, v takovém případě byste měli i tak zvážit vyřazení produktu. 😏
Použití
Toto rozšíření lze použít se syntaxí podobnou XML v zobrazení úprav wiki. Parametry řídí, jaká data a jak se budou zobrazovat. Informace o jednotlivých parametrech naleznete v následujících částech. Ve výchozím nastavení zobrazí barevně odlišenou tabulku otevřených tiketů.
<mantis/>
Chcete-li zobrazit poslední 3 'přiřazené' tipy bez záhlaví a bez barevných řádků se sloupci ID, Stav, Aktualizováno a Souhrn:
<mantis> status = assigned header = false color = false count = 3 show = id, status, updated, summary </mantis>
Parametry
Parametry se nastavují ve formátu parametr=hodnota
.
Mezery jsou ignorovány.
bugid
bugid
určuje jeden tiket nebo seznam tiketů (oddělených čárkou).
Pokud je zadán pouze jeden tiket, header
a color
se automaticky vypnou.
Lze je znovu zapnout jejich explicitním nastavením.
Pokud tiket není (nebo tikety nejsou) nalezen, zobrazí se informační zpráva, pokud není suppressinfo
nastaveno na true
.
Parametr | bugid |
---|---|
Format | value [, value, ...] |
Value(s) | a Mantis ticket id |
Default |
header
header
decides, if a table header will be displayed.
The default value is true
unless a single bugid
is specified.
Parametr lze nastavit na true
nebo false
, přičemž on
a yes
jsou aliasy pro true
a off
a no
jsou aliasy pro false
.
Pokud vstupní hodnota není rozpoznána, bude ignorována a použije se výchozí hodnota.
Parameter | header |
---|---|
Format | value |
Value(s) | yes|on, false|no|off |
Default | true |
color
color
decides, if the table will be color-coded.
The default value is true
unless a single bugid
is specified.
Parametr lze nastavit na true
nebo false
, přičemž on
a yes
jsou aliasy pro true
a off
a no
jsou aliasy pro false
.
Pokud vstupní hodnota není rozpoznána, bude ignorována a použije se výchozí hodnota.
Parameter | color |
---|---|
Format | value |
Value(s) | yes|on, false|no|off |
Default | true |
dateformat
dateformat
specifies the format of the date that will be shown in the columns Updated and Created. The default value is Y-m-d
.
Parameter | dateformat |
---|---|
Format | value |
Value(s) | a valid date format string |
Default | Y-m-d |
show
show
specifies which columns are shown in the table. By default the following columns are shown: id
, project
, category
, severity
, status
, updated
, and summary
. Valid values are id
, category
, severity
, priority
, status
, username
, created
, updated
, version
, target_version
, fixed_in_version
, resolution
, and summary
. If the input value is not recognized, it will be ignored. Are all of the input values invalid, the default columns are shown.
Parameter | show |
---|---|
Format | value [, value, ...] |
Value(s) | id, project, category, severity, priority, status, username, created, updated, version, target_version, fixed_in_version, resolution, summary |
Default | id, category, severity, status, updated, summary |
status
status
determines which tickets will be shown in the table. The default value is open
, which are all tickets that are not closed
. In a standard Mantis environment, the following values are valid: new
, feedback
, acknowledged
, confirmed
, assigned
, resolved
, closed
, and all
. If the input value is not recognized, it will be ignored and the default value will be used.
If you have a customized $wgMantisConf['StatusString']
, the status names listed in the parameter are valid values (see Configuration).
Parameter | status |
---|---|
Format | value [, value, ...] |
Value(s) | open, new, feedback, acknowledged, confirmed, assigned, resolved, closed, all |
Default | open |
severity
severity
allows to filter tickets by severity. In a standard Mantis environment, the following values are valid: feature
, trivial
, text
, tweak
, minor
, major
, crash
, and block
.
If you have a customized $wgMantisConf['SeverityString']
, the severity names listed in the parameter are valid values (see Configuration).
Parameter | severity |
---|---|
Format | value [, value, ...] |
Value(s) | feature, trivial, text, tweak, minor, major, crash, block |
Default |
category
category
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.
Parameter | category |
---|---|
Format | value [, value, ...] |
Value(s) | category name |
Default |
project
project
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.
Parameter | project |
---|---|
Format | value [, value, ...] |
Value(s) | project name |
Default |
username
username
allows to filter tickets by username. Only usernames defined in the database are valid. If the input value is not recognized, it will be ignored.
Parameter | username |
---|---|
Format | value [, value, ...] |
Value(s) | username |
Default |
version
version
allows to filter tickets by version. Only versions defined in the database are valid. If the input value is not recognized, it will be ignored.
Range Filtering is supported. Please see section Range Filtering for more details.
Parameter | version |
---|---|
Format | value [, value, ...] |
Value(s) | version |
Default |
target_version
target_version
allows to filter tickets by target_version. Only target_versions defined in the database are valid. If the input value is not recognized, it will be ignored.
Range Filtering is supported. Please see section Range Filtering for more details.
Parameter | target_version |
---|---|
Format | value [, value, ...] |
Value(s) | target version |
Default |
fixed_in_version
fixed_in_version
allows to filter tickets by fixed_in_version. Only fixed_in_versions defined in the database are valid. If the input value is not recognized, it will be ignored.
Range Filtering is supported. Please see section Range Filtering for more details.
Parameter | fixed_in_version |
---|---|
Format | value [, value, ...] |
Value(s) | fixed in version |
Default |
resolution
resolution
allows to filter tickets by resolution. In a standard Mantis environment, the following values are valid: open
, fixed
, reopened
, unable to duplicate
, not fixable
, duplicate
, not a bug
, suspended
, and wont fix
.
If you have a customized $wgMantisConf['ResolutionString']
, the resolution names listed in the parameter are valid values (see Configuration).
Parameter | category |
---|---|
Format | value [, value, ...] |
Value(s) | open, fixed, reopened, unable to duplicate, not fixable, duplicate, not a bug, suspended, wont fix |
Default |
orderby
orderby
determines by which columns the table is sorted. The default value is updated desc
, which is the date the ticket was last updated with a reverse sort order (most recent tickets first). Valid values are id
, project
, category
, severity
, priority
, status
, username
, created
, updated
, version
, target_version
, fixed_in_version
, resolution
, and summary
. The additional values asc
and desc
can be appended to specify the sort order for that column. If the input value is not recognized, it will be ignored and the default value will be used.
Instead of orderby
, the aliases sortkey
or ordermethod
may be used.
Note: status
, property
, severity
, and resolution
are sorted by their numerical value (see Configuration), not their name.
Parameter | orderby, ordermethod, sortkey |
---|---|
Format | desc| [, value [asc|desc], ...] |
Value(s) | id, project, category, severity, priority, status, username, created, updated, version, target_version, fixed_in_version, resolution, summary |
Default | updated desc |
order
Note: This option is deprecated, but still available for backwards compatibility. It will be ignored unless orderby
specifies a single column without a sort order!
order
decides the sort direction. The value can be descending
(default, most recent to oldest, z to a) or ascending
(oldest to most recent, a to z). desc
is an alias for descending
, and asc
is an alias for ascending
. If the input value is not recognized, it will be ignored and the default value will be used.
Parameter | order |
---|---|
Format | value |
Value(s) | ascending, desc|descending |
Default | desc |
count
count
restricts the number of results that are shown. There is no default value. If the input value is not recognized, it will be ignored.
Parameter | count |
---|---|
Format | value |
Value(s) | number of results to show |
Default |
summarylength
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.
Parameter | summarylength |
---|---|
Format | value |
Value(s) | max length of summary text |
Default |
suppresserrors
suppresserrors
hides database errors, like connection errors. The value can be true
(hide errors) or false
(default, show errors). on
and yes
are aliases for true
, and off
and no
are aliases for false
. If the input value is not recognized, it will be ignored and the default value will be used.
Parameter | suppresserrors |
---|---|
Format | value |
Value(s) | yes|on, false|no|off |
Default | false |
suppressinfo
suppressinfo
hides informational messages, e.g. that no ticket with a specified bugid
was found or that there are no tickets with a certain status
. The value can be true
(hide informational messages) or false
(default, show informational messages). on
and yes
are aliases for true
, and off
and no
are aliases for false
. If the input value is not recognized, it will be ignored and the default value will be used.
Parameter | suppressinfo |
---|---|
Format | value |
Value(s) | yes|on, false|no|off |
Default | false |
headername
headername
makes it possible to change the header names of table columns. They are specified by using the following format: headername<delimiter><colname> = text
, where <delimiter>
can be any character. Valid values for <colname>
are all valid values for the option show
.
Parameter | headername<delimiter><colname> |
---|---|
Format | value |
Value(s) | header name for column |
Default |
Example:
headername.fixed_in_version = Fixed In
align
align
makes it possible to change the alignment of table columns. They are specified by using the following format: align<delimiter><colname> = value
, where <delimiter>
can be any character. Valid values for <colname>
are all valid values for the option show
.
Parameter | align<delimiter><colname> |
---|---|
Format | value |
Value(s) | left, c|center, r|right |
Default |
Example:
align.fixed_in_version = left
comment
comment
makes it possible to add comments to tickets. They are specified by using the following format: comment<delimiter><bugid> = text
, where <delimiter>
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
Parameter | comment<delimiter><bugid> |
---|---|
Format | value |
Value(s) | comment to be added to <bugid> |
Default |
summary_as_comment
If summary_as_comment
is set to true, the summary is used as the comment. Explicitly set comments take precedence, which means they will not be overwritten by the summary.
Parameter | summary_as_comment |
---|---|
Format | value |
Value(s) | yes|on, false|no|off |
Default | false |
Range Filtering
Range Filtering is available for the following options: version
, target_version
, and fixed_in_version
Following operators are available: gt
, ge
, lt
, le
.
Operator | Meaning |
---|---|
gt | greater than |
ge | greater than or equal to |
lt | less than |
le | less than or equal to |
Maximal two operators are allowed.
Format | op value [, op value] |
---|---|
op | gt, ge, lt, le |
value | version |
Examples:
<mantis> status = resolved, closed fixed_in_version = gt 2.71
It is also possible to restrict the range on both ends:
status = resolved, closed fixed_in_version = gt 2.71, le 3.0Category:Task extensions/cs