Custom Field - textarea

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
JT

Custom Field - textarea

Post by JT »

how can I add an textarea custom field? I added a custom field but it shows up on the report as a regular text field only. I want to change this to a textarea field.

Thanks in advance,
JT
Mr.J!M
Posts: 21
Joined: 11 Dec 2006, 17:43

Post by Mr.J!M »

same request :)
runner80
Posts: 13
Joined: 23 Jan 2007, 10:29
Location: Dortmund, Germany

Textarea

Post by runner80 »

Hi,

in constant_inc.php you should add a line like
define( 'CUSTOM_FIELD_TYPE_TEXTAREA', 9 ); in section "# Custom Field types"

Next in strings_english.txt you find a line for the custom field strings. You should edit it this way:
$s_custom_field_type_enum_string = '0:String,1:Numeric,2:Float,3:Enumeration,4:Email,5:Checkbox,6:List,7:Multiselection list,8:Date,9:Textarea';

The same in config_defaults_inc.php. Find "$g_custom_field_type_enum_string" and set the value to
= '0:string,1:numeric,2:float,3:enum,4:email,5:checkbox,6:list,7:multiselection list,8:date,9:textarea';

In custom_field_api.php in function print_custom_field_input add
case CUSTOM_FIELD_TYPE_TEXTAREA:
echo '<textarea cols="80" rows="10" name="custom_field_' . $t_id . '" wrap="virtual"';
if( 0 < $p_field_def['length_max'] ) {
echo ' maxlength="' . $p_field_def['length_max'] . '"';
} else {
echo ' maxlength="255"';
}
echo '>' . $t_custom_field_value .'</textarea>';
break ;


before the last "case" inside this function.

These modifications worked for me. Hope this suits your needs!

Regards
Patrick
Mr.J!M
Posts: 21
Joined: 11 Dec 2006, 17:43

Post by Mr.J!M »

Thanks a lot i will test asap @ work!

THANKS for your help
charsy
Posts: 4
Joined: 23 Mar 2010, 09:49

Re: Custom Field - textarea

Post by charsy »

I have tried it with version 1.2, but does not work,
you could add a custom field textarea to version 1.2?
jmonin
Posts: 1
Joined: 22 Oct 2010, 08:37

Re: Custom Field - textarea

Post by jmonin »

For your information, I've shared a backport of the Mantis 1.3.x implementation of this feature for Mantis 1.2.3. The file is attached to the issue [issue]6626[/issue]
atrol
Site Admin
Posts: 8402
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Custom Field - textarea

Post by atrol »

Maybe a good decision, who knows when 1.3 will be out.
I didn't have a closer look. I hope there will be no conflict when updating 1.2.3 with your patch applied to 1.2.x or 1.3.0 because there where already database schema changes in 1.3
The upgrade procedure might get problems with database version in config table.
Please use Search before posting and read the Manual
Post Reply