phpcompta-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpcompta-dev] r4341 - in phpcompta/trunk: html html/js include


From: phpcompta-dev
Subject: [Phpcompta-dev] r4341 - in phpcompta/trunk: html html/js include
Date: Fri, 11 Nov 2011 16:47:56 +0100 (CET)

Author: danydb
Date: 2011-11-11 16:47:55 +0100 (Fri, 11 Nov 2011)
New Revision: 4341

Added:
   phpcompta/trunk/include/ajax_bank_saldo.php.php
   phpcompta/trunk/include/ajax_update_predef.php.php
Removed:
   phpcompta/trunk/html/get_predef.php
   phpcompta/trunk/html/get_saldo.php
   phpcompta/trunk/include/ajax_bank_saldo.inc.php.php
Modified:
   phpcompta/trunk/html/ajax_misc.php
   phpcompta/trunk/html/js/acc_ledger.js
   phpcompta/trunk/html/show_document.php
Log:
show_document.php  : add security
acc_ledger.js : move get_predef.php to include/ajax_up_predef.php
renaming files


Modified: phpcompta/trunk/html/ajax_misc.php
===================================================================
--- phpcompta/trunk/html/ajax_misc.php  2011-11-11 15:42:09 UTC (rev 4340)
+++ phpcompta/trunk/html/ajax_misc.php  2011-11-11 15:47:55 UTC (rev 4341)
@@ -522,6 +522,9 @@
                require_once 'template/plugin_detail.php';
                break;
          case 'saldo':
-             require_once 'ajax_bank_saldo.inc.php';
+             require_once 'ajax_bank_saldo.php';
              break;
+         case 'up_predef':
+             require_once 'ajax_update_predef.php';
+             break;
 }
\ No newline at end of file

Deleted: phpcompta/trunk/html/get_predef.php
===================================================================
--- phpcompta/trunk/html/get_predef.php 2011-11-11 15:42:09 UTC (rev 4340)
+++ phpcompta/trunk/html/get_predef.php 2011-11-11 15:47:55 UTC (rev 4341)
@@ -1,68 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder address@hidden
-
-/*!\file
- * \brief respond ajax request, the get contains
- *  the value :
- * - l for ledger 
- * - gDossier
- * Must return at least tva, htva and tvac
- */
-
-require_once ('constant.php');
-require_once ('class_database.php');
-require_once('class_dossier.php');
-require_once('class_pre_operation.php');
-// Check if the needed field does exist
-extract ($_GET);
-foreach (array('l','t','d','gDossier') as $a)
-{
-    if ( ! isset (${$a}) )
-    {
-        echo "error $a is not set ";
-        exit();
-    }
-
-}
-$cn=new Database(dossier::id());
-$op=new Pre_operation_detail($cn);
-$op->set('ledger',$l);
-$op->set('ledger_type',$t);
-$op->set('direct',$d);
-$array=$op->get_operation();
-$string='{"count":"'.count($array).'"';
-$idx=0;
-if (! empty($array))
-    foreach ($array as $a)
-{
-    $string.=',"value'.$idx.'":"'.$a['value'].'",';
-    $string.='"label'.$idx.'":"'.$a['label'].'"';
-    $idx++;
-}
-$string.="}";
-
-header("Content-type: text/json; charset: utf8",true);
-echo $string;
-
-
-?>
-

