Hello,
I would 'like to customize the submit button per project. I mean the text for the button will be different if i choose a project.
How can I do this?
Thanks.
Submit button customization
Moderators: Developer, Contributor
Re: Submit button customization
All strings can be customized, see https://mantisbt.org/docs/master/en-US/ ... ze.strings
The note below https://mantisbt.org/docs/master/en-US/ ... ngs.format
shows an example of how to change the Summary string based on a project.
Out of interest, as this feature request looks a bit strange to me: Isn't it confusing for users to see different buttons for the same action for differnt projects?
The note below https://mantisbt.org/docs/master/en-US/ ... ngs.format
shows an example of how to change the Summary string based on a project.
Out of interest, as this feature request looks a bit strange to me: Isn't it confusing for users to see different buttons for the same action for differnt projects?
Re: Submit button customization
Hi,
It is not strange, users are informed.
In fact, i have added new status beginning by the status "draft" instead of "new". But for some projects, the first status is "new". That's why i have to differentiate the "$s_submit_report_button". For some project it has the value "create the draft" for others it has the value "submit ...".
So i tried this code :
$t_cookie_name = config_get_global( 'project_cookie' );
if ( $_COOKIE[$t_cookie_name] ){
$t_project_id = $_COOKIE[$t_cookie_name];
//if ($t_project_id === '11'){
if ($t_project_id === '7'){
$s_submit_report_button = 'Submit new ticket';
}else{
$s_submit_report_button = 'Create the draft';
}
}
It works af en toe. When there is no cookie, it takes the value from mantisbt/lang/english.txt, that is "Submit Issue". Notice that we are not using Issue but Ticket.
When i use the fucntion : helper_get_current_project(), the mantis server is no longer accessible. the error is :
"This page is not available at the moment. The server cannot currently process this request."
Any idea?
It is not strange, users are informed.
In fact, i have added new status beginning by the status "draft" instead of "new". But for some projects, the first status is "new". That's why i have to differentiate the "$s_submit_report_button". For some project it has the value "create the draft" for others it has the value "submit ...".
So i tried this code :
$t_cookie_name = config_get_global( 'project_cookie' );
if ( $_COOKIE[$t_cookie_name] ){
$t_project_id = $_COOKIE[$t_cookie_name];
//if ($t_project_id === '11'){
if ($t_project_id === '7'){
$s_submit_report_button = 'Submit new ticket';
}else{
$s_submit_report_button = 'Create the draft';
}
}
It works af en toe. When there is no cookie, it takes the value from mantisbt/lang/english.txt, that is "Submit Issue". Notice that we are not using Issue but Ticket.
When i use the fucntion : helper_get_current_project(), the mantis server is no longer accessible. the error is :
"This page is not available at the moment. The server cannot currently process this request."
Any idea?
Re: Submit button customization
Please, any help for these problem?
I've tried using the following in custom_strings_inc.php
if( db_is_connected() ) {
if( helper_get_current_project() == 7 ) {
$s_summary = 'Title';
}
but the fact of calling "helper_get_current_project()" crashes Mantis.
Is there something I must do before calling this function?
In which sequence does Mantis load the different files or/en pages?
Thanks
I've tried using the following in custom_strings_inc.php
if( db_is_connected() ) {
if( helper_get_current_project() == 7 ) {
$s_summary = 'Title';
}
but the fact of calling "helper_get_current_project()" crashes Mantis.
Is there something I must do before calling this function?
In which sequence does Mantis load the different files or/en pages?
Thanks
Re: Submit button customization
Try
Code: Select all
if( auth_is_user_authenticated() ) {
if( helper_get_current_project() == 7 ) {
$s_summary = 'Title';
}
}
Re: Submit button customization
Thank you very much, that works fine.
Re: Submit button customization
Documentation will be fixed in next verssion, see https://mantisbt.org/bugs/view.php?id=35646