UserList CustomField

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
Mmarouane89
Posts: 49
Joined: 24 Mar 2015, 22:41

UserList CustomField

Post by Mmarouane89 »

Hi,
I want to add a custom field that contains the list of all mantis users, i have added this code in custom_field_api, the users appear normaly in the page but when i select a one user or more i have a message error:
case CUSTOM_FIELD_TYPE_MANTISUSER:
$t_checked_values = explode( '|', $t_custom_field_value );
$p_field_def['possible_values'] = "";
$uquery = "SELECT realname FROM mantis_user_table WHERE enabled = 1 AND realname <> '' ORDER by realname DESC";
$result = db_query($uquery);
$user_count = db_num_rows( $result );
while ($row = db_fetch_array($result)){
echo '<input type="checkbox" name="custom_field_' . $t_id . '[]"';
if( in_array( $row['realname'], $t_checked_values ) ) {
echo ' value="' . $row['realname'] . '" checked>&nbsp;' . $row['realname'] . '&nbsp;&nbsp;';
} else {
echo ' value="' . $row['realname'] . '">&nbsp;' . $row['realname'] . '&nbsp;&nbsp;';
}
}
break ;
}

can you help me ! :(
Attachments
Sans titre1.jpg
Sans titre1.jpg (57.47 KiB) Viewed 5253 times
Sans titre.jpg
Sans titre.jpg (49.42 KiB) Viewed 5253 times
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: UserList CustomField

Post by atrol »

Mmarouane89 wrote:i have added this code in custom_field_api
You should not change any code of MantisBT for it but implement it the documented way
https://www.mantisbt.org/docs/master-1. ... DS.DYNAMIC
Please use Search before posting and read the Manual
Mmarouane89
Posts: 49
Joined: 24 Mar 2015, 22:41

Re: UserList CustomField

Post by Mmarouane89 »

Ok Thanks
Post Reply