phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r581 - in trunk: coprop/include rapport_avance rapport_a


From: phpcompta-dev
Subject: [Phpcompta-dev] r581 - in trunk: coprop/include rapport_avance rapport_avance/doc rapport_avance/include rapport_avance/include/template
Date: Fri, 22 Nov 2013 19:17:56 +0100 (CET)

Author: danydb
Date: 2013-11-22 19:17:56 +0100 (Fri, 22 Nov 2013)
New Revision: 581

Added:
   trunk/rapport_avance/include/class_rapav_listing_formula.php
Modified:
   trunk/coprop/include/class_copro_budget.php
   trunk/rapport_avance/doc/rapav-listing-code.odt
   trunk/rapport_avance/include/class_rapav_listing.php
   trunk/rapport_avance/include/liste.inc.php
   trunk/rapport_avance/include/template/listing_param_input.php
   trunk/rapport_avance/include/template/param_detail_new.php
   trunk/rapport_avance/include/template/rapav_listing_definition.php
   trunk/rapport_avance/include/template/rapav_listing_to_list.php
   trunk/rapport_avance/rapav_javascript.js
Log:
Continue dev - listing 

Modified: trunk/coprop/include/class_copro_budget.php
===================================================================
--- trunk/coprop/include/class_copro_budget.php 2013-11-22 18:09:36 UTC (rev 
580)
+++ trunk/coprop/include/class_copro_budget.php 2013-11-22 18:17:56 UTC (rev 
581)
@@ -9,9 +9,9 @@
 
         $array=$cn->get_array("select b_id, b_name,
                    b_exercice,
-                                  b_type,
-                                   case when b_type = 'OPER' then 
'Opérationnel'
-                                        when b_type = 'PREV' then 
'Prévisionnel' else 'inconnu' end as str_type,
+                    b_type,
+                     case when b_type = 'OPER' then 'Opérationnel'
+                          when b_type = 'PREV' then 'Prévisionnel' else 
'inconnu' end as str_type,
                     b_amount
                     from coprop.budget
                     order by b_name

Modified: trunk/rapport_avance/doc/rapav-listing-code.odt
===================================================================
(Binary files differ)

Modified: trunk/rapport_avance/include/class_rapav_listing.php
===================================================================
--- trunk/rapport_avance/include/class_rapav_listing.php        2013-11-22 
18:09:36 UTC (rev 580)
+++ trunk/rapport_avance/include/class_rapav_listing.php        2013-11-22 
18:17:56 UTC (rev 581)
@@ -193,9 +193,23 @@
      */
     function display()
     {
+        require_once 'class_rapav_listing_formula.php';
         // Load all listing_parameter
         $this->load_detail();
         
+        // Button for modifing 
+        $button=new IButton('listing_mod_bt_id','Modifie');
+        $arg = array(
+            'gDossier' => Dossier::id(),
+            'ac' => $_REQUEST['ac'],
+            'pc' => $_REQUEST['plugin_code'],
+            'id' => $this->Data->l_id,
+            'cin' => 'listing_tb_id',
+            'cout' => 'listing_mod_div');
+        $json = 'listing_modify(' . str_replace('"', "'", json_encode($arg)) . 
')';
+        $button->javascript=$json;
+        
+        
         // Display them avec an anchor to update / delete (javascript)
         include_once 'template/rapav_listing_definition.php';
     }
@@ -233,4 +247,28 @@
         $param=new RAPAV_Listing_Param();
         $param->input($this->Data->getp("id"));
     }
