Hi.
I set this custom query in appgini lookup field advanced settings:
-----------my advanced setting ---------------
SELECT `appuntamenti`.`pri_key`, IF(CHAR_LENGTH(if(`appuntamenti`.`data_appuntamento`,date_format(`appuntamenti`.`data_appuntamento`,'%d/%m/%Y'),'')) || CHAR_LENGTH(`appuntamenti`.`titolo`), CONCAT_WS('', if(`appuntamenti`.`data_appuntamento`,date_format(`appuntamenti`.`data_appuntamento`,'%d/%m/%Y'),''), ': ', `appuntamenti`.`titolo`), '') FROM `appuntamenti` LEFT JOIN `azioni_progetto` as azioni_progetto1 ON `azioni_progetto1`.`prikey`=`appuntamenti`.`azione_di_progetto` LEFT JOIN `schede_tratt_dati` as schede_tratt_dati1 ON `schede_tratt_dati1`.`pri_key`=`appuntamenti`.`nome_sch_inf_tratt_dati` WHERE `appuntamenti`.`accesso_op_enti_partner` = '1' AND `appuntamenti`.`attivo`= '1' ORDER BY `data_appuntamento` DESC
---------end of advance setting----------------
I need to apply the specific clause `appuntamenti`.`attivo` = '1' only if user-groups is not Admins or Superuser.
Any help please?
Thank you!
Fabiano
apply a custom quey in lookup field only if groups is not admin or superuser
Re: apply a custom quey in lookup field only if groups is not admin or superuser
Hi,
just from memory:
The query is saved in some file (just search all files for part of your querystring) and exists in a JS variable. You might be able to overwrite this variable in the /hooks/tablename-php _init function according to your needs. Just check in the init for the usergroup and set the variable accordingly.
Olaf
just from memory:
The query is saved in some file (just search all files for part of your querystring) and exists in a JS variable. You might be able to overwrite this variable in the /hooks/tablename-php _init function according to your needs. Just check in the init for the usergroup and set the variable accordingly.
Olaf
Some postings I was involved, you might find useful:
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
SingleEdit - Prevent concurrent edits on records; Field Permissions; Column-Value-Based-Permissions; Custom (error) message; Audit Log; Backup your database; Two Factor Authentication; Block brute force (failed) logins; Add 2nd SAVE CHANGES button; Place a search on details view
Re: apply a custom quey in lookup field only if groups is not admin or superuser
Thanks for the reply. I'm sorry but I can't understand what I can do.
Can't change the custom query in appgini to get my purpose?
Thanks and sorry for my incompetence!
Can't change the custom query in appgini to get my purpose?
Thanks and sorry for my incompetence!
Re: apply a custom quey in lookup field only if groups is not admin or superuser
Hi,
AppGini does not support that feature out of the box right now. And for your specific case I guess it will take some time if at all this will be supported.
AppGini does not support that feature out of the box right now. And for your specific case I guess it will take some time if at all this will be supported.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: apply a custom quey in lookup field only if groups is not admin or superuser
Hi,
Why don’t you try the following strategy:
Create 2 lookup fields. In the first one place the original SQL you posted and in the second one place the SQL with the additional `appuntamenti`.`attivo` = '1' .
Now you can add in footer-extras.php a php code that checks for session variable of the user group and inside it a JS script that hides one or the other field if a certain user group is presented.
Why don’t you try the following strategy:
Create 2 lookup fields. In the first one place the original SQL you posted and in the second one place the SQL with the additional `appuntamenti`.`attivo` = '1' .
Now you can add in footer-extras.php a php code that checks for session variable of the user group and inside it a JS script that hides one or the other field if a certain user group is presented.