noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 10/13: Reduce the number of file in HTML fold


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 10/13: Reduce the number of file in HTML folder, move ajax_poste.php to include/ajax called from ajax_misc.php
Date: Wed, 14 Oct 2015 21:38:33 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit 19b166de67182a6a7f948efe820d97f2362ef728
Author: Dany De Bontridder <address@hidden>
Date:   Wed Oct 14 18:43:16 2015 +0200

    Reduce the number of file in HTML folder, move ajax_poste.php to 
include/ajax called from ajax_misc.php
---
 html/ajax_misc.php                    |    3 ++
 html/js/accounting_item.js            |   10 ++++---
 {html => include/ajax}/ajax_poste.php |   45 ++------------------------------
 3 files changed, 12 insertions(+), 46 deletions(-)

diff --git a/html/ajax_misc.php b/html/ajax_misc.php
index 2bac2bf..6eac5f4 100644
--- a/html/ajax_misc.php
+++ b/html/ajax_misc.php
@@ -101,6 +101,9 @@ if ( LOGINPUT)
     }
 switch ($op)
 {
+        case 'account':
+            require NOALYSS_INCLUDE.'/ajax/ajax_poste.php';
+            return;
         case 'card' : 
             require NOALYSS_INCLUDE.'/ajax/ajax_card.php';
             return;
diff --git a/html/js/accounting_item.js b/html/js/accounting_item.js
index acbe0ef..8ef2d2b 100644
--- a/html/js/accounting_item.js
+++ b/html/js/accounting_item.js
@@ -124,7 +124,8 @@ function search_poste(obj)
 
     var queryString="gDossier="+dossier;
 
-    queryString+="&op=sf";
+    queryString+="&op2=sf";
+    queryString+="&op=account";
     try
     {
         if ( obj.jrn)
@@ -174,7 +175,7 @@ function search_poste(obj)
 
         queryString+="&ctl="+'search_account';
         queryString=encodeURI(queryString);
-        var action=new Ajax.Request ( 'ajax_poste.php',
+        var action=new Ajax.Request ( 'ajax_misc.php',
                                       {
                                   method:'get',
                                   parameters:queryString,
@@ -199,7 +200,8 @@ function search_get_poste(obj)
     var dossier=$('gDossier').value;
     var queryString="gDossier="+dossier;
 
-    queryString+="&op=sf";
+    queryString+="&op=account";
+    queryString+="&op2=sf";
 
     if ( obj.elements['jrn'] )
     {
@@ -235,7 +237,7 @@ function search_get_poste(obj)
     }
 
     $('asearch').innerHTML=loading();
-    var action=new Ajax.Request ( 'ajax_poste.php',
+    var action=new Ajax.Request ( 'ajax_misc.php',
                                   {
                                   method:'get',
                                   parameters:queryString,
diff --git a/html/ajax_poste.php b/include/ajax/ajax_poste.php
similarity index 78%
rename from html/ajax_poste.php
rename to include/ajax/ajax_poste.php
index 4625571..f7d270e 100644
--- a/html/ajax_poste.php
+++ b/include/ajax/ajax_poste.php
@@ -32,9 +32,8 @@
  *
  *
  */
-if ( ! defined('ALLOWED')) define ('ALLOWED',1);
+if ( ! defined('ALLOWED')) die (_('Non authorisé'));
 
-require_once '../include/constant.php';
 require_once  NOALYSS_INCLUDE.'/lib/ac_common.php';
 require_once NOALYSS_INCLUDE.'/class/class_acc_ledger.php';
 require_once  NOALYSS_INCLUDE.'/lib/class_database.php';
@@ -43,48 +42,10 @@ require_once 
NOALYSS_INCLUDE.'/class/class_acc_account_ledger.php';
 mb_internal_encoding("UTF-8");
 
 extract($_REQUEST);
-$var=array('gDossier','op','ctl');
-$cont=0;
-/*  check if mandatory parameters are given */
-foreach ($var as $v)
-{
-    if ( ! isset ($_REQUEST [$v] ) )
-    {
-        echo "$v is not set ";
-        $cont=1;
-    }
-}
-ajax_disconnected($ctl);
 
-set_language();
-
-if ( $cont != 0 ) exit();
-$cn=Dossier::connect();
-require_once  NOALYSS_INCLUDE.'/class/class_user.php';
-global $g_user;
-$g_user=new User($cn);
-$g_user->Check();
 if  ($g_user->check_dossier(dossier::id()) == 'X') exit();
-$xml="";
-if ( LOGINPUT)
-    {
-        
$file_loginput=fopen($_ENV['TMP'].'/scenario-'.$_SERVER['REQUEST_TIME'].'.php','a+');
-        fwrite ($file_loginput,"<?php \n");
-        fwrite ($file_loginput,'//@description:'.$op."\n");
-        fwrite($file_loginput, '$_GET='.var_export($_GET,true));
-        fwrite($file_loginput,";\n");
-        fwrite($file_loginput, '$_POST='.var_export($_POST,true));
-        fwrite($file_loginput,";\n");
-        fwrite($file_loginput, '$_POST[\'gDossier\']=$gDossierLogInput;');
-        fwrite($file_loginput,"\n");
-        fwrite($file_loginput, '$_GET[\'gDossier\']=$gDossierLogInput;');
-        fwrite($file_loginput,"\n");
-        fwrite($file_loginput,' $_REQUEST=array_merge($_GET,$_POST);');
-        fwrite($file_loginput,"\n");
-         fwrite($file_loginput,"include '".basename(__FILE__)."';\n");
-        fclose($file_loginput);
-    }
-switch ($op)
+
+switch ($op2)
 {
     /*----------------------------------------------------------------------
      * Show the form and the result



reply via email to

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