From 65dfde935c0dc4a624e77ce195a91541c4be246b Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Mon, 18 Jun 2012 07:56:06 +0000 Subject: [PATCH] 0000630: Action - Gestion : recherche date de rappel : interval --- include/action.common.inc.php | 2 +- include/action.inc.php | 3 ++- include/class_follow_up.php | 14 ++++++++++---- include/template/action_search.php | 8 +++++++- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/include/action.common.inc.php b/include/action.common.inc.php index 72b13a7be..a50caf409 100644 --- a/include/action.common.inc.php +++ b/include/action.common.inc.php @@ -194,7 +194,7 @@ if ($sub_action == "list") Follow_Up::ShowActionList($cn, $base); // Add a button to export to Csv echo '
'; - echo HtmlInput::request_to_hidden(array("remind_date","sag_ref", "remind_date","only_internal", "state", "gDossier", "qcode", "start_date", "end_date", "ag_id", "ag_dest_query", + echo HtmlInput::request_to_hidden(array("remind_date_end","remind_date","sag_ref", "remind_date","only_internal", "state", "gDossier", "qcode", "start_date", "end_date", "ag_id", "ag_dest_query", "tdoc", "see_all", "all_action", "query")); echo HtmlInput::hidden("act", "CSV:ActionGestion"); echo HtmlInput::submit("follow_up_csv", "Export CSV"); diff --git a/include/action.inc.php b/include/action.inc.php index f9a36d8d9..88cbb0e8b 100644 --- a/include/action.inc.php +++ b/include/action.inc.php @@ -23,7 +23,8 @@ */ require_once('class_ipopup.php'); global $g_user; -$retour=HtmlInput::button_anchor(_('Retour liste'),HtmlInput::request_to_string(array("remind_date","sag_ref","only_internal","state","ac","gDossier","qcode","ag_dest_query","query","tdoc","date_start","date_end","see_all","all_action")).'&my_action'); +$retour=HtmlInput::button_anchor(_('Retour liste'), + HtmlInput::request_to_string(array("remind_date_end","remind_date","sag_ref","only_internal","state","ac","gDossier","qcode","ag_dest_query","query","tdoc","date_start","date_end","see_all","all_action")).'&my_action'); //----------------------------------------------------- // Follow_Up //----------------------------------------------------- diff --git a/include/class_follow_up.php b/include/class_follow_up.php index 795b27811..3852b37bc 100644 --- a/include/class_follow_up.php +++ b/include/class_follow_up.php @@ -498,7 +498,7 @@ class Follow_Up /* add the number of item */ $Hid = new IHidden(); $r.=$Hid->input("nb_item", MAX_ARTICLE); - $r.=HtmlInput::request_to_hidden(array("remind_date","sag_ref","only_internal","state","qcode", "ag_dest_query", "query", "tdoc", "date_start", "date_end", "see_all", "all_action")); + $r.=HtmlInput::request_to_hidden(array("remind_date_end","remind_date","sag_ref","only_internal","state","qcode", "ag_dest_query", "query", "tdoc", "date_start", "date_end", "see_all", "all_action")); /* get template */ ob_start(); require_once 'template/detail-action.php'; @@ -671,7 +671,7 @@ class Follow_Up function myList($p_base, $p_filter = "", $p_search = "") { // for the sort - $url = HtmlInput::get_to_string(array("remind_date","sag_ref","only_internal","state","qcode", "ag_dest_query", "query", "tdoc", "date_start", "date_end", "see_all", "all_action")) . '&' . $p_base; + $url = HtmlInput::get_to_string(array("remind_date_end","remind_date","sag_ref","only_internal","state","qcode", "ag_dest_query", "query", "tdoc", "date_start", "date_end", "see_all", "all_action")) . '&' . $p_base; $table = new Sort_Table(); $table->add('Date', $url, 'order by ag_timestamp asc', 'order by ag_timestamp desc', 'da', 'dd'); @@ -743,7 +743,7 @@ class Follow_Up //show the sub_action foreach ($a_row as $row) { - $href = ''; + $href = ''; $i++; $tr = ($i % 2 == 0) ? 'even' : 'odd'; if ($row['ag_priority'] < 2) @@ -1156,6 +1156,8 @@ class Follow_Up $osag_ref->value=(isset($_GET['sag_ref']))?$_GET['sag_ref']:""; $remind_date=new IDate('remind_date'); $remind_date->value=(isset($_GET['remind_date']))?$_GET['remind_date']:""; + $remind_date_end=new IDate('remind_date_end'); + $remind_date_end->value=(isset($_GET['remind_date_end']))?$_GET['remind_date_end']:""; // show the action in require_once 'template/action_search.php'; } @@ -1257,7 +1259,11 @@ class Follow_Up } if ( isset($remind_date) && $remind_date != "" && isDate($remind_date)==$remind_date) { - $query = " and to_char(ag_remind_date,'DD.MM.YYYY')= '".sql_string($remind_date)."'"; + $query .= " and to_date('".sql_string($remind_date)."','DD.MM.YYYY')<= ag_remind_date"; + } + if ( isset($remind_date_end) && $remind_date_end != "" && isDate($remind_date_end)==$remind_date_end) + { + $query .= " and to_date('".sql_string($remind_date_end)."','DD.MM.YYYY')>= ag_remind_date"; } return $query . $str; } diff --git a/include/template/action_search.php b/include/template/action_search.php index 89b4621c1..f208b5e16 100644 --- a/include/template/action_search.php +++ b/include/template/action_search.php @@ -48,11 +48,17 @@ - + + + + +
Date de rappel Date de rappel après input();?>
Date de rappel avant + input();?> +
Référence input();?>