phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r5220 - in phpcompta/trunk: html html/js include


From: phpcompta-dev
Subject: [Phpcompta-dev] r5220 - in phpcompta/trunk: html html/js include
Date: Tue, 7 May 2013 01:35:00 +0200 (CEST)

Author: danydb
Date: 2013-05-07 01:35:00 +0200 (Tue, 07 May 2013)
New Revision: 5220

Modified:
   phpcompta/trunk/html/js/infobulle.js
   phpcompta/trunk/html/js/scripts.js
   phpcompta/trunk/html/user_login.php
   phpcompta/trunk/include/balance.inc.php
   phpcompta/trunk/include/class_html_input.php
   phpcompta/trunk/include/class_user.php
   phpcompta/trunk/include/compta_fin_rec.inc.php
   phpcompta/trunk/include/constant.php
   phpcompta/trunk/include/dossier.inc.php
   phpcompta/trunk/include/modele.inc.php
   phpcompta/trunk/include/user.inc.php
Log:
task #0000832: Filtrage simple de table

Ajout pour les utilisateurs, dossier, mod?\195?\168les, balances (PRINTBAL),
rapprochements bancaires(FREC)

Modified: phpcompta/trunk/html/js/infobulle.js
===================================================================
--- phpcompta/trunk/html/js/infobulle.js        2013-05-06 23:21:37 UTC (rev 
5219)
+++ phpcompta/trunk/html/js/infobulle.js        2013-05-06 23:35:00 UTC (rev 
5220)
@@ -49,6 +49,11 @@
 content[19]="Donnez une partie du nom, de la description,  du n° de TVA ou 
quick code";
 content[20]="Les menus ne peuvent dépendre que dans d'un menu principal ou 
d'un menu, si cette liste est vide, ajouter des modules ou menu principal sans 
donner de dépendance";
 content[21]="Donnez un nombre entre 0 & 100";
+content[22]="Donnez une partie du nom du dossier,du nom, du prénom ou du login 
pour filtrer";
+content[23]="Donnez une partie du nom du dossier ou de la description pour 
filtrer";
+content[24]="Donnez une partie du poste comptable ou du libellé pour filtrer";
+content[25]="Donnez une partie du libellé, la date, le montant ou le numéro 
d'opération pour filtrer, cela n'efface pas ce qui a déjà été sélectionné";
+
 function showBulle(p_ctl)
 {
     d=document.getElementById('bulle');

Modified: phpcompta/trunk/html/js/scripts.js
===================================================================
--- phpcompta/trunk/html/js/scripts.js  2013-05-06 23:21:37 UTC (rev 5219)
+++ phpcompta/trunk/html/js/scripts.js  2013-05-06 23:35:00 UTC (rev 5220)
@@ -1712,4 +1712,45 @@
                                }
                        }
        );
+}
+/**
+ * @brief filter quickly a table
+ * @param  phrase : phrase to seach
+ * @param  _id : id of the table
+ * @param  colnr : string containing the column number where you're searching 
separated by a comma
+ * @param start_row : first row (1 if you have table header)
+ * @returns nothing
+ * @see HtmlInput::filter_table
+ */
+function filter_table(phrase, _id, colnr,start_row) {
+       var words = phrase.value.toLowerCase();
+       var table = document.getElementById(_id);
+       // if colnr contains a comma then check several columns
+       var aCol = new Array();
+       if (colnr.indexOf(',') >= 0) {
+               aCol = colnr.split(',');
+       } else {
+               aCol[0] = colnr;
+       }
+       var ele;
+       for (var r = start_row; r < table.rows.length; r++) {
+               var found=0;
+               for (var col =0;col < aCol.length;col++)
+               {
+                       var idx=aCol[col];
+                       console.log(r);
+                       if (table.rows[r].cells[idx])
+                                {
+                                       ele = 
table.rows[r].cells[idx].innerHTML.replace(/<[^>]+>/g, "");
+                                               //var displayStyle = 'none';
+                                       if (ele.toLowerCase().indexOf(words) >= 
0){ found=1; }
+                                }
+
+               }
+               if (found == 1 ){
+                       table.rows[r].style.display = '';
+               } else {
+                       table.rows[r].style.display = 'none';
+               }
+       }
 }
\ No newline at end of file

Modified: phpcompta/trunk/html/user_login.php
===================================================================
--- phpcompta/trunk/html/user_login.php 2013-05-06 23:21:37 UTC (rev 5219)
+++ phpcompta/trunk/html/user_login.php 2013-05-06 23:35:00 UTC (rev 5220)
@@ -25,6 +25,7 @@
 include_once ("ac_common.php");
 require_once('class_database.php');
 require_once('class_itext.php');
