pdf.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. <?php
  2. /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
  5. * Copyright (C) 2012-2103 Juanjo Menent <jmenent@2byte.es>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. /**
  21. * \file htdocs/admin/pdf.php
  22. * \brief Page to setup PDF options
  23. */
  24. require '../main.inc.php';
  25. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
  26. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
  27. require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
  28. require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
  29. require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
  30. require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
  31. $langs->load("admin");
  32. $langs->load("languages");
  33. $langs->load("other");
  34. $langs->load("companies");
  35. $langs->load("products");
  36. $langs->load("members");
  37. if (! $user->admin) accessforbidden();
  38. $action = GETPOST('action','alpha');
  39. /*
  40. * Actions
  41. */
  42. if ($action == 'update')
  43. {
  44. dolibarr_set_const($db, "MAIN_PDF_FORMAT", $_POST["MAIN_PDF_FORMAT"],'chaine',0,'',$conf->entity);
  45. dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", $_POST["MAIN_PROFID1_IN_ADDRESS"],'chaine',0,'',$conf->entity);
  46. dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", $_POST["MAIN_PROFID2_IN_ADDRESS"],'chaine',0,'',$conf->entity);
  47. dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", $_POST["MAIN_PROFID3_IN_ADDRESS"],'chaine',0,'',$conf->entity);
  48. dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", $_POST["MAIN_PROFID4_IN_ADDRESS"],'chaine',0,'',$conf->entity);
  49. dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", $_POST["MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"],'chaine',0,'',$conf->entity);
  50. dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", $_POST["MAIN_TVAINTRA_NOT_IN_ADDRESS"],'chaine',0,'',$conf->entity);
  51. dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"],'chaine',0,'',$conf->entity);
  52. dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_DESC"],'chaine',0,'',$conf->entity);
  53. dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'',$conf->entity);
  54. header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
  55. exit;
  56. }
  57. if ($action == 'activate_pdfsecurity')
  58. {
  59. dolibarr_set_const($db, "PDF_SECURITY_ENCRYPTION", "1",'chaine',0,'',$conf->entity);
  60. header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
  61. exit;
  62. }
  63. else if ($action == 'disable_pdfsecurity')
  64. {
  65. dolibarr_del_const($db, "PDF_SECURITY_ENCRYPTION",$conf->entity);
  66. header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
  67. exit;
  68. }
  69. /*
  70. * View
  71. */
  72. $wikihelp='EN:First_setup|FR:Premiers_param&eacute;trages|ES:Primeras_configuraciones';
  73. llxHeader('',$langs->trans("Setup"),$wikihelp);
  74. $form=new Form($db);
  75. $formother=new FormOther($db);
  76. $formadmin=new FormAdmin($db);
  77. print_fiche_titre($langs->trans("PDF"),'','setup');
  78. print $langs->trans("PDFDesc")."<br>\n";
  79. print "<br>\n";
  80. $noCountryCode = (empty($mysoc->country_code) ? true : false);
  81. if ($action == 'edit') // Edit
  82. {
  83. print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
  84. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  85. print '<input type="hidden" name="action" value="update">';
  86. clearstatcache();
  87. // Misc options
  88. print_fiche_titre($langs->trans("DictionaryPaperFormat"),'','').'<br>';
  89. $var=true;
  90. print '<table summary="more" class="noborder" width="100%">';
  91. print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
  92. $selected=$conf->global->MAIN_PDF_FORMAT;
  93. if (empty($selected)) $selected=dol_getDefaultFormat();
  94. // Show pdf format
  95. $var=!$var;
  96. print '<tr '.$bc[$var].'><td>'.$langs->trans("DictionaryPaperFormat").'</td><td>';
  97. print $formadmin->select_paper_format($selected,'MAIN_PDF_FORMAT');
  98. print '</td></tr>';
  99. print '</table>';
  100. print '<br>';
  101. // Addresses
  102. print_fiche_titre($langs->trans("PDFAddressForging"),'','').'<br>';
  103. $var=true;
  104. print '<table summary="more" class="noborder" width="100%">';
  105. print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
  106. // Show prof id 1 in address into pdf
  107. $var=!$var;
  108. if (! $noCountryCode)
  109. {
  110. $pid1=$langs->transcountry("ProfId1",$mysoc->country_code);
  111. if ($pid1 == '-') $pid1=false;
  112. }
  113. else
  114. {
  115. $pid1 = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
  116. }
  117. if ($pid1)
  118. {
  119. print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid1.'</td><td>';
  120. print $form->selectyesno('MAIN_PROFID1_IN_ADDRESS',isset($conf->global->MAIN_PROFID1_IN_ADDRESS)?$conf->global->MAIN_PROFID1_IN_ADDRESS:0,1,$noCountryCode);
  121. print '</td></tr>';
  122. }
  123. // Show prof id 2 in address into pdf
  124. $var=!$var;
  125. if (! $noCountryCode)
  126. {
  127. $pid2=$langs->transcountry("ProfId2",$mysoc->country_code);
  128. if ($pid2 == '-') $pid2=false;
  129. }
  130. else
  131. {
  132. $pid2 = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
  133. }
  134. if ($pid2)
  135. {
  136. print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid2.'</td><td>';
  137. print $form->selectyesno('MAIN_PROFID2_IN_ADDRESS',isset($conf->global->MAIN_PROFID2_IN_ADDRESS)?$conf->global->MAIN_PROFID2_IN_ADDRESS:0,1,$noCountryCode);
  138. print '</td></tr>';
  139. }
  140. // Show prof id 3 in address into pdf
  141. $var=!$var;
  142. if (! $noCountryCode)
  143. {
  144. $pid3=$langs->transcountry("ProfId3",$mysoc->country_code);
  145. if ($pid3 == '-') $pid3=false;
  146. }
  147. else
  148. {
  149. $pid3 = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
  150. }
  151. if ($pid3)
  152. {
  153. print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid3.'</td><td>';
  154. print $form->selectyesno('MAIN_PROFID3_IN_ADDRESS',isset($conf->global->MAIN_PROFID3_IN_ADDRESS)?$conf->global->MAIN_PROFID3_IN_ADDRESS:0,1,$noCountryCode);
  155. print '</td></tr>';
  156. }
  157. // Show prof id 4 in address into pdf
  158. $var=!$var;
  159. if (! $noCountryCode)
  160. {
  161. $pid4=$langs->transcountry("ProfId4",$mysoc->country_code);
  162. if ($pid4 == '-') $pid4=false;
  163. }
  164. else
  165. {
  166. $pid4 = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
  167. }
  168. if ($pid4)
  169. {
  170. print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid4.'</td><td>';
  171. print $form->selectyesno('MAIN_PROFID4_IN_ADDRESS',isset($conf->global->MAIN_PROFID4_IN_ADDRESS)?$conf->global->MAIN_PROFID4_IN_ADDRESS:0,1,$noCountryCode);
  172. print '</td></tr>';
  173. }
  174. print '</table>';
  175. print '<br>';
  176. // Other
  177. print_fiche_titre($langs->trans("Other"),'','').'<br>';
  178. $var=true;
  179. print '<table summary="more" class="noborder" width="100%">';
  180. print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
  181. // Hide any PDF informations
  182. $var=!$var;
  183. print '<tr '.$bc[$var].'><td>'.$langs->trans("HideAnyVATInformationOnPDF").'</td><td>';
  184. print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))?$conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT:0,1);
  185. print '</td></tr>';
  186. // Hide Tva Intra on adress
  187. $var=!$var;
  188. print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowVATIntaInAddress").'</td><td>';
  189. print $form->selectyesno('MAIN_TVAINTRA_NOT_IN_ADDRESS',(! empty($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS))?$conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS:0,1);
  190. print '</td></tr>';
  191. //Desc
  192. $var=!$var;
  193. print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDescOnPDF").'</td><td>';
  194. print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC:0,1);
  195. print '</td></tr>';
  196. //Ref
  197. $var=!$var;
  198. print '<tr '.$bc[$var].'><td>'.$langs->trans("HideRefOnPDF").'</td><td>';
  199. print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_REF',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF:0,1);
  200. print '</td></tr>';
  201. //Details
  202. $var=!$var;
  203. print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDetailsOnPDF").'</td><td>';
  204. print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS:0,1);
  205. print '</td></tr>';
  206. print '</table>';
  207. print '<br><div class="center">';
  208. print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
  209. print '</div>';
  210. print '</form>';
  211. print '<br>';
  212. }
  213. else // Show
  214. {
  215. $var=true;
  216. // Misc options
  217. print_fiche_titre($langs->trans("DictionaryPaperFormat"),'','').'<br>';
  218. $var=true;
  219. print '<table summary="more" class="noborder" width="100%">';
  220. print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
  221. // Show pdf format
  222. $var=!$var;
  223. print '<tr '.$bc[$var].'><td>'.$langs->trans("DictionaryPaperFormat").'</td><td>';
  224. $pdfformatlabel='';
  225. if (empty($conf->global->MAIN_PDF_FORMAT))
  226. {
  227. include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
  228. $pdfformatlabel=dol_getDefaultFormat();
  229. }
  230. else $pdfformatlabel=$conf->global->MAIN_PDF_FORMAT;
  231. if (! empty($pdfformatlabel))
  232. {
  233. $sql="SELECT code, label, width, height, unit FROM ".MAIN_DB_PREFIX."c_paper_format";
  234. $sql.=" WHERE code LIKE '%".$db->escape($pdfformatlabel)."%'";
  235. $resql=$db->query($sql);
  236. if ($resql)
  237. {
  238. $obj=$db->fetch_object($resql);
  239. $paperKey = $langs->trans('PaperFormat'.$obj->code);
  240. $unitKey = $langs->trans('SizeUnit'.$obj->unit);
  241. $pdfformatlabel = ($paperKey == 'PaperFormat'.$obj->code ? $obj->label : $paperKey).' - '.round($obj->width).'x'.round($obj->height).' '.($unitKey == 'SizeUnit'.$obj->unit ? $obj->unit : $unitKey);
  242. }
  243. }
  244. print $pdfformatlabel;
  245. print '</td></tr>';
  246. print '</table>';
  247. print '<br>';
  248. print_fiche_titre($langs->trans("PDFAddressForging"),'','').'<br>';
  249. print '<table class="noborder" width="100%">';
  250. print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
  251. // Show prof id 1 in address into pdf
  252. $var=!$var;
  253. if (! $noCountryCode)
  254. {
  255. $pid1=$langs->transcountry("ProfId1",$mysoc->country_code);
  256. if ($pid1 == '-') $pid1=false;
  257. }
  258. else
  259. {
  260. $pid1 = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
  261. }
  262. if ($pid1)
  263. {
  264. print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid1.'</td><td>';
  265. print yn($conf->global->MAIN_PROFID1_IN_ADDRESS,1);
  266. print '</td></tr>';
  267. }
  268. // Show prof id 2 in address into pdf
  269. $var=!$var;
  270. if (! $noCountryCode)
  271. {
  272. $pid2=$langs->transcountry("ProfId2",$mysoc->country_code);
  273. if ($pid2 == '-') $pid2=false;
  274. }
  275. else
  276. {
  277. $pid2 = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
  278. }
  279. if ($pid2)
  280. {
  281. print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid2.'</td><td>';
  282. print yn($conf->global->MAIN_PROFID2_IN_ADDRESS,1);
  283. print '</td></tr>';
  284. }
  285. // Show prof id 3 in address into pdf
  286. $var=!$var;
  287. if (! $noCountryCode)
  288. {
  289. $pid3=$langs->transcountry("ProfId3",$mysoc->country_code);
  290. if ($pid3 == '-') $pid3=false;
  291. }
  292. else
  293. {
  294. $pid3 = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
  295. }
  296. if ($pid3)
  297. {
  298. print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid3.'</td><td>';
  299. print yn($conf->global->MAIN_PROFID3_IN_ADDRESS,1);
  300. print '</td></tr>';
  301. }
  302. // Show prof id 4 in address into pdf
  303. $var=!$var;
  304. if (! $noCountryCode)
  305. {
  306. $pid4=$langs->transcountry("ProfId4",$mysoc->country_code);
  307. if ($pid4 == '-') $pid4=false;
  308. }
  309. else
  310. {
  311. $pid4 = img_warning().' <font class="error">'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).'</font>';
  312. }
  313. if ($pid4)
  314. {
  315. print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid4.'</td><td>';
  316. print yn($conf->global->MAIN_PROFID4_IN_ADDRESS,1);
  317. print '</td></tr>';
  318. }
  319. print '</table>'."\n";
  320. print '<br>';
  321. // Other
  322. print_fiche_titre($langs->trans("Other"),'','').'<br>';
  323. $var=true;
  324. print '<table summary="more" class="noborder" width="100%">';
  325. print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td width="200px" colspan="2">'.$langs->trans("Value").'</td></tr>';
  326. // Hide any PDF informations
  327. $var=!$var;
  328. print '<tr '.$bc[$var].'><td>'.$langs->trans("HideAnyVATInformationOnPDF").'</td><td colspan="2">';
  329. print yn($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT,1);
  330. print '</td></tr>';
  331. // Encrypt and protect PDF
  332. $var=!$var;
  333. print "<tr ".$bc[$var].">";
  334. print '<td>';
  335. $text = $langs->trans("ProtectAndEncryptPdfFiles");
  336. $desc = $form->textwithpicto($text,$langs->transnoentities("ProtectAndEncryptPdfFilesDesc"),1);
  337. print $desc;
  338. print '</td>';
  339. print '<td width="60">';
  340. if($conf->global->PDF_SECURITY_ENCRYPTION == 1)
  341. {
  342. print img_picto($langs->trans("Active"),'tick');
  343. }
  344. print '</td>';
  345. print '<td align="center" width="140">';
  346. if ($conf->global->PDF_SECURITY_ENCRYPTION == 0)
  347. {
  348. print '<a href="'.$_SERVER["PHP_SELF"].'?action=activate_pdfsecurity">'.$langs->trans("Activate").'</a>';
  349. }
  350. if($conf->global->PDF_SECURITY_ENCRYPTION == 1)
  351. {
  352. print '<a href="'.$_SERVER["PHP_SELF"].'?action=disable_pdfsecurity">'.$langs->trans("Disable").'</a>';
  353. }
  354. print "</td>";
  355. print "</td>";
  356. print '</tr>';
  357. // Hide Tva Intra on adress
  358. $var=!$var;
  359. print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowVATIntaInAddress").'</td><td colspan="2">';
  360. print yn($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS,1);
  361. print '</td></tr>';
  362. //Desc
  363. $var=!$var;
  364. print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDescOnPDF").'</td><td colspan="2">';
  365. print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC,1);
  366. print '</td></tr>';
  367. //Ref
  368. $var=!$var;
  369. print '<tr '.$bc[$var].'><td>'.$langs->trans("HideRefOnPDF").'</td><td colspan="2">';
  370. print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF,1);
  371. print '</td></tr>';
  372. //Details
  373. $var=!$var;
  374. print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDetailsOnPDF").'</td><td colspan="2">';
  375. print yn($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS,1);
  376. print '</td></tr>';
  377. print '</table>';
  378. /*
  379. * Library
  380. */
  381. print '<br>';
  382. print_titre($langs->trans("Library"));
  383. print '<table class="noborder" width="100%">'."\n";
  384. print '<tr class="liste_titre">'."\n";
  385. print '<td>'.$langs->trans("Name").'</td>'."\n";
  386. print '<td>'.$langs->trans("Value").'</td>'."\n";
  387. print "</tr>\n";
  388. $var=false;
  389. if (! empty($dolibarr_pdf_force_fpdf))
  390. {
  391. $var=!$var;
  392. print '<tr '.$bc[$var].'>'."\n";
  393. print '<td>dolibarr_pdf_force_fpdf</td>'."\n";
  394. print '<td>';
  395. print $dolibarr_pdf_force_fpdf;
  396. print '</td>';
  397. print '</tr>';
  398. }
  399. $var=!$var;
  400. print '<tr '.$bc[$var].'>'."\n";
  401. print '<td>'.$langs->trans("LibraryToBuildPDF").'</td>'."\n";
  402. print '<td>';
  403. $i=0;
  404. $pdf=pdf_getInstance('A4');
  405. if (class_exists('FPDF') && ! class_exists('TCPDF'))
  406. {
  407. if ($i) print ' + ';
  408. print 'FPDF';
  409. print ' ('.@constant('FPDF_PATH').')';
  410. $i++;
  411. }
  412. if (class_exists('TCPDF'))
  413. {
  414. if ($i) print ' + ';
  415. print 'TCPDF';
  416. print ' ('.@constant('TCPDF_PATH').')';
  417. $i++;
  418. }
  419. if (class_exists('FPDI'))
  420. {
  421. if ($i) print ' + ';
  422. print 'FPDI';
  423. print ' ('.@constant('FPDI_PATH').')';
  424. $i++;
  425. }
  426. if (class_exists('TCPDI'))
  427. {
  428. if ($i) print ' + ';
  429. print 'TCPDI';
  430. print ' ('.@constant('TCPDI_PATH').')';
  431. $i++;
  432. }
  433. print '<!-- $conf->global->MAIN_USE_FPDF = '.$conf->global->MAIN_USE_FPDF.' -->';
  434. print '</td>'."\n";
  435. print '</tr>'."\n";
  436. print "</table>\n";
  437. if (! empty($dolibarr_pdf_force_fpdf))
  438. {
  439. print info_admin($langs->trans("WarningUsingFPDF")).'<br>';
  440. }
  441. print '<div class="tabsAction">';
  442. print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
  443. print '</div>';
  444. print '<br>';
  445. }
  446. llxFooter();
  447. $db->close();