phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r588 - trunk/rapport_avance


From: phpcompta-dev
Subject: [Phpcompta-dev] r588 - trunk/rapport_avance
Date: Mon, 25 Nov 2013 17:32:09 +0100 (CET)

Author: danydb
Date: 2013-11-25 17:32:09 +0100 (Mon, 25 Nov 2013)
New Revision: 588

Added:
   trunk/rapport_avance/ajax_add_row_definition.php
   trunk/rapport_avance/ajax_mod_form.php
   trunk/rapport_avance/ajax_mod_param.php
   trunk/rapport_avance/ajax_rapav_declaration_display.php
   trunk/rapport_avance/ajax_rapav_search_code.php
Removed:
   trunk/rapport_avance/ajax_declaration_display.php
   trunk/rapport_avance/ajax_search_code.php
Modified:
   trunk/rapport_avance/ajax.php
   trunk/rapport_avance/ajax_save_param_listing.php
Log:
r?\195?\169?\195?\169criture de la procedure ajax

Modified: trunk/rapport_avance/ajax.php
===================================================================
--- trunk/rapport_avance/ajax.php       2013-11-23 20:31:27 UTC (rev 587)
+++ trunk/rapport_avance/ajax.php       2013-11-25 16:32:09 UTC (rev 588)
@@ -1,113 +1,25 @@
 <?php
 extract($_GET);
 global $cn;
