phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r491 - in trunk/rapport_avance: include include/template


From: phpcompta-dev
Subject: [Phpcompta-dev] r491 - in trunk/rapport_avance: include include/template sql
Date: Thu, 2 May 2013 23:20:02 +0200 (CEST)

Author: danydb
Date: 2013-05-02 23:20:02 +0200 (Thu, 02 May 2013)
New Revision: 491

Modified:
   trunk/rapport_avance/include/class_rapav_declaration.php
   trunk/rapport_avance/include/class_rapav_formulaire.php
   trunk/rapport_avance/include/class_rapport_avance_sql.php
   trunk/rapport_avance/include/declaration.inc.php
   trunk/rapport_avance/include/formulaire.inc.php
   trunk/rapport_avance/include/historique.inc.php
   trunk/rapport_avance/include/template/declaration_display.php
   trunk/rapport_avance/include/template/formulaire_definition.php
   trunk/rapport_avance/include/template/formulaire_listing.php
   trunk/rapport_avance/sql/upgrade3.sql
Log:
Add a description
In history : show comment + sorttable table
Add notice when saving a definition

Modified: trunk/rapport_avance/include/class_rapav_declaration.php
===================================================================
--- trunk/rapport_avance/include/class_rapav_declaration.php    2013-05-02 
21:18:59 UTC (rev 490)
+++ trunk/rapport_avance/include/class_rapav_declaration.php    2013-05-02 
21:20:02 UTC (rev 491)
@@ -227,7 +227,7 @@
        {
                global $cn,$g_parameter;
                // Retrieve all the code + libelle
-               $array[]=array('code'=>'PERIODE_DECLARATION','value'=>  
format_date($this->d_end)." - ".format_date($this->d_start));
+               $array[]=array('code'=>'PERIODE_DECLARATION','value'=>  
format_date($this->d_start)." - ".format_date($this->d_end));
                $array[]=array('code'=>'TITRE','value'=>$this->d_title);
                
$array[]=array('code'=>'DOSSIER','value'=>$cn->format_name($_REQUEST['gDossier'],'dos'));
                $array[]=array('code'=>'NAME','value'=>$g_parameter->MY_NAME);
@@ -238,6 +238,7 @@
                $array[]=array('code'=>'PHONE','value'=>$g_parameter->MY_TEL);
                $array[]=array('code'=>'CEDEX','value'=>$g_parameter->MY_CP);
                $array[]=array('code'=>'FAX','value'=>$g_parameter->MY_FAX);
+               $array[]=array('code'=>'NOTE','value'=>$this->d_description);
 
                // open the files
                $ifile=fopen($p_dir.'/'.$p_filename,'r');
@@ -267,9 +268,9 @@
                                {
                                        
$replace='<<'.$value['code'].'>>';
                                        $fmt_value=$value['value'];
+                                       
$fmt_value=str_replace('&','&',$fmt_value);
                                        
$fmt_value=str_replace('<','&lt;',$fmt_value);
                                        
$fmt_value=str_replace('>','&gt;',$fmt_value);
-                                       
$fmt_value=str_replace('&','&amp;',$fmt_value);
                                        
$fmt_value=str_replace('"','&quot;',$fmt_value);
                                        
$fmt_value=str_replace("'",'&apos;',$fmt_value);
                                } else {

Modified: trunk/rapport_avance/include/class_rapav_formulaire.php
===================================================================
--- trunk/rapport_avance/include/class_rapav_formulaire.php     2013-05-02 
21:18:59 UTC (rev 490)
+++ trunk/rapport_avance/include/class_rapav_formulaire.php     2013-05-02 
21:20:02 UTC (rev 491)
@@ -43,15 +43,24 @@
         *  show a list of all existing declaration
         * @global type $cn database connection
         */
-       static
-                       function listing()
+       static  function listing()
        {
                global $cn;
-               $alist = $cn->get_array("select f_id,f_title,f_description from 
rapport_advanced.formulaire order by 2");
+               $alist = $cn->get_array("select f_id,f_title,f_description
+                       from rapport_advanced.formulaire order by 2");
                require 'template/formulaire_listing.php';
        }
-
        /**
+        * Anchor to the template
+        * @return html anchor string
+        */
+       function anchor_document()
+       {
+               
$url=HtmlInput::request_to_string(array('gDossier','ac','plugin_code'));
+               
$url='extension.raw.php'.$url.'&amp;act=export_definition_modele&amp;id='.$this->f_id;
+               return HtmlInput::anchor($this->f_filename,$url);
+       }
+       /**
         * Get data from database, from the table 
rapport_advanced.formulaire_param
         */
        function load_definition()
@@ -122,7 +131,7 @@
                for ($i = 0; $i < $nb_line ; $i++)
                {
                        $form_param = new 
formulaire_param_sql($p_array['p_id'][$i]);
-                       $form_param->p_code = $p_array['p_code'][$i];
+                       $form_param->p_code = 
(trim($p_array['p_code'][$i])!="")?$p_array['p_code'][$i]:'C'.$i.microtime();
                        $form_param->p_libelle = $p_array['p_libelle'][$i];
                        $form_param->p_type = $p_array['p_type'][$i];
                        $form_param->p_order = 
(isNumber($p_array['p_order'][$i]) == 0) ?  ($i+1) * 10 : 
$p_array['p_order'][$i];

Modified: trunk/rapport_avance/include/class_rapport_avance_sql.php
===================================================================
--- trunk/rapport_avance/include/class_rapport_avance_sql.php   2013-05-02 
21:18:59 UTC (rev 490)
+++ trunk/rapport_avance/include/class_rapport_avance_sql.php   2013-05-02 
21:20:02 UTC (rev 491)
@@ -167,6 +167,7 @@
                $this->name = array(
                        "d_id"=>"d_id",
                        "d_title"=>"d_title",
+                       "d_description"=>'d_description',
                        "d_start"=>"d_start",
                        "d_end"=>"d_end",
                        "to_keep"=>"to_keep",
@@ -181,6 +182,7 @@
                $this->type = array(
                                "d_id"=>"numeric",
                        "d_title"=>"text",
+                       "d_description"=>'text',
                        "d_start"=>"date",
                        "d_end"=>"date",
                        "to_keep"=>"text",

Modified: trunk/rapport_avance/include/declaration.inc.php
===================================================================
--- trunk/rapport_avance/include/declaration.inc.php    2013-05-02 21:18:59 UTC 
(rev 490)
+++ trunk/rapport_avance/include/declaration.inc.php    2013-05-02 21:20:02 UTC 
(rev 491)
@@ -41,7 +41,7 @@
        $decl->save();
        $decl->generate_document();
        $decl->display();
-       echo '<h2 class="notice">'._(' Sauvé ').date('d-m-Y H:i').'</h2>';
+       echo '<p class="notice">'._(' Sauvé ').date('d-m-Y H:i').'</p>';
 
        $ref_csv = HtmlInput::array_to_string(array('gDossier', 'plugin_code', 
'd_id'), $_REQUEST, 'extension.raw.php?');
        $ref_csv.="&amp;act=export_decla_csv";
@@ -61,6 +61,7 @@
        }
        else
        {
+               $decl->d_description=$_GET['p_description'];
                $decl->compute($_GET['p_form'], $_GET['p_start'], 
$_GET['p_end']);
                echo '<form class="print" method="POST">';
                echo HtmlInput::hidden('p_form', $_GET['p_form']);
@@ -75,6 +76,8 @@
 $hidden = HtmlInput::array_to_hidden(array('gDossier', 'ac', 'plugin_code', 
'sa'), $_GET);
 $select = new ISelect('p_form');
 $select->value = $cn->make_array('select f_id,f_title from 
rapport_advanced.formulaire order by 2');
+$description=new IText('p_description');
+$description->size=80;
 ?>
 <form id="declaration_form_id" method="GET" onsubmit="return validate()">
        <?= $hidden?>
@@ -86,6 +89,10 @@
                        <td>
                                <?= $select->input()?>
                        </td>
+                       </tr>
+       </table>
+       <p> Description <?=$description->input()?>
+       <table>
                <tr>
                        <td>
                                Date de début
@@ -103,11 +110,12 @@
                        </td>
                </tr>
        </table>
+       </p>
        <?= HtmlInput::submit('compute', 'Générer')?>
 </form>
 <script charset="UTF8" lang="javascript">
        function validate() {
-               if ( check_date_id('<?= $date_start->id?>') == false ) 
{alert('Date de début incorrecte');return false;}
-               if ( check_date_id('<?= $date_end->id?>') == false ) 
{alert('Date de fin incorrecte');return false;}
+               if ( check_date_id('<?= $date_start->id?>') == false ) 
{alert('Date de début incorrecte');$('<?= 
$date_start->id?>').style.borderColor='red';$('<?= 
$date_start->id?>').style.borderWidth=2;return false;}
+               if ( check_date_id('<?= $date_end->id?>') == false ) 
{alert('Date de fin incorrecte');$('<?= 
$date_end->id?>').style.borderColor='red';$('<?= 
$date_end->id?>').style.borderWidth=2;return false;}
        }
 </script>
\ No newline at end of file

Modified: trunk/rapport_avance/include/formulaire.inc.php
===================================================================
--- trunk/rapport_avance/include/formulaire.inc.php     2013-05-02 21:18:59 UTC 
(rev 490)
+++ trunk/rapport_avance/include/formulaire.inc.php     2013-05-02 21:20:02 UTC 
(rev 491)
@@ -36,8 +36,10 @@
        }
        else
        {
+               echo '<p class="notice">'._(' dernière sauvegarde 
').date('d-m-Y H:i').'</p>';
                RAPAV_formulaire::save_definition($_POST);
                require_once 'formulaire_definition_show.inc.php';
+               echo '<p class="notice">'._(' dernière sauvegarde 
').date('d-m-Y H:i').'</p>';
                exit();
        }
 }

Modified: trunk/rapport_avance/include/historique.inc.php
===================================================================
--- trunk/rapport_avance/include/historique.inc.php     2013-05-02 21:18:59 UTC 
(rev 490)
+++ trunk/rapport_avance/include/historique.inc.php     2013-05-02 21:20:02 UTC 
(rev 491)
@@ -29,7 +29,11 @@
 global $cn;
 $cn->exec_sql("delete from rapport_advanced.declaration where to_keep='N' and 
d_generated < now() - interval '5 hours'");
 $data=$cn->get_array("select d_id,d_title,
-               d_start,d_end
+               d_start,d_end,to_char(d_generated,'DD/MM/YY HH24:MI') as 
fmt_generated,
+               d_description,d_generated,
+               to_char(d_start,'YYMMDD') as fmt_start,
+               to_char(d_end,'YYMMDD') as fmt_end,
+               to_char(d_end,'YYMMDDHH24MI') as fmt_order_generated
                from rapport_advanced.declaration
                where to_keep='Y'
                order by d_start,d_title");
@@ -37,8 +41,9 @@
 <div id="declaration_list_div">
 <table class="sortable">
        <tr>
-               <th>
-                       Date début
+               <th class=" sorttable_sorted_reverse">
+                       Date début <?php echo HtmlInput::infobulle(17);?>
+                       <span 
id="sorttable_sortrevind">&nbsp;&blacktriangle;</span>
                </th>
                <th>
                        Date Fin
@@ -47,6 +52,12 @@
                        Déclaration
                </th>
                <th>
+                       Description
+               </th>
+               <th>
+                       Date génération
+               </th>
+               <th>
 
                </th>
                <th>
@@ -55,19 +66,26 @@
        </tr>
        <? for ($i=0;$i<count($data);$i++) :?>
        <tr id="tr_<?=$data[$i]['d_id']?>">
-               <td>
+               <td sortable_customkey="<?=$data[$i]['fmt_start']?>">
+
                        <?=format_date($data[$i]['d_start'])?>
                </td>
-               <td>
+               <td sortable_customkey="<?=$data[$i]['fmt_end']?>">
                        <?=format_date($data[$i]['d_end'])?>
                </td>
                <td>
                        <?=h($data[$i]['d_title'])?>
                </td>
-               <td id="mod_<?=$data[$i]['d_id']?>">
+               <td>
+                       <?=h($data[$i]['d_description'])?>
+               </td>
+               <td sortable_customkey="<?=$data[$i]['fmt_order_generated']?>">
+                       <?=h($data[$i]['fmt_generated'])?>
+               </td>
+               <td  id="mod_<?=$data[$i]['d_id']?>">
                        
<?=HtmlInput::anchor("Afficher","",sprintf("onclick=\"rapav_declaration_display('%s','%s','%s','%s')\"",$_REQUEST['plugin_code'],$_REQUEST['ac'],$_REQUEST['gDossier'],$data[$i]['d_id']))?>
                </td>
-               <td id="del_<?=$data[$i]['d_id']?>">
+               <td  id="del_<?=$data[$i]['d_id']?>">
                        
<?=HtmlInput::anchor("Efface","",sprintf("onclick=\"rapav_declaration_delete('%s','%s','%s','%s')\"",$_REQUEST['plugin_code'],$_REQUEST['ac'],$_REQUEST['gDossier'],$data[$i]['d_id']))?>
                </td>
        </tr>

Modified: trunk/rapport_avance/include/template/declaration_display.php
===================================================================
--- trunk/rapport_avance/include/template/declaration_display.php       
2013-05-02 21:18:59 UTC (rev 490)
+++ trunk/rapport_avance/include/template/declaration_display.php       
2013-05-02 21:20:02 UTC (rev 491)
@@ -29,6 +29,9 @@
 ?>
 <h1><?=$this->d_title?></h1>
 <h2> Du <?=$this->d_start?> au <?=$this->d_end?></h2>
+<p>
+       Note : <?=h($this->d_description)?>
+</p>
 <?
        if ( empty($array) ) { echo 'Aucune donnée'; exit();}
 
@@ -57,7 +60,7 @@
                echo '<p>'.$row['dr_libelle'].'</p>';
                break;
        case 8:
-               echo '<span class="notice" > '.$row['dr_libelle'].'</span>';
+               echo '<p class="notice" > '.$row['dr_libelle'].'</p>';
                break;
 
 }

Modified: trunk/rapport_avance/include/template/formulaire_definition.php
===================================================================
--- trunk/rapport_avance/include/template/formulaire_definition.php     
2013-05-02 21:18:59 UTC (rev 490)
+++ trunk/rapport_avance/include/template/formulaire_definition.php     
2013-05-02 21:20:02 UTC (rev 491)
@@ -129,7 +129,7 @@
                                                $_REQUEST['gDossier'],
                                                $this->f_id
                                ));
-               echo '<span id="rapav_template"> '.$this->f_filename.'</span>';
+               echo '<span id="rapav_template"> 
'.$this->anchor_document().'</span>';
                echo '<span id="rapav_template_ctl"> '.$remove_doc.'</span>';
                echo '<span id="rapav_new_file" style="display:none"> 
'.$file->input().'</span>';
        }

Modified: trunk/rapport_avance/include/template/formulaire_listing.php
===================================================================
--- trunk/rapport_avance/include/template/formulaire_listing.php        
2013-05-02 21:18:59 UTC (rev 490)
+++ trunk/rapport_avance/include/template/formulaire_listing.php        
2013-05-02 21:20:02 UTC (rev 491)
@@ -32,6 +32,7 @@
        <tr>
                <th>Nom du formulaire</th>
                <th>Description</th>
+
                <th></th>
                <th></th>
                <th></th>

Modified: trunk/rapport_avance/sql/upgrade3.sql
===================================================================
--- trunk/rapport_avance/sql/upgrade3.sql       2013-05-02 21:18:59 UTC (rev 
490)
+++ trunk/rapport_avance/sql/upgrade3.sql       2013-05-02 21:20:02 UTC (rev 
491)
@@ -30,3 +30,4 @@
 
 ALTER TABLE rapport_advanced.declaration ADD COLUMN d_size bigint;
 COMMENT ON COLUMN rapport_advanced.declaration.d_size IS 'Size of the file';
+



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