phpcompta-dev
[Top][All Lists]
Advanced

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

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


From: phpcompta-dev
Subject: [Phpcompta-dev] r4269 - in phpcompta/trunk: html include
Date: Sat, 29 Oct 2011 14:53:55 +0200 (CEST)

Author: danydb
Date: 2011-10-29 14:53:53 +0200 (Sat, 29 Oct 2011)
New Revision: 4269

Added:
   phpcompta/trunk/include/export_bilan_oth.php
Removed:
   phpcompta/trunk/html/bilan.php
Modified:
   phpcompta/trunk/html/export.php
   phpcompta/trunk/include/ac_common.php
   phpcompta/trunk/include/impress_bilan.inc.php
Log:
421: bilan.php moved

Deleted: phpcompta/trunk/html/bilan.php
===================================================================
--- phpcompta/trunk/html/bilan.php      2011-10-29 03:05:29 UTC (rev 4268)
+++ phpcompta/trunk/html/bilan.php      2011-10-29 12:53:53 UTC (rev 4269)
@@ -1,70 +0,0 @@
-<?php
-/*
- *   This file is part of PhpCompta.
- *
- *   PhpCompta is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   PhpCompta is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with PhpCompta; if not, write to the Free Software
- *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-/* $Revision$ */
-// Copyright Author Dany De Bontridder address@hidden
-/*! \file
- * \brief send a Bilan in RTF format
- */
-include_once("ac_common.php");
-include_once("impress_inc.php");
-require_once('class_database.php');
-require_once ('header_print.php');
-require_once ('class_acc_bilan.php');
-
-require_once  ('class_user.php');
-require_once('class_dossier.php');
-$gDossier=dossier::id();
-
-/* Admin. Dossier */
-$cn=new Database($gDossier);
-
-$User=new User($cn);
-$User->Check();
-
-// TODO a specific level of security for the "bilan" ???
-// Change must be done here
-$User->can_request(IMPBIL);
-
-
-$bilan=new Acc_Bilan($cn);
-$bilan->get_request_get();
-$bilan->load();
-/*\!bug the headers shouldn't be sent here, but it doesn't work
- * a html header is send before, to fix asap */
-if ( $bilan->b_type=='odt')
-{
-    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
-    header("Cache-Control: must-revalidate");
-    header('Content-type: application/vnd.oasis.opendocument.text');
-    header('Content-Disposition: 
attachment;filename="'.$bilan->b_name.'.odt"',FALSE);
-    header("Accept-Ranges: bytes");
-
-}
-if ( $bilan->b_type=='ods')
-{
-    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
-    header("Cache-Control: must-revalidate");
-    header('Content-type: application/vnd.oasis.opendocument.spreadsheet');
-    header('Content-Disposition: 
attachment;filename="'.$bilan->b_name.'.ods"',FALSE);
-    header("Accept-Ranges: bytes");
-
-}
-
-$bilan->generate();
-?>

Modified: phpcompta/trunk/html/export.php
===================================================================
--- phpcompta/trunk/html/export.php     2011-10-29 03:05:29 UTC (rev 4268)
+++ phpcompta/trunk/html/export.php     2011-10-29 12:53:53 UTC (rev 4269)
@@ -22,7 +22,7 @@
 
 /*!\file
  * \brief manage all the export to CSV or PDF
- *   act can be 
+ *   act can be
  *
  */
 
@@ -46,7 +46,7 @@
     exit();
   }
 
-switch( $_GET['act']) 
+switch( $_GET['act'])
   {
   case 'CSV/histo':
     $user->can_request(IMPJRN,0);
@@ -168,7 +168,11 @@
     require_once('export_anc_balance_group_csv.php');
     exit();
     break;
-
+  case 'OTH/Bilan':
+      $user->can_request(IMPBIL);
+      require_once 'export_bilan_oth.php';
+      exit();
+      break;
    default:
     alert('Action inconnue '.$_GET['act']);
     exit();

Modified: phpcompta/trunk/include/ac_common.php
===================================================================
--- phpcompta/trunk/include/ac_common.php       2011-10-29 03:05:29 UTC (rev 
4268)
+++ phpcompta/trunk/include/ac_common.php       2011-10-29 12:53:53 UTC (rev 
4269)
@@ -886,7 +886,10 @@
 function compute_variable($p_string)
 {
     $array=array();
+    if ($p_string == '') return $array;
+    
     $var=explode("&",$p_string);
+    if (empty ($var))  return $array;
     for ($i=0;$i < count($var);$i++)
     {
        $var2=explode('=',$var[$i]);

Copied: phpcompta/trunk/include/export_bilan_oth.php (from rev 4265, 
phpcompta/trunk/html/bilan.php)
===================================================================
--- phpcompta/trunk/include/export_bilan_oth.php                                
(rev 0)
+++ phpcompta/trunk/include/export_bilan_oth.php        2011-10-29 12:53:53 UTC 
(rev 4269)
@@ -0,0 +1,70 @@
+<?php
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+/* $Revision$ */
+// Copyright Author Dany De Bontridder address@hidden
+/*! \file
+ * \brief send a Bilan in RTF format
+ */
+include_once("ac_common.php");
+include_once("impress_inc.php");
+require_once('class_database.php');
+require_once ('header_print.php');
+require_once ('class_acc_bilan.php');
+
+require_once  ('class_user.php');
+require_once('class_dossier.php');
+$gDossier=dossier::id();
+
+/* Admin. Dossier */
+$cn=new Database($gDossier);
+
+$User=new User($cn);
+$User->Check();
+
+// TODO a specific level of security for the "bilan" ???
+// Change must be done here
+$User->can_request(IMPBIL);
+
+
+$bilan=new Acc_Bilan($cn);
+$bilan->get_request_get();
+$bilan->load();
+/*\!bug the headers shouldn't be sent here, but it doesn't work
+ * a html header is send before, to fix asap */
+if ( $bilan->b_type=='odt')
+{
+    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+    header("Cache-Control: must-revalidate");
+    header('Content-type: application/vnd.oasis.opendocument.text');
+    header('Content-Disposition: 
attachment;filename="'.$bilan->b_name.'.odt"',FALSE);
+    header("Accept-Ranges: bytes");
+
+}
+if ( $bilan->b_type=='ods')
+{
+    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+    header("Cache-Control: must-revalidate");
+    header('Content-type: application/vnd.oasis.opendocument.spreadsheet');
+    header('Content-Disposition: 
attachment;filename="'.$bilan->b_name.'.ods"',FALSE);
+    header("Accept-Ranges: bytes");
+
+}
+
+$bilan->generate();
+?>

Modified: phpcompta/trunk/include/impress_bilan.inc.php
===================================================================
--- phpcompta/trunk/include/impress_bilan.inc.php       2011-10-29 03:05:29 UTC 
(rev 4268)
+++ phpcompta/trunk/include/impress_bilan.inc.php       2011-10-29 12:53:53 UTC 
(rev 4269)
@@ -74,10 +74,11 @@
     $bilan->get_request_get();
     $bilan->verify();
 
-    echo '<FORM METHOD="GET" ACTION="bilan.php">';
+    echo '<FORM METHOD="GET" ACTION="export.php">';
     echo dossier::hidden();
     echo HtmlInput::get_to_hidden(array('exercice'));
     echo HtmlInput::hidden('b_id',$_GET['b_id']);
+    echo HtmlInput::hidden('act','OTH/Bilan');
 
     echo HtmlInput::hidden('from_periode',$bilan->from);
     echo HtmlInput::hidden('to_periode',$bilan->to);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]