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:10%;width:80%";
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     
00042     var action=new Ajax.Request(
00043                    "ajax_misc.php",
00044                    {
00045                    method:'get',
00046                    parameters:querystring,
00047                    onFailure:error_box,
00048                    onSuccess:modify_document_success_box
00049                    }
00050                );
00051 }
00052 /**
00053  *@brief receive answer from ajax and just display it into the IBox
00054  * XML must contains at least 2 fields : code is the ID of the IBOX and
00055  * html which is the contain
00056  */
00057 function modify_document_success_box(req,json)
00058 {
00059     try
00060     {
00061         $('mod_doc').show();
00062         var answer=req.responseXML;
00063         var a=answer.getElementsByTagName('ctl');
00064         var html=answer.getElementsByTagName('code');
00065         if ( a.length == 0 )
00066         {
00067             var rec=req.responseText;
00068             alert ('erreur :'+rec);
00069         }
00070         var name_ctl=a[0].firstChild.nodeValue;
00071         var code_html=getNodeText(html[0]);
00072 
00073         code_html=unescape_xml(code_html);
00074         g(name_ctl).innerHTML=code_html;
00075         g(name_ctl).style.height='auto';
00076     }
00077     catch (e)
00078     {
00079         alert("success_box"+e.message);
00080     }
00081     try
00082     {
00083         code_html.evalScripts();
00084     }
00085     catch(e)
00086     {
00087         alert("answer_box Impossible executer script de la reponse\n"+e.message);
00088     }
00089 }
 All Data Structures Namespaces Files Functions Variables Enumerations