tiagovareta
Member
Hi,
I have a table / list where users can create records! In list view, each user only sees the records that he created: http://prntscr.com/i19qy8
In a form (other than this list) I have a DropDown / DataBaseJoin field, to select one of these records, which should have the option to select only the records that the respective user created.
To do this filter I have a field in the form: id_user_logado_sms_ind, which is hidden to go select the "id" of the logged in user, with the code:
$id_user = JFactory::getUser()->get('id');
$db = FabrikWorker::getDbo();
$queryidassessor = "SELECT id FROM tb_contactos_geral WHERE id_login_ctg = '$id_user'";
$db->setQuery($queryidassessor);
$id_assessor = $db->loadResult();
return $id_assessor;
And fill the field well with the "id", which I intend to: http://prntscr.com/i19up1
The issue is that the DropDown / DataBaseJoin field does not load user records.
In the field I have:
- http://prntscr.com/i19vgn
- http://prntscr.com/i19vq6
In the WHERE code, I have: {thistable}.id_assessor_sms_pred = '{id_user_logado_sms_ind}', but it does not work!
If I put: {thistable}.id_assessor_sms_pred = 2 , already works! However the value of the field: id_user_logado_sms_ind, can be 2 that it does not assume.
How can I resolve this situation?
I have a table / list where users can create records! In list view, each user only sees the records that he created: http://prntscr.com/i19qy8
In a form (other than this list) I have a DropDown / DataBaseJoin field, to select one of these records, which should have the option to select only the records that the respective user created.
To do this filter I have a field in the form: id_user_logado_sms_ind, which is hidden to go select the "id" of the logged in user, with the code:
$id_user = JFactory::getUser()->get('id');
$db = FabrikWorker::getDbo();
$queryidassessor = "SELECT id FROM tb_contactos_geral WHERE id_login_ctg = '$id_user'";
$db->setQuery($queryidassessor);
$id_assessor = $db->loadResult();
return $id_assessor;
And fill the field well with the "id", which I intend to: http://prntscr.com/i19up1
The issue is that the DropDown / DataBaseJoin field does not load user records.
In the field I have:
- http://prntscr.com/i19vgn
- http://prntscr.com/i19vq6
In the WHERE code, I have: {thistable}.id_assessor_sms_pred = '{id_user_logado_sms_ind}', but it does not work!
If I put: {thistable}.id_assessor_sms_pred = 2 , already works! However the value of the field: id_user_logado_sms_ind, can be 2 that it does not assume.
How can I resolve this situation?