noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 03/07: Put a button export CSV & PDF into the


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 03/07: Put a button export CSV & PDF into the inner windows for the history of card and accounting + quick filter
Date: Thu, 15 Oct 2015 19:00:15 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit 03a3de6a2f1d6d2d8f84e3ab6417027675b8c4d7
Author: Dany De Bontridder <address@hidden>
Date:   Thu Oct 15 11:43:25 2015 +0200

    Put a button export CSV & PDF into the inner windows for the history of 
card and accounting + quick filter
---
 include/ajax/ajax_history.php              |   32 +++++++++++++++++++--------
 include/class/class_acc_account_ledger.php |   16 ++++++++++---
 include/class/class_fiche.php              |   11 ++++++++-
 3 files changed, 44 insertions(+), 15 deletions(-)

diff --git a/include/ajax/ajax_history.php b/include/ajax/ajax_history.php
index cb2119e..0603b3b 100644
--- a/include/ajax/ajax_history.php
+++ b/include/ajax/ajax_history.php
@@ -41,7 +41,7 @@ mb_internal_encoding("UTF-8");
 /* security */
 if ( $g_user->check_dossier(dossier::id(),true) == 'X' ) exit();
 
-$from_div = (isset($_REQUEST['ajax'])) ? 1 : $_GET['l'];
+$from_div = (isset($_REQUEST['ajax'])) ? 1 : $div;
 
 ///////////////////////////////////////////////////////////////////////////
 /* first detail for a card */
@@ -99,16 +99,23 @@ if ( isset($_GET['f_id']))
                $old.='</form>';
              }
          }
-
+        ob_start();
+        $result=$fiche->HtmlTable($array,0,$from_div);
+        $table=ob_get_contents();
+        ob_end_clean();
+        
+        
         ob_start();
         require_once NOALYSS_INCLUDE.'/template/history_top.php';
        
$detail_card=HtmlInput::card_detail($fiche->strAttribut(ATTR_DEF_QUICKCODE),$fiche->getName());
        echo h2(  
$fiche->getName().'['.$fiche->strAttribut(ATTR_DEF_QUICKCODE).']',' 
class="title" ');
        echo '<p style="text-align:center;">'.$detail_card.'</p>';
  
-       if (   $fiche->HtmlTable($array,0,$from_div)==-1){
+       if (   $result ==-1){
          echo h2(_("Aucune opération pour l'exercice 
courant"),'class="error"');
        } else {
+            echo $fiche->filter_history("tb".$div);
+            echo $table;
             echo 
$fiche->button_csv($array['from_periode'],$array['to_periode']);
             echo 
$fiche->button_pdf($array['from_periode'],$array['to_periode']);
           }
@@ -175,20 +182,25 @@ if ( isset($_REQUEST['pcm_val']))
              }
 
          }
-
         ob_start();
-        require_once NOALYSS_INCLUDE.'/template/history_top.php';
-        
+        $result=$poste->HtmlTable($array,0,$from_div);
+        $table=ob_get_contents();
+        ob_end_clean();
         
+        ob_start();
+        require_once NOALYSS_INCLUDE.'/template/history_top.php';
+             
+        echo '<h2 class="title">'.$poste->id." ".h($poste->name).'</h2>';
         
-        if ( $poste->HtmlTable($array) == -1)
+        if ( $result == -1)
          {
            echo h2($poste->id." ".$poste->name,' class="title"');
            echo h2(_("Aucune opération pour l'exercice 
courant"),'class="error"');
          } else {
-                 
-                 echo 
$poste->button_csv($array['from_periode'],$array['to_periode']);
-                 echo 
$poste->button_pdf($array['from_periode'],$array['to_periode']);
+                echo $poste->filter_history('tb'.$div);
+                echo $table;
+                echo 
$poste->button_csv($array['from_periode'],$array['to_periode']);
+                echo 
$poste->button_pdf($array['from_periode'],$array['to_periode']);
           }
        echo $old;
 
diff --git a/include/class/class_acc_account_ledger.php 
b/include/class/class_acc_account_ledger.php
index f35a939..ebad5a6 100644
--- a/include/class/class_acc_account_ledger.php
+++ b/include/class/class_acc_account_ledger.php
@@ -330,11 +330,11 @@ class Acc_Account_Ledger
 
         $rep="";
 
-        echo '<h2 class="title">'.$this->id." ".$this->name.'</h2>';
-        if ( $from_div == 0)
-                       echo "<TABLE class=\"resultfooter\" 
style=\"border-collapse:separate;margin:1%;width:98%;;border-spacing:0px 
5px\">";
+        
+        if ( $from_div == 1)
+                       echo "<TABLE id=\"tbpopup\" class=\"resultfooter\" 
style=\"border-collapse:separate;margin:1%;width:98%;;border-spacing:0px 
5px\">";
                else
-                       echo "<TABLE class=\"resultfooter\" 
style=\"border-collapse:separate;margin:1%;width:98%;;border-spacing:0px 
2px\">";
+                       echo "<TABLE id=\"tb".$from_div."\" 
class=\"resultfooter\" 
style=\"border-collapse:separate;margin:1%;width:98%;;border-spacing:0px 
2px\">";
         echo '<tbody>';
         echo "<TR>".
         "<TH style=\"text-align:left\"> Date</TH>".
@@ -690,6 +690,14 @@ class Acc_Account_Ledger
         return '<a class="smallbutton" style="display:inline" 
href="'.$href.'">'._("Export PDF").'</a>';
         
     }
+    /**
+     * @brief Filter in javascript the table with the history
+     * @param type $p_table_id id of the table containting the data to filter
+     * @return html string
+     */
+    function filter_history($p_table_id) {
+        return _('Filtre rapide').' '.HtmlInput::filter_table($p_table_id, 
'0,1,2,3,5,6,7', 1);
+    }
     static function test_me()
     {
         $cn=Dossier::connect();
diff --git a/include/class/class_fiche.php b/include/class/class_fiche.php
index d6ab887..3dad915 100644
--- a/include/class/class_fiche.php
+++ b/include/class/class_fiche.php
@@ -1293,7 +1293,7 @@ class Fiche
         $rep="";
        if ( $from_div==1)
          {
-           echo "<TABLE class=\"resultfooter\" 
style=\"margin:1%;width:98%;;border-collapse:separate;border-spacing:0px 
5px\">";
+           echo "<TABLE id=\"tbpopup\" class=\"resultfooter\" 
style=\"margin:1%;width:98%;;border-collapse:separate;border-spacing:0px 
5px\">";
          }
        else
          {
@@ -2031,6 +2031,15 @@ class Fiche
         return '<a class="smallbutton" style="display:inline" 
href="'.$href.'">'._("Export PDF").'</a>';
         
     }
+    /**
+     * @brief Filter in javascript the table with the history
+     * @param type $p_table_id id of the table containting the data to filter
+     * @return html string
+     */
+
+    function filter_history($p_table_id) {
+        return _('Filtre rapide').' '.HtmlInput::filter_table($p_table_id, 
'0,1,2,3,5,6,7', 1);
+    }
 }
 
 ?>



reply via email to

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