Display the username who updated issue in the my view page ?

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
jithinkcs
Posts: 72
Joined: 29 Jan 2010, 08:20

Display the username who updated issue in the my view page ?

Post by jithinkcs »

Hi All,

I would like to add the user who "edited or updated the issue last" in the My View page . Will it possible to add. If possible how ?


Mantis 1.2.3
Apache 2.2
MySQL 5
PHP 5

Regards

Jithin K
Attachments
requirement.JPG
requirement.JPG (77.72 KiB) Viewed 18946 times
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Display the username who updated issue in the my view pa

Post by atrol »

Just a quick and dirty code line to see how it works
Insert the following line after line 502 of my_view_inc.php

Code: Select all

print_user ( $t_bug->handler_id );
As always: Be aware that your modifications are lost when updating MantisBT and might not work the same way in newer versions!
Please use Search before posting and read the Manual
jithinkcs
Posts: 72
Joined: 29 Jan 2010, 08:20

Re: Display the username who updated issue in the my view pa

Post by jithinkcs »

Hi Atrol,

Thank you very much for your response.

What i mean is

1. Display the username who edited /updated/ change the status of the issue in the My view page .

While adding your code "print_user ( $t_bug->handler_id );" , it shows assigned username.

Can i Display the username who edited /updated/ change the status of the issue there ?

Regards

Jithin K
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Display the username who updated issue in the my view pa

Post by atrol »

jithinkcs wrote: What i mean is

1. Display the username who edited /updated/ change the status of the issue in the My view page .

While adding your code "print_user ( $t_bug->handler_id );" , it shows assigned username.

Can i Display the username who edited /updated/ change the status of the issue there ?
My code was just to give you a hint where you have to change code and a function which should be used when displaying users
You can find the information you need in mantis_bug_history_table
Please use Search before posting and read the Manual
jithinkcs
Posts: 72
Joined: 29 Jan 2010, 08:20

Re: Display the username who updated issue in the my view pa

Post by jithinkcs »

Hi Atrol,

Thanks for your response
:D

Jithin
jithinkcs
Posts: 72
Joined: 29 Jan 2010, 08:20

Re: Display the username who updated issue in the my view pa

Post by jithinkcs »

Hi Atrol,

I did it . Thank u very much
:D
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Display the username who updated issue in the my view pa

Post by atrol »

Great to hear,
I hope you will not get any performance issues.
If this page is used by a lot of users your database might get stressed.
Also be aware that this page does a autorefresh. But shouldn't be too bad as long as you didn't change $g_min_refresh_delay (default is 10 minutes)
Please use Search before posting and read the Manual
jithinkcs
Posts: 72
Joined: 29 Jan 2010, 08:20

Re: Display the username who updated issue in the my view pa

Post by jithinkcs »

Hi Atrol,

I didn't get any performance issue till now. I didn't change the $g_min_refresh_delay.

Thanks for response.

Regards

Jithin K
ddeprekel
Posts: 1
Joined: 09 Nov 2010, 18:56

Re: Display the username who updated issue in the my view pa

Post by ddeprekel »

Hello jithinkcs,
Would you happen to have the code you used to do this? I am trying to do something similar, just on the view all page.

Thank you,

Doug D
jithinkcs
Posts: 72
Joined: 29 Jan 2010, 08:20

Re: Display the username who updated issue in the my view pa

Post by jithinkcs »

Hi,

I added the following line under 502 my_view_inc.php.

$query = "SELECT user_id FROM mantis_bug_history_table WHERE bug_id=$t_bug->id ORDER BY date_modified DESC";

if ($result=mysql_query($query))
{

if ($row=mysql_fetch_row($result))
{
echo " - ";
echo "Last edited by ";
print_user($row[0]);
}
else
{

}
}
else
{
#echo "<!-- SQL Error ".mysql_error()." -->";
}
Post Reply