phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r412 - in trunk/rapport_avance: . include


From: phpcompta-dev
Subject: [Phpcompta-dev] r412 - in trunk/rapport_avance: . include
Date: Mon, 24 Sep 2012 22:47:13 +0200 (CEST)

Author: danydb
Date: 2012-09-24 22:47:12 +0200 (Mon, 24 Sep 2012)
New Revision: 412

Modified:
   trunk/rapport_avance/ajax.php
   trunk/rapport_avance/ajax_save_param_detail.php
   trunk/rapport_avance/include/class_formulaire_param.php
   trunk/rapport_avance/include/class_rapav_formulaire.php
   trunk/rapport_avance/include/formulaire.inc.php
   trunk/rapport_avance/rapav_javascript.js
Log:
Correct the code, remove the add_param_detail popup if success

Modified: trunk/rapport_avance/ajax.php
===================================================================
--- trunk/rapport_avance/ajax.php       2012-09-24 20:07:04 UTC (rev 411)
+++ trunk/rapport_avance/ajax.php       2012-09-24 20:47:12 UTC (rev 412)
@@ -84,12 +84,8 @@
                echo '<h1>Paramètre </h1>';
                $form = new RAPAV_formulaire($_REQUEST['f_id']);
                $form->load_definition();
-               echo '<form method="POST" class="print">';
-               echo HtmlInput::hidden('f_id', $_REQUEST['f_id']);
                $form->echo_formulaire();
                $form->input_parameter();
-               echo HtmlInput::submit('form_param_sub', 'Sauve');
-               echo '</form>';
                break;
 
        
