pdf_other.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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@inodbox.com>
  5. * Copyright (C) 2012-2107 Juanjo Menent <jmenent@2byte.es>
  6. * Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
  7. * Copyright (C) 2021 Anthony Berton <bertonanthony@gmail.com>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 3 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  21. */
  22. /**
  23. * \file htdocs/admin/pdf.php
  24. * \brief Page to setup PDF options
  25. */
  26. require '../main.inc.php';
  27. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
  28. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
  29. require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
  30. require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
  31. require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
  32. require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
  33. // Load translation files required by the page
  34. $langs->loadLangs(array('admin', 'languages', 'other', 'companies', 'products', 'members', 'stocks', 'Trips'));
  35. if (!$user->admin) {
  36. accessforbidden();
  37. }
  38. $action = GETPOST('action', 'aZ09');
  39. /*
  40. * Actions
  41. */
  42. if ($action == 'update') {
  43. if (GETPOSTISSET('PROPOSAL_PDF_HIDE_PAYMENTTERM')) {
  44. dolibarr_set_const($db, "PROPOSAL_PDF_HIDE_PAYMENTTERM", GETPOST("PROPOSAL_PDF_HIDE_PAYMENTTERM"), 'chaine', 0, '', $conf->entity);
  45. }
  46. if (GETPOSTISSET('PROPOSAL_PDF_HIDE_PAYMENTMODE')) {
  47. dolibarr_set_const($db, "PROPOSAL_PDF_HIDE_PAYMENTMODE", GETPOST("PROPOSAL_PDF_HIDE_PAYMENTMODE"), 'chaine', 0, '', $conf->entity);
  48. }
  49. if (GETPOSTISSET('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')) {
  50. dolibarr_set_const($db, "MAIN_GENERATE_PROPOSALS_WITH_PICTURE", GETPOST("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), 'chaine', 0, '', $conf->entity);
  51. }
  52. if (GETPOSTISSET('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH')) {
  53. dolibarr_set_const($db, "MAIN_DOCUMENTS_WITH_PICTURE_WIDTH", GETPOST("MAIN_DOCUMENTS_WITH_PICTURE_WIDTH", 'int'), 'chaine', 0, '', $conf->entity);
  54. }
  55. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  56. header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
  57. exit;
  58. }
  59. /*
  60. * View
  61. */
  62. $wikihelp = 'EN:First_setup|FR:Premiers_param&eacute;trages|ES:Primeras_configuraciones';
  63. llxHeader('', $langs->trans("Setup"), $wikihelp);
  64. $form = new Form($db);
  65. $formother = new FormOther($db);
  66. $formadmin = new FormAdmin($db);
  67. print load_fiche_titre($langs->trans("PDF"), '', 'title_setup');
  68. $head = pdf_admin_prepare_head();
  69. print dol_get_fiche_head($head, 'other', '', -1, '');
  70. $tooltiptext = '';
  71. print '<span class="opacitymedium">'.$form->textwithpicto($langs->trans("PDFOtherDesc"), $tooltiptext)."</span><br>\n";
  72. print "<br>\n";
  73. if (!empty($conf->propal->enabled)) {
  74. print load_fiche_titre($langs->trans("Proposal"), '', '');
  75. print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
  76. print '<input type="hidden" name="token" value="'.newToken().'">';
  77. print '<input type="hidden" name="action" value="update">';
  78. print '<div class="div-table-responsive-no-min">';
  79. print '<table summary="more" class="noborder centpercent">';
  80. print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
  81. print '<tr class="oddeven"><td>'.$langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE");
  82. print ' <span class="opacitymedium">('.$langs->trans("RandomlySelectedIfSeveral").')</span>';
  83. print '</td><td>';
  84. if ($conf->use_javascript_ajax) {
  85. print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE');
  86. } else {
  87. $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
  88. print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, $conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE);
  89. }
  90. print '</td></tr>';
  91. /*
  92. print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").'</td><td>';
  93. if ($conf->use_javascript_ajax) {
  94. print ajax_constantonoff('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING');
  95. } else {
  96. $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
  97. print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, $conf->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING);
  98. }
  99. print '</td></tr>';
  100. */
  101. print '</table>';
  102. print '</div>';
  103. }
  104. print '<br><div class="center">';
  105. print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
  106. print '</div>';
  107. print '</form>';
  108. // End of page
  109. llxFooter();
  110. $db->close();