[grisbiwebcommit] [5] ADD afficher ou non le d?\195?\169tail des op?\195?\169rations ventil? \195?\169es

[ Thread Index | Date Index | More lists.tuxfamily.org/grisbiwebcommit Archives ]


Revision: 5
Author:   nicosomb
Date:     2009-01-25 20:29:22 +0100 (Sun, 25 Jan 2009)

Log Message:
-----------
ADD afficher ou non le d?\195?\169tail des op?\195?\169rations ventil?\195?\169es

Modified Paths:
--------------
    trunk/functions.php
    trunk/grisbi.php
    trunk/historique.php
    trunk/locale/fr_FR/LC_MESSAGES/messages.mo
    trunk/locale/fr_FR/LC_MESSAGES/messages.po


Modified: trunk/functions.php
===================================================================
--- trunk/functions.php	2009-01-25 18:19:04 UTC (rev 4)
+++ trunk/functions.php	2009-01-25 19:29:22 UTC (rev 5)
@@ -36,15 +36,15 @@
 	$form = '
             <fieldset>
               <legend>'._("Criteres").'</legend>
-              <label for="d">'._("Date debut").' : </label> 
-              <input type="text" name="dateDebut" onfocus="if(this.value==\'JJ/MM/AAAA\') this.value=\'\';" onblur="if(this.value==\'\') this.value=\'JJ/MM/AAAA\';" value="'.(isset($_POST['dateDebut']) && $_POST['dateDebut'] != '' ? $_POST['dateDebut'] : 'JJ/MM/AAAA').'" /><br />
-              <label for="d">'._("Date fin").' : </label> 
-              <input type="text" name="dateFin" onfocus="if(this.value==\'JJ/MM/AAAA\') this.value=\'\';" onblur="if(this.value==\'\') this.value=\'JJ/MM/AAAA\';" value="'.(isset($_POST['dateFin']) && $_POST['dateFin'] != '' ? $_POST['dateFin'] : 'JJ/MM/AAAA').'" /><br />
+              <label for="dd">'._("Date debut").' : </label> 
+              <input type="text" id="dd" name="dateDebut" onfocus="if(this.value==\'JJ/MM/AAAA\') this.value=\'\';" onblur="if(this.value==\'\') this.value=\'JJ/MM/AAAA\';" value="'.(isset($_POST['dateDebut']) && $_POST['dateDebut'] != '' ? $_POST['dateDebut'] : 'JJ/MM/AAAA').'" /><br />
+              <label for="df">'._("Date fin").' : </label> 
+              <input type="text" id="df" name="dateFin" onfocus="if(this.value==\'JJ/MM/AAAA\') this.value=\'\';" onblur="if(this.value==\'\') this.value=\'JJ/MM/AAAA\';" value="'.(isset($_POST['dateFin']) && $_POST['dateFin'] != '' ? $_POST['dateFin'] : 'JJ/MM/AAAA').'" /><br />
               <label for="mc">'._("Montant au credit").' : </label> 
-              <input type="text" name="mc" value="'.(isset($_POST['mc']) && $_POST['mc'] != '' ? $_POST['mc'] : '').'" /><br />
+              <input type="text" id="mc" name="mc" value="'.(isset($_POST['mc']) && $_POST['mc'] != '' ? $_POST['mc'] : '').'" /><br />
               <label for="md">'._("Montant au debit").' : </label> 
-              <input type="text" name="md" value="'.(isset($_POST['md']) && $_POST['md'] != '' ? $_POST['md'] : '').'" /><br />';
-  $form .= '<label for="t">'._("Tiers").' : </label><select name="t">
+              <input type="text" id="md" name="md" value="'.(isset($_POST['md']) && $_POST['md'] != '' ? $_POST['md'] : '').'" /><br />';
+  $form .= '<label for="t">'._("Tiers").' : </label><select id="t" name="t">
     <option value=""></option>';
 	$tabTiers = $grisbi->getLibelleTiers();
 	foreach($tabTiers as $tiers)