+    /**
+     * Return the name of the description of the category of the cards
+     * 
+     * @return string
+     */
+    function get_categorie_name()
+    {
+        global $cn;
+        if ($this->Data->getp('id')==0) return;
+        $cat=$cn->get_value('select fd_label from fiche_def where 
fd_id=$1',array($this->Data->getp('fiche_def_id')));
+        return $cat;
+    }
+    /**
+     * Return the name of the description of the category of the cards
+     * 
+     * @return string
+     */
+    function get_categorie_description()
+    {
+        global $cn;
+        if ($this->Data->getp('id')==0) return;
+        $cat=$cn->get_value('select fd_description from fiche_def where 
fd_id=$1',array($this->Data->getp('fiche_def_id')));
+        return $cat;
+    }
 }

Added: trunk/rapport_avance/include/class_rapav_listing_formula.php
===================================================================
--- trunk/rapport_avance/include/class_rapav_listing_formula.php                
                (rev 0)
+++ trunk/rapport_avance/include/class_rapav_listing_formula.php        
2013-11-22 18:17:56 UTC (rev 581)
@@ -0,0 +1,27 @@
+<?php
+
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+/**
+ * Description of class_rapav_listing_formula
+ *
+ * @author dany
+ */
+abstract class RAPAV_Listing_Formula
+{
+    abstract public function display();
+    abstract public function compute();
+    abstract public function input();
+    /**
+     * 
+     * @param $p_obj RAPAV_Listing_Param_SQL
+     */
+    public function make_object($p_obj)
+    {
+        
+    }
+}

Modified: trunk/rapport_avance/include/liste.inc.php
===================================================================
--- trunk/rapport_avance/include/liste.inc.php  2013-11-22 18:09:36 UTC (rev 
580)
+++ trunk/rapport_avance/include/liste.inc.php  2013-11-22 18:17:56 UTC (rev 
581)
@@ -1,32 +1,38 @@
 <div class="content" id="listing_definition_div_id">
-<?php
-/**
- * @file
- * @brief manage the listing
- */
-var_dump($_POST);
-require_once 'class_rapav_listing.php';
-global $cn;
-$listing=new Rapav_Listing();
+    <?php
+    /**
+     * @file
+     * @brief manage the listing
+     */
+    var_dump($_POST);
+    require_once 'class_rapav_listing.php';
+    global $cn;
+    $listing = new Rapav_Listing();
 
-/**
- * save new listing
- */
-if ( isset ($_POST['listing_add_sb']))
-{
-    $new=new Rapav_Listing($_POST['l_id']);
-    if ( ! isset ($_POST['remove']))
-        $new->save($_POST);
-    else
-        $new->delete($_POST);
-}
+    /**
+     * save new listing
+     */
+    if (isset($_POST['listing_add_sb']))
+    {
+        $new = new Rapav_Listing($_POST['l_id']);
+        if (!isset($_POST['remove']))
+        {
+            $new->save($_POST);
+            $new->display();
+            echo '<p>';
+            $new->button_add_param();
+            echo '</p>';
+            exit();
+        } else
+            $new->delete($_POST);
+    }
 
 ///////////////////////////////////////////////////////////////////////////////
 //Listing
 ///////////////////////////////////////////////////////////////////////////////
-$listing->to_list();
-echo '<p>';
-Rapav_Listing::Button_Add_Listing();
-echo '</p>';
-?>
+    $listing->to_list();
+    echo '<p>';
+    Rapav_Listing::Button_Add_Listing();
+    echo '</p>';
+    ?>
 </div>
\ No newline at end of file

Modified: trunk/rapport_avance/include/template/listing_param_input.php
===================================================================
--- trunk/rapport_avance/include/template/listing_param_input.php       
2013-11-22 18:09:36 UTC (rev 580)
+++ trunk/rapport_avance/include/template/listing_param_input.php       
2013-11-22 18:17:56 UTC (rev 581)
@@ -1,5 +1,104 @@
 <div>
-    <label>Code</label> <?php echo $code->input() ?>
-    <label>Commentaire</label><?php echo $comment->input(); ?>
-    <label>Order apparation</label><?php echo $order->input(); ?>
+    <table>
+        <tr>
+            <td>
+                <label>Code</label> 
+            </td>
+            <td>
+                <?php echo $code->input() ?>
+            </tD>
+        </tr>
+        <tr>
+            <td>
+                <label>Commentaire</label>
+            </td>
+            <td>
+                <?php echo $comment->input(); ?>
+            </td>
+        </tr>
+        <tr>
+            <td>
+                <label>Order apparition</label>
+            </td>
+            <td>
+                <?php echo $order->input(); ?>
+            </td>
+        </tr>
+    </table>
+    <table style="width:90%;margin-left:5%" >
+        <tr>
+            <td id="new_formula_id_bt" class="tool" style="background:red">
+                <a class="mtitle"  href="javascript:void(0)"  
onclick="show_listing_formula('new_formula_id')">
+                    Formule
+                </a>
+            </td>
+            <td id="new_compute_id_bt"  class="tool" 
style="background:inherit">
+                <a class="mtitle" href="javascript:void(0)"
+                   onclick="show_listing_formula('new_compute_id')">
+                    Compute
+                </a>
+            </td>
+
+            <td id="new_account_id_bt"  class="tool" 
style="background:inherit">
+                <a class="mtitle" href="javascript:void(0)"   
onclick="show_listing_formula('new_account_id')">
+                    Poste comptable
+                </a>
+            </td>
+        </tr>
+    </table>
+    <div style="width:100%;height:290px;margin:1px">
+        <span class="error" id="param_detail_info_div"></span>
+
+        <div style="padding: 10px">
+            <div id="new_formula_id" style="display:block">
+                <p>
+                    Entrer une formule avec des postes comptables, la syntaxe 
est la même que celle des "rapports"
+                </p>
+                <p>
+                    Exemple : [70%]*0.25+[71%]
+                </p>
+
+                <form id="new_padef" method="POST" 
onsubmit="save_param_listing('new_padef');
+                        return false">
+                          <?php echo 
HtmlInput::request_to_hidden(array('gDossier', 'ac', 'plugin_code', 'p_id')) ?>
+                    <p>
+                        <?php echo HtmlInput::hidden('tab', 'formula') ?>
+                        <?php echo "formula"; ?>
+                    </p>
+
+                    <?php echo HtmlInput::submit('save', 'Sauve') ?>
+
+                </form>
+            </div>
+            <div id="new_compute_id" style="display:none">
+                <p>
+                    Entrer une formule avec des codes utilisés dans ce 
formulaires
+                </p>
+                <form id="new_padec" method="POST" 
onsubmit="save_param_listing('new_padec');
+                        return false">
+                          <?php echo 
HtmlInput::request_to_hidden(array('gDossier', 'ac', 'plugin_code', 'p_id')) ?>
+
+                    <?php echo HtmlInput::hidden('tab', 'compute_id') ?>
+                    <?php echo "compute" ?>
+                    <p>
+                        <?php echo HtmlInput::submit('save', 'Sauve') ?>
+                    </p>
+
+                </form>
+            </div>
+            <div id="new_account_id" style="display:none">
+                <form id="new_paded" method="POST" 
onsubmit="save_param_listing('new_paded');
+                        return false">
+
+                    <?php echo HtmlInput::request_to_hidden(array('gDossier', 
'ac', 'plugin_code', 'p_id')) ?>
+
+                    <?php echo HtmlInput::hidden('tab', 'new_account_id') ?>
+                    <?php echo "account" ?>
+
+                    <?php echo HtmlInput::submit('save', 'Sauve') ?>
+
+                </form>
+            </div>
+        </div>
+    </div>
 </div>
\ No newline at end of file

Modified: trunk/rapport_avance/include/template/param_detail_new.php
===================================================================
--- trunk/rapport_avance/include/template/param_detail_new.php  2013-11-22 
18:09:36 UTC (rev 580)
+++ trunk/rapport_avance/include/template/param_detail_new.php  2013-11-22 
18:17:56 UTC (rev 581)
@@ -23,7 +23,7 @@
 
 /**
  * @file
- * @brief
+ * @brief add parameter for declaration
  *
  */
 
@@ -32,28 +32,28 @@
 <table style="width:90%;margin-left:5%" >
        <tr>
        <td id="new_formula_id_bt" class="tool" style="background:red">
-               <a class="mtitle"  href="javascript:void(0)"  
onclick="show_type_formula('new_formula_id')">
+               <a class="mtitle"  href="javascript:void(0)"  
onclick="show_rapport_formula('new_formula_id')">
                        Formule
                </a>
        </td>
        <td id="new_compute_id_bt"  class="tool" style="background:inherit">
                <a class="mtitle" href="javascript:void(0)"
-                  onclick="show_type_formula('new_compute_id')">
+                  onclick="show_rapport_formula('new_compute_id')">
                        Compute
                </a>
        </td>
        <td id="new_account_tva_id_bt"  class="tool" style="background:inherit">
-               <a class="mtitle" href="javascript:void(0)"   
onclick="show_type_formula('new_account_tva_id')">
+               <a class="mtitle" href="javascript:void(0)"   
onclick="show_rapport_formula('new_account_tva_id')">
                        Poste comptable et code TVA
                </a>
        </td>
        <td id="new_account_id_bt"  class="tool" style="background:inherit">
-               <a class="mtitle" href="javascript:void(0)"   
onclick="show_type_formula('new_account_id')">
+               <a class="mtitle" href="javascript:void(0)"   
onclick="show_rapport_formula('new_account_id')">
                        Poste comptable
                </a>
        </td>
        <td id="new_reconcile_id_bt"  class="tool" style="background:inherit">
-               <a class="mtitle" href="javascript:void(0)"   
onclick="show_type_formula('new_reconcile_id')">
+               <a class="mtitle" href="javascript:void(0)"   
onclick="show_rapport_formula('new_reconcile_id')">
                        Opérations rapprochées
                </a>
        </td>

Modified: trunk/rapport_avance/include/template/rapav_listing_definition.php
===================================================================
--- trunk/rapport_avance/include/template/rapav_listing_definition.php  
2013-11-22 18:09:36 UTC (rev 580)
+++ trunk/rapport_avance/include/template/rapav_listing_definition.php  
2013-11-22 18:17:56 UTC (rev 581)
@@ -7,6 +7,17 @@
  */
 
 ?>
+<p>
+    Nom listing <?php echo h($this->Data->getp('name')); ?>
+</p>
+<p>
+    Description <?php echo h($this->Data->getp('description')); ?>
+</p>
+<p>
+    Catégorie <?php echo h($this->get_categorie_name()); ?>
+    <?php echo h($this->get_categorie_description());  ?>
+</p>
+<?php echo $button->input(); ?>
 <table class="result" id="definition_tb_id">
     <tr>
         <th>

Modified: trunk/rapport_avance/include/template/rapav_listing_to_list.php
===================================================================
--- trunk/rapport_avance/include/template/rapav_listing_to_list.php     
2013-11-22 18:09:36 UTC (rev 580)
+++ trunk/rapport_avance/include/template/rapav_listing_to_list.php     
2013-11-22 18:17:56 UTC (rev 581)
@@ -16,14 +16,14 @@
     $max=Database::num_row($res);
     for ($i=0;$i<$max;$i++):
         $row=  Database::fetch_array($res, $i);
-        $arg = array(
+     $arg = array(
             'gDossier' => Dossier::id(),
             'ac' => $_REQUEST['ac'],
             'pc' => $_REQUEST['plugin_code'],
             'id' => $row['l_id'],
-            'cin' => 'listing_tb_id',
-            'cout' => 'listing_mod_div');
-        $json = 'listing_modify(' . str_replace('"', "'", json_encode($arg)) . 
')';
+            'cin' => 'listing_definition_id',
+            'cout' => 'listing_definition_div_id');
+        $json = 'listing_definition(' . str_replace('"', "'", 
json_encode($arg)) . ')';
     ?>
     <tr>
         <td>
@@ -36,17 +36,6 @@
             <?php echo h($row['fd_label']); ?>
         </td>
         <td>
-        <?php
-        $arg = array(
-            'gDossier' => Dossier::id(),
-            'ac' => $_REQUEST['ac'],
-            'pc' => $_REQUEST['plugin_code'],
-            'id' => $row['l_id'],
-            'cin' => 'listing_definition_id',
-            'cout' => 'listing_definition_div_id');
-        $json = 'listing_definition(' . str_replace('"', "'", 
json_encode($arg)) . ')';
-        echo HtmlInput::anchor(h($row['l_name']),'',' onclick="'.$json.'"'); 
-        ?>
             
         </td>
     </tr>

Modified: trunk/rapport_avance/rapav_javascript.js
===================================================================
--- trunk/rapport_avance/rapav_javascript.js    2013-11-22 18:09:36 UTC (rev 
580)
+++ trunk/rapport_avance/rapav_javascript.js    2013-11-22 18:17:56 UTC (rev 
581)
@@ -214,9 +214,9 @@
        }
 }
 /**
- * @brief montre le div contenant le type de formule
+ * @brief montre le div contenant le type de formule pour les rapports
  */
