Page 1 of 1

Days Lapse from Case Open to Case Closed

Posted: 28 Aug 2017, 07:14
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.

Re: Days Lapse from Case Open to Case Closed

Posted: 29 Aug 2017, 05:57
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')

Re: Days Lapse from Case Open to Case Closed

Posted: 31 Aug 2017, 02:43
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.

Re: Days Lapse from Case Open to Case Closed

Posted: 01 Sep 2017, 21:38
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

Re: Days Lapse from Case Open to Case Closed

Posted: 05 Sep 2017, 06:40
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.

Re: Days Lapse from Case Open to Case Closed

Posted: 06 Sep 2017, 06:27
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.

Re: Days Lapse from Case Open to Case Closed

Posted: 07 Sep 2017, 02:50
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.

Re: Days Lapse from Case Open to Case Closed

Posted: 08 Sep 2017, 06:01
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

Re: Days Lapse from Case Open to Case Closed

Posted: 13 Sep 2017, 18:16
by atrol

Re: Days Lapse from Case Open to Case Closed

Posted: 19 Oct 2022, 16:58
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?

Re: Days Lapse from Case Open to Case Closed

Posted: 20 Oct 2022, 18:12
by atrol
Thats a field which is populated if you have Time Tracking enabled, see https://www.mantisbt.org/docs/master/en ... metracking