+require_once 'function_javascript.php';
 @html_page_start($_SESSION['g_theme']);
 $rep=new Database();
 include_once ("class_user.php");
@@ -93,6 +94,7 @@
 
 include_once("user_menu.php");
 $priv=($User->admin==1)?"Administrateur":"Utilisateur";
+load_all_script();
 echo '<div class="welcome"> ';
 /**
  *
@@ -140,29 +142,18 @@
 ?>
 <div class="foldercontent">
 <?php echo '<h2 >'._('Choississez votre dossier').'</h2>';?>
-<form method="get" action="?">
-                          <input type="submit" class="button" value="<?php 
echo _('Rechercher');?>">
-                                                                 <?php
-                                                                 $w=new 
IText();
-$p_nom=isset($_GET ['p_nom'])?$_GET['p_nom']:"";
-echo $w->input('p_nom',$p_nom);
-
+       <span style="display:block">
+ <?php
+                        echo _('Filtre').HtmlInput::infobulle(23);
 ?>
-<span class="notice">
-                        <?php
-                        echo _('Donnez une partie du nom du dossier ou de la 
description à rechercher');
+<?php
+       echo HtmlInput::filter_table("folder", '1,2',0);
 ?>
 </span>
-</form>
 <?php
-$filtre="";
-if ( isset ($_GET ['p_nom']))
-{
-    $filtre=$_GET['p_nom'];
-}
 
 // If admin show everything otherwise only the available dossier
-$res=$User->show_dossier($filtre);
+$res=$User->show_dossier("");
 echo $res;
 ?>
 <P>

Modified: phpcompta/trunk/include/balance.inc.php
===================================================================
--- phpcompta/trunk/include/balance.inc.php     2013-05-06 23:21:37 UTC (rev 
5219)
+++ phpcompta/trunk/include/balance.inc.php     2013-05-06 23:35:00 UTC (rev 
5220)
@@ -172,6 +172,7 @@
 
     $hid=new IHidden();
 
+
     echo "<table>";
     echo '<TR>';
     echo '<TD><form method="GET" ACTION="export.php">'.
@@ -255,8 +256,11 @@
     $a=$periode->get_date_limit($_GET['from_periode']);
     $b=$periode->get_date_limit($_GET['to_periode']);
     echo "<h2 class=\"info\"> période du ".$a['p_start']." au 
".$b['p_end']."</h2>";
-
-    echo '<table width="100%">';
+       echo '<span style="display:block">';
+       echo _('Filtre').HtmlInput::infobulle(24);
+       echo HtmlInput::filter_table("t_balance", "0,1","1");
+       echo '</span>';
+    echo '<table id="t_balance" width="100%">';
     echo '<th>Poste Comptable</th>';
     echo '<th>Libell&eacute;</th>';
     echo '<th>D&eacute;bit</th>';

Modified: phpcompta/trunk/include/class_html_input.php
===================================================================
--- phpcompta/trunk/include/class_html_input.php        2013-05-06 23:21:37 UTC 
(rev 5219)
+++ phpcompta/trunk/include/class_html_input.php        2013-05-06 23:35:00 UTC 
(rev 5220)
@@ -713,4 +713,13 @@
                      return $sel;
                        }
        }
+       static function filter_table($p_table_id,$p_col,$start_row)
+       {
+               $r= "
+                       <form style=\"display:inline\">
+                       <input class=\"input_text\" name=\"filter\" 
onkeyup=\"filter_table(this, '$p_table_id','$p_col',$start_row )\" 
type=\"text\">
+                       </form>
+                       ";
+               return $r;
+       }
 }
\ No newline at end of file

Modified: phpcompta/trunk/include/class_user.php
===================================================================
--- phpcompta/trunk/include/class_user.php      2013-05-06 23:21:37 UTC (rev 
5219)
+++ phpcompta/trunk/include/class_user.php      2013-05-06 23:35:00 UTC (rev 
5220)
@@ -935,7 +935,7 @@
                if ($p_array == 0)
                        return $result . " * Aucun dossier *";
 
-               $result.="<TABLE 
style=\"width:auto;border-width:0px;border-collapse:collapse;\">";
+               $result.="<TABLE id=\"folder\" 
style=\"width:auto;border-width:0px;border-collapse:collapse;\">";
                for ($i = 0; $i < sizeof($p_array); $i++)
                {
 

Modified: phpcompta/trunk/include/compta_fin_rec.inc.php
===================================================================
--- phpcompta/trunk/include/compta_fin_rec.inc.php      2013-05-06 23:21:37 UTC 
(rev 5219)
+++ phpcompta/trunk/include/compta_fin_rec.inc.php      2013-05-06 23:35:00 UTC 
(rev 5220)
@@ -122,7 +122,11 @@
 echo IButton::tooggle_checkbox('rec1');
 echo '</p>';
 echo HtmlInput::submit('save', 'Mettre à jour le n° de relevé bancaire');
-echo '<table class="sortable" style="width:80%;margin-left:10%">';
+echo '<span style="display:block">';
+       echo _('Filtre').HtmlInput::infobulle(25);
+       echo HtmlInput::filter_table("t_rec_bk", "0,1,2,3","1");
+       echo '</span>';
+echo '<table id="t_rec_bk" class="sortable" 
style="width:80%;margin-left:10%">';
 $r ='<th class=" sorttable_sorted_reverse">'.'Date 
'.HtmlInput::infobulle(17).'<span 
id="sorttable_sortrevind">&nbsp;&blacktriangle;</span>'.'</th>';
 $r.=th('Libellé');
 $r.=th('N° interne');

Modified: phpcompta/trunk/include/constant.php
===================================================================
--- phpcompta/trunk/include/constant.php        2013-05-06 23:21:37 UTC (rev 
5219)
+++ phpcompta/trunk/include/constant.php        2013-05-06 23:35:00 UTC (rev 
5220)
@@ -35,8 +35,9 @@
 $g_succeed="<span style=\"font-size:18px;color:green\">&#x2713;</span>";
 /*set to none for production */
 /* uncomment for production */
