phpcompta-dev
[Top][All Lists]
Advanced

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

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


From: phpcompta-dev
Subject: [Phpcompta-dev] r4908 - in phpcompta/trunk: html html/js include
Date: Sat, 16 Jun 2012 17:33:49 +0200 (CEST)

Author: danydb
Date: 2012-06-16 17:33:48 +0200 (Sat, 16 Jun 2012)
New Revision: 4908

Modified:
   phpcompta/trunk/html/ajax_card.php
   phpcompta/trunk/html/fid_card.php
   phpcompta/trunk/html/js/ajax_fiche.js
   phpcompta/trunk/include/class_fiche.php
   phpcompta/trunk/include/class_fiche_def.php
   phpcompta/trunk/include/fiche.inc.php
Log:
attribut fiche : card, fix bug, can use search button + filter + dble click

Modified: phpcompta/trunk/html/ajax_card.php
===================================================================
--- phpcompta/trunk/html/ajax_card.php  2012-06-16 00:00:01 UTC (rev 4907)
+++ phpcompta/trunk/html/ajax_card.php  2012-06-16 15:33:48 UTC (rev 4908)
@@ -301,6 +301,7 @@
     {
         $f=new Fiche($cn);
         $f->insert($fd_id,$_POST);
+               $f->Get();
         $html.='<h2 class="notice">Fiche sauvée</h2>';
         $html.=$f->Display(true);
         $js="";

Modified: phpcompta/trunk/html/fid_card.php
===================================================================
--- phpcompta/trunk/html/fid_card.php   2012-06-16 00:00:01 UTC (rev 4907)
+++ phpcompta/trunk/html/fid_card.php   2012-06-16 15:33:48 UTC (rev 4908)
@@ -55,15 +55,15 @@
 $g_user->check();
 $g_user->check_dossier(dossier::id());
 
-switch ($d)
+if ( $d == 'all')
 {
-case 'all':
     $filter_card='';
-    break;
-
-default:
+}
+else if (strpos($d,'sql]')==true)
+{
+       $filter_card=  str_replace('[sql]', "", $d);
+} else
     $filter_card="and fd_id in ($d)";
-}
 
 if ( $jrn != -1 )
 {

Modified: phpcompta/trunk/html/js/ajax_fiche.js
===================================================================
--- phpcompta/trunk/html/js/ajax_fiche.js       2012-06-16 00:00:01 UTC (rev 
4907)
+++ phpcompta/trunk/html/js/ajax_fiche.js       2012-06-16 15:33:48 UTC (rev 
4908)
@@ -68,7 +68,8 @@
 {
        try
        {
-    var gDossier=$('gDossier').value;
+               alert('ici');
+       var gDossier=$('gDossier').value;
     var jrn=$(p_ctl).jrn;
     $(p_ctl).value=$(p_ctl).value.toUpperCase();
     if ( jrn == undefined )

Modified: phpcompta/trunk/include/class_fiche.php
===================================================================
--- phpcompta/trunk/include/class_fiche.php     2012-06-16 00:00:01 UTC (rev 
4907)
+++ phpcompta/trunk/include/class_fiche.php     2012-06-16 15:33:48 UTC (rev 
4908)
@@ -518,16 +518,14 @@
                                        case 'card':
                                                $w = new ICard("av_text" . 
$attr->ad_id);
                                                // filter on frd_id
-                                               $sql = ' select fd_id from 
fiche_def ';
-                                               $filter = 
$this->cn->make_list($sql);
-                                               $w->extra = $filter;
+                                               $w->extra = $attr->ad_extra;
                                                $w->extra2 = 0;
                                                $label = new ISpan();
-                                               $label->name = "av_text" . 
$r->ad_id . "_label";
+                                               $label->name = "av_text" . 
$attr->ad_id . "_label";
                                                $w->set_attribute('ipopup', 
'ipopcard');
-                                               $w->set_attribute('typecard', 
$filter);
-                                               $w->set_attribute('inp', 
"av_text" . $r->ad_id);
-                                               $w->set_attribute('label', 
"av_text" . $r->ad_id . "_label");
+                                               $w->set_attribute('typecard', 
$attr->ad_extra);
+                                               $w->set_attribute('inp', 
"av_text" . $attr->ad_id);
+                                               $w->set_attribute('label', 
"av_text" . $attr->ad_id . "_label");
                                                $msg = $w->search();
                                                $msg.=$label->input();
                                                break;
@@ -538,7 +536,7 @@
                        $w->label = $attr->ad_text;
                        $w->name = "av_text" . $attr->ad_id;
 
-                       $r.="<TR>" . td($w->label, ' class="input_text" ') . 
td($w->input()) . "$msg </TR>";
+                       $r.="<TR>" . td($w->label, ' class="input_text" ') . 
td($w->input()) . td("$msg")." </TR>";
                }
                $r.= '</table>';
         return $r;
@@ -663,9 +661,9 @@
                                                        break;
                                                case 'card':
                                                        $w = new 
ICard("av_text" . $r->ad_id);
-                                                       // filter on frd_id
-                                                       $sql = ' select fd_id 
from fiche_def ';
-                                                       $filter = 
$this->cn->make_list($sql);
+                                                       // filter on ad_extra
+
+                                                       $filter = $r->ad_extra;
                                                        $w->width = $r->ad_size;
                                                        $w->extra = $filter;
                                                        $w->extra2 = 0;
@@ -675,6 +673,7 @@
                                                        
$w->set_attribute('typecard', $filter);
                                                        
$w->set_attribute('inp', "av_text" . $r->ad_id);
                                                        
$w->set_attribute('label', "av_text" . $r->ad_id . "_label");
+                                                       
$w->dblclick="fill_ipopcard(this);";
                                                        $msg = $w->search();
                                                        $msg.=$label->input();
                                                        $w->value = $r->av_text;
@@ -1815,50 +1814,57 @@
         $filter_query='';
         if ( isset($typecard))
         {
-            switch($typecard)
-            {
-            case 'cred':
-                if ( ! isset($jrn)) throw ('Erreur pas de valeur pour jrn');
-                $filter_jrn=$this->cn->make_list("select jrn_def_fiche_cred 
from jrn_Def where jrn_def_id=$1",array($jrn));
-                $filter_fd_id=" fd_id in (".$filter_jrn.")";
-                $and=" and ";
-                break;
-            case 'deb':
-                if ( ! isset($jrn)) throw ('Erreur pas de valeur pour jrn');
-                $filter_jrn=$this->cn->make_list("select jrn_def_fiche_deb 
from jrn_Def where jrn_def_id=$1",array($jrn));
-                $filter_fd_id=" fd_id in (".$filter_jrn.")";
-                $and=" and ";
-                break;
-            case 'filter':
-                if ( ! isset($jrn)) throw ('Erreur pas de valeur pour jrn');
-                $filter_jrn=$this->cn->make_list("select jrn_def_fiche_deb 
from jrn_Def where jrn_def_id=$1",array($jrn));
+                       if (strpos($typecard, "sql")==false)
+                       {
+                               switch($typecard)
+                               {
+                               case 'cred':
+                                       if ( ! isset($jrn)) throw ('Erreur pas 
de valeur pour jrn');
+                                       
$filter_jrn=$this->cn->make_list("select jrn_def_fiche_cred from jrn_Def where 
jrn_def_id=$1",array($jrn));
+                                       $filter_fd_id=" fd_id in 
(".$filter_jrn.")";
+                                       $and=" and ";
+                                       break;
+                               case 'deb':
+                                       if ( ! isset($jrn)) throw ('Erreur pas 
de valeur pour jrn');
+                                       
$filter_jrn=$this->cn->make_list("select jrn_def_fiche_deb from jrn_Def where 
jrn_def_id=$1",array($jrn));
+                                       $filter_fd_id=" fd_id in 
(".$filter_jrn.")";
+                                       $and=" and ";
+                                       break;
+                               case 'filter':
+                                       if ( ! isset($jrn)) throw ('Erreur pas 
de valeur pour jrn');
+                                       
$filter_jrn=$this->cn->make_list("select jrn_def_fiche_deb from jrn_Def where 
jrn_def_id=$1",array($jrn));
 
-                if ( trim($filter_jrn) !='')
-                    $fp1=" fd_id in (".$filter_jrn.")";
-                else
-                    $fp1="fd_id < 0";
+                                       if ( trim($filter_jrn) !='')
+                                               $fp1=" fd_id in 
(".$filter_jrn.")";
+                                       else
+                                               $fp1="fd_id < 0";
 
-                $filter_jrn=$this->cn->make_list("select jrn_def_fiche_cred 
from jrn_Def where jrn_def_id=$1",array($jrn));
+                                       
$filter_jrn=$this->cn->make_list("select jrn_def_fiche_cred from jrn_Def where 
jrn_def_id=$1",array($jrn));
 
-                if ( trim($filter_jrn) !='')
-                    $fp2=" fd_id in (".$filter_jrn.")";
-                else
-                    $fp2="fd_id < 0";
+                                       if ( trim($filter_jrn) !='')
+                                               $fp2=" fd_id in 
(".$filter_jrn.")";
+                                       else
+                                               $fp2="fd_id < 0";
 
-                $filter_fd_id='('.$fp1.' or '.$fp2.')';
+                                       $filter_fd_id='('.$fp1.' or '.$fp2.')';
 
-                $and=" and ";
-                break;
-            case 'all':
-                $filter_fd_id=' true';
-                break;
-            default:
-                if ( trim($typecard) != '')
-                    $filter_fd_id=' fd_id in ('.$typecard.')';
-                else
-                    $filter_fd_id=' fd_id < 0';
-            }
-        }
+                                       $and=" and ";
+                                       break;
+                               case 'all':
+                                       $filter_fd_id=' true';
+                                       break;
+                               default:
+                                       if ( trim($typecard) != '')
+                                               $filter_fd_id=' fd_id in 
('.$typecard.')';
+                                       else
+                                               $filter_fd_id=' fd_id < 0';
+                               }
+                       }
+                       else
+                       {
+                               $filter_fd_id = str_replace('[sql]', '', 
$typecard);
+                       }
+               }
 
         $and=" and ";
         if (isset($query))

Modified: phpcompta/trunk/include/class_fiche_def.php
===================================================================
--- phpcompta/trunk/include/class_fiche_def.php 2012-06-16 00:00:01 UTC (rev 
4907)
+++ phpcompta/trunk/include/class_fiche_def.php 2012-06-16 15:33:48 UTC (rev 
4908)
@@ -344,7 +344,7 @@
     function myList()
     {
         $this->Get();
-        echo '<H2 class="info">'.$this->label.'</H2>';
+        echo '<H2 class="info">'.$this->id." ".$this->label.'</H2>';
 
         $step=$_SESSION['g_pagesize'];
         $sql_limit="";
@@ -452,10 +452,9 @@
     {
         if ( $this->id == 0 )
             return ;
-        /*      $this->cn->exec_sql('select fiche_attribut_synchro($1)',
-        array($this->id));
-        */
-        $MaxLine=sizeof($this->attribut);
+           $this->cn->exec_sql('select 
fiche_attribut_synchro($1)',array($this->id));
+
+                  $MaxLine=sizeof($this->attribut);
         $r="<TABLE>";
        $r.="<tr>".th('Nom 
attribut').th('').th('Ordre','style="text-align:right"').'</tr>';
         // Display each attribute

Modified: phpcompta/trunk/include/fiche.inc.php
===================================================================
--- phpcompta/trunk/include/fiche.inc.php       2012-06-16 00:00:01 UTC (rev 
4907)
+++ phpcompta/trunk/include/fiche.inc.php       2012-06-16 15:33:48 UTC (rev 
4908)
@@ -89,7 +89,7 @@
         $p_fiche_def->save_class_base($_REQUEST['class_base']);
     }
     $p_fiche_def->Get();
-    $r.= '<H2 class="info">'.h($p_fiche_def->label).'</H2>';
+    $r.= '<H2 class="info">'.$p_fiche_def->id." 
".h($p_fiche_def->label).'</H2>';
     $r.='<fieldset><legend>Données générales</legend>';
 
     /* show the values label class_base and create account */



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