noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
modele_document.js
Go to the documentation of this file.
00001 /*
00002  *   This file is part of NOALYSS.
00003  *
00004  *   NOALYSS is free software; you can redistribute it and/or modify
00005  *   it under the terms of the GNU General Public License as published by
00006  *   the Free Software Foundation; either version 2 of the License, or
00007  *   (at your option) any later version.
00008  *
00009  *   NOALYSS is distributed in the hope that it will be useful,
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *   GNU General Public License for more details.
00013  *
00014  *   You should have received a copy of the GNU General Public License
00015  *   along with NOALYSS; if not, write to the Free Software
00016  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017  */
00018 
00019 /*!\brief
00020  * \param p_value jrn.jr_id
00021  */
00022 function modifyModeleDocument(p_value,dossier)
00023 {
00024     layer++;
00025     id='det'+layer;
00026     var pos_y=posY+offsetY-20;
00027     var pos_x=posX+offsetX+40;
00028     var style="position:absolute;top:"+pos_y+"px;left:"+pos_x+"px";
00029     var popup={'id':'mod_doc',
00030                'cssclass':'inner_box',
00031                'html': loading(),
00032                'drag':false,
00033                'style':style
00034               };
00035 
00036     querystring='gDossier='+dossier+'&op=mod_doc&id='+p_value+'&div=mod_doc';
00037     if ( ! $('mod_doc'))
00038     {
00039         add_div(popup);
00040     }
00041     var action=new Ajax.Request(
00042                    "ajax_misc.php",
00043                    {
00044                    method:'get',
00045                    parameters:querystring,
00046                    onFailure:error_box,
00047                    onSuccess:modify_document_success_box
00048                    }
00049                );
00050 }
00051 /**
00052  *@brief receive answer from ajax and just display it into the IBox
00053  * XML must contains at least 2 fields : code is the ID of the IBOX and
00054  * html which is the contain
00055  */
00056 function modify_document_success_box(req,json)
00057 {
00058     try
00059     {
00060         var answer=req.responseXML;
00061         var a=answer.getElementsByTagName('ctl');
00062         var html=answer.getElementsByTagName('code');
00063         if ( a.length == 0 )
00064         {
00065             var rec=req.responseText;
00066             alert ('erreur :'+rec);
00067         }
00068         var name_ctl=a[0].firstChild.nodeValue;
00069         var code_html=getNodeText(html[0]);
00070 
00071         code_html=unescape_xml(code_html);
00072         g(name_ctl).innerHTML=code_html;
00073         g(name_ctl).style.height='auto';
00074     }
00075     catch (e)
00076     {
00077         alert("success_box"+e.message);
00078     }
00079     try
00080     {
00081         code_html.evalScripts();
00082     }
00083     catch(e)
00084     {
00085         alert("answer_box Impossible executer script de la reponse\n"+e.message);
00086     }
00087 }
 All Data Structures Namespaces Files Functions Variables Enumerations