Mantis

How to use HelpLink on custom field (solution)

Posted by abdaizs 
How to use HelpLink on custom field (solution)
June 12, 2009 11:08AM
Hi All,

As I posted before, I want to share with All, how to use HelpLink, on custom fields.

First, you must create a new text typed field, named: helperstring in mantis_custom_field_table.

And you must change the following php with theese option:

custom_field_api.php

NEW FUNCTION:

function custom_field_helpstring_read( $p_field_id ) {


$c_field_id = db_prepare_int( $p_field_id );
$t_custom_field_table = config_get( 'mantis_custom_field_table' );

$query = "SELECT helperstring
FROM $t_custom_field_table
WHERE id='$c_field_id'";

$result = db_query( $query );

$row = db_result( $result );


if ( $row != null && $row > " ") {
plugins_helplink_print_link ( "<h3>".lang_get( &#039;custom_field_help_display&#039; )."</h3><br>".$row, 350, 250) ;
}
}

bug_report_page.php

After this string: <?php echo string_display( lang_get_defaulted( $t_def[&#039;name&#039;] ) ) ?>

Insert this: <?php custom_field_helpstring_read ($t_id); ?>


mantis_custom_field_update.php
Define a new value!
$t_values[&#039;helperstring&#039;] = gpc_get_string( &#039;helperstring&#039; );


mantis_custom_field_edit_page.php

<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get( &#039;custom_field_helperstring&#039; ) ?>
</td>
<td>

<textarea name="helperstring" cols="80" rows="10"><?php echo $t_definition[&#039;helperstring&#039;] ?></textarea>
</td>
</tr>


And last, you must define in your language file the new help string values:

strings_[language].txt

$s_custom_field_helperstring = &#039;Help text&#039;;
$s_custom_field_help_display = &#039;What does it mean?&#039;;


WELL, DONE! smiling smiley



Edited 1 time(s). Last edit at 06/12/2009 01:01PM by abdaizs.
Sorry, only registered users may post in this forum.

Click here to login



Online Users

Guests: 3
Record Number of Users: 1 on April 02, 2023
Record Number of Guests: 115 on November 09, 2023
Top Users
Hébergeur : Morinie.Fr