Page 1 of 1

Adding due date feature in mantis

Posted: 28 Sep 2012, 09:49
by namhung1986
Hi,

I would like to add due_date field to the issue table and also want to display it in all output screens:
View Issues page
Print Issues page
Issue View Advanced page
Issue Update Advanced page
CSV export
Excel export
Word export

I am using mantis 1.1.8.
Thank you in advance for your help buddies!

Re: Adding due date feature in mantis

Posted: 28 Sep 2012, 11:46
by cas
you better upgrade to the latest version (1.2.11) where this field is standard available :mrgreen:

Re: Adding due date feature in mantis

Posted: 01 Oct 2012, 02:06
by namhung1986
Thanks Cas!

However, our company headquarter is using Mantis 1.1.8 with a lot customization. I am afraid that we will lost all of them when we upgrade to 1.2.11.
Do you have any plugin or way to change code to add due date feature?
Thank you in advance! Any help would be appreciated!

Re: Adding due date feature in mantis

Posted: 01 Oct 2012, 06:24
by cas
In that case you face some customization.
First of all check if you can work with using a custom field (not sure what options are there in 1.1.8).
If not, you indeed need to add the field to the mantis_bug_table and cistomize the other scripts.
Having said the above, as of version 1.2.x Mantis comes with a powerfull plugin mechanism.
We were in the same position as you, a lot of changes made.
We decided to move to the latest version and transformed most of our changes (95%) into plugins.
Some were available, a few were made.
Now we have an almost standard system which in the end is the only way to go :mrgreen:

Re: Adding due date feature in mantis

Posted: 08 Oct 2012, 06:17
by namhung1986
Hi cas,

I almost do it. I added a custom field in Manage Custom Field named Due Date and can display it in (bug_update_advanced_page.php) and also in (bug_update_page.php), then can save.

However, when I try to display Due Date in View_all_bug_page.php, it just shows the value like 1354752000.
I did adjust the query in filter_api.php and add 2 custom functions in columns_api.php:

#print column title for Custom_Due Date- Hung Tran
function print_column_title_value( $p_sort, $p_dir, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {

if ( $p_columns_target != COLUMNS_TARGET_CSV_PAGE ) {
echo '<td>';
print_view_bug_sort_link( lang_get( 'due_date' ), 'value', $p_sort, $p_dir, $p_columns_target );
print_sort_icon( $p_dir, $p_sort, 'value' );
echo '</td>';
} else {
echo lang_get( 'due_date' );
}
}

#print column Custom_Due Date- Hung Tran
function print_column_value( $p_row, $p_columns_target = COLUMNS_TARGET_VIEW_PAGE ) {

echo '<td>';
echo $p_row['value'];
echo '</td>';
}

but it didn't work. Please help me!

Image

Uploaded with ImageShack.us

PS: I get Due Date from 'value' column in mantis_custom_field_string_table, is it right?

Re: Adding due date feature in mantis

Posted: 10 Oct 2012, 03:40
by namhung1986
I made it. In addition, if anyone wants to discover how to adding due date feature in mantis, you can contact me at my skype valentineday_vnn2004.
Thank you for your help!