From c2c7fa2ed34beb2efbf7981002ad94cdc03cd065 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Fri, 18 Nov 2011 09:50:18 +0000 Subject: [PATCH] #168 recherche imp. analytique anc --- html/ajax_misc.php | 3 +++ html/js/anc_script.js | 31 ++++++++++++++++++++++++++++--- include/ajax_anc_search.php | 9 ++------- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/html/ajax_misc.php b/html/ajax_misc.php index 3fc2d5db7..6337fa401 100644 --- a/html/ajax_misc.php +++ b/html/ajax_misc.php @@ -530,4 +530,7 @@ EOF; case 'up_pay_method': require_once 'ajax_update_payment.php'; break; + case 'openancsearch': + require_once('ajax_anc_search.php'); + break; } \ No newline at end of file diff --git a/html/js/anc_script.js b/html/js/anc_script.js index 6d8b480f1..318aa4c49 100644 --- a/html/js/anc_script.js +++ b/html/js/anc_script.js @@ -182,10 +182,35 @@ function search_ca (p_dossier,p_target,p_source) { var pa_id=g(p_source).value; var url="gDossier="+p_dossier+"&c1="+p_target+"&c2="+pa_id; - var a=window.open("search_ca.php"+url,"CA recherche",'statusbar=no,scrollbars=yes,toolbar=no'); - a.focus(); -} + waiting_box(); + removeDiv('search_anc'); + var qs="op=openancsearch&gDossier="+p_dossier+"&ctl=searchanc"; + var action=new Ajax.Request ( 'ajax_misc.php', + { + method:'get', + parameters:qs, + onFailure:null, + onSuccess:function(req){ + try{ + remove_waiting_box(); + var pos=fixed_position(250,150)+";width:30%"; + add_div({ + id:"searchanc", + drag:1, + cssclass:"inner_box", + style:pos + }); + $('searchanc').innerHTML=req.responseText; + + } catch(e){ + alert(e.message); + } + } + } + ); + +} function caod_checkTotal() { var ie4=false; diff --git a/include/ajax_anc_search.php b/include/ajax_anc_search.php index fb652834d..8829e5004 100644 --- a/include/ajax_anc_search.php +++ b/include/ajax_anc_search.php @@ -38,13 +38,8 @@ require_once ('class_anc_account.php'); require_once ('class_anc_plan.php'); require_once('function_javascript.php'); -/*!\todo add security here : check user and access to CA - */ - -html_page_start(); -load_all_script(); //------------- FORM ---------------------------------- -echo '
'; +echo ''; $texte=new IText(); echo ''._('Recherche').':'; echo $texte->input('label'); @@ -59,7 +54,7 @@ echo ''; //------------- FORM ---------------------------------- if ( isset($_REQUEST['go'])) { - $cn=new Database(dossier::id()); + $cn=Dossier::connect(); $plan=new Anc_Plan($cn,$_REQUEST['c2']); $plan->pa_id=$_REQUEST['c2']; if ( $plan->exist()==false)