From 80a8af8e160adf9a60e122994d447ef21d2154d4 Mon Sep 17 00:00:00 2001 From: diego Date: Mon, 26 Sep 2022 17:12:53 -0300 Subject: [PATCH] add option in advaced reports to filter terms 'Modified on or after'#78 --- common/include/fun.html_forms.php | 34 +++++++++++++++++++++++-------- common/include/fun.sql.php | 12 ++++++----- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/common/include/fun.html_forms.php b/common/include/fun.html_forms.php index 3fd3e8cc..e69f4187 100644 --- a/common/include/fun.html_forms.php +++ b/common/include/fun.html_forms.php @@ -728,6 +728,10 @@ function HTMLformAdvancedTermReport($array) $LABEL_equalThisWord=LABEL_equalThisWord; $arrayVocabStats=ARRAYresumen($_SESSION["id_tesa"], "G", ""); + $array_mes=do_intervalDate("1", "12", FORM_LABEL_FechaMes); + + $array_ano=do_intervalDate(date('Y', strtotime($_SESSION["CFGCreacion"])), date("Y"), FORM_LABEL_FechaAno); + $arrayWS=array("t#$LABEL_Termino"); if ($arrayVocabStats["cant_up"]>0) { array_push($arrayWS, "uf#$LABEL_esNoPreferido"); @@ -811,7 +815,7 @@ function HTMLformAdvancedTermReport($array)
'; @@ -822,8 +826,22 @@ function HTMLformAdvancedTermReport($array)
+ '.doSelectForm(array('create#'.ucfirst(LABEL_DesdeFecha),'mod#'.ucfirst(LABEL_fecha_modificacion)), "").'
+
+ +
+
+ +
'; //target vocabularies if ($arrayVocabStats["cant_term2tterm"]) { @@ -833,12 +851,12 @@ function HTMLformAdvancedTermReport($array)
'; @@ -850,12 +868,12 @@ function HTMLformAdvancedTermReport($array)
'; @@ -873,7 +891,7 @@ function HTMLformAdvancedTermReport($array)
'; @@ -883,7 +901,7 @@ function HTMLformAdvancedTermReport($array)
diff --git a/common/include/fun.sql.php b/common/include/fun.sql.php index 11f8a624..c53c5f68 100644 --- a/common/include/fun.sql.php +++ b/common/include/fun.sql.php @@ -2596,13 +2596,15 @@ function SQLadvancedTermReport($array) // time filter // sanitice - $arrayDates=explode("-", $array["fromDate"]); - $yearDate=secure_data($arrayDates[0], "int"); - $monthDate=secure_data($arrayDates[1], "int"); + $yearDate=secure_data($array["fromDateYear"], "int"); + $monthDate=secure_data($array["fromDateMonth"], "int"); + + if (in_array($array["fromDate"], array("create","mod"))) { + + $tag_date= ($array["fromDate"]=='create') ? 't.cuando' : 't.cuando_final'; - if (($yearDate>0) && ($monthDate>0)) { $fromDate=$yearDate.'-'.$monthDate.'-01'; - $where.=" and (t.cuando between '$fromDate' and now())"; + $where.=" and ($tag_date between '$fromDate' and now())"; } // time update filter // and (cuando_final between '2010-05-19' and now())