Days Lapse from Case Open to Case Closed

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
froilanserohijos
Posts: 9
Joined: 17 Oct 2016, 08:06

Days Lapse from Case Open to Case Closed

Post by froilanserohijos »

Hi!

Can anyone help me how to display the Days Laps in Viewing Issue Page in MantisBT base on the Date Difference from the Date reported to the date Closed?

Hoping for any kind help and assistance.

Thank you so much.
atrol
Site Admin
Posts: 8398
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Days Lapse from Case Open to Case Closed

Post by atrol »

For the open date, use field date_submitted from database table mantis_bug_table
For the close date, search in database table mantis_history_table for the last status change to "closed" (field_name = 'status' and new_value = '90')
Please use Search before posting and read the Manual
froilanserohijos
Posts: 9
Joined: 17 Oct 2016, 08:06

Re: Days Lapse from Case Open to Case Closed

Post by froilanserohijos »

Hi Atrol;

Thanks for the time.

Actually,
1) I created a Customer Field named custom_Days Lapse
2) I modify the View Issues Columns as per below

$g_view_issues_page_columns = array(
'selection', 'edit', 'status', 'custom_Days Lapse', 'priority', 'id', 'sponsorship_total',
'bugnotes_count', 'attachment_count', 'category_id',
'last_updated', 'summary'
);

3) I want to display the number of Days the Case was not closed since reported.
Example :
date_submitted = 1 Aug 2017
close date = 20 Aug 2017 --> The date when it was really closed.
custom_Days Lapse = 20

4) It will only stop the counting of Days Lapse if the Status is Closed, if not, it will still count the Days Lapse.
5) I also want that I can sort the custom_Days Lapse according to highest and lowest Day Lapse.

Hoping for your kind advise if what php files and tables are involve and if possible can pls help me of the code for this because I am not that good in Php.

Thank you so much in advance.
atrol
Site Admin
Posts: 8398
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Days Lapse from Case Open to Case Closed

Post by atrol »

froilanserohijos wrote: 1) I created a Customer Field named custom_Days Lapse
There is no need to create a custom field as you don't want to store any value, but just compute a value based on existing data.
You have to write a plugin for that which uses event EVENT_FILTER_COLUMNS to implement the column.
http://www.mantisbt.org/docs/master/en- ... ev.plugins
You can learn from existing plugins, e.g.https://github.com/mantisbt-plugins/source-integration
https://github.com/mantisbt-plugins/sou ... e.php#L115
https://github.com/mantisbt-plugins/sou ... .class.php
Please use Search before posting and read the Manual
froilanserohijos
Posts: 9
Joined: 17 Oct 2016, 08:06

Re: Days Lapse from Case Open to Case Closed

Post by froilanserohijos »

Hi Atrol;

Good day!

I am not that good in progrmming.

Hoping someone can help me and I will learn from it.

I need to display in the Column the Days Lapse.

Thank you and hoping for your kind assistance.
atrol
Site Admin
Posts: 8398
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Days Lapse from Case Open to Case Closed

Post by atrol »

Sorry @froilanserohijos, I don't have time to provide such kind of support.
All I can do is to try to push you in the right direction.
Please use Search before posting and read the Manual
froilanserohijos
Posts: 9
Joined: 17 Oct 2016, 08:06

Re: Days Lapse from Case Open to Case Closed

Post by froilanserohijos »

Hi Atrol;

Good day!

Can just help me where can I find or what Php file involves to display all the cases in the View Issues?

I tried to follow but I am so much confuse already what Php file is the one that will display the issues in View Isuses.

Hoping for your kind help even only on this portion because my next plan is to directly control the Date Submitted and check the Database of Date Close to compute for the Days lapse and display in the Column.

Pls, really hoping for your kind help.
atrol
Site Admin
Posts: 8398
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Days Lapse from Case Open to Case Closed

Post by atrol »

froilanserohijos wrote: Can just help me where can I find or what Php file involves to display all the cases in the View Issues?
I can tell you, but I fear it will not help you that much:
It's function write_bug_rows in file view_all_inc.php
Please use Search before posting and read the Manual
atrol
Site Admin
Posts: 8398
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Days Lapse from Case Open to Case Closed

Post by atrol »

Please use Search before posting and read the Manual
ppatel
Posts: 8
Joined: 12 May 2022, 16:22

Re: Days Lapse from Case Open to Case Closed

Post by ppatel »

Hi Atrol,

I was looking at the time_tracking field from the mantis_bugnote_table in the database that is used in the plugin mentioned above, and I see all the values as '0'.. do you know why this is?
atrol
Site Admin
Posts: 8398
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Days Lapse from Case Open to Case Closed

Post by atrol »

Thats a field which is populated if you have Time Tracking enabled, see https://www.mantisbt.org/docs/master/en ... metracking
Please use Search before posting and read the Manual
Post Reply