* Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2012-2107 Juanjo Menent * Copyright (C) 2019 Ferran Marcet * Copyright (C) 2021-2022 Anthony Berton * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * \file htdocs/admin/pdf.php * \brief Page to setup PDF options */ // Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; // Load translation files required by the page $langs->loadLangs(array('admin', 'languages', 'other', 'companies', 'products', 'members', 'stocks', 'Trips')); if (!$user->admin) { accessforbidden(); } $action = GETPOST('action', 'aZ09'); /* * Actions */ if ($action == 'update') { if (GETPOSTISSET('PROPOSAL_PDF_HIDE_PAYMENTTERM')) { dolibarr_set_const($db, "PROPOSAL_PDF_HIDE_PAYMENTTERM", GETPOST("PROPOSAL_PDF_HIDE_PAYMENTTERM"), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET('PROPOSAL_PDF_HIDE_PAYMENTMODE')) { dolibarr_set_const($db, "PROPOSAL_PDF_HIDE_PAYMENTMODE", GETPOST("PROPOSAL_PDF_HIDE_PAYMENTMODE"), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')) { dolibarr_set_const($db, "MAIN_GENERATE_PROPOSALS_WITH_PICTURE", GETPOST("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH')) { dolibarr_set_const($db, "MAIN_DOCUMENTS_WITH_PICTURE_WIDTH", GETPOST("MAIN_DOCUMENTS_WITH_PICTURE_WIDTH", 'int'), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET('INVOICE_ADD_ZATCA_QR_CODE')) { dolibarr_set_const($db, "INVOICE_ADD_ZATCA_QR_CODE", GETPOST("INVOICE_ADD_ZATCA_QR_CODE", 'int'), 'chaine', 0, '', $conf->entity); dolibarr_del_const($db, "INVOICE_ADD_SWISS_QR_CODE", $conf->entity); } if (GETPOSTISSET('INVOICE_ADD_SWISS_QR_CODE')) { dolibarr_set_const($db, "INVOICE_ADD_SWISS_QR_CODE", GETPOST("INVOICE_ADD_SWISS_QR_CODE", 'int'), 'chaine', 0, '', $conf->entity); dolibarr_del_const($db, "INVOICE_ADD_ZATCA_QR_CODE", $conf->entity); } if (GETPOSTISSET('INVOICE_SHOW_SHIPPING_ADDRESS')) { dolibarr_set_const($db, "INVOICE_SHOW_SHIPPING_ADDRESS", GETPOST("INVOICE_SHOW_SHIPPING_ADDRESS", 'int'), 'chaine', 0, '', $conf->entity); dolibarr_del_const($db, "INVOICE_SHOW_SHIPPING_ADDRESS", $conf->entity); } setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; } /* * View */ $wikihelp = 'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones'; llxHeader('', $langs->trans("Setup"), $wikihelp); $form = new Form($db); $formother = new FormOther($db); $formadmin = new FormAdmin($db); print load_fiche_titre($langs->trans("PDF"), '', 'title_setup'); $head = pdf_admin_prepare_head(); print dol_get_fiche_head($head, 'other', '', -1, ''); $tooltiptext = ''; print ''.$form->textwithpicto($langs->trans("PDFOtherDesc"), $tooltiptext)."
\n"; print "
\n"; print '
'; print ''; print ''; if (isModEnabled('propal')) { print load_fiche_titre($langs->trans("Proposal"), '', 'proposal'); print '
'; print ''; print ''; print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print $form->textwithpicto($langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral")); print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, $conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE); } print '
'; print '
'; } if (isModEnabled('facture')) { print load_fiche_titre($langs->trans("Invoices"), '', 'bill'); print '
'; print ''; print ''; print ''; print ''; print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print $form->textwithpicto($langs->trans("INVOICE_ADD_ZATCA_QR_CODE"), $langs->trans("INVOICE_ADD_ZATCA_QR_CODEMore")); print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('INVOICE_ADD_ZATCA_QR_CODE'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); print $form->selectarray("INVOICE_ADD_ZATCA_QR_CODE", $arrval, $conf->global->INVOICE_ADD_ZATCA_QR_CODE); } print '
'; print $form->textwithpicto($langs->trans("INVOICE_ADD_SWISS_QR_CODE"), ''); print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('INVOICE_ADD_SWISS_QR_CODE'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); print $form->selectarray("INVOICE_ADD_SWISS_QR_CODE", $arrval, $conf->global->INVOICE_ADD_SWISS_QR_CODE); } print '
'; print $form->textwithpicto($langs->trans("INVOICE_SHOW_SHIPPING_ADDRESS"), $langs->trans("INVOICE_SHOW_SHIPPING_ADDRESSMore")); print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('INVOICE_SHOW_SHIPPING_ADDRESS'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); print $form->selectarray("INVOICE_SHOW_SHIPPING_ADDRESS", $arrval, $conf->global->INVOICE_SHOW_SHIPPING_ADDRESS); } print '
'; print '
'; } if (isModEnabled('reception')) { print load_fiche_titre($langs->trans("Receptions"), '', 'reception'); print '
'; print ''; print ''; print ''; print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print $langs->trans("RECEPTION_PDF_HIDE_ORDERED"); print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('RECEPTION_PDF_HIDE_ORDERED'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); print $form->selectarray("RECEPTION_PDF_HIDE_ORDERED", $arrval, $conf->global->RECEPTION_PDF_HIDE_ORDERED); } print '
'; print $langs->trans("MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT"); print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); print $form->selectarray("MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT", $arrval, $conf->global->MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT); } print '
'; print '
'; } print '
'; print ''; print '
'; print '
'; // End of page llxFooter(); $db->close();