Deleted: phpcompta/trunk/html/get_saldo.php
===================================================================
--- phpcompta/trunk/html/get_saldo.php  2011-11-11 15:42:09 UTC (rev 4340)
+++ phpcompta/trunk/html/get_saldo.php  2011-11-11 15:47:55 UTC (rev 4341)
@@ -1,66 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder address@hidden
-
-/*!\file
- * \brief get the saldo of a account
- * the get variable are :
- *  - l the jrn id
- *  - ctl the ctl where to get the quick_code
- */
-require_once('class_user.php');
-require_once('class_dossier.php');
-require_once('class_fiche.php');
-extract($_GET);
-/* check the parameters */
-foreach ( array('j','ctl') as $a )
-{
-    if ( ! isset(${$a}) )
-    {
-        echo "missing $a";
-        return;
-    }
-}
-
-$cn=new Database(dossier::id());
-$user=new User($cn);
-$user->check();
-if ( $user->check_jrn($_GET['j'])=='X' ) return '{"saldo":"0"}';
-/*  make a filter on the exercice */
-
-$filter_year="  j_tech_per in (select p_id from parm_periode ".
-             "where p_exercice='".$user->get_exercice()."')";
-
-
-$id=$cn->get_value('select jrn_def_bank from jrn_def where 
jrn_def_id=$1',array($_GET['j']));
-$acc=new Fiche($cn,$id);
-
-$res=$acc->get_bk_balance($filter_year." and ( trim(jr_pj_number) != '' and 
jr_pj_number is not null)" );
-
-
-if ( empty($res) ) return '{"saldo":"0"}';
-$solde=$res['solde'];
-if ( $res['debit'] < $res['credit'] ) $solde=$solde*(-1);
-
-echo '{"saldo":"'.$solde.'"}';
-
-
-

Modified: phpcompta/trunk/html/js/acc_ledger.js
===================================================================
--- phpcompta/trunk/html/js/acc_ledger.js       2011-11-11 15:42:09 UTC (rev 
4340)
+++ phpcompta/trunk/html/js/acc_ledger.js       2011-11-11 15:47:55 UTC (rev 
4341)
@@ -32,10 +32,10 @@
 {
     var jrn=g("p_jrn").value;
     var dossier=g("gDossier").value;
-    var querystring='gDossier='+dossier+'&l='+jrn+'&t='+p_type+'&d='+p_direct;
+    var 
querystring='gDossier='+dossier+'&l='+jrn+'&t='+p_type+'&d='+p_direct+"&op=up_predef";
     g("p_jrn_predef").value=jrn;
     var action=new Ajax.Request(
-                   "get_predef.php",
+                   "ajax_misc.php",
                    {
                    method:'get',
                    parameters:querystring,

Modified: phpcompta/trunk/html/show_document.php
===================================================================
--- phpcompta/trunk/html/show_document.php      2011-11-11 15:42:09 UTC (rev 
4340)
+++ phpcompta/trunk/html/show_document.php      2011-11-11 15:47:55 UTC (rev 
4341)
@@ -35,6 +35,7 @@
 $User=new User(new Database());
 $User->Check();
 $User->check_dossier($gDossier);
+
 /* Show the document */
 if ( $action == 'sh')
 {

Deleted: phpcompta/trunk/include/ajax_bank_saldo.inc.php.php
===================================================================
--- phpcompta/trunk/include/ajax_bank_saldo.inc.php.php 2011-11-11 15:42:09 UTC 
(rev 4340)
+++ phpcompta/trunk/include/ajax_bank_saldo.inc.php.php 2011-11-11 15:47:55 UTC 
(rev 4341)
@@ -1,67 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-/* $Revision$ */
-
-// Copyright Author Dany De Bontridder address@hidden
-
-/*!\file
- * \brief respond ajax request, the get contains
- *  the value :
- * - l for ledger
- * - gDossier
- * Must return at least tva, htva and tvac
-
- */
-
-require_once ('constant.php');
-require_once ('class_database.php');
-require_once('class_dossier.php');
-require_once('class_acc_ledger.php');
-require_once ('class_user.php');
-
-// Check if the needed field does exist
-extract ($_GET);
-foreach (array('l','gDossier') as $a)
-{
-    if ( ! isset (${$a}) )
-    {
-        echo "error $a is not set ";
-        exit();
-    }
-
-}
-if ( is_numeric($l) == false  )
-{
-    exit();
-}
-$cn=new Database(dossier::id());
-$User=new User($cn);
-$User->Check();
-
-$Ledger=new Acc_Ledger($cn,$l);
-$prop=$Ledger->get_propertie();
-$pj_seq=$Ledger->guess_pj();
-$string='{"pj":"'.$pj_seq.'"}';
-
-header("Content-type: text/json; charset: utf8",true);
-echo $string;
-
-
-?>
-

Copied: phpcompta/trunk/include/ajax_bank_saldo.php.php (from rev 4340, 
phpcompta/trunk/include/ajax_bank_saldo.inc.php.php)
===================================================================
--- phpcompta/trunk/include/ajax_bank_saldo.php.php                             
(rev 0)
+++ phpcompta/trunk/include/ajax_bank_saldo.php.php     2011-11-11 15:47:55 UTC 
(rev 4341)
@@ -0,0 +1,67 @@
+<?php
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/*!\file
+ * \brief respond ajax request, the get contains
+ *  the value :
+ * - l for ledger
+ * - gDossier
+ * Must return at least tva, htva and tvac
+
+ */
+
+require_once ('constant.php');
+require_once ('class_database.php');
+require_once('class_dossier.php');
+require_once('class_acc_ledger.php');
+require_once ('class_user.php');
+
+// Check if the needed field does exist
+extract ($_GET);
+foreach (array('l','gDossier') as $a)
+{
+    if ( ! isset (${$a}) )
+    {
+        echo "error $a is not set ";
+        exit();
+    }
+
+}
+if ( is_numeric($l) == false  )
+{
+    exit();
+}
+$cn=new Database(dossier::id());
+$User=new User($cn);
+$User->Check();
+
+$Ledger=new Acc_Ledger($cn,$l);
+$prop=$Ledger->get_propertie();
+$pj_seq=$Ledger->guess_pj();
+$string='{"pj":"'.$pj_seq.'"}';
+
+header("Content-type: text/json; charset: utf8",true);
+echo $string;
+
+
+?>
+

Copied: phpcompta/trunk/include/ajax_update_predef.php.php (from rev 4339, 
phpcompta/trunk/html/get_predef.php)
===================================================================
--- phpcompta/trunk/include/ajax_update_predef.php.php                          
(rev 0)
+++ phpcompta/trunk/include/ajax_update_predef.php.php  2011-11-11 15:47:55 UTC 
(rev 4341)
@@ -0,0 +1,68 @@
+<?php
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/*!\file
+ * \brief respond ajax request, the get contains
+ *  the value :
+ * - l for ledger 
+ * - gDossier
+ * Must return at least tva, htva and tvac
+ */
+
+require_once ('constant.php');
+require_once ('class_database.php');
+require_once('class_dossier.php');
+require_once('class_pre_operation.php');
+// Check if the needed field does exist
+extract ($_GET);
+foreach (array('l','t','d','gDossier') as $a)
+{
+    if ( ! isset (${$a}) )
+    {
+        echo "error $a is not set ";
+        exit();
+    }
+
+}
+$cn=new Database(dossier::id());
+$op=new Pre_operation_detail($cn);
+$op->set('ledger',$l);
+$op->set('ledger_type',$t);
+$op->set('direct',$d);
+$array=$op->get_operation();
+$string='{"count":"'.count($array).'"';
+$idx=0;
+if (! empty($array))
+    foreach ($array as $a)
+{
+    $string.=',"value'.$idx.'":"'.$a['value'].'",';
+    $string.='"label'.$idx.'":"'.$a['label'].'"';
+    $idx++;
+}
+$string.="}";
+
+header("Content-type: text/json; charset: utf8",true);
+echo $string;
+
+
+?>
+




reply via email to

[Prev in Thread] Current Thread [Next in Thread]