Hello,
I try to use “beforeFilter” event to customize my filter.
I use:
"
$gridConn->set_options(“study.StudyDate”,array(“Ce jour”=>1,“Cette semaine”=>2,“Ce mois”=>3));
"
and my function:
"
function doBeforeFilter($filter_by){
//vairables d�finie en ent�te de fichier php
$ind = $filter_by->index(“study.StudyDate”);
if ($ind!==false){
if($filter_by->rules[$ind][“value”] == “Ce jour”) {
$date = date(“Ymd”);
$filter_by->rules[$ind][“value”] = $date;
$filter_by->rules[$ind][“operation”] = “>”;
print_r($date);
}
}
}
"
My problem is the final query is
SELECT … WHERE study.StudyDate LIKE ‘%Ce jour%’.
I put some log in your base_connector.php file:
function: render()
"
LogMaster::log("---------filter before: “,$this->request->get_filters());
$this->event->trigger(“beforeFilter”,new FilterInterface($this->request));
LogMaster::log(”---------filter before: ",$this->request->get_filters());
"
I get my message “print_r($date);” with the right date but in your log file “some.txt”
the filter before and after is the same.
"
…
4 =>
name => study.StudyDate
value => Ce jour
operation =>
5 =>
…
"
Any suggestion,
regards
Answer was sent by email