phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r5286 - in phpcompta/trunk/include: . template


From: phpcompta-dev
Subject: [Phpcompta-dev] r5286 - in phpcompta/trunk/include: . template
Date: Sat, 18 May 2013 22:07:13 +0200 (CEST)

Author: danydb
Date: 2013-05-18 22:07:12 +0200 (Sat, 18 May 2013)
New Revision: 5286

Modified:
   phpcompta/trunk/include/cfgfiche.inc.php
   phpcompta/trunk/include/class_fiche_def.php
   phpcompta/trunk/include/template/fiche_def_input.php
   phpcompta/trunk/include/template/fiche_def_list.php
Log:
task #0000844: Ajout d'une description pour les cat?\195?\169gories de fiches

Modified: phpcompta/trunk/include/cfgfiche.inc.php
===================================================================
--- phpcompta/trunk/include/cfgfiche.inc.php    2013-05-18 20:06:43 UTC (rev 
5285)
+++ phpcompta/trunk/include/cfgfiche.inc.php    2013-05-18 20:07:12 UTC (rev 
5286)
@@ -87,6 +87,7 @@
             $fiche_def->set_autocreate(false);
         }
         $fiche_def->save_class_base($_REQUEST['class_base']);
+               $fiche_def->save_description($_REQUEST['fd_description']);
 
     }
        echo $fiche_def->input_detail();

Modified: phpcompta/trunk/include/class_fiche_def.php
===================================================================
--- phpcompta/trunk/include/class_fiche_def.php 2013-05-18 20:06:43 UTC (rev 
5285)
+++ phpcompta/trunk/include/class_fiche_def.php 2013-05-18 20:07:12 UTC (rev 
5286)
@@ -60,6 +60,10 @@
         $class_base->set_attribute('account','class_base');
         $class_base->set_attribute('label','acc_label');
         $f_class_base=$class_base->input();
+               $fd_description=new ITextarea('fd_description');
+               $fd_description->width=80;
+               $fd_description->heigh=4;
+               $fd_description->style='style="vertical-align:text-top"';
         require_once ('template/fiche_def_input.php');
         return;
     }
@@ -115,6 +119,7 @@
         $this->class_base=$row['fd_class_base'];
         $this->fiche_def=$row['frd_id'];
         $this->create_account=$row['fd_create_account'];
+        $this->fd_description=$row['fd_description'];
     }
     /*!
      **************************************************
@@ -174,7 +179,7 @@
 
 
                $res = $this->cn->exec_sql("SELECT fd_id, fd_class_base, 
fd_label, fd_create_account, fiche_def_ref.frd_id,
-frd_text  FROM fiche_def join fiche_def_ref on 
(fiche_def.frd_id=fiche_def_ref.frd_id)
+frd_text , fd_description FROM fiche_def join fiche_def_ref on 
(fiche_def.frd_id=fiche_def_ref.frd_id)
 $order
 ");
 
@@ -243,10 +248,10 @@
         if ( sql_string($p_class_base) != null || strpos(',',$p_class_base) != 
0 )
         {
             // p_class is a valid number
-            $sql="insert into 
fiche_def(fd_label,fd_class_base,frd_id,fd_create_account)
-                 values ($1,$2,$3,$4) returning fd_id";
+            $sql="insert into 
fiche_def(fd_label,fd_class_base,frd_id,fd_create_account,fd_description)
+                 values ($1,$2,$3,$4,$5) returning fd_id";
 
-            
$fd_id=$this->cn->get_value($sql,array($p_nom_mod,$p_class_base,$p_FICHE_REF,$p_create));
+            
$fd_id=$this->cn->get_value($sql,array($p_nom_mod,$p_class_base,$p_FICHE_REF,$p_create,$p_fd_description));
 
             // p_class must be added to tmp_pcmn if it is a single accounting
             if ( strpos(',',$p_class_base) ==0)
@@ -265,11 +270,11 @@
         else
         {
             //There is no class base not even as default
-            $sql=sprintf("insert into 
fiche_def(fd_label,frd_id,fd_create_account) values ('%s',%d,'%s') returning 
fd_id",
-                         $p_nom_mod,$p_FICHE_REF,$p_create);
+            $sql="insert into 
fiche_def(fd_label,frd_id,fd_create_account,fd_description) values 
($1,$2,$3,$4) returning fd_id";
 
-            $this->id=$this->cn->get_value($sql);
 
+            
$this->id=$this->cn->get_value($sql,array($p_nom_mod,$p_FICHE_REF,$p_create,$p_fd_description));
+
             // Get the fd_id
             $fd_id=$this->cn->get_current_seq('s_fdef');
 
@@ -455,10 +460,17 @@
         $class_base->set_attribute('ipopup','ipop_account');
         $class_base->set_attribute('account','class_base');
         $class_base->set_attribute('label','acc_label');
+               $fd_description=new 
ITextarea('fd_description',$this->fd_description);
+               $fd_description->width=80;
+               $fd_description->heigh=4;
+               $fd_description->style='style="vertical-align:text-top"';
         $r.=_('Poste Comptable de base').' : ';
         $r.=$class_base->input();
         $r.='<span id="acc_label"></span><br>';
+               $r.='<br/>';
+               $r.=" Description ".$fd_description->input();
         /* auto Create */
