Days Lapse from Case Open to Case Closed

General discussion of Mantis.

Moderators: Contributor, Developer

Days Lapse from Case Open to Case Closed

Postby froilanserohijos » Aug 28, 2017 2:14 am

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.
froilanserohijos
 
Posts: 8
Joined: Oct 17, 2016 3:06 am

Re: Days Lapse from Case Open to Case Closed

Postby atrol » Aug 29, 2017 12:57 am

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
Use Mantis2Go to try MantisBT on Windows or to reproduce issues
atrol
Site Admin
 
Posts: 6691
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: Days Lapse from Case Open to Case Closed

Postby froilanserohijos » Aug 30, 2017 9:43 pm

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.
froilanserohijos
 
Posts: 8
Joined: Oct 17, 2016 3:06 am

Re: Days Lapse from Case Open to Case Closed

Postby atrol » Sep 01, 2017 4:38 pm

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
Use Mantis2Go to try MantisBT on Windows or to reproduce issues
atrol
Site Admin
 
Posts: 6691
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: Days Lapse from Case Open to Case Closed

Postby froilanserohijos » Sep 05, 2017 1:40 am

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.
froilanserohijos
 
Posts: 8
Joined: Oct 17, 2016 3:06 am

Re: Days Lapse from Case Open to Case Closed

Postby atrol » Sep 06, 2017 1:27 am

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
Use Mantis2Go to try MantisBT on Windows or to reproduce issues
atrol
Site Admin
 
Posts: 6691
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: Days Lapse from Case Open to Case Closed

Postby froilanserohijos » Sep 06, 2017 9:50 pm

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.
froilanserohijos
 
Posts: 8
Joined: Oct 17, 2016 3:06 am

Re: Days Lapse from Case Open to Case Closed

Postby atrol » Sep 08, 2017 1:01 am

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
Use Mantis2Go to try MantisBT on Windows or to reproduce issues
atrol
Site Admin
 
Posts: 6691
Joined: Mar 26, 2008 4:37 pm
Location: Germany

Re: Days Lapse from Case Open to Case Closed

Postby atrol » Sep 13, 2017 1:16 pm

Please use Search before posting and read the Manual
Use Mantis2Go to try MantisBT on Windows or to reproduce issues
atrol
Site Admin
 
Posts: 6691
Joined: Mar 26, 2008 4:37 pm
Location: Germany


Return to General Discussion

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 15 guests