+$a_action=explode(',',
+        'mod_form,add_row_definition,mod_param,add_param_detail,'.
+        'rapav_search_code,save_param_detail,rapav_declaration_display,'.
+        'listing_modify,listing_remove_modele,listing_display_definition,'.
+        'listing_param_add,save_param_listing');
+if ( in_array($act,$a_action ) == true )
+{
+    include 'ajax_'.$act.'.php';
+    exit();
+}
 switch ($act)
 {
-    /*     * 
*******************************************************************************************************
 */
-    // Modifie une definition de formulaire
-    /*     * 
*******************************************************************************************************
 */
-
-    case 'mod_form':
-        require_once 'include/class_rapav_formulaire.php';
-        if (!isset($_GET['f_id']) && isNum($_GET['f_id']) == 0)
-            exit();
-        require_once 'include/formulaire_definition_show.inc.php';
-        break;
-    /*     * 
**************************************************************************************************************
-     * Ajoute une ligne dans la definition
-     * 
***************************************************************************************************************
 */
-    case 'add_row_definition':
-        $type_row = $cn->make_array("select p_type,p_description from 
rapport_advanced.type_row order by p_description");
-        $type_periode = $cn->make_array("select t_id,t_description from 
rapport_advanced.periode_type order by t_description");
-        ?>
-        <td>
-            Nouv.
-        </td>
-        <td>
-            <?php echo HtmlInput::hidden('p_id[]', -1) ?>
-            <?php
-            $p_code = new IText('p_code[]');
-            $p_code->size = "10";
-            echo $p_code->input();
-            ?>
-        </td>
-        <td>
-            <?php
-            $p_libelle = new IText('p_libelle[]');
-            $p_libelle->css_size = "100%";
-            echo $p_libelle->input();
-            ?>
-        </td>
-        <td>
-            <?php
-            $p_type = new ISelect('p_type[]');
-            $p_type->value = $type_row;
-            echo $p_type->input();
-            ?>
-        </td>
-        <td>
-            <?php
-            $p_type_periode = new ISelect('t_id[]');
-            $p_type_periode->value = $type_periode;
-            echo $p_type_periode->input();
-            ?>
-        </td>
-        <td>
-            <?php
-            $p_order = new INum('p_order[]');
-            $p_order->prec = 0;
-            $p_order->size = 4;
-            echo $p_order->input();
-            ?>
-        </td>
-        <?php
-        break;
-    /*     * 
**************************************************************************************************************
-     * Montre le résultat et permet de changer les paramètrages d'un formulaire
-     * uniquement pour ceux ayant un champs de calcul (formule, code tva+poste 
comptable + totaux intermédiare
-     * 
***************************************************************************************************************
 */
-    case 'mod_param':
-        require_once 'include/class_rapav_formulaire.php';
-        if (!isset($_GET['f_id']) && isNum($_GET['f_id']) == 0)
-            exit();
-        echo '<h1>Paramètre </h1>';
-        $form = new RAPAV_formulaire($_REQUEST['f_id']);
-        $form->load_definition();
-        $form->echo_formulaire();
-        $form->input_parameter();
-        break;
-
-    /*     * 
****************************************************************************************************************
-     * Montre un écran pour ajouter une ligne de formulaire dans les paramètre 
de formulaires
-     */
-    case 'add_param_detail':
-        include 'ajax_add_param_detail.php';
-        break;
-    
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    //rapav_search_code cherche les codes du formulaires courants
-    
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    case 'rapav_search_code':
-        include 'ajax_search_code.php';
-        break;
-    
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    // Sauve résultat et renvoie un xml
-    
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    case 'save_param_detail':
-        include 'ajax_save_param_detail.php';
-        break;
-    
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    /////////////////////////////////////////////////////////////////////////
     // Delete un formulaire_param_detail
-    
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+    /////////////////////////////////////////////////////////////////////////
     case 'delete_param_detail':
         $cn->exec_sql("delete from rapport_advanced.formulaire_param_detail 
where fp_id=$1", array($fp_id));
         break;
     
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    // Display a saved declaration from history
-    
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    case 'rapav_declaration_display':
-        include 'ajax_declaration_display.php';
-        break;
-    
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // Delete a saved declaration (from history)
     
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     case 'rapav_declaration_delete':
@@ -121,36 +33,6 @@
         $rapav = new Rapav_Formulaire($_GET['f_id']);
         $rapav->remove_doc_template();
         break;
-    
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    // Show a div to enter new listing
-    
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    case 'listing_modify':
-       include 'ajax_listing_modify.php';
-        exit();
-    
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    // Remove a document modele
-    
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    case 'listing_remove_modele':
-       include 'ajax_listing_remove_modele.php';
-        exit();
-    
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    // Display the definition of a listing
-    
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    case 'listing_display_definition':
-        include 'ajax_listing_display_definition.php';
-        exit();
-    
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    // Add a param to a listing
-    
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    case 'listing_param_add':
-        include 'ajax_listing_param_add.php';
-        exit();
-    
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    // save a param to a listing
-    
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-    case 'save_param_listing':
-        include 'ajax_save_param_listing.php';
-        exit();
     default:
         if ( DEBUG) var_dump($_GET);
         die ("Aucune action demandée");

Added: trunk/rapport_avance/ajax_add_row_definition.php
===================================================================
--- trunk/rapport_avance/ajax_add_row_definition.php                            
(rev 0)
+++ trunk/rapport_avance/ajax_add_row_definition.php    2013-11-25 16:32:09 UTC 
(rev 588)
@@ -0,0 +1,48 @@
+<?php
+/**
+ * @file
+ * @brief  Ajoute une ligne dans la definition
+ */
+$type_row = $cn->make_array("select p_type,p_description from 
rapport_advanced.type_row order by p_description");
+$type_periode = $cn->make_array("select t_id,t_description from 
rapport_advanced.periode_type order by t_description");
+?>
+<td>
+    Nouv.
+</td>
+<td>
+    <?php echo HtmlInput::hidden('p_id[]', -1) ?>
+    <?php
+    $p_code = new IText('p_code[]');
+    $p_code->size = "10";
+    echo $p_code->input();
+    ?>
+</td>
+<td>
+    <?php
+    $p_libelle = new IText('p_libelle[]');
+    $p_libelle->css_size = "100%";
+    echo $p_libelle->input();
+    ?>
+</td>
+<td>
+    <?php
+    $p_type = new ISelect('p_type[]');
+    $p_type->value = $type_row;
+    echo $p_type->input();
+    ?>
+</td>
+<td>
+    <?php
+    $p_type_periode = new ISelect('t_id[]');
+    $p_type_periode->value = $type_periode;
+    echo $p_type_periode->input();
+    ?>
+</td>
+<td>
+    <?php
+    $p_order = new INum('p_order[]');
+    $p_order->prec = 0;
+    $p_order->size = 4;
+    echo $p_order->input();
+    ?>
+</td>

Deleted: trunk/rapport_avance/ajax_declaration_display.php
===================================================================
--- trunk/rapport_avance/ajax_declaration_display.php   2013-11-23 20:31:27 UTC 
(rev 587)
+++ trunk/rapport_avance/ajax_declaration_display.php   2013-11-25 16:32:09 UTC 
(rev 588)
@@ -1,41 +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 display a declaration but you can't modify it
- */
-require_once 'include/class_rapav_declaration.php';
-global $cn;
-echo HtmlInput::button_action("Retour","$('declaration_list_div').show(); 
$('declaration_display_div').hide();");
-$decl = new Rapav_Declaration();
-$decl->d_id = $_GET['d_id'];
-$decl->load();
-$decl->display();
-echo $decl->anchor_document();
-echo '<hr>';
-$ref=HtmlInput::array_to_string(array('gDossier','plugin_code','d_id'),$_GET,'extension.raw.php?');
-$ref.="&amp;act=export_decla_csv";
-echo HtmlInput::button_anchor("Export CSV",$ref,'export_id');
-echo HtmlInput::button_action("Retour","$('declaration_list_div').show(); 
$('declaration_display_div').hide();");
-?>

Added: trunk/rapport_avance/ajax_mod_form.php
===================================================================
--- trunk/rapport_avance/ajax_mod_form.php                              (rev 0)
+++ trunk/rapport_avance/ajax_mod_form.php      2013-11-25 16:32:09 UTC (rev 
588)
@@ -0,0 +1,11 @@
+<?php
+
+//////////////////////////////////////////////////////////////
+// Modifie une definition de formulaire
+//////////////////////////////////////////////////////////////
+require_once 'include/class_rapav_formulaire.php';
+if (!isset($_GET['f_id']) && isNum($_GET['f_id']) == 0)
+    exit();
+require_once 'include/formulaire_definition_show.inc.php';
+exit();
+?>
\ No newline at end of file

Added: trunk/rapport_avance/ajax_mod_param.php
===================================================================
--- trunk/rapport_avance/ajax_mod_param.php                             (rev 0)
+++ trunk/rapport_avance/ajax_mod_param.php     2013-11-25 16:32:09 UTC (rev 
588)
@@ -0,0 +1,15 @@
+<?php
+/**
+ * @file
+ * @brief Montre le résultat et permet de changer les paramètrages d'un 
formulaire
+ *  uniquement pour ceux ayant un champs de calcul (formule, code tva+poste 
comptable + totaux intermédiare
+ */
+require_once 'include/class_rapav_formulaire.php';
+if (!isset($_GET['f_id']) && isNum($_GET['f_id']) == 0)
+    exit();
+echo '<h1>Paramètre </h1>';
+$form = new RAPAV_formulaire($_REQUEST['f_id']);
+$form->load_definition();
+$form->echo_formulaire();
+$form->input_parameter();
+?>
\ No newline at end of file

Copied: trunk/rapport_avance/ajax_rapav_declaration_display.php (from rev 587, 
trunk/rapport_avance/ajax_declaration_display.php)
===================================================================
--- trunk/rapport_avance/ajax_rapav_declaration_display.php                     
        (rev 0)
+++ trunk/rapport_avance/ajax_rapav_declaration_display.php     2013-11-25 
16:32:09 UTC (rev 588)
@@ -0,0 +1,41 @@
+<?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 display a declaration from history but you can't modify it
+ */
+require_once 'include/class_rapav_declaration.php';
+global $cn;
+echo HtmlInput::button_action("Retour","$('declaration_list_div').show(); 
$('declaration_display_div').hide();");
+$decl = new Rapav_Declaration();
+$decl->d_id = $_GET['d_id'];
+$decl->load();
+$decl->display();
+echo $decl->anchor_document();
+echo '<hr>';
+$ref=HtmlInput::array_to_string(array('gDossier','plugin_code','d_id'),$_GET,'extension.raw.php?');
+$ref.="&amp;act=export_decla_csv";
+echo HtmlInput::button_anchor("Export CSV",$ref,'export_id');
+echo HtmlInput::button_action("Retour","$('declaration_list_div').show(); 
$('declaration_display_div').hide();");
+?>

Copied: trunk/rapport_avance/ajax_rapav_search_code.php (from rev 587, 
trunk/rapport_avance/ajax_search_code.php)
===================================================================
--- trunk/rapport_avance/ajax_rapav_search_code.php                             
(rev 0)
+++ trunk/rapport_avance/ajax_rapav_search_code.php     2013-11-25 16:32:09 UTC 
(rev 588)
@@ -0,0 +1,52 @@
+<?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 show the list of code of the form
+ *
+ */
+global $cn;
+$array=$cn->get_array("select p_id,p_code,p_libelle from 
rapport_advanced.formulaire_param where p_type=3 and f_id=$1 order by 
2",array($f_id));
+echo HtmlInput::title_box('Code Formulaire','search_code_div');
+?>
+<table>
+       <tr>
+               <th>
+                       Code
+               </th>
+               <th>
+                       Libellé
+               </th>
+       </tr>
+       <?php for ($i=0;$i<count($array);$i++): ?>
+       <tr>
+               <td>
+                       <?php echo 
HtmlInput::anchor(h($array[$i]['p_code']),"",'onclick="$(\'form_compute\').value+=\'['.$array[$i]['p_code'].']\';removeDiv(\'search_code_div\');"')?>
+               </td>
+               <td>
+                       <?php echo h($array[$i]['p_libelle'])?>
+               </td>
+       </tr>
+       <?php endfor;?>
+</table>

Modified: trunk/rapport_avance/ajax_save_param_listing.php
===================================================================
--- trunk/rapport_avance/ajax_save_param_listing.php    2013-11-23 20:31:27 UTC 
(rev 587)
+++ trunk/rapport_avance/ajax_save_param_listing.php    2013-11-25 16:32:09 UTC 
(rev 588)
@@ -46,7 +46,7 @@
             $html.=ob_get_contents();
             ob_end_clean();
             $html.='<td id="del_' . $lp_id . '">';
-            $html.=HtmlInput::anchor("Effacer", "", 
sprintf("onclick=\"delete_param_detail('%s','%s','%s','%s')\""
+            $html.=HtmlInput::anchor("Effacer", "", 
sprintf("onclick=\"delete_listing_detail('%s','%s','%s','%s')\""
                                     , $_REQUEST['plugin_code'], 
$_REQUEST['ac'], $_REQUEST['gDossier'], $lp_id));
             $html.='</td>';
         }

Deleted: trunk/rapport_avance/ajax_search_code.php
===================================================================
--- trunk/rapport_avance/ajax_search_code.php   2013-11-23 20:31:27 UTC (rev 
587)
+++ trunk/rapport_avance/ajax_search_code.php   2013-11-25 16:32:09 UTC (rev 
588)
@@ -1,52 +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 show the list of code of the form
- *
- */
-global $cn;
-$array=$cn->get_array("select p_id,p_code,p_libelle from 
rapport_advanced.formulaire_param where p_type=3 and f_id=$1 order by 
2",array($f_id));
-echo HtmlInput::title_box('Code Formulaire','search_code_div');
-?>
-<table>
-       <tr>
-               <th>
-                       Code
-               </th>
-               <th>
-                       Libellé
-               </th>
-       </tr>
-       <?php for ($i=0;$i<count($array);$i++): ?>
-       <tr>
-               <td>
-                       <?php echo 
HtmlInput::anchor(h($array[$i]['p_code']),"",'onclick="$(\'form_compute\').value+=\'['.$array[$i]['p_code'].']\';removeDiv(\'search_code_div\');"')?>
-               </td>
-               <td>
-                       <?php echo h($array[$i]['p_libelle'])?>
-               </td>
-       </tr>
-       <?php endfor;?>
-</table>



---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu



reply via email to

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