phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r4888 - phpcompta/trunk/html


From: phpcompta-dev
Subject: [Phpcompta-dev] r4888 - phpcompta/trunk/html
Date: Wed, 13 Jun 2012 19:11:51 +0200 (CEST)

Author: danydb
Date: 2012-06-13 19:11:51 +0200 (Wed, 13 Jun 2012)
New Revision: 4888

Modified:
   phpcompta/trunk/html/ajax_card.php
   phpcompta/trunk/html/ajax_history.php
Log:
0000617: Avertissement si aucune fiche ou cat?\195?\169gorie n'est disponible

Modified: phpcompta/trunk/html/ajax_card.php
===================================================================
--- phpcompta/trunk/html/ajax_card.php  2012-06-13 16:55:05 UTC (rev 4887)
+++ phpcompta/trunk/html/ajax_card.php  2012-06-13 17:11:51 UTC (rev 4888)
@@ -215,19 +215,19 @@
         {
         case -1:
             $l=new Acc_Ledger($cn,$ledger);
-            $sql.='  where fd_id in ('.$l->get_all_fiche_def().')';
+            $where='  where fd_id in ('.$l->get_all_fiche_def().')';
             break;
         case 'cred':
             $l=new Acc_Ledger($cn,$ledger);
             $prop=$l->get_propertie();
             if ( $prop['jrn_def_fiche_cred']=='')$prop=-1;
-            $sql.='  where fd_id in ('.$prop['jrn_def_fiche_cred'].')';
+            $where='  where fd_id in ('.$prop['jrn_def_fiche_cred'].')';
             break;
         case 'deb':
             $l=new Acc_Ledger($cn,$ledger);
             $prop=$l->get_propertie();
             if ( $prop=='')$prop=-1;
-            $sql.='  where fd_id in ('.$prop['jrn_def_fiche_deb'].')';
+            $where='  where fd_id in ('.$prop['jrn_def_fiche_deb'].')';
             break;
         }
     }
@@ -236,23 +236,33 @@
         /* we filter thanks a given model of card */
         if ( isset($cat))
         {
-            $sql=$sql.sprintf(' where frd_id in ('.sql_string ($cat).')');
+            $where=sprintf(' where frd_id in ('.sql_string ($cat).')');
         }
         else
             /* we filter thanks a given list of category of card
              */
             if ( isset($fil) && strlen(trim($fil)) > 0 )
             {
-                $sql=$sql.sprintf(" where fd_id in (%s)",
+                $where=sprintf(" where fd_id in (%s)",
                                   sql_string($fil));
             }
     }
+       if ( strpos($where," in ()") != 0)
+       {
+                $html=HtmlInput::anchor_close('select_card_div');
+                $html.=h2info('Choix de la catégorie');
+                $html.='<h3 class="notice">';
+                $html.=_("Aucune catégorie de fiche ne correspond à".
+                " votre demande, le journal pourrait n'avoir accès à aucune 
fiche");
+                $html.='</h3>';
+                break;
+       }
     $array=$cn->make_array($sql);
     $html=HtmlInput::anchor_close('select_card_div');
     $html.=h2info('Choix de la catégorie');
     if ( empty($array))
     {
-        $html.=_("Aucune catégorie de fiche ne correspondant à".
+        $html.=_("Aucune catégorie de fiche ne correspond  à".
                 " votre demande");
                if ( DEBUG )        $html.=$sql;
     }
@@ -339,6 +349,16 @@
     /* Build the SQL and show result */
     $sql=$fiche->build_sql($sql_array);
 
+       if ( strpos($sql," in ()") != 0)
+       {
+               $html=HtmlInput::anchor_close('search_card');
+                $html.='<div> '.h2info(_('Recherche de fiche')).'</div>';
+                $html.='<h3 class="notice">';
+                $html.=_("Aucune catégorie de fiche ne correspond à".
+                " votre demande, le journal pourrait n'avoir accès à aucune 
fiche");
+                $html.='</h3>';
+                break;
+       }
     /* We limit the search to 20 records */
     $sql=$sql.' order by vw_name limit 20';
     $a=$cn->get_array($sql);

Modified: phpcompta/trunk/html/ajax_history.php
===================================================================
--- phpcompta/trunk/html/ajax_history.php       2012-06-13 16:55:05 UTC (rev 
4887)
+++ phpcompta/trunk/html/ajax_history.php       2012-06-13 17:11:51 UTC (rev 
4888)
@@ -39,6 +39,7 @@
  */
 ajax_disconnected($div);
 global $g_user;
+$cn=new Database(dossier::id());
 $g_user=new User($cn);
 /* security */
 if ( $g_user->check_dossier(dossier::id(),true) == 'X' ) exit();



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