Is there a way to give different aliases for the same fields, based on project.
My requirement is to have different projects with different set of fields, and I know I can use custom fields for this, and then hide the unwanted fields by using the bug_report_page_fields configuration option.
But there are few primary fields, such as 'summary' and 'description' which cannot be hidden using the above mentioned option. So I'm wondering if there's a way for me to at least rename them.
For example, say I have two projects, one BUG TRACKER, and another named KNOWLEDGEBASE.
I want the summary field to be named:
'Alarm' in BUG TRACKER
'Item' in KNOWLEDGEBASE
Is this possible?
I know I can change the aliases from lang/strings_english.txt file by setting '$s_summary = 'Alarm' etc, but that is a global change and is inherited by all projects.
Different Field Name Aliases per Project?
Moderators: Developer, Contributor
Re: Different Field Name Aliases per Project?
No, is not available as far as I know.
What you could do, is use 2 instances of mantis, each having dedicated titles for those fields.
You could arrange access to both instances via a simple portal page
What you could do, is use 2 instances of mantis, each having dedicated titles for those fields.
You could arrange access to both instances via a simple portal page
-
- Posts: 20
- Joined: 07 Mar 2019, 20:59
Re: Different Field Name Aliases per Project?
That's a bummer.
Well what you could is possible I guess, but would have been so much nicer if we had this feature.
Well what you could is possible I guess, but would have been so much nicer if we had this feature.
-
- Posts: 22
- Joined: 07 Feb 2019, 11:44
Re: Different Field Name Aliases per Project?
Hi I am looking for exactly the same feature as sachintha81, to rename Description in different in a project.
Alternativ solution: How can I hide Description, and make it "NOT Required", and make a Searchable "Custom Field"?
Alternativ solution: How can I hide Description, and make it "NOT Required", and make a Searchable "Custom Field"?
Re: Different Field Name Aliases per Project?
You can do this writing some code in core/custom_strings_inc.php
So first is to check if the correct function is available
Then retrieve the project_id
Next check if this is the correct project
If so, provide the correct name.
Of course you also can use the switch statement in case you need changes for multiple project.
The correct screen field names you can find in the corresponding language text file.
Code: Select all
if (function_exists('helper_get_current_project')) {
$t_current_project = helper_get_current_project();
if ($t_current_project === 11){
$s_summary = 'BullshitStory';
}
}
Then retrieve the project_id
Next check if this is the correct project
If so, provide the correct name.
Of course you also can use the switch statement in case you need changes for multiple project.
The correct screen field names you can find in the corresponding language text file.
Re: Different Field Name Aliases per Project?
I have version 2.24.4 and I don't have such a file. Is it necessary to create a new file?
cas wrote: ↑16 Feb 2022, 13:01 You can do this writing some code in core/custom_strings_inc.php
So first is to check if the correct function is availableCode: Select all
if (function_exists('helper_get_current_project')) { $t_current_project = helper_get_current_project(); if ($t_current_project === 11){ $s_summary = 'BullshitStory'; } }
Then retrieve the project_id
Next check if this is the correct project
If so, provide the correct name.
Of course you also can use the switch statement in case you need changes for multiple project.
The correct screen field names you can find in the corresponding language text file.
Re: Different Field Name Aliases per Project?
sorry, you need to create the file in the config directory if it does not exists.
Also reviewed the code, which needs to be:
So first is to retrieve the project_id
Next check if this is the correct project
If so, provide the correct name.
Of course you also can use the switch statement in case you need changes for multiple project.
The correct screen field names you can find in the corresponding language text file.
Also reviewed the code, which needs to be:
Code: Select all
$t_cookie_name = config_get_global( 'project_cookie' );
$t_project_id = $_COOKIE[$t_cookie_name];
if ($t_project_id === '11'){
$s_summary = 'BullshitStory';
}
Next check if this is the correct project
If so, provide the correct name.
Of course you also can use the switch statement in case you need changes for multiple project.
The correct screen field names you can find in the corresponding language text file.