/******************************************************************************************************************

Modified: trunk/rapport_avance/ajax_save_param_detail.php
===================================================================
--- trunk/rapport_avance/ajax_save_param_detail.php     2012-09-24 20:07:04 UTC 
(rev 411)
+++ trunk/rapport_avance/ajax_save_param_detail.php     2012-09-24 20:47:12 UTC 
(rev 412)
@@ -41,6 +41,7 @@
                $acc_tva->jrn_def_type=$code_jrn;
                $acc_tva->p_id=$p_id;
                $acc_tva->type_detail=2;
+               $acc_tva->tt_id=$code_base;
                if ($acc_tva->verify() == 1)
                {
                        $code='nok';

Modified: trunk/rapport_avance/include/class_formulaire_param.php
===================================================================
--- trunk/rapport_avance/include/class_formulaire_param.php     2012-09-24 
20:07:04 UTC (rev 411)
+++ trunk/rapport_avance/include/class_formulaire_param.php     2012-09-24 
20:47:12 UTC (rev 412)
@@ -67,11 +67,6 @@
 
        }
 
-       function compute()
-       {
-
-       }
-
        /**
         * @brief load all the row from formulaire_param_detail, children of 
formulaire_param
         *  return an array of objects Formulaire_Param_Detail
@@ -95,11 +90,7 @@
                echo h1($this->obj->p_libelle, "");
        }
 
-       function compute()
-       {
 
-       }
-
        function input()
        {
                echo h1($this->obj->p_libelle, ' class="title"');
@@ -115,11 +106,7 @@
                echo h2($this->obj->p_libelle, 'class="title"');
        }
 
-       function compute()
-       {
 
-       }
-
        function input()
        {
                echo h2($this->obj->p_libelle, 'class="title"');
@@ -135,11 +122,7 @@
                echo "<h3>" . $this->obj->p_libelle . "</h3>";
        }
 
-       function compute()
-       {
 
-       }
-
        function input()
        {
                echo "<h3 class=\"title\">" . $this->obj->p_libelle . "</h3>";

Modified: trunk/rapport_avance/include/class_rapav_formulaire.php
===================================================================
--- trunk/rapport_avance/include/class_rapav_formulaire.php     2012-09-24 
20:07:04 UTC (rev 411)
+++ trunk/rapport_avance/include/class_rapav_formulaire.php     2012-09-24 
20:47:12 UTC (rev 412)
@@ -113,16 +113,6 @@
        }
 
        /**
-        * insert into formulaire and formulaire_param
-        * @see save_definition
-        * @param type $p_array
-        */
-       static function insert_definition($p_array)
-       {
-
-       }
-
-       /**
         *
         * @see save_definition
         * @param type $p_array
@@ -169,67 +159,7 @@
                }
        }
 
-       static function save_parameter($p_array)
-       {
-               $param = new RAPAV_Formulaire($p_array['f_id']);
-               $param->load_definition();
-               // save everything
-               $max = count($p_array['fp_id']);
 
-               // update
-               for ($i = 0; $i < $max; $i++)
-               {
-                       // update
-                       if (isset($p_array['fp_id'][$i]))
-                       {
-                               $fp_id = $p_array['fp_id'][$i];
-                               $old_frm = new 
Formulaire_Param_Detail($p_array['fp_id'][$i]);
-                               $new_frm = new Formulaire_Param_Detail();
-                               $new_frm->p_id = $old_frm->p_id;
-                               $new_frm->fp_id = $p_array['fp_id'][$i];
-                               // update formula
-                               $new_frm->fp_formula = $p_array['frm' . $fp_id];
-                               $new_frm->tmp_val = (isset($p_array['code_frm' 
. $fp_id])) ? $p_array['code_frm' . $fp_id] : null;
-                               $new_frm->tva_id = (isset($p_array['code_tva' . 
$fp_id])) ? $p_array['code_tva' . $fp_id] : null;
-                               $new_frm->jrn_def_type = 
(isset($p_array['code_jrn' . $fp_id])) ? $p_array['code_jrn' . $fp_id] : null;
-                               $new_frm->tt_id = (isset($p_array['code_base' . 
$fp_id])) ? $p_array['code_base' . $fp_id] : null;
-                               $new_frm->update();
-                       }
-               }
-               
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-               // insert fp_id
-               
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-               if (isset($p_array['new']))
-               {
-                       $max_new = count($p_array['new']);
-                       for ($i = 0; $i < $max_new; $i++)
-                       {
-                               $new_frm = new Formulaire_Param_Detail();
-                               $new_frm->p_id = $p_array['new'][$i];
-                               // if it is a formula
-                               $new_frm->fp_formula = 
(isset($p_array['new_frm'][$i])) ? $p_array['new_frm'][$i] : null;
-                               $new_frm->tmp_val = 
(isset($p_array['new_code_frm'][$i])) ? $p_array['new_code_frm'][$i] : null;
-                               $new_frm->tva_id = 
(isset($p_array['new_code_tva'][$i])) ? $p_array['new_code_tva'][$i] : null;
-                               $new_frm->jrn_def_type = 
(isset($p_array['new_code_jrn'][$i])) ? $p_array['new_code_jrn'][$i] : null;
-                               $new_frm->tt_id = 
(isset($p_array['new_code_base'][$i])) ? $p_array['new_code_base'][$i] : null;
-                               $new_frm->insert();
-                       }
-               }
-               
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-               // Delete fp_id
-               
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-               if (isset($p_array['delete']))
-               {
-                       //delete
-                       $max_del = count($p_array['delete']);
-                       for ($i = 0; $i < $max_del; $i++)
-                       {
-                               $frm = new 
Formulaire_Param_Detail($p_array['delete'][$i]);
-                               $frm->delete();
-                       }
-               }
-       }
-
 }
 
 ?>

Modified: trunk/rapport_avance/include/formulaire.inc.php
===================================================================
--- trunk/rapport_avance/include/formulaire.inc.php     2012-09-24 20:07:04 UTC 
(rev 411)
+++ trunk/rapport_avance/include/formulaire.inc.php     2012-09-24 20:47:12 UTC 
(rev 412)
@@ -30,12 +30,7 @@
 if ( isset($_POST['form_def_sub']))
 {
        RAPAV_formulaire::save_definition($_POST);
-       exit();
 }
-if (isset ($_POST['form_param_sub']))
-{
-       RAPAV_Formulaire::save_parameter($_POST);
-}
 if (isset ($_POST['add_form']))
 {
        $form= new RAPAV_Formulaire();

Modified: trunk/rapport_avance/rapav_javascript.js
===================================================================
--- trunk/rapport_avance/rapav_javascript.js    2012-09-24 20:07:04 UTC (rev 
411)
+++ trunk/rapport_avance/rapav_javascript.js    2012-09-24 20:47:12 UTC (rev 
412)
@@ -3,7 +3,9 @@
 content[200]="Le code doit être unique pour ce formulaire";
 content[201]="Formula TODO";
 
-
+/**
+ address@hidden show the definition of a form and let it modify it
+ */
 function rapav_form_def(plugin_code,ac,dossier,f_id)
 {
        try
@@ -105,6 +107,9 @@
                alert("add_param_detail"+e.message);
        }
 }
