phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r611 - in trunk/rapport_avance: . include include/templa


From: phpcompta-dev
Subject: [Phpcompta-dev] r611 - in trunk/rapport_avance: . include include/template
Date: Wed, 11 Dec 2013 18:43:05 +0100 (CET)

Author: danydb
Date: 2013-12-11 18:43:05 +0100 (Wed, 11 Dec 2013)
New Revision: 611

Modified:
   trunk/rapport_avance/include/class_rapav_listing_compute.php
   trunk/rapport_avance/include/declaration.inc.php
   trunk/rapport_avance/include/template/rapav_listing_definition.php
   trunk/rapport_avance/raw.php
Log:
New style : with flower
Task #939 - Listing : G?\195?\169n?\195?\169ration de document

Modified: trunk/rapport_avance/include/class_rapav_listing_compute.php
===================================================================
--- trunk/rapport_avance/include/class_rapav_listing_compute.php        
2013-12-11 16:22:28 UTC (rev 610)
+++ trunk/rapport_avance/include/class_rapav_listing_compute.php        
2013-12-11 17:43:05 UTC (rev 611)
@@ -147,7 +147,8 @@
     }
     /**
      * Display the result of the computing, no card are deleted for the moment
-     * @param $with true display the checkbox, false don't
+     * @param $with_sel true display the checkbox, false don't
+     * @param $form_name Name of the form (to compute it id)
      * @global type $cn
      */
     function display($with_sel,$form_name="")
@@ -185,6 +186,7 @@
                     $detail=$odetail->next($r_detail,$e);
                     echo th( $detail->lc_code);
                 }
+                echo th("");
                 echo '</tr>';
             }
             /** for each detail */
@@ -202,6 +204,16 @@
                 echo (($detail->ld_value_text !== 
null)?td($detail->ld_value_text):"");
                 echo (($detail->ld_value_date!== 
null)?td($detail->ld_value_date):"");
             }
+            if ( $fiche->lf_filename != "")
+            {
+                $arg=array("gDossier"=>$_REQUEST['gDossier'],
+                    "plugin_code"=>$_REQUEST['plugin_code'],
+                    "ac"=>$_REQUEST['ac'],
+                    'act'=>'show_file',
+                    'lf_id'=>$fiche->lf_id);
+                $href=  "extension.raw.php?".http_build_query($arg);
+                echo td('<a href="'.$href.'">'.$fiche->lf_filename);
+            }
             echo '</tr>';
         }
         echo '</table>';

Modified: trunk/rapport_avance/include/declaration.inc.php
===================================================================
--- trunk/rapport_avance/include/declaration.inc.php    2013-12-11 16:22:28 UTC 
(rev 610)
+++ trunk/rapport_avance/include/declaration.inc.php    2013-12-11 17:43:05 UTC 
(rev 611)
@@ -92,6 +92,8 @@
     $listing=new RAPAV_Listing_Compute();
     $listing->load($_GET['lc_id']);
     $listing->generate();
+    $listing->display(false);
+    exit();
 }
 /**
  * Save listing now you can export them to csv and generate file if any

Modified: trunk/rapport_avance/include/template/rapav_listing_definition.php
===================================================================
--- trunk/rapport_avance/include/template/rapav_listing_definition.php  
2013-12-11 16:22:28 UTC (rev 610)
+++ trunk/rapport_avance/include/template/rapav_listing_definition.php  
2013-12-11 17:43:05 UTC (rev 611)
@@ -6,10 +6,10 @@
  */
 ?>
 <p>
-    Nom listing <?php echo h($this->Data->getp('name')); ?>
+    Nom listing <?php echo h($this->data->getp('name')); ?>
 </p>
 <p>
-    Description <?php echo h($this->Data->getp('description')); ?>
+    Description <?php echo h($this->data->getp('description')); ?>
 </p>
 <p>
     Catégorie <?php echo h($this->get_categorie_name()); ?>

Modified: trunk/rapport_avance/raw.php
===================================================================
--- trunk/rapport_avance/raw.php        2013-12-11 16:22:28 UTC (rev 610)
+++ trunk/rapport_avance/raw.php        2013-12-11 17:43:05 UTC (rev 611)
@@ -26,6 +26,8 @@
  */
 require_once 'include/class_formulaire_param.php';
 require_once 'include/class_rapav_declaration.php';
+require_once 'include/class_rapav_listing_compute_fiche.php';
+
 extract($_REQUEST);
 if ($act == 'rapav_form_export')
 {
@@ -137,4 +139,51 @@
      */
     echo 'export-listing-csv';
 }
+/**
+ * Show generated file
+ */
+if ($act=="show_file")
+{
+        $decl = new RAPAV_Listing_Compute_Fiche();
+       $decl->lf_id = $lf_id;
+       $decl->load();
+
+       $cn->start();
+       if ($decl->lf_filename == "")
+       {
+               ini_set('zlib.output_compression', 'Off');
+               header("Pragma: public");
+               header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+               header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
+               header("Cache-Control: must-revalidate");
+               header('Content-type: ' . 'text/plain');
+               header('Content-Disposition: attachment;filename=vide.txt', 
FALSE);
+               header("Accept-Ranges: bytes");
+               echo "******************";
+               echo _("Fichier effacé");
+               echo "******************";
+               exit();
+       }
+       $tmp = tempnam($_ENV['TMP'], 'document_');
+
+       $cn->lo_export($decl->lf_lob, $tmp);
+
+       ini_set('zlib.output_compression', 'Off');
+       header("Pragma: public");
+       header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+       header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
+       header("Cache-Control: must-revalidate");
+       header('Content-type: ' . $decl->lf_mimetype);
+       header('Content-Disposition: attachment;filename="' . 
$decl->lf_filename . '"', FALSE);
+       header("Accept-Ranges: bytes");
+       $file = fopen($tmp, 'r');
+       while (!feof($file))
+               echo fread($file, 8192);
+
+       fclose($file);
+
+       unlink($tmp);
+
+       $cn->commit();
+}
 ?>



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