+define ('SVNINFO',5666);
 $version_phpcompta=SVNINFO;
-define ("DEBUG",false);
+define ("DEBUG",true);
 /* define ('SVNINFO',5015);
  * $version_phpcompta=SVNINFO;
  * define ("DEBUG",true);

Modified: phpcompta/trunk/include/dossier.inc.php
===================================================================
--- phpcompta/trunk/include/dossier.inc.php     2013-05-06 23:21:37 UTC (rev 
5219)
+++ phpcompta/trunk/include/dossier.inc.php     2013-05-06 23:35:00 UTC (rev 
5220)
@@ -172,7 +172,11 @@
        $compteur=1;
     $template="";
        echo '<div class="content">';
-    echo '<TABLE class="table_large" >';
+       echo '<span style="display:block">';
+       echo _('Filtre').HtmlInput::infobulle(23);
+       echo HtmlInput::filter_table("t_dossier", "0,1,2","1");
+       echo '</span>';
+    echo '<TABLE id="t_dossier" class="table_large" >';
        $r="";
        $r.='<th>'.$header->get_header(0).'</td>';
        $r.='<th>'.$header->get_header(1).'</td>';

Modified: phpcompta/trunk/include/modele.inc.php
===================================================================
--- phpcompta/trunk/include/modele.inc.php      2013-05-06 23:21:37 UTC (rev 
5219)
+++ phpcompta/trunk/include/modele.inc.php      2013-05-06 23:35:00 UTC (rev 
5220)
@@ -232,8 +232,11 @@
 
                echo HtmlInput::button_anchor('Rafra&icirc;chir', 
'admin_repo.php?action=modele_mgt');
                echo HtmlInput::button_anchor('Ajouter', 
'admin_repo.php?action=modele_mgt&sa=add');
-
-               echo '<table class="result" 
style="border-spacing:10;border-collapse:separate" >';
+               echo '<span style="display:block;margin-top:10">';
+               echo _('Filtre').HtmlInput::infobulle(23);
+               echo HtmlInput::filter_table("t_modele", "0,1,2","1");
+               echo '</span>';
+               echo '<table id="t_modele" class="table_large" 
style="border-spacing:10;border-collapse:separate" >';
                echo "<TR>".
                                "<TH>".$header->get_header(0)."</TH>" .
                                "<TH>".$header->get_header(1)."</TH>" .

Modified: phpcompta/trunk/include/user.inc.php
===================================================================
--- phpcompta/trunk/include/user.inc.php        2013-05-06 23:21:37 UTC (rev 
5219)
+++ phpcompta/trunk/include/user.inc.php        2013-05-06 23:35:00 UTC (rev 
5220)
@@ -112,7 +112,11 @@
 
 if ( !empty ($a_user) )
 {
-    echo '<table class="result">';
+       echo '<span style="display:block">';
+       echo _('Filtre').HtmlInput::infobulle(22);
+       echo HtmlInput::filter_table("user", "0,1,2,5","1");
+       echo '</span>';
+    echo '<table id="user" class="result">';
     echo '<tr>';
     echo '<th>'.$header->get_header(0).'</th>';
     echo '<th>'.$header->get_header(1).'</th>';



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