noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
ajax_update_predef.php
Go to the documentation of this file.
00001 <?php
00002 /*
00003  *   This file is part of NOALYSS.
00004  *
00005  *   NOALYSS is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU General Public License as published by
00007  *   the Free Software Foundation; either version 2 of the License, or
00008  *   (at your option) any later version.
00009  *
00010  *   NOALYSS is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with NOALYSS; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 
00020 // Copyright Author Dany De Bontridder danydb@aevalys.eu
00021 
00022 /*!\file
00023  * \brief respond ajax request, the get contains
00024  *  the value :
00025  * - l for ledger 
00026  * - gDossier
00027  * Must return at least tva, htva and tvac
00028  */
00029 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00030 
00031 require_once ('constant.php');
00032 require_once ('class_database.php');
00033 require_once('class_dossier.php');
00034 require_once('class_pre_operation.php');
00035 // Check if the needed field does exist
00036 extract ($_GET);
00037 foreach (array('l','t','d','gDossier') as $a)
00038 {
00039     if ( ! isset (${$a}) )
00040     {
00041         echo "error $a is not set ";
00042         exit();
00043     }
00044 
00045 }
00046 $cn=new Database(dossier::id());
00047 $op=new Pre_operation_detail($cn);
00048 $op->set('ledger',$l);
00049 $op->set('ledger_type',$t);
00050 $op->set('direct',$d);
00051 $url=http_build_query(array('action'=>'use_opd','p_jrn_predef'=>$l,'ac'=>$_GET['ac'],'gDossier'=>dossier::id()));
00052 $html="";
00053 
00054 $html.=HtmlInput::title_box(_("Modèle d'opérations"), 'modele_op_div', 'hide');
00055 $html.=$op->show_button('do.php?'.$url);
00056 
00057 $html=escape_xml($html);
00058 header('Content-type: text/xml; charset=UTF-8');
00059 echo <<<EOF
00060 <?xml version="1.0" encoding="UTF-8"?>
00061 <data>
00062 <code></code>
00063 <value>$html</value>
00064 </data>
00065 EOF;
00066 
00067 ?>
00068 
 All Data Structures Namespaces Files Functions Variables Enumerations