diff --git a/html/js/anc_script.js b/html/js/anc_script.js index 001d7f0dd..838861c0e 100644 --- a/html/js/anc_script.js +++ b/html/js/anc_script.js @@ -181,10 +181,10 @@ function verify_ca(div) 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; waiting_box(); removeDiv('search_anc'); var qs="op=openancsearch&gDossier="+p_dossier+"&ctl=searchanc"; + qs+="&c2="+pa_id+"&c1="+p_target; var action=new Ajax.Request ( 'ajax_misc.php', { @@ -213,7 +213,7 @@ function search_ca (p_dossier,p_target,p_source) } function search_anc_form(obj) { - var qs="op=resultancsearch&ctl=searchanc&gDossier="+obj.gDossier; + var qs="op=resultancsearch&ctl=searchanc&"; qs+=obj.serialize(false); waiting_box(); var action=new Ajax.Request ( 'ajax_misc.php', diff --git a/include/ajax_anc_search.php b/include/ajax_anc_search.php index d133e31d6..7913630cb 100644 --- a/include/ajax_anc_search.php +++ b/include/ajax_anc_search.php @@ -37,16 +37,16 @@ require_once ('class_dossier.php'); require_once ('class_anc_account.php'); require_once ('class_anc_plan.php'); require_once('function_javascript.php'); -var_dump($_GET); + echo HtmlInput::title_box("Recherche activité", $ctl); //------------- FORM ---------------------------------- echo '
'; echo ''._('Recherche').':'; -$texte=new IText(); -$texte->value=HtmlInput::default_value('label',"", $_GET); -echo $texte->input('label'); +$texte=new IText('plabel'); +$texte->value=HtmlInput::default_value('plabel',"", $_GET); +echo $texte->input(); echo ''; echo dossier::hidden(); $hid=new IHidden(); @@ -66,9 +66,9 @@ if ( isset($_REQUEST['go'])) $sql="select po_name , po_description from poste_analytique ". "where pa_id=$1 and ". - " upper (po_name) like upper('%'||$2||'%') order by po_name"; - $res=$cn->exec_sql($sql,array($_REQUEST['c2'],$_REQUEST['label'])); - $array=Database::fetch_all($res); + " (po_name ~* $2 or po_description ~* $3) order by po_name"; + $array=$cn->get_array($sql,array($_REQUEST['c2'],$_REQUEST['plabel'],$_REQUEST['plabel'])); + if (empty($array) == true) { echo "Désolé aucun poste trouvé"; @@ -81,9 +81,9 @@ if ( isset($_REQUEST['go'])) echo ''; foreach ($array as $line) { - $button->javascript=sprintf("$('%s').value='%s'", + $button->javascript=sprintf("$('%s').value='%s';removeDiv('%s')", $_REQUEST['c1'], - $line['po_name']); + $line['po_name'],$ctl); echo ''. '
'. $button->input(). diff --git a/include/anc_pa.inc.php b/include/anc_pa.inc.php index 77d5335f4..aaebe076b 100644 --- a/include/anc_pa.inc.php +++ b/include/anc_pa.inc.php @@ -189,7 +189,7 @@ if ( isset($_REQUEST['sa'])) $new->get(); $array=$new->get_poste_analytique(" order by po_name"); $ret.='
'; - $ret.=''; + $ret.='
'; $ret.=""; $ret.="
Nom "; $ret.=" Montant ";