Skip to content

Commit

Permalink
Qual: Removed no more used external libraries (fpdi_protection)
Browse files Browse the repository at this point in the history
Qual: Centralize include of external libray fpdi
Qual: Now use fpdi with no changes
  • Loading branch information
eldy committed Aug 11, 2011
1 parent 40c4bcc commit 9b438ac
Show file tree
Hide file tree
Showing 50 changed files with 2,490 additions and 2,737 deletions.
10 changes: 6 additions & 4 deletions htdocs/admin/fournisseur.php
Expand Up @@ -25,7 +25,7 @@
* \file htdocs/admin/fournisseur.php
* \ingroup fournisseur
* \brief Page d'administration-configuration du module Fournisseur
* \version $Id: fournisseur.php,v 1.63 2011/07/31 22:23:21 eldy Exp $
* \version $Id: fournisseur.php,v 1.64 2011/08/11 12:14:02 eldy Exp $
*/

require("../main.inc.php");
Expand Down Expand Up @@ -109,10 +109,11 @@
// Charge le modele
$dir = "/includes/modules/supplier_invoice/pdf/";
$file = "pdf_".$modele.".modules.php";
if (file_exists($dir.$file))
$file = dol_buildpath($dir.$file);
if (file_exists($file))
{
$classname = "pdf_".$modele;
require_once($dir.$file);
require_once($file);

$obj = new $classname($db,$facture);

Expand Down Expand Up @@ -499,6 +500,7 @@
dol_print_error($db);
}


print '<table class="noborder" width="100%">'."\n";
print '<tr class="liste_titre">'."\n";
print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
Expand Down Expand Up @@ -617,5 +619,5 @@
print "</td></tr>\n";
print '</form>';

llxFooter('$Date: 2011/07/31 22:23:21 $ - $Revision: 1.63 $');
llxFooter('$Date: 2011/08/11 12:14:02 $ - $Revision: 1.64 $');
?>
45 changes: 24 additions & 21 deletions htdocs/compta/facture/impayees.php
Expand Up @@ -22,14 +22,15 @@
* \file htdocs/compta/facture/impayees.php
* \ingroup facture
* \brief Page to list and build liste of unpaid invoices
* \version $Revision: 1.85 $
* \version $Revision: 1.86 $
*/

require("../../main.inc.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT."/compta/facture/class/facture.class.php");
require_once(DOL_DOCUMENT_ROOT."/compta/paiement/class/paiement.class.php");
require_once(DOL_DOCUMENT_ROOT."/lib/files.lib.php");
require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php');


$langs->load("bills");
Expand All @@ -52,9 +53,6 @@
{
if (is_array($_POST['toGenerate']))
{
require_once(FPDFI_PATH.'fpdi.php');
require_once(DOL_DOCUMENT_ROOT.'/lib/pdf.lib.php');

$factures = dol_dir_list($conf->facture->dir_output,'all',1,implode('\.pdf|',$_POST['toGenerate']).'\.pdf','\.meta$|\.png','date',SORT_DESC) ;

// liste les fichiers
Expand All @@ -68,22 +66,27 @@
}
}

// Create empty PDF
$pdf=new FPDI('P','mm','A4');
if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);

if (class_exists('TCPDF'))
{
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
}
//$pdf->SetFont(pdf_getPDFFont($outputlangs));

//$pdf->Open();
//$pdf->AddPage();
//$title=$langs->trans("BillsCustomersUnpaid");
//if ($option=='late') $title=$langs->trans("BillsCustomersUnpaid");
//$pdf->MultiCell(100, 3, $title, 0, 'J');
// Define output language (Here it is not used because we do only merging existing PDF)
$outputlangs = $langs;
$newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
if (! empty($newlang))
{
$outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang);
}

// Create empty PDF
$pdf=pdf_getInstance();
if (class_exists('TCPDF'))
{
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
}
$pdf->SetFont(pdf_getPDFFont($outputlangs));

if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false);

// Add all others
foreach($files as $file)
Expand Down Expand Up @@ -424,5 +427,5 @@

$db->close();

llxFooter('$Date: 2011/08/10 23:21:13 $ - $Revision: 1.85 $');
llxFooter('$Date: 2011/08/11 12:14:03 $ - $Revision: 1.86 $');
?>
1 change: 0 additions & 1 deletion htdocs/includes/fpdf/fpdfi/README.txt
@@ -1,5 +1,4 @@
This directory contains all FPDFI librairies:
- FPDI
- FPDI_TPL
- FPDI_Protection
Found on http://www.setasign.de/products/pdf-php-solutions/fpdi/
9 changes: 3 additions & 6 deletions htdocs/includes/fpdf/fpdfi/filters/FilterASCII85.php
@@ -1,8 +1,8 @@
<?php
//
// FPDI - Version 1.3.4
// FPDI - Version 1.4.1
//
// Copyright 2004-2010 Setasign - Jan Slabon
// Copyright 2004-2011 Setasign - Jan Slabon
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -26,8 +26,7 @@
if (!defined('ORD_tilde'))
define('ORD_tilde', ord('~'));

$__tmp = version_compare(phpversion(), "5") == -1 ? array('FilterASCII85') : array('FilterASCII85', false);
if (!call_user_func_array('class_exists', $__tmp)) {
if (!class_exists('FilterASCII85', false)) {

class FilterASCII85 {

Expand Down Expand Up @@ -100,5 +99,3 @@ function encode($in) {
}
}
}

unset($__tmp);
64 changes: 32 additions & 32 deletions htdocs/includes/fpdf/fpdfi/filters/FilterASCII85_FPDI.php
@@ -1,33 +1,33 @@
<?php
//
// FPDI - Version 1.3.4
//
// Copyright 2004-2010 Setasign - Jan Slabon
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

require_once('FilterASCII85.php');

class FilterASCII85_FPDI extends FilterASCII85 {

var $fpdi;

function FilterASCII85_FPDI(&$fpdi) {
$this->fpdi =& $fpdi;
}

function error($msg) {
$this->fpdi->error($msg);
}
<?php
//
// FPDI - Version 1.4.1
//
// Copyright 2004-2011 Setasign - Jan Slabon
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

require_once('FilterASCII85.php');

class FilterASCII85_FPDI extends FilterASCII85 {

var $fpdi;

function FilterASCII85_FPDI(&$fpdi) {
$this->fpdi =& $fpdi;
}

function error($msg) {
$this->fpdi->error($msg);
}
}
9 changes: 3 additions & 6 deletions htdocs/includes/fpdf/fpdfi/filters/FilterLZW.php
@@ -1,8 +1,8 @@
<?php
//
// FPDI - Version 1.3.4
// FPDI - Version 1.4.1
//
// Copyright 2004-2010 Setasign - Jan Slabon
// Copyright 2004-2011 Setasign - Jan Slabon
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -17,8 +17,7 @@
// limitations under the License.
//

$__tmp = version_compare(phpversion(), "5") == -1 ? array('FilterLZW') : array('FilterLZW', false);
if (!call_user_func_array('class_exists', $__tmp)) {
if (!class_exists('FilterLZW', false)) {

class FilterLZW {

Expand Down Expand Up @@ -156,5 +155,3 @@ function encode($in) {
}
}
}

unset($__tmp);
64 changes: 32 additions & 32 deletions htdocs/includes/fpdf/fpdfi/filters/FilterLZW_FPDI.php
@@ -1,33 +1,33 @@
<?php
//
// FPDI - Version 1.3.4
//
// Copyright 2004-2010 Setasign - Jan Slabon
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

require_once('FilterLZW.php');

class FilterLZW_FPDI extends FilterLZW {

var $fpdi;

function FilterLZW_FPDI(&$fpdi) {
$this->fpdi =& $fpdi;
}

function error($msg) {
$this->fpdi->error($msg);
}
<?php
//
// FPDI - Version 1.4.1
//
// Copyright 2004-2011 Setasign - Jan Slabon
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

require_once('FilterLZW.php');

class FilterLZW_FPDI extends FilterLZW {

var $fpdi;

function FilterLZW_FPDI(&$fpdi) {
$this->fpdi =& $fpdi;
}

function error($msg) {
$this->fpdi->error($msg);
}
}

0 comments on commit 9b438ac

Please sign in to comment.