-function show_type_formula(p_toshow)
+function show_rapport_formula(p_toshow)
 {
        try
        {
@@ -235,6 +235,27 @@
 
 }
 /**
+ * @brief montre le div contenant le type de formule pour les listings
+ */
+function show_listing_formula(p_toshow)
+{
+       try
+       {
+               var div=['new_formula_id','new_compute_id','new_account_id'];
+               for (var r =0;r<div.length;r++ ) {
+                       $(div[r]).hide();
+                       $(div[r]+'_bt').style.backgroundColor="inherit";
+
+               }
+               $(p_toshow).show();
+               $(p_toshow+'_bt').style.backgroundColor="red";
+       } catch (e)
+{
+               alert (e.message);
+       }
+
+}
+/**
  * @brief sauve les données pour nouvelle formule, code,...
  */
 function save_param_detail(p_form_id)
@@ -630,7 +651,7 @@
                             var code_html = getNodeText(html[0]); 
                             code_html = unescape_xml(code_html);
                             console.log(code_html);
-                            var position=fixed_position(451,217);
+                            var position=fixed_position(451,217)+';width:50%';
                             
add_div({'id':json.cin,'cssclass':'inner_box','drag':1,'style':position});
                            $(json.cin).innerHTML = code_html;
                         } catch (e) {



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