This topic is locked
[SOLVED]

 Add an extra field to where clause

7/2/2019 4:02:44 PM
Calendar Template general questions
M
marcelorribas author

Hi,
I´m trying to use the Calendar template to display information of different groups. I have created a new field on Calcalendar table and I´m recording the group id on it. Now I would like to filter the events of wich group, but I can´t find the right place or method to do it.

I´ve tried do put this field on SQL query (using session variable ), on "After table initialized" event, but not of then works.
Thanks in advance for any tips,
Marcelo

M
marcelorribas author 7/3/2019



Hi,
I´m trying to use the Calendar template to display information of different groups. I have created a new field on Calcalendar table and I´m recording the group id on it. Now I would like to filter the events of wich group, but I can´t find the right place or method to do it.

I´ve tried do put this field on SQL query (using session variable ), on "After table initialized" event, but not of then works.
Thanks in advance for any tips,
Marcelo


Hi guys,

I receveid this tip from admin:
In event calcalendar -> list page -> before sql query add code similar to this one:

$_SESSION["strWhereClause"] = "DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= DateField";
Worked perfectly.
Thanks Sergey.