@@ -53,7 +53,9 @@
 	}
 	$form .= '</select><br />
 	            <label for="nbOperations">'._("Nombre operations").' : </label>
-	            <input type="text" name="nbOperations" value="'.(isset($_POST['nbOperations']) && $_POST['nbOperations'] != '' ? $_POST['nbOperations'] : '').'" /><br />
+	            <input type="text" id="nbOperations" name="nbOperations" value="'.(isset($_POST['nbOperations']) && $_POST['nbOperations'] != '' ? $_POST['nbOperations'] : '').'" /><br />
+              <label for="afficherDetails">'._("Afficher details operations").' : </label>
+              <input type="checkbox" id="afficherDetails" name="afficherDetails" '.(isset($_POST['afficherDetails']) && $_POST['afficherDetails'] != '' ? 'checked = "checked"' : '').' value="1" /><br />
               <input type="submit" value="'._("Filtrer").'" />
             </fieldset>
 	';
@@ -69,6 +71,12 @@
 {
 	$params = array();
   // Traitement des options du filtre
+  
+  // Afficher les d\xE9tails de l'op\xE9ration
+  if (isset($_POST['afficherDetails']) && $_POST['afficherDetails'] == '1') {
+    $params['afficherDetails'] = $_POST['afficherDetails'];
+  }
+	
   // date de d\xE9but
   if (isset($_POST['dateDebut']) && $_POST['dateDebut'] != '' && $_POST['dateDebut'] != 'JJ/MM/AAAA') {
     $params['dateDebut'] = $_POST['dateDebut'];
@@ -93,7 +101,7 @@
   if (isset($_POST['t']) && $_POST['t'] != '') {
     $params['t'] = $_POST['t'];
   }
-  
+    
   return $params;
 }
 
@@ -148,6 +156,7 @@
 function convertirTimestamp($date)
 {
 	$timestamp = split("[/.-]", $date);
+	var_dump($timestamp);
 	$timestamp = mktime(0,0,0, $timestamp[1], $timestamp[0], $timestamp[2]);
 	return $timestamp;
 }

Modified: trunk/grisbi.php
===================================================================
--- trunk/grisbi.php	2009-01-25 18:19:04 UTC (rev 4)
+++ trunk/grisbi.php	2009-01-25 19:29:22 UTC (rev 5)
@@ -209,17 +209,19 @@
         	if (!empty($params)) {
         		
             // Traitement de la plage de date
-            $dateOperation = convertirTimestamp($operation->tagAttrs['d']);
-            $borneDebut = convertirTimestamp($params['dateDebut']);
-            $borneFin = convertirTimestamp($params['dateFin']);
-            if ($dateOperation >= $borneDebut && $dateOperation <= $borneFin) {
-            	$display = true;
+            if ($params['dateDebut'] != '' && $params['dateFin'] != '') {
+	            $dateOperation = convertirTimestamp($operation->tagAttrs['d']);
+	            $borneDebut = convertirTimestamp($params['dateDebut']);
+	            $borneFin = convertirTimestamp($params['dateFin']);
+	            if ($dateOperation >= $borneDebut && $dateOperation <= $borneFin) {
+	            	$display = true;
+	            }
             }
         		
             // Traitement des autres param\xE8tres
 	        	foreach($params as $parametre => $valeur) {
 	        		if ($parametre != 'dateDebut' && $parametre != 'dateFin') {
-		        		if ($operation->tagAttrs[$parametre] == $valeur) {
+		        		if ($operation->tagAttrs[$parametre] == $valeur || $parametre == 'afficherDetails') {
 		        			$display = true;
 		        		}
 		        		else {
@@ -232,7 +234,7 @@
         	else {
         		$display = true;
         	}
-        	
+        	        	
         	// On ne r\xE9cup\xE8re que les op\xE9rations m\xE8res
         	if ($display && $compteur < $nbOperations && $operation->tagAttrs['va'] == 0) {
         		// ici, on ne r\xE9cup\xE8re qu'un seul tiers, car on passe un identifiant

Modified: trunk/historique.php
===================================================================
--- trunk/historique.php	2009-01-25 18:19:04 UTC (rev 4)
+++ trunk/historique.php	2009-01-25 19:29:22 UTC (rev 5)
@@ -24,7 +24,7 @@
           </form>
         </div>
         
-        <?php $parametres = traitementDonneesOperations($parametres); ?>
+        <?php $parametres = traitementDonneesOperations(); ?>
         <?php $nbOperations = (isset($_POST['nbOperations']) && $_POST['nbOperations'] != '' ? $_POST['nbOperations'] : 10); // TODO stocker la valeur par d\xE9faut dans un fichier de conf?>
         
         <?php foreach($listeComptes as $compte) : ?>
@@ -58,11 +58,12 @@
           </tr>
           
           <!-- On r\xE9cup\xE8re les op\xE9rations filles -->
-           <?php $operationsFille = $grisbi->getOperationsFille($compte['id'], $operation['num_ope_mere']); ?>
+          <?php if ($parametres['afficherDetails'] == '1') : ?>
+            <?php $operationsFille = $grisbi->getOperationsFille($compte['id'], $operation['num_ope_mere']); ?>
 
-           <?php foreach($operationsFille as $fille) : ?>
+            <?php foreach($operationsFille as $fille) : ?>
            
-           <?php $categorieFille = formatCategorie($fille['cat']['categorie'],  $fille['cat']['souscategorie']); ?>
+            <?php $categorieFille = formatCategorie($fille['cat']['categorie'],  $fille['cat']['souscategorie']); ?>
           <tr class="<?php echo $classeRow ?> details">
             <td rowspan="2" class="date"></td>
             <td colspan="2"></td>
@@ -72,9 +73,10 @@
             <td width="30%" style="padding-left: 15px;">&raquo; <?php echo $categorieFille; ?></td>
             <td><?php echo $fille['remarque'] ?></td>
           </tr>
+              <?php endforeach; // operationsFille ?>
+            
+            <?php endif; // afficherDetails ?>
           
-            <?php endforeach; // operationsFille ?>
-          
           <?php endforeach; // listeOperations ?>
           
         </table>

Modified: trunk/locale/fr_FR/LC_MESSAGES/messages.mo
===================================================================
(Binary files differ)

Modified: trunk/locale/fr_FR/LC_MESSAGES/messages.po
===================================================================
--- trunk/locale/fr_FR/LC_MESSAGES/messages.po	2009-01-25 18:19:04 UTC (rev 4)
+++ trunk/locale/fr_FR/LC_MESSAGES/messages.po	2009-01-25 19:29:22 UTC (rev 5)
@@ -2,8 +2,8 @@
 msgstr ""
 "Project-Id-Version: Grisbiweb 0.5.9\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-01-24 23:01+0100\n"
-"PO-Revision-Date: 2009-01-24 23:01+0100\n"
+"POT-Creation-Date: 2009-01-25 20:27+0100\n"
+"PO-Revision-Date: 2009-01-25 20:28+0100\n"
 "Last-Translator: Nicolas Loeuillet <nicolas.loeuillet@xxxxxxxx>\n"
 "Language-Team: Grisbiweb <nicolas.loeuillet@xxxxxxxx>\n"
 "MIME-Version: 1.0\n"
@@ -33,7 +33,7 @@
 msgstr "Montant"
 
 #: /home/nicosomb/dev/svn/svn/trunk/header.php:26
-#: /home/nicosomb/dev/svn/svn/trunk/functions.php:163
+#: /home/nicosomb/dev/svn/svn/trunk/functions.php:172
 msgid "Grisbiweb"
 msgstr "Grisbiweb"
 
@@ -92,6 +92,10 @@
 msgstr "Nombre d'op&eacute;rations"
 
 #: /home/nicosomb/dev/svn/svn/trunk/functions.php:57
+msgid "Afficher details operations"
+msgstr "Afficher le d&eacute;tail des op&eacute;rations"
+
+#: /home/nicosomb/dev/svn/svn/trunk/functions.php:59
 msgid "Filtrer"
 msgstr "Filtrer"
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/