-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpdf.php
163 lines (154 loc) · 6.4 KB
/
pdf.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?php
// +-------------------------------------------------+
// © 2002-2004 PMB Services / www.sigb.net [email protected] et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: pdf.php,v 1.47 2017-07-10 16:00:35 dgoron Exp $
// définition du minimum nécéssaire
$base_path=".";
$base_auth = "CATALOGAGE_AUTH|CIRCULATION_AUTH|EDIT_AUTH|ACQUISITION_AUTH";
$base_title = "PDF";
$base_noheader=1;
$base_nosession = 0 ; // pas d'envoi de cookie avant l'entête PDF
require_once ("$base_path/includes/init.inc.php");
//Appliquons un eventuel fichier de substitution de paramètres en fonction de la localisation de l'utilisateur courant
require_once("$class_path/parameters_subst.class.php");
if (file_exists($include_path.'/parameters_subst/per_localisations_subst.xml')){
$subst_filename = $include_path.'/parameters_subst/per_localisations_subst.xml';
} else {
$subst_filename = $include_path.'/parameters_subst/per_localisations.xml';
}
$parameter_subst = new parameters_subst($subst_filename, $deflt2docs_location);
$parameter_subst->extract();
// modules propres à pdf.php ou à ses sous-modules
require_once("$include_path/fpdf.inc.php");
require_once("$include_path/misc.inc.php");
require_once("$class_path/author.class.php");
require_once("$include_path/notice_authors.inc.php");
require_once("$include_path/notice_categories.inc.php");
require_once("$base_path/circ/pret_func.inc.php");
// pour les champs perso
require_once("$include_path/fields_empr.inc.php");
require_once("$include_path/datatype.inc.php");
require_once("$include_path/parser.inc.php");
// inclusion de la classe de gestion des impressions PDF
// Definition de la police si pas définie dans les paramètres
if (!$pmb_pdf_font) $pmb_pdf_font = 'pmb';
if (!$pmb_pdf_fontfixed) $pmb_pdf_fontfixed = 'pmbmono';
if(!defined('FPDF_FONTPATH')) define('FPDF_FONTPATH',"$class_path/font/");
require_once("$class_path/fpdf.class.php");
require_once("$class_path/ufpdf.class.php");
require_once($class_path."/sticks_sheet/sticks_sheet_output.class.php");
switch ($pdfdoc) {
case 'ticket_pret':
if($pmb_printer_ticket_script) $script_perso_file=$pmb_printer_ticket_script;
else $script_perso_file = "./circ/ticket-pret.inc.php";
if(SESSrights & CIRCULATION_AUTH) include($script_perso_file);
else echo "<script> self.close(); </script>" ;
break;
case 'liste_pret':
if(SESSrights & CIRCULATION_AUTH) include("./edit/liste_pret.inc.php");
else echo "<script> self.close(); </script>" ;
break;
case 'mail_liste_pret':
if(SESSrights & CIRCULATION_AUTH) include("./circ/ticket-pret-electro.inc.php");
echo "<script> self.close(); </script>" ;
break;
case 'lettre_retard':
if ($niveau) $relance=$niveau; else $relance=1;
if((SESSrights & EDIT_AUTH) || (SESSrights & CIRCULATION_AUTH)) include("./edit/lettre-retard.inc.php");
else echo "<script> self.close(); </script>" ;
break;
case 'lettre_resa':
if(SESSrights & CIRCULATION_AUTH) include("./edit/lettre-resa.inc.php");
else echo "<script> self.close(); </script>" ;
break;
case 'lettre_resa_planning':
if(SESSrights & CIRCULATION_AUTH) include("./edit/lettre-resa_planning.inc.php");
else echo "<script> self.close(); </script>" ;
break;
case 'lettre_retard_groupe':
$relance=1;
if(SESSrights & EDIT_AUTH) include("./edit/lettre-retard.inc.php");
else echo "<script> self.close(); </script>" ;
break;
case 'liste_pret_groupe':
if((SESSrights & EDIT_AUTH) || (SESSrights & CIRCULATION_AUTH)) include("./edit/liste_prets.inc.php");
else echo "<script> self.close(); </script>" ;
break;
case 'lettre_relance_adhesion':
if(SESSrights & EDIT_AUTH) include("./edit/lettre-relance-adhesion.inc.php");
else echo "<script> self.close(); </script>" ;
break;
case 'fiche_catalographique':
if((SESSrights & CATALOGAGE_AUTH) || (SESSrights & CIRCULATION_AUTH) ) include("./edit/fiche_catalographique.inc.php");
else echo "<script> self.close(); </script>" ;
break;
case 'carte-lecteur':
if(SESSrights & CIRCULATION_AUTH) {
require("$class_path/fpdf_carte_lecteur.class.php");
include("./circ/carte-lecteur.inc.php");
} else echo "<script> self.close(); </script>" ;
break;
case 'cmde':
if(SESSrights & ACQUISITION_AUTH) {
include("./acquisition/achats/commandes/lettre_commande.inc.php");
} else echo "<script> self.close(); </script>" ;
break;
case 'devi':
if(SESSrights & ACQUISITION_AUTH) {
include("./acquisition/achats/devis/lettre-devis.inc.php");
} else echo "<script> self.close(); </script>" ;
break;
case 'livr':
if(SESSrights & ACQUISITION_AUTH) {
include("./acquisition/achats/livraisons/lettre-livraison.inc.php");
}
break;
case 'fact':
if(SESSrights & ACQUISITION_AUTH) {
include("./acquisition/achats/factures/lettre-facture.inc.php");
}
break;
case 'listsug':
if(SESSrights & ACQUISITION_AUTH) {
include("./acquisition/suggestions/liste-suggestions.inc.php");
}
break;
case 'liste_bulletinage':
if(SESSrights & CIRCULATION_AUTH) include("./edit/liste_bulletinage.inc.php");
else echo "<script> self.close(); </script>" ;
break;
case 'abts_depasse':
if(SESSrights & CIRCULATION_AUTH) include("./edit/abts_depasse.inc.php");
else echo "<script> self.close(); </script>" ;
break;
case 'listrecept':
if(SESSrights & ACQUISITION_AUTH) include("./acquisition/achats/receptions/liste_relances.inc.php");
else echo "<script> self.close(); </script>" ;
break;
case 'rapport_tache':
if(SESSrights & ADMINISTRATION_AUTH) include("./admin/planificateur/rapport_tache.inc.php");
else echo "<script> self.close(); </script>" ;
break;
case 'account_command':
if(SESSrights & ACQUISITION_AUTH) include("./acquisition/rent/account_command.inc.php");
else echo "<script> self.close(); </script>" ;
break;
case 'account_invoice':
if(SESSrights & ACQUISITION_AUTH) include("./acquisition/rent/account_invoice.inc.php");
else echo "<script> self.close(); </script>" ;
break;
case 'sticks_sheet':
$sticks_sheet_output = new sticks_sheet_output($id, $display_class);
$data = explode(",", $data);
$sticks_sheet_output->output("PDF", $data, $x_stick_selected, $y_stick_selected);
break;
case 'mail_liste_pret_groupe':
if(SESSrights & CIRCULATION_AUTH) include("./circ/ticket-pret-electro.inc.php");
echo "<script> self.close(); </script>" ;
break;
default:
echo "<script> self.close(); </script>" ;
break;
}
pmb_mysql_close($dbh);