+/**
+ address@hidden display a popup and let you select an existing code
+ */
 function rapav_search_code(ac,plugin_code,dossier,f_id)
 {
        try
@@ -140,6 +145,9 @@
                alert("add_param_detail"+e.message);
        }
 }
+/**
+ address@hidden delete a parameter detail
+ */
 function delete_param_detail(plugin_code,ac,dossier,fp_id)
 {
        try
@@ -168,108 +176,6 @@
        }
 }
 /**
- address@hidden Sauve les données
- */
-/*function  show_poste(answer) {
-       try{
-               var answer=req.responseXML;
-               var a=answer.getElementsByTagName('ctl');
-               var html=answer.getElementsByTagName('code');
-               if ( a.length == 0 ) {
-                       var rec=req.responseText;
-                       alert ('erreur :'+rec);
-               }
-               var name_ctl=a[0].firstChild.nodeValue;
-               var code_html=html[0].firstChild.nodeValue;
-               // ou mieux
-               var code_html=getNodeText(html[0]); // Firefox ne prend que les 
4096 car.
-               code_html=unescape_xml(code_html);
-               $(name_ctl).innerHTML=code_html;
-       }
-       catch (e) {
-               alert(e.message);
-       }
-       try{
-               code_html.evalScripts();
-       }
-       catch(e){
-               alert("Impossible executer script de la reponse\n"+e.message);
-       }
-
-}*/
-/**
- * @brief Add a row to the table in formulaire_parametre
- * table id = table p_id
- */
-/*function row_add_code_tva(plugin_code,ac,dossier,p_id)
-{
-try
-       {
-               var max=parseFloat($('count_'+p_id).value);
-               var 
querystring='plugin_code='+plugin_code+'&ac='+ac+'&gDossier='+dossier+'&act=row_add_code_tva'+"&p_id="+p_id+"&max="+max;
-               waiting_box();
-               var action=new Ajax.Request(
-                       "ajax.php",
-                       {
-                               method:'get',
-                               parameters:querystring,
-                               onFailure:error_get_predef,
-                               onSuccess:function(req){
-                                       remove_waiting_box();
-                                       var answer=req.responseText;
-                                       var mytable=g("table_"+p_id).tBodies[0];
-                                       var nNumberRow=mytable.rows.length;
-                                       var oRow=mytable.insertRow(nNumberRow);
-                                       oRow.innerHTML=answer;
-                                       var 
max2=parseFloat($('count_'+p_id).value)+1;
-                                       $('count_'+p_id).value=max2;
-                                       answer.evalScripts();
-                               }
-                       }
-                       );
-
-       }catch (e)
-       {
-               alert(e.message);
-       }
-}*/
-/**
- * @brief Add a row to the table in formulaire_parametre, with total
- * table id = table p_id
- */
-/*function row_add_compute(plugin_code,ac,dossier,p_id)
-{
-try
-       {
-               var max=parseFloat($('count_'+p_id).value);
-               var 
querystring='plugin_code='+plugin_code+'&ac='+ac+'&gDossier='+dossier+'&act=row_add_compute'+"&p_id="+p_id+"&max="+max;
-               waiting_box();
-               var action=new Ajax.Request(
-                       "ajax.php",
-                       {
-                               method:'get',
-                               parameters:querystring,
-                               onFailure:error_get_predef,
-                               onSuccess:function(req){
-                                       remove_waiting_box();
-                                       var answer=req.responseText;
-                                       var mytable=g("table_"+p_id).tBodies[0];
-                                       var nNumberRow=mytable.rows.length;
-                                       var oRow=mytable.insertRow(nNumberRow);
-                                       oRow.innerHTML=answer;
-                                       var 
max2=parseFloat($('count_'+p_id).value)+1;
-                                       $('count_'+p_id).value=max2;
-                                       answer.evalScripts();
-                               }
-                       }
-                       );
-
-       }catch (e)
-       {
-               alert(e.message);
-       }
-}*/
-/**
  * @brief  montre les détails d'un formulaire
  */
 function rapav_form_param(plugin_code,ac,dossier,f_id)
@@ -363,6 +269,7 @@
                                                                var 
oRow=mytable.insertRow(nNumberRow);
                                                                
oRow.id="tr_"+fp_id;
                                                                
oRow.innerHTML=code_html;
+                                                               
removeDiv('param_detail_div');
 
                                                        }
                                                if (code == 'nok')



---
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]