+               $r.='<br/>';
         $ck=new ICheckBox('create');
         $ck->selected=($this->create_account=='f')?false:true;
         $r.=_('Chaque fiche aura automatiquement son propre poste comptable : 
');
@@ -594,6 +606,11 @@
 
         $Res=$this->cn->exec_sql($sql,array($p_label,$this->id));
     }
+       function save_description($p_description)
+       {
+               if ( $this->id == 0)                    return;
+               $this->cn->exec_sql("update fiche_def set fd_description=$1 
where fd_id=$2",array($p_description,$this->id));
+       }
 
 
     /*!\brief insert a new attribut for this fiche_def

Modified: phpcompta/trunk/include/template/fiche_def_input.php
===================================================================
--- phpcompta/trunk/include/template/fiche_def_input.php        2013-05-18 
20:06:43 UTC (rev 5285)
+++ phpcompta/trunk/include/template/fiche_def_input.php        2013-05-18 
20:07:12 UTC (rev 5286)
@@ -3,6 +3,14 @@
 <TD><?php echo ('Catégorie de fiche')?> </TD>
 <TD><INPUT TYPE="INPUT" NAME="nom_mod"></TD>
 </TR>
+<tr>
+       <td style="vertical-align: text-top">
+               Description
+       </td>
+       <td>
+               <?php echo $fd_description->input(); ?>
+       </td>
+</tr>
 <TR>
    <TD> <?php echo _('Classe de base')?> </TD>
 <TD><?php echo $f_class_base?> </TD>
@@ -14,7 +22,7 @@
 <?php
   if ( sizeof($ref)  ) {
     foreach ($ref as $i=>$v) { ?>
-<TR><TD COLSPAN="2">
+<TR><TD style="width:auto" COLSPAN="2">
 <?php echo $iradio->input("FICHE_REF",$v['frd_id']);
    echo $v['frd_text'];
    if ( sizeof ($v['frd_class_base']) != 0 )

Modified: phpcompta/trunk/include/template/fiche_def_list.php
===================================================================
--- phpcompta/trunk/include/template/fiche_def_list.php 2013-05-18 20:06:43 UTC 
(rev 5285)
+++ phpcompta/trunk/include/template/fiche_def_list.php 2013-05-18 20:07:12 UTC 
(rev 5286)
@@ -29,7 +29,8 @@
 $max=Database::num_row($res);
 ?>
 <div id="list_cat_div" class="content">
-<table class="result">
+       <?php echo "Filtre"; echo HtmlInput::filter_table("fiche_def_tb", 
"0,1,2,3,4", "1"); ?>
+<table id="fiche_def_tb" class="result">
        <tR>
                <th>
                        <?php echo $tab->get_header(0)?>
@@ -43,8 +44,11 @@
                <th>
                        <?php echo $tab->get_header(3)?>
                </th>
+               <th>
+                       Description
+               </th>
        </tR>
-<?php 
+<?php
 $dossier=Dossier::id();
 for ($i=0;$i<$max;$i++):
        $class=($i%2==0)?' class="even" ':' class="odd" ';
@@ -58,7 +62,7 @@
                        <?php echo h($row['fd_class_base'])?>
                </td>
                <td>
-                       <?php 
+                       <?php
                         
$v=($row['fd_create_account']=='t')?"Automatique":"Manuel";
                         echo $v;
                        ?>
@@ -66,14 +70,17 @@
                <td>
                        <?php echo $row['frd_text']?>
                </td>
+               <td>
+                       <?php echo h($row['fd_description']) ?>
+               </td>
        </tr>
 
 
-<?php 
+<?php
 endfor;
 ?>
 </table>
-<?php 
+<?php
 echo HtmlInput::button("cat_fiche_def_add","Ajout d'une nouvelle catégorie", 
"onclick=\"detail_category_show('detail_category_div','".$dossier."','-1')\"");
 ?>
 </div>



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