fieldtype_users in comments

Put your suggestions here.
Post Reply
rbulati
Posts: 6
Joined: 03 Mar 2015, 20:18

fieldtype_users in comments

Post by rbulati »

Hello,

I need to be able to add the field type fieldtype_users in "Fields in Comments Form"
on page Comments Form Configuration (index.php?module=entities/comments_form). But looking at the code, this type of field, is not included in select SQL query, so i can't add it.

I tried to add it to the SQL in code but when i create a new comment in a task, with this field, i get some errors because the functionality needs more adjustments.
rbulati
Posts: 6
Joined: 03 Mar 2015, 20:18

Re: fieldtype_users in comments

Post by rbulati »

I coded this to solve my problem temporarily.

With this you can change assigned users using comments, thus maintaining the historical.

Please support, don't need to be with this code but add this functionality on next version.

if someone need...

Add 'fieldtype_users' on the SQL of line 15 and 33 in modules/entities/views/comments_form.php
--------------------------------------------------------------------------------------------------------------------
Near line 29 of modules/items/views/comments_form.php change the code to this:

$object = $v['type'] === 'fieldtype_users' ? db_find('app_entity_' . $current_entity_id, array_pop(explode('-', $_GET['path'])))['field_'.$v['id']] : '';

$html .='
<div class="form-group">
<label class="col-md-3 control-label" for="fields_' . $v['id'] . '">' . fields_types::get_option($v['type'],'name',$v['name']) . '</label>
<div class="col-md-9">
' . fields_types::render($v['type'],$v,array('field_' . $v['id']=>$object),array('parent_entity_item_id'=>$parent_entity_item_id,'form'=>'comment')) . '
' . tooltip_text($v['tooltip']) . '
</div>
</div>
';
--------------------------------------------------------------------------------------------------------------------
Add 'users_cache'=>users::get_cache() on output_options array in line 59 of modules/items/actions/comments_listing.php

Post Reply