Extension talk:Mantis

Jump to: navigation, search

About this board

By clicking "Add topic", you agree to our Terms of Use and agree to irrevocably release your text under the CC BY-SA 3.0 License and GFDL
193.10.97.111 (talkcontribs)

Where do I modify the code to allow shoing the "fixed_in_version" field?

Tessus (talkcontribs)

I was about to send a reply, when you posted the code. I wanted to add that a while back, but couldn't get in contact with the person who wrote that code fragment.

It's GPL, so I should be able to just cherry pick his commit...

85.11.62.102 (talkcontribs)

I posted that code in the wrong topic, sorry again. But I did a Pull request instead on GitHub.

Reply to "Show "fixed_in_version"?"

Show two tables with different filterings

3
193.10.97.111 (talkcontribs)

Does it not work to show two tables at the same time?

Tessus (talkcontribs)

I do not understand the question.

Just add 2 Mantis stanzas on the page and you have 2 tables.

85.11.62.102 (talkcontribs)

Sorry, I had written the closing tag as <mantis/ > instead of </mantis> !

Reply to "Show two tables with different filterings"
2605:A601:CD1:9300:AC2F:870A:F624:7EF1 (talkcontribs)

I can tag issues in MantisBT and feel that there would be a lot of value to adding a filter for the extension to query based on a tag.

Tessus (talkcontribs)

This sounds like an interesting idea, but that code change would be extensive. Also, how exactly would you handle a new parameter tag?

Let's say one enters 2 tags. Should only tickets be listed that include both tags or tickets that are tagged with either tag?

Pull requests are always welcome.

193.10.97.111 (talkcontribs)

It works with the following changes:

$columnNames = 'id:b.id,project:p.name,category:c.name,severity:b.severity,priority:b.priority,status:b.status,username:u.username,created:b.date_submitted,updated:b.last_updated,summary:b.summary,releaseversion:b.fixed_in_version,version:b.version';

..

$conf['version']        = NULL;

$conf['releaseversion']  = NULL;

...

case 'version':

$tmpVersions = $arg;

break;

case 'releaseversion':

   $tmpVersions = $arg;

$conf['releaseversion'] = true;

break;

...

 // Create version array

if (!empty($tmpVersions))

{

$versionNames = array();

$versionNew = array();

$verQuery = "select version as ver from ${tabprefix}project_version_table";

if ($result = $db->query($verQuery))

{

while ($row = $result->fetch_assoc())

{

$versionNames[] = $row['ver'];

}

}

$versions = explode(',', $tmpVersions);

foreach ($versions as $version)

{

$version = trim($version);

if (in_array($version, $versionNames))

{

$versionNew[] = $version;

}

}

if (!empty($versionNew))

{

$conf['version'] = $versionNew;

}

}

...

// build the SQL query

$versionColumnToJoin = ($conf['releaseversion'] == NULL) ? "b.version" : "b.fixed_in_version" ;

$query = "select b.id as id, p.name as project, c.name as category, b.severity as severity, b.priority as priority, b.status as status, u.username as username, b.date_submitted as created, b.last_updated as updated, b.summary as summary,

b.fixed_in_version as releaseversion,b.version as version

from ${tabprefix}category_table c inner join ${tabprefix}bug_table b on (b.category_id = c.id) inner join ${tabprefix}project_table p on (b.project_id = p.id) inner join ${tabprefix}project_version_table pv on (p.id = pv.project_id and ${versionColumnToJoin} = pv.version) left outer join ${tabprefix}user_table u on (u.id = b.handler_id) ";

...

if ($conf['version'])

{

$inlist = "'".implode("','", $conf['version'])."'";

$query .= "and pv.version in ( $inlist ) ";

}

..

if ($conf['version'])

{

if ($useAnd)

{

$errmsg .= " and ";

}

$errmsg .= sprintf("version '%s'", implode("'", $conf['version']));

$useAnd = true;

}

Tessus (talkcontribs)

I think you added this to the wrong topic. Anyway, thanks, I know how to code it. AFAIK this code is from a fork and I wanted to ask that person, if he wanted to contribute his changes.

Reply to "Support for filtering by "Tags""
5.104.143.6 (talkcontribs)

I've added custom fields to our MantisBT installation (1.3.1). Is it possible to include them in the table when specifying the show parameter on a wiki page?

Tessus (talkcontribs)

There was a request a while back to allow searches on custom fields. see https://github.com/tessus/mwExtensionMantis/issues/8

I've never worked with custom fields thus I do not know how they work and how I could make them available (but I think I have an idea).

For now the answer to your question is no, but you can open a ticket on github. I'm travelling these days and don't have time to look into it.

Tessus (talkcontribs)

Ticket on github: Custom fields

Reply to "Custom fields"
There are no older topics