Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 function set_poste_parent(p_ctl,p_value)
00028 {
00029 var f=g(p_ctl);
00030 f.value+='['+p_value+']';
00031 }
00032
00033 function set_jrn_parent(p_ctl,p_value)
00034 {
00035 var f=g(p_ctl);
00036 if ( f )
00037 {
00038 if ( trim(f.value)!="") f.value+=' ';
00039 f.value+=p_value;
00040 }
00041 }
00042
00043
00044 function PcmnUpdate(p_value,p_lib,p_parent,p_type,p_dossier)
00045 {
00046 $('p_valu').value=p_value;
00047 $('p_oldu').value=p_value;
00048 $('p_libu').value=p_lib;
00049 $('p_parentu').value=p_parent;
00050 $('p_typeu').value=p_type;
00051 $('acc_update').style.top=posY+offsetY+"px";
00052 $('acc_update').style.left=posX+offsetX+"px";
00053 $('acc_update').show();
00054 }
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 function search_poste(obj)
00067 {
00068 var sx=0;
00069 if ( window.scrollY)
00070 {
00071 sx=window.scrollY+40;
00072 }
00073 else
00074 {
00075 sx=document.body.scrollTop+60;
00076 }
00077
00078 var div_style="top:"+sx+"px";
00079 removeDiv('search_account');
00080 add_div({id:'search_account',cssclass:'inner_box',html:loading(),style:div_style,drag:true});
00081
00082 var dossier=$('gDossier').value;
00083
00084 var queryString="gDossier="+dossier;
00085
00086 queryString+="&op=sf";
00087 try
00088 {
00089 if ( obj.jrn)
00090 {
00091 queryString+="&j="+obj.jrn;
00092 }
00093 if ( obj.account)
00094 {
00095 queryString+="&c="+obj.account;
00096 }
00097 if ( obj.label)
00098 {
00099 queryString+="&l="+obj.label;
00100 }
00101 if ( obj.bracket)
00102 {
00103 queryString+="&b="+obj.bracket;
00104 }
00105 if( obj.noquery)
00106 {
00107 queryString+="&nq";
00108 }
00109 if( obj.no_overwrite)
00110 {
00111 queryString+="&nover";
00112 }
00113 if( obj.bracket)
00114 {
00115 queryString+="&bracket";
00116 }
00117 if ( ! obj.noquery)
00118 {
00119 if( obj.acc_query)
00120 {
00121 queryString+="&q="+obj.acc_query;
00122 }
00123 else
00124 {
00125 if ($(obj).account)
00126 {
00127 var e=$(obj).account;
00128 var str_account=$(e).value;
00129 queryString+="&q="+str_account;
00130 }
00131 }
00132 }
00133
00134 queryString+="&ctl="+'search_account';
00135 queryString=encodeURI(queryString);
00136 var action=new Ajax.Request ( 'ajax_poste.php',
00137 {
00138 method:'get',
00139 parameters:queryString,
00140 onFailure:errorPoste,
00141 onSuccess:result_poste_search
00142 }
00143 );
00144 }
00145 catch (e)
00146 {
00147 alert(e.getMessage);
00148 }
00149 }
00150
00151
00152
00153
00154
00155
00156 function search_get_poste(obj)
00157 {
00158 var dossier=$('gDossier').value;
00159 var queryString="gDossier="+dossier;
00160
00161 queryString+="&op=sf";
00162
00163 if ( obj.elements['jrn'] )
00164 {
00165 queryString+="&j="+$F('jrn');
00166 }
00167 if ( obj.elements['account'])
00168 {
00169 queryString+="&c="+$F('account');
00170 }
00171 if ( obj.elements['label'])
00172 {
00173 queryString+="&l="+$F('label');
00174 }
00175 if( obj.elements['acc_query'])
00176 {
00177 queryString+="&q="+$F('acc_query');
00178 }
00179 if (obj.ctl )
00180 {
00181 queryString+="&ctl="+obj.ctl;
00182 }
00183 if( obj.elements['nosearch'])
00184 {
00185 queryString+="&nq";
00186 }
00187 if( obj.elements['nover'])
00188 {
00189 queryString+="&nover";
00190 }
00191 if( obj.elements['bracket'])
00192 {
00193 queryString+="&bracket";
00194 }
00195
00196 $('asearch').innerHTML=loading();
00197 var action=new Ajax.Request ( 'ajax_poste.php',
00198 {
00199 method:'get',
00200 parameters:queryString,
00201 onFailure:errorPoste,
00202 onSuccess:result_poste_search
00203 }
00204 );
00205 }
00206
00207
00208
00209
00210
00211 function result_poste_search(req)
00212 {
00213 try
00214 {
00215 var answer=req.responseXML;
00216 var a=answer.getElementsByTagName('ctl');
00217 if ( a.length == 0 )
00218 {
00219 var rec=req.responseText;
00220 alert ('erreur :'+rec);
00221 }
00222 var html=answer.getElementsByTagName('code');
00223
00224 var name_ctl=a[0].firstChild.nodeValue;
00225 var nodeXml=html[0];
00226 var code_html=getNodeText(nodeXml);
00227 code_html=unescape_xml(code_html);
00228 $('search_account').innerHTML=code_html;
00229 }
00230 catch (e)
00231 {
00232 alert(e.message);
00233 }
00234 try
00235 {
00236 code_html.evalScripts();
00237 }
00238 catch(e)
00239 {
00240 alert("Impossible executer script de la reponse\n"+e.message);
00241 }
00242
00243 }
00244
00245
00246
00247 function errorPoste()
00248 {
00249 alert('Ajax failed');
00250 }