diff --git a/htdocs/adherents/cartes/PDF_card.class.php b/htdocs/adherents/cartes/PDF_card.class.php index c8e28c3ae669fc96a854eda1d95898e83751a96e..3d8c2623c7d557429f32408ac21320e897e05946 100755 --- a/htdocs/adherents/cartes/PDF_card.class.php +++ b/htdocs/adherents/cartes/PDF_card.class.php @@ -67,7 +67,7 @@ \version $Revision$ */ -require_once(FPDF_PATH.'fpdf.php'); +require_once(FPDF_PATH.'fpdi_protection.php'); /** diff --git a/htdocs/comm/action/rapport/rapport.pdf.php b/htdocs/comm/action/rapport/rapport.pdf.php index 64c691b1416ff7775579ffced0c0ca56ccee1667..b0d7d15f7360b93ab25ea85613184b595f6a1d73 100644 --- a/htdocs/comm/action/rapport/rapport.pdf.php +++ b/htdocs/comm/action/rapport/rapport.pdf.php @@ -28,7 +28,7 @@ \version $Revision$ */ -require_once(FPDF_PATH.'fpdf.php'); +require_once(FPDF_PATH.'fpdi_protection.php'); require_once(DOL_DOCUMENT_ROOT ."/includes/fpdf/fpdf_indexes.php"); require_once(DOL_DOCUMENT_ROOT ."/includes/fpdf/fpdf_html.php"); diff --git a/htdocs/compta/export/ComptaJournalPdf.class.php b/htdocs/compta/export/ComptaJournalPdf.class.php index 4c2f2bb59338ba8c63271fd0ce6b6958ebd642bf..42e57edbf12f905e0edd09aa1767aa1357741018 100644 --- a/htdocs/compta/export/ComptaJournalPdf.class.php +++ b/htdocs/compta/export/ComptaJournalPdf.class.php @@ -21,7 +21,7 @@ * */ -require_once(FPDF_PATH.'fpdf.php'); +require_once(FPDF_PATH.'fpdi_protection.php'); class ComptaJournalPdf extends FPDF { diff --git a/htdocs/compta/paiement/cheque/pdf/pdf_blochet.class.php b/htdocs/compta/paiement/cheque/pdf/pdf_blochet.class.php index 3df01404d19aca0c2cddf6eb63880169d52413ad..e1eb4d9152b4a1f0b8c412b358760cf97b02ad18 100644 --- a/htdocs/compta/paiement/cheque/pdf/pdf_blochet.class.php +++ b/htdocs/compta/paiement/cheque/pdf/pdf_blochet.class.php @@ -27,7 +27,7 @@ \version $Revision$ */ -require_once(FPDF_PATH.'fpdf.php'); +require_once(FPDF_PATH.'fpdi_protection.php'); /** @@ -220,7 +220,8 @@ class BordereauChequeBlochet $year = sprintf("%04d",$year); $_file = $dir . "bordereau-".$number.".pdf"; - $pdf = new FPDF('P','mm','A4'); + $pdf = new FPDI_Protection('P','mm','A4'); + $pdf->SetProtection(array('print')); //ne permet que l'impression du document $pdf->Open(); diff --git a/htdocs/expedition/mods/methode_expedition.modules.php b/htdocs/expedition/mods/methode_expedition.modules.php index 8baaea112074c6cbbc2b3e5b01883eb713ee3330..15dac3b3bf7812eee0cdd6a1f0d3f163891b4c74 100644 --- a/htdocs/expedition/mods/methode_expedition.modules.php +++ b/htdocs/expedition/mods/methode_expedition.modules.php @@ -21,7 +21,7 @@ * */ -require_once(FPDF_PATH.'fpdf.php'); +require_once(FPDF_PATH.'fpdi_protection.php'); Class methode_expedition { @@ -80,7 +80,8 @@ Class methode_expedition if (file_exists($dir)) { - $pdf=new FPDF('P','mm','A4'); + $pdf=new FPDI_Protection('P','mm','A4'); + $pdf->SetProtection(array('print')); //ne permet que l'impression du document $pdf->Open(); $pdf->AddPage(); diff --git a/htdocs/expedition/mods/pdf/pdf_expedition_merou.modules.php b/htdocs/expedition/mods/pdf/pdf_expedition_merou.modules.php index ab63147db4810f0b4fd71c9298ce24811e3e51db..9508f03365a46918ea42204d714e33d63c8d36df 100644 --- a/htdocs/expedition/mods/pdf/pdf_expedition_merou.modules.php +++ b/htdocs/expedition/mods/pdf/pdf_expedition_merou.modules.php @@ -143,7 +143,8 @@ Class pdf_expedition_merou extends ModelePdfExpedition if (file_exists($dir)) { // Initialisation Bon vierge - $pdf = new FPDF('l','mm',$this->format); + $pdf = new FPDI_Protection('l','mm',$this->format); + $pdf->SetProtection(array('print')); //ne permet que l'impression du document $pdf->Open(); $pdf->AddPage(); //Generation de l entete du fichier diff --git a/htdocs/fourn/commande/modules/modules_commandefournisseur.php b/htdocs/fourn/commande/modules/modules_commandefournisseur.php index 0a2480388bf67e78832d28ade30db342102a1b84..fed9fb4af546d3a71a538f9d99f61361cf66329f 100644 --- a/htdocs/fourn/commande/modules/modules_commandefournisseur.php +++ b/htdocs/fourn/commande/modules/modules_commandefournisseur.php @@ -32,7 +32,7 @@ \version $Revision$ */ -require_once(FPDF_PATH.'fpdf.php'); +require_once(FPDF_PATH.'fpdi_protection.php'); /** diff --git a/htdocs/fourn/commande/modules/pdf/pdf_muscadet.modules.php b/htdocs/fourn/commande/modules/pdf/pdf_muscadet.modules.php index 585eef02972ce6c1fe74144fc949d55599627ac0..256f33ac5348f6c35d0f4bfc384ce83afe766c01 100644 --- a/htdocs/fourn/commande/modules/pdf/pdf_muscadet.modules.php +++ b/htdocs/fourn/commande/modules/pdf/pdf_muscadet.modules.php @@ -175,7 +175,8 @@ class pdf_muscadet extends ModelePDFCommandesSuppliers $nblignes = sizeof($com->lignes); // Initialisation document vierge - $pdf=new FPDF('P','mm',$this->format); + $pdf=new FPDI_Protection('P','mm',$this->format); + $pdf->SetProtection(array('print')); //ne permet que l'impression du document $pdf->Open(); $pdf->AddPage(); diff --git a/htdocs/includes/fpdf/DolibarrPdfBarCode.class.php b/htdocs/includes/fpdf/DolibarrPdfBarCode.class.php index f099420820c62abf341fb5911bc6897ded915c1c..1ee02dbde953d8ab5577744b7e639d959af73222 100644 --- a/htdocs/includes/fpdf/DolibarrPdfBarCode.class.php +++ b/htdocs/includes/fpdf/DolibarrPdfBarCode.class.php @@ -20,7 +20,7 @@ * */ -require_once(FPDF_PATH.'fpdf.php'); +require_once(FPDF_PATH.'fpdi_protection.php'); class DolibarrPdfBarCode extends FPDF { diff --git a/htdocs/includes/fpdf/code39ext/code39.php b/htdocs/includes/fpdf/code39ext/code39.php index ed526d9414f0bd2f5f31b6c8df6a51ec587aa18a..d7e8b7ab1f09228291c406647c0ffe9b19eebbce 100755 --- a/htdocs/includes/fpdf/code39ext/code39.php +++ b/htdocs/includes/fpdf/code39ext/code39.php @@ -1,157 +1,157 @@ -<?php -require_once(FPDF_PATH.'fpdf.php'); - -class PDF_Code39 extends FPDF { - -function Code39($x, $y, $code, $ext = true, $cks = false, $w = 0.4, $h = 20, $wide = true) { - - //Display code - $this->SetFont('Arial', '', 10); - $this->Text($x, $y+$h+4, $code); - - if($ext) - { - //Extended encoding - $code = $this->encode_code39_ext($code); - } - else - { - //Convert to upper case - $code = strtoupper($code); - //Check validity - if(!preg_match('|^[0-9A-Z. $/+%-]*$|', $code)) - $this->Error('Invalid barcode value: '.$code); - } - - //Compute checksum - if ($cks) - $code .= $this->checksum_code39($code); - - //Add start and stop characters - $code = '*'.$code.'*'; - - //Conversion tables - $narrow_encoding = array ( - '0' => '101001101101', '1' => '110100101011', '2' => '101100101011', - '3' => '110110010101', '4' => '101001101011', '5' => '110100110101', - '6' => '101100110101', '7' => '101001011011', '8' => '110100101101', - '9' => '101100101101', 'A' => '110101001011', 'B' => '101101001011', - 'C' => '110110100101', 'D' => '101011001011', 'E' => '110101100101', - 'F' => '101101100101', 'G' => '101010011011', 'H' => '110101001101', - 'I' => '101101001101', 'J' => '101011001101', 'K' => '110101010011', - 'L' => '101101010011', 'M' => '110110101001', 'N' => '101011010011', - 'O' => '110101101001', 'P' => '101101101001', 'Q' => '101010110011', - 'R' => '110101011001', 'S' => '101101011001', 'T' => '101011011001', - 'U' => '110010101011', 'V' => '100110101011', 'W' => '110011010101', - 'X' => '100101101011', 'Y' => '110010110101', 'Z' => '100110110101', - '-' => '100101011011', '.' => '110010101101', ' ' => '100110101101', - '*' => '100101101101', '$' => '100100100101', '/' => '100100101001', - '+' => '100101001001', '%' => '101001001001' ); - - $wide_encoding = array ( - '0' => '101000111011101', '1' => '111010001010111', '2' => '101110001010111', - '3' => '111011100010101', '4' => '101000111010111', '5' => '111010001110101', - '6' => '101110001110101', '7' => '101000101110111', '8' => '111010001011101', - '9' => '101110001011101', 'A' => '111010100010111', 'B' => '101110100010111', - 'C' => '111011101000101', 'D' => '101011100010111', 'E' => '111010111000101', - 'F' => '101110111000101', 'G' => '101010001110111', 'H' => '111010100011101', - 'I' => '101110100011101', 'J' => '101011100011101', 'K' => '111010101000111', - 'L' => '101110101000111', 'M' => '111011101010001', 'N' => '101011101000111', - 'O' => '111010111010001', 'P' => '101110111010001', 'Q' => '101010111000111', - 'R' => '111010101110001', 'S' => '101110101110001', 'T' => '101011101110001', - 'U' => '111000101010111', 'V' => '100011101010111', 'W' => '111000111010101', - 'X' => '100010111010111', 'Y' => '111000101110101', 'Z' => '100011101110101', - '-' => '100010101110111', '.' => '111000101011101', ' ' => '100011101011101', - '*' => '100010111011101', '$' => '100010001000101', '/' => '100010001010001', - '+' => '100010100010001', '%' => '101000100010001'); - - $encoding = $wide ? $wide_encoding : $narrow_encoding; - - //Inter-character spacing - $gap = ($w > 0.29) ? '00' : '0'; - - //Convert to bars - $encode = ''; - for ($i = 0; $i< strlen($code); $i++) - $encode .= $encoding[$code{$i}].$gap; - - //Draw bars - $this->draw_code39($encode, $x, $y, $w, $h); -} - -function checksum_code39($code) { - - //Compute the modulo 43 checksum - - $chars = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', - 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', - 'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%'); - $sum = 0; - for ($i=0 ; $i<strlen($code); $i++) { - $a = array_keys($chars, $code{$i}); - $sum += $a[0]; - } - $r = $sum % 43; - return $chars[$r]; -} - -function encode_code39_ext($code) { - - //Encode characters in extended mode - - $encode = array( - chr(0) => '%U', chr(1) => '$A', chr(2) => '$B', chr(3) => '$C', - chr(4) => '$D', chr(5) => '$E', chr(6) => '$F', chr(7) => '$G', - chr(8) => '$H', chr(9) => '$I', chr(10) => '$J', chr(11) => '�K', - chr(12) => '$L', chr(13) => '$M', chr(14) => '$N', chr(15) => '$O', - chr(16) => '$P', chr(17) => '$Q', chr(18) => '$R', chr(19) => '$S', - chr(20) => '$T', chr(21) => '$U', chr(22) => '$V', chr(23) => '$W', - chr(24) => '$X', chr(25) => '$Y', chr(26) => '$Z', chr(27) => '%A', - chr(28) => '%B', chr(29) => '%C', chr(30) => '%D', chr(31) => '%E', - chr(32) => ' ', chr(33) => '/A', chr(34) => '/B', chr(35) => '/C', - chr(36) => '/D', chr(37) => '/E', chr(38) => '/F', chr(39) => '/G', - chr(40) => '/H', chr(41) => '/I', chr(42) => '/J', chr(43) => '/K', - chr(44) => '/L', chr(45) => '-', chr(46) => '.', chr(47) => '/O', - chr(48) => '0', chr(49) => '1', chr(50) => '2', chr(51) => '3', - chr(52) => '4', chr(53) => '5', chr(54) => '6', chr(55) => '7', - chr(56) => '8', chr(57) => '9', chr(58) => '/Z', chr(59) => '%F', - chr(60) => '%G', chr(61) => '%H', chr(62) => '%I', chr(63) => '%J', - chr(64) => '%V', chr(65) => 'A', chr(66) => 'B', chr(67) => 'C', - chr(68) => 'D', chr(69) => 'E', chr(70) => 'F', chr(71) => 'G', - chr(72) => 'H', chr(73) => 'I', chr(74) => 'J', chr(75) => 'K', - chr(76) => 'L', chr(77) => 'M', chr(78) => 'N', chr(79) => 'O', - chr(80) => 'P', chr(81) => 'Q', chr(82) => 'R', chr(83) => 'S', - chr(84) => 'T', chr(85) => 'U', chr(86) => 'V', chr(87) => 'W', - chr(88) => 'X', chr(89) => 'Y', chr(90) => 'Z', chr(91) => '%K', - chr(92) => '%L', chr(93) => '%M', chr(94) => '%N', chr(95) => '%O', - chr(96) => '%W', chr(97) => '+A', chr(98) => '+B', chr(99) => '+C', - chr(100) => '+D', chr(101) => '+E', chr(102) => '+F', chr(103) => '+G', - chr(104) => '+H', chr(105) => '+I', chr(106) => '+J', chr(107) => '+K', - chr(108) => '+L', chr(109) => '+M', chr(110) => '+N', chr(111) => '+O', - chr(112) => '+P', chr(113) => '+Q', chr(114) => '+R', chr(115) => '+S', - chr(116) => '+T', chr(117) => '+U', chr(118) => '+V', chr(119) => '+W', - chr(120) => '+X', chr(121) => '+Y', chr(122) => '+Z', chr(123) => '%P', - chr(124) => '%Q', chr(125) => '%R', chr(126) => '%S', chr(127) => '%T'); - - $code_ext = ''; - for ($i = 0 ; $i<strlen($code); $i++) { - if (ord($code{$i}) > 127) - $this->Error('Invalid character: '.$code{$i}); - $code_ext .= $encode[$code{$i}]; - } - return $code_ext; -} - -function draw_code39($code, $x, $y, $w, $h){ - - //Draw bars - - for($i=0; $i<strlen($code); $i++) - { - if($code{$i} == '1') - $this->Rect($x+$i*$w, $y, $w, $h, 'F'); - } -} -} -?> +<?php +require_once(FPDF_PATH.'fpdi_protection.php'); + +class PDF_Code39 extends FPDF { + +function Code39($x, $y, $code, $ext = true, $cks = false, $w = 0.4, $h = 20, $wide = true) { + + //Display code + $this->SetFont('Arial', '', 10); + $this->Text($x, $y+$h+4, $code); + + if($ext) + { + //Extended encoding + $code = $this->encode_code39_ext($code); + } + else + { + //Convert to upper case + $code = strtoupper($code); + //Check validity + if(!preg_match('|^[0-9A-Z. $/+%-]*$|', $code)) + $this->Error('Invalid barcode value: '.$code); + } + + //Compute checksum + if ($cks) + $code .= $this->checksum_code39($code); + + //Add start and stop characters + $code = '*'.$code.'*'; + + //Conversion tables + $narrow_encoding = array ( + '0' => '101001101101', '1' => '110100101011', '2' => '101100101011', + '3' => '110110010101', '4' => '101001101011', '5' => '110100110101', + '6' => '101100110101', '7' => '101001011011', '8' => '110100101101', + '9' => '101100101101', 'A' => '110101001011', 'B' => '101101001011', + 'C' => '110110100101', 'D' => '101011001011', 'E' => '110101100101', + 'F' => '101101100101', 'G' => '101010011011', 'H' => '110101001101', + 'I' => '101101001101', 'J' => '101011001101', 'K' => '110101010011', + 'L' => '101101010011', 'M' => '110110101001', 'N' => '101011010011', + 'O' => '110101101001', 'P' => '101101101001', 'Q' => '101010110011', + 'R' => '110101011001', 'S' => '101101011001', 'T' => '101011011001', + 'U' => '110010101011', 'V' => '100110101011', 'W' => '110011010101', + 'X' => '100101101011', 'Y' => '110010110101', 'Z' => '100110110101', + '-' => '100101011011', '.' => '110010101101', ' ' => '100110101101', + '*' => '100101101101', '$' => '100100100101', '/' => '100100101001', + '+' => '100101001001', '%' => '101001001001' ); + + $wide_encoding = array ( + '0' => '101000111011101', '1' => '111010001010111', '2' => '101110001010111', + '3' => '111011100010101', '4' => '101000111010111', '5' => '111010001110101', + '6' => '101110001110101', '7' => '101000101110111', '8' => '111010001011101', + '9' => '101110001011101', 'A' => '111010100010111', 'B' => '101110100010111', + 'C' => '111011101000101', 'D' => '101011100010111', 'E' => '111010111000101', + 'F' => '101110111000101', 'G' => '101010001110111', 'H' => '111010100011101', + 'I' => '101110100011101', 'J' => '101011100011101', 'K' => '111010101000111', + 'L' => '101110101000111', 'M' => '111011101010001', 'N' => '101011101000111', + 'O' => '111010111010001', 'P' => '101110111010001', 'Q' => '101010111000111', + 'R' => '111010101110001', 'S' => '101110101110001', 'T' => '101011101110001', + 'U' => '111000101010111', 'V' => '100011101010111', 'W' => '111000111010101', + 'X' => '100010111010111', 'Y' => '111000101110101', 'Z' => '100011101110101', + '-' => '100010101110111', '.' => '111000101011101', ' ' => '100011101011101', + '*' => '100010111011101', '$' => '100010001000101', '/' => '100010001010001', + '+' => '100010100010001', '%' => '101000100010001'); + + $encoding = $wide ? $wide_encoding : $narrow_encoding; + + //Inter-character spacing + $gap = ($w > 0.29) ? '00' : '0'; + + //Convert to bars + $encode = ''; + for ($i = 0; $i< strlen($code); $i++) + $encode .= $encoding[$code{$i}].$gap; + + //Draw bars + $this->draw_code39($encode, $x, $y, $w, $h); +} + +function checksum_code39($code) { + + //Compute the modulo 43 checksum + + $chars = array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', + 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', + 'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%'); + $sum = 0; + for ($i=0 ; $i<strlen($code); $i++) { + $a = array_keys($chars, $code{$i}); + $sum += $a[0]; + } + $r = $sum % 43; + return $chars[$r]; +} + +function encode_code39_ext($code) { + + //Encode characters in extended mode + + $encode = array( + chr(0) => '%U', chr(1) => '$A', chr(2) => '$B', chr(3) => '$C', + chr(4) => '$D', chr(5) => '$E', chr(6) => '$F', chr(7) => '$G', + chr(8) => '$H', chr(9) => '$I', chr(10) => '$J', chr(11) => '�K', + chr(12) => '$L', chr(13) => '$M', chr(14) => '$N', chr(15) => '$O', + chr(16) => '$P', chr(17) => '$Q', chr(18) => '$R', chr(19) => '$S', + chr(20) => '$T', chr(21) => '$U', chr(22) => '$V', chr(23) => '$W', + chr(24) => '$X', chr(25) => '$Y', chr(26) => '$Z', chr(27) => '%A', + chr(28) => '%B', chr(29) => '%C', chr(30) => '%D', chr(31) => '%E', + chr(32) => ' ', chr(33) => '/A', chr(34) => '/B', chr(35) => '/C', + chr(36) => '/D', chr(37) => '/E', chr(38) => '/F', chr(39) => '/G', + chr(40) => '/H', chr(41) => '/I', chr(42) => '/J', chr(43) => '/K', + chr(44) => '/L', chr(45) => '-', chr(46) => '.', chr(47) => '/O', + chr(48) => '0', chr(49) => '1', chr(50) => '2', chr(51) => '3', + chr(52) => '4', chr(53) => '5', chr(54) => '6', chr(55) => '7', + chr(56) => '8', chr(57) => '9', chr(58) => '/Z', chr(59) => '%F', + chr(60) => '%G', chr(61) => '%H', chr(62) => '%I', chr(63) => '%J', + chr(64) => '%V', chr(65) => 'A', chr(66) => 'B', chr(67) => 'C', + chr(68) => 'D', chr(69) => 'E', chr(70) => 'F', chr(71) => 'G', + chr(72) => 'H', chr(73) => 'I', chr(74) => 'J', chr(75) => 'K', + chr(76) => 'L', chr(77) => 'M', chr(78) => 'N', chr(79) => 'O', + chr(80) => 'P', chr(81) => 'Q', chr(82) => 'R', chr(83) => 'S', + chr(84) => 'T', chr(85) => 'U', chr(86) => 'V', chr(87) => 'W', + chr(88) => 'X', chr(89) => 'Y', chr(90) => 'Z', chr(91) => '%K', + chr(92) => '%L', chr(93) => '%M', chr(94) => '%N', chr(95) => '%O', + chr(96) => '%W', chr(97) => '+A', chr(98) => '+B', chr(99) => '+C', + chr(100) => '+D', chr(101) => '+E', chr(102) => '+F', chr(103) => '+G', + chr(104) => '+H', chr(105) => '+I', chr(106) => '+J', chr(107) => '+K', + chr(108) => '+L', chr(109) => '+M', chr(110) => '+N', chr(111) => '+O', + chr(112) => '+P', chr(113) => '+Q', chr(114) => '+R', chr(115) => '+S', + chr(116) => '+T', chr(117) => '+U', chr(118) => '+V', chr(119) => '+W', + chr(120) => '+X', chr(121) => '+Y', chr(122) => '+Z', chr(123) => '%P', + chr(124) => '%Q', chr(125) => '%R', chr(126) => '%S', chr(127) => '%T'); + + $code_ext = ''; + for ($i = 0 ; $i<strlen($code); $i++) { + if (ord($code{$i}) > 127) + $this->Error('Invalid character: '.$code{$i}); + $code_ext .= $encode[$code{$i}]; + } + return $code_ext; +} + +function draw_code39($code, $x, $y, $w, $h){ + + //Draw bars + + for($i=0; $i<strlen($code); $i++) + { + if($code{$i} == '1') + $this->Rect($x+$i*$w, $y, $w, $h, 'F'); + } +} +} +?> diff --git a/htdocs/includes/fpdf/i25/i25.php b/htdocs/includes/fpdf/i25/i25.php index 60a971a3d60b5b66fd9851e18fa0661542ac13a8..38936f16618a7b617b5ee070e705373db045a87c 100755 --- a/htdocs/includes/fpdf/i25/i25.php +++ b/htdocs/includes/fpdf/i25/i25.php @@ -1,71 +1,71 @@ -<?php -require_once(FPDF_PATH.'fpdf.php'); - -// based on the Code 39 script from The-eh -class PDF_i25 extends FPDF -{ -function i25($xpos, $ypos, $code, $basewidth=1, $height=10){ - - $wide = $basewidth; - $narrow = $basewidth / 3 ; - - // wide/narrow codes for the digits - $barChar['0'] = 'nnwwn'; - $barChar['1'] = 'wnnnw'; - $barChar['2'] = 'nwnnw'; - $barChar['3'] = 'wwnnn'; - $barChar['4'] = 'nnwnw'; - $barChar['5'] = 'wnwnn'; - $barChar['6'] = 'nwwnn'; - $barChar['7'] = 'nnnww'; - $barChar['8'] = 'wnnwn'; - $barChar['9'] = 'nwnwn'; - $barChar['A'] = 'nn'; - $barChar['Z'] = 'wn'; - - // add leading zero if code-length is odd - if(strlen($code) % 2 != 0){ - $code = '0' . $code; - } - - $this->SetFont('Arial','',10); - $this->Text($xpos, $ypos + $height + 4, $code); - $this->SetFillColor(0); - - // add start and stop codes - $code = 'AA'.strtolower($code).'ZA'; - - for($i=0; $i<strlen($code); $i=$i+2){ - // choose next pair of digits - $charBar = $code{$i}; - $charSpace = $code{$i+1}; - // check whether it is a valid digit - if(!isset($barChar[$charBar])){ - $this->Error('Invalid character in barcode: '.$charBar); - } - if(!isset($barChar[$charSpace])){ - $this->Error('Invalid character in barcode: '.$charSpace); - } - // create a wide/narrow-sequence (first digit=bars, second digit=spaces) - $seq = ''; - for($s=0; $s<strlen($barChar[$charBar]); $s++){ - $seq .= $barChar[$charBar]{$s} . $barChar[$charSpace]{$s}; - } - for($bar=0; $bar<strlen($seq); $bar++){ - // set lineWidth depending on value - if($seq{$bar} == 'n'){ - $lineWidth = $narrow; - }else{ - $lineWidth = $wide; - } - // draw every second value, because the second digit of the pair is represented by the spaces - if($bar % 2 == 0){ - $this->Rect($xpos, $ypos, $lineWidth, $height, 'F'); - } - $xpos += $lineWidth; - } - } -} -} - -?> +<?php +require_once(FPDF_PATH.'fpdi_protection.php'); + +// based on the Code 39 script from The-eh +class PDF_i25 extends FPDF +{ +function i25($xpos, $ypos, $code, $basewidth=1, $height=10){ + + $wide = $basewidth; + $narrow = $basewidth / 3 ; + + // wide/narrow codes for the digits + $barChar['0'] = 'nnwwn'; + $barChar['1'] = 'wnnnw'; + $barChar['2'] = 'nwnnw'; + $barChar['3'] = 'wwnnn'; + $barChar['4'] = 'nnwnw'; + $barChar['5'] = 'wnwnn'; + $barChar['6'] = 'nwwnn'; + $barChar['7'] = 'nnnww'; + $barChar['8'] = 'wnnwn'; + $barChar['9'] = 'nwnwn'; + $barChar['A'] = 'nn'; + $barChar['Z'] = 'wn'; + + // add leading zero if code-length is odd + if(strlen($code) % 2 != 0){ + $code = '0' . $code; + } + + $this->SetFont('Arial','',10); + $this->Text($xpos, $ypos + $height + 4, $code); + $this->SetFillColor(0); + + // add start and stop codes + $code = 'AA'.strtolower($code).'ZA'; + + for($i=0; $i<strlen($code); $i=$i+2){ + // choose next pair of digits + $charBar = $code{$i}; + $charSpace = $code{$i+1}; + // check whether it is a valid digit + if(!isset($barChar[$charBar])){ + $this->Error('Invalid character in barcode: '.$charBar); + } + if(!isset($barChar[$charSpace])){ + $this->Error('Invalid character in barcode: '.$charSpace); + } + // create a wide/narrow-sequence (first digit=bars, second digit=spaces) + $seq = ''; + for($s=0; $s<strlen($barChar[$charBar]); $s++){ + $seq .= $barChar[$charBar]{$s} . $barChar[$charSpace]{$s}; + } + for($bar=0; $bar<strlen($seq); $bar++){ + // set lineWidth depending on value + if($seq{$bar} == 'n'){ + $lineWidth = $narrow; + }else{ + $lineWidth = $wide; + } + // draw every second value, because the second digit of the pair is represented by the spaces + if($bar % 2 == 0){ + $this->Rect($xpos, $ypos, $lineWidth, $height, 'F'); + } + $xpos += $lineWidth; + } + } +} +} + +?> diff --git a/htdocs/includes/modules/commande/modules_commande.php b/htdocs/includes/modules/commande/modules_commande.php index e87a54fd6da3b28db111df152c901043a5610afe..05996ce582c2c93f957490606afebc39d842497f 100644 --- a/htdocs/includes/modules/commande/modules_commande.php +++ b/htdocs/includes/modules/commande/modules_commande.php @@ -32,7 +32,7 @@ \version $Revision$ */ -require_once(FPDF_PATH.'fpdf.php'); +require_once(FPDF_PATH.'fpdi_protection.php'); require_once(DOL_DOCUMENT_ROOT."/compta/bank/account.class.php"); // requis car utilise par les classes qui heritent diff --git a/htdocs/includes/modules/commande/pdf_edison.modules.php b/htdocs/includes/modules/commande/pdf_edison.modules.php index c22112daf45a25035976840ec625d530b6db92b4..cdb03f413b77fd5f97cc6d978714201c08538396 100644 --- a/htdocs/includes/modules/commande/pdf_edison.modules.php +++ b/htdocs/includes/modules/commande/pdf_edison.modules.php @@ -122,7 +122,7 @@ class pdf_edison extends ModelePDFCommandes if (file_exists($dir)) { // Initialisation document vierge - $pdf=new FPDF('P','mm',$this->format); + $pdf=new FPDI_Protection('P','mm',$this->format); $pdf->Open(); $pdf->AddPage(); diff --git a/htdocs/includes/modules/commande/pdf_einstein.modules.php b/htdocs/includes/modules/commande/pdf_einstein.modules.php index 82e8b666c88f76c8c96ac34b3c88010cdbf64ca6..0d7c6411198628899ef9862784d4d1944c366e01 100644 --- a/htdocs/includes/modules/commande/pdf_einstein.modules.php +++ b/htdocs/includes/modules/commande/pdf_einstein.modules.php @@ -152,7 +152,8 @@ class pdf_einstein extends ModelePDFCommandes $nblignes = sizeof($com->lignes); // Initialisation document vierge - $pdf=new FPDF('P','mm',$this->format); + $pdf=new FPDI_Protection('P','mm',$this->format); + $pdf->SetProtection(array('print')); //ne permet que l'impression du document $pdf->Open(); $pdf->AddPage(); diff --git a/htdocs/includes/modules/dons/modules_don.php b/htdocs/includes/modules/dons/modules_don.php index 6f64f4f013b6c42f3ee06f00b98f999d0a522642..0c2474ac183d9524469fc5f0814f854ae8839b26 100644 --- a/htdocs/includes/modules/dons/modules_don.php +++ b/htdocs/includes/modules/dons/modules_don.php @@ -30,7 +30,7 @@ \version $Revision$ */ -require_once(FPDF_PATH.'fpdf.php'); +require_once(FPDF_PATH.'fpdi_protection.php'); require_once(DOL_DOCUMENT_ROOT."/don.class.php"); diff --git a/htdocs/includes/modules/facture/modules_facture.php b/htdocs/includes/modules/facture/modules_facture.php index 2c84b9e97ba3a99d91add1833bc8f3a6fe9d2ba4..9cda463c02a4a8aa58f84978b96e63a470a4de67 100644 --- a/htdocs/includes/modules/facture/modules_facture.php +++ b/htdocs/includes/modules/facture/modules_facture.php @@ -31,7 +31,7 @@ \version $Revision$ */ -require_once(FPDF_PATH.'fpdf.php'); +require_once(FPDF_PATH.'fpdi_protection.php'); require_once(DOL_DOCUMENT_ROOT."/product.class.php"); require_once(DOL_DOCUMENT_ROOT."/compta/bank/account.class.php"); // Requis car utilis� dans les classes qui h�ritent diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php index 1d0e3a8730e97d4e5ccb076acb3bea4992873501..9f8309b7d6c49bad80a2194bd04692f0c6103f47 100644 --- a/htdocs/includes/modules/facture/pdf_crabe.modules.php +++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php @@ -152,7 +152,8 @@ class pdf_crabe extends ModelePDFFactures $nblignes = sizeof($fac->lignes); // Initialisation document vierge - $pdf=new FPDF('P','mm',$this->format); + $pdf=new FPDI_Protection('P','mm',$this->format); + $pdf->SetProtection(array('print')); //ne permet que l'impression du document $pdf->Open(); $pdf->AddPage(); diff --git a/htdocs/includes/modules/facture/pdf_huitre.modules.php b/htdocs/includes/modules/facture/pdf_huitre.modules.php index 5d93d49501cda58dc588c5db1296fb142c69c95f..be01d6fad0236ac8082e2fe241a83b403f6d1125 100644 --- a/htdocs/includes/modules/facture/pdf_huitre.modules.php +++ b/htdocs/includes/modules/facture/pdf_huitre.modules.php @@ -125,7 +125,8 @@ class pdf_huitre extends ModelePDFFactures if (file_exists($dir)) { // Initialisation facture vierge - $pdf=new FPDF('P','mm','A4'); + $pdf=new FPDI_Protection('P','mm','A4'); + $pdf->SetProtection(array('print')); //ne permet que l'impression du document $pdf->Open(); $pdf->AddPage(); diff --git a/htdocs/includes/modules/facture/pdf_oursin.modules.php b/htdocs/includes/modules/facture/pdf_oursin.modules.php index 72f002b9f99de4dd40b089b2d1c6deace54c6fcb..63f5f38d28781b0041b0e5b4f306ad314e699ce1 100644 --- a/htdocs/includes/modules/facture/pdf_oursin.modules.php +++ b/htdocs/includes/modules/facture/pdf_oursin.modules.php @@ -149,7 +149,8 @@ class pdf_oursin extends ModelePDFFactures if (file_exists($dir)) { // Initialisation facture vierge - $pdf=new FPDF('P','mm',$this->format); + $pdf=new FPDI_Protection('P','mm',$this->format); + $pdf->SetProtection(array('print')); //ne permet que l'impression du document $pdf->Open(); $pdf->AddPage(); diff --git a/htdocs/includes/modules/fichinter/modules_fichinter.php b/htdocs/includes/modules/fichinter/modules_fichinter.php index cb6eced26367d71eefa8b0f8250f6f52ae6aee5f..4410a1511abafb09bad5d6b492023edc57555250 100644 --- a/htdocs/includes/modules/fichinter/modules_fichinter.php +++ b/htdocs/includes/modules/fichinter/modules_fichinter.php @@ -30,7 +30,7 @@ \version $Revision$ */ -require_once(FPDF_PATH.'fpdf.php'); +require_once(FPDF_PATH.'fpdi_protection.php'); /** \class ModelePDFFicheinter diff --git a/htdocs/includes/modules/fichinter/pdf_soleil.modules.php b/htdocs/includes/modules/fichinter/pdf_soleil.modules.php index a4e978d36942ff7c9bac67c00bb84efa28623bee..66877c39323edfcc9789c1de191571285f63418e 100644 --- a/htdocs/includes/modules/fichinter/pdf_soleil.modules.php +++ b/htdocs/includes/modules/fichinter/pdf_soleil.modules.php @@ -101,7 +101,8 @@ class pdf_soleil extends ModelePDFFicheinter if (file_exists($dir)) { // Initialisation document vierge - $pdf=new FPDF('P','mm',$this->format); + $pdf=new FPDI_Protection('P','mm',$this->format); + $pdf->SetProtection(array('print')); //ne permet que l'impression du document $pdf->Open(); $pdf->AddPage(); diff --git a/htdocs/includes/modules/propale/modules_propale.php b/htdocs/includes/modules/propale/modules_propale.php index fe144fbe565aa0024204e7e7bd6bd5e0bde4446f..e71b5eb68588b9f826347b6934241a7197a1bc85 100644 --- a/htdocs/includes/modules/propale/modules_propale.php +++ b/htdocs/includes/modules/propale/modules_propale.php @@ -29,7 +29,7 @@ \version $Revision$ */ -require_once(FPDF_PATH.'fpdf.php'); +require_once(FPDF_PATH.'fpdi_protection.php'); require_once(DOL_DOCUMENT_ROOT."/compta/bank/account.class.php"); // Requis car utilis� dans les classes qui h�ritent diff --git a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php index 4fbe8c4d0b7514374d950f54c3e36d7198f721ea..c7d3ab05f0272f65247c87769be880cefd24eb48 100644 --- a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php @@ -151,7 +151,8 @@ class pdf_propale_azur extends ModelePDFPropales $nblignes = sizeof($propale->lignes); // Initialisation document vierge - $pdf=new FPDF('P','mm',$this->format); + $pdf=new FPDI_Protection('P','mm',$this->format); + $pdf->SetProtection(array('print')); //ne permet que l'impression du document $pdf->Open(); $pdf->AddPage(); diff --git a/htdocs/includes/modules/propale/pdf_propale_bleu.modules.php b/htdocs/includes/modules/propale/pdf_propale_bleu.modules.php index 89df278f7df71cfd1384f8044bd52c18b22aa68f..18b926dd3fe9ffbbd88c6afad3296d1bcc75e299 100644 --- a/htdocs/includes/modules/propale/pdf_propale_bleu.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_bleu.modules.php @@ -116,7 +116,8 @@ class pdf_propale_bleu extends ModelePDFPropales if (file_exists($dir)) { - $pdf=new FPDF('P','mm',$this->format); + $pdf=new FPDI_Protection('P','mm',$this->format); + $pdf->SetProtection(array('print')); //ne permet que l'impression du document $pdf->Open(); $pdf->AddPage(); diff --git a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php index 1a2cfdd80ddc1a1217eef97392b70165dcea1666..d6abda061a6421bf34a19822884a84db940d020c 100644 --- a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php @@ -117,7 +117,8 @@ class pdf_propale_jaune extends ModelePDFPropales if (file_exists($dir)) { - $pdf=new FPDF('P','mm',$this->format); + $pdf=new FPDI_Protection('P','mm',$this->format); + $pdf->SetProtection(array('print')); //ne permet que l'impression du document $pdf->Open(); $pdf->SetTitle($propale->ref); diff --git a/htdocs/includes/modules/propale/pdf_propale_rouge.modules.php b/htdocs/includes/modules/propale/pdf_propale_rouge.modules.php index 0bb5e56eb5a162beb94f8fa73e67a9ffdd47d6a0..96bded7e298b64fa4ac7f52c983a8c96c1d9cea7 100644 --- a/htdocs/includes/modules/propale/pdf_propale_rouge.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_rouge.modules.php @@ -119,7 +119,8 @@ class pdf_propale_rouge extends ModelePDFPropales if (file_exists($dir)) { - $pdf=new FPDF('P','mm',$this->format); + $pdf=new FPDI_Protection('P','mm',$this->format); + $pdf->SetProtection(array('print')); //ne permet que l'impression du document $pdf->Open(); $pdf->AddPage(); diff --git a/htdocs/includes/modules/propale/pdf_propale_vert.modules.php b/htdocs/includes/modules/propale/pdf_propale_vert.modules.php index 545dcfd5dee9a25b896957036c11c91cdc8bdffb..12343f1fb7e00b633dcb8c0d253de2fc64ca7862 100644 --- a/htdocs/includes/modules/propale/pdf_propale_vert.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_vert.modules.php @@ -118,7 +118,8 @@ class pdf_propale_vert extends ModelePDFPropales if (file_exists($dir)) { - $pdf=new FPDF('P','mm',$this->format); + $pdf=new FPDI_Protection('P','mm',$this->format); + $pdf->SetProtection(array('print')); //ne permet que l'impression du document $pdf->Open(); $pdf->AddPage(); diff --git a/htdocs/includes/modules/rapport/pdf_paiement.class.php b/htdocs/includes/modules/rapport/pdf_paiement.class.php index f3da30f835452106916d6016ee21eff06d72a78d..72fa039519f7a311a3be750cdaa31c8491f446fd 100644 --- a/htdocs/includes/modules/rapport/pdf_paiement.class.php +++ b/htdocs/includes/modules/rapport/pdf_paiement.class.php @@ -28,7 +28,7 @@ \version $Revision$ */ -require_once(FPDF_PATH.'fpdf.php'); +require_once(FPDF_PATH.'fpdi_protection.php'); /** \class pdf_paiement @@ -180,7 +180,8 @@ class pdf_paiement $year = sprintf("%04d",$year); $_file = $dir . "/payments-".$month."-".$year.".pdf"; - $pdf = new FPDF('P','mm','A4'); + $pdf = new FPDI_Protection('P','mm','A4'); + $pdf->SetProtection(array('print')); //ne permet que l'impression du document $pdf->Open(); $sql = "SELECT ".$this->db->pdate("p.datep")." as dp, f.facnumber"; diff --git a/htdocs/livraison/mods/modules_livraison.php b/htdocs/livraison/mods/modules_livraison.php index 57bb4a2e9d8c564ee9be60794dc10d61be731bcf..03dd76c58aef2af198e6dd0dc49a7c59099ac80b 100644 --- a/htdocs/livraison/mods/modules_livraison.php +++ b/htdocs/livraison/mods/modules_livraison.php @@ -32,7 +32,7 @@ \version $Revision$ */ -require_once(FPDF_PATH.'fpdf.php'); +require_once(FPDF_PATH.'fpdi_protection.php'); /** diff --git a/htdocs/livraison/mods/pdf/pdf_sirocco.modules.php b/htdocs/livraison/mods/pdf/pdf_sirocco.modules.php index df4532403dc986d2ecc908833f2f4660358a5ead..a6e6d72fbd80ae9ad3dd7106bf12ede0f16ea4d2 100644 --- a/htdocs/livraison/mods/pdf/pdf_sirocco.modules.php +++ b/htdocs/livraison/mods/pdf/pdf_sirocco.modules.php @@ -107,7 +107,8 @@ class pdf_sirocco extends ModelePDFDeliveryOrder if (file_exists($dir)) { - $pdf=new FPDF('P','mm',$this->format); + $pdf=new FPDI_Protection('P','mm',$this->format); + $pdf->SetProtection(array('print')); //ne permet que l'impression du document $pdf->Open(); $pdf->AddPage(); diff --git a/htdocs/livraison/mods/pdf/pdf_typhon.modules.php b/htdocs/livraison/mods/pdf/pdf_typhon.modules.php index 67f031727e2849a1d666f234f375c94e2403909d..b940ce7144d0c94aa882ea15561dab9bb858410d 100644 --- a/htdocs/livraison/mods/pdf/pdf_typhon.modules.php +++ b/htdocs/livraison/mods/pdf/pdf_typhon.modules.php @@ -162,7 +162,8 @@ class pdf_typhon extends ModelePDFDeliveryOrder if (file_exists($dir)) { // Initialisation document vierge - $pdf=new FPDF('P','mm',$this->format); + $pdf=new FPDI_Protection('P','mm',$this->format); + $pdf->SetProtection(array('print')); //ne permet que l'impression du document $pdf->Open(); $pdf->AddPage(); diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index a0a360cd123d582d1424e428e6a707d50e3fede9..07d0e724f800592a7d341b2e91e2a7c2e76d962e 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -185,7 +185,7 @@ if (! defined('MAGPIE_CACHE_DIR')) { define('MAGPIE_CACHE_DIR', $conf->exte if (defined("MAIN_MODULE_TELEPHONIE") && MAIN_MODULE_TELEPHONIE) require_once(DOL_DOCUMENT_ROOT ."/includes/modules/facture/modules_facture.php"); // require_once(FPDF_PATH . "fpdf.php"); // dans le fichier pdfdetail_standard_modeles du module telephonie afin de pouvoir supprimer la ligne suivante -if (defined("MAIN_MODULE_TELEPHONIE") && MAIN_MODULE_TELEPHONIE) require_once(FPDF_PATH . "fpdf.php"); +if (defined("MAIN_MODULE_TELEPHONIE") && MAIN_MODULE_TELEPHONIE) require_once(FPDF_PATH . "fpdi_protection.php"); /* diff --git a/htdocs/telephonie/script/facturation-impression.php b/htdocs/telephonie/script/facturation-impression.php index 8753219bb1d8cbe9ccbba572e523a027bb6a828f..06f764af970f040d255300b8d4cb79d18e1ad790 100644 --- a/htdocs/telephonie/script/facturation-impression.php +++ b/htdocs/telephonie/script/facturation-impression.php @@ -92,7 +92,8 @@ if ( $resql ) dolibarr_syslog("$num factures a imprimer"); - $pdf = new FPDF('P','mm','A4'); + $pdf = new FPDI_Protection('P','mm','A4'); + $pdf->SetProtection(array('print')); //ne permet que l'impression du document $pdf->Open(); $pdf->SetMargins(10, 10, 10); $pdf->SetAutoPageBreak(1,0);