dolibarr  16.0.5
pdf_other.php
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 
28 require '../main.inc.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
31 require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
32 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
35 
36 // Load translation files required by the page
37 $langs->loadLangs(array('admin', 'languages', 'other', 'companies', 'products', 'members', 'stocks', 'Trips'));
38 
39 if (!$user->admin) {
41 }
42 
43 $action = GETPOST('action', 'aZ09');
44 
45 
46 /*
47  * Actions
48  */
49 
50 if ($action == 'update') {
51  if (GETPOSTISSET('PROPOSAL_PDF_HIDE_PAYMENTTERM')) {
52  dolibarr_set_const($db, "PROPOSAL_PDF_HIDE_PAYMENTTERM", GETPOST("PROPOSAL_PDF_HIDE_PAYMENTTERM"), 'chaine', 0, '', $conf->entity);
53  }
54  if (GETPOSTISSET('PROPOSAL_PDF_HIDE_PAYMENTMODE')) {
55  dolibarr_set_const($db, "PROPOSAL_PDF_HIDE_PAYMENTMODE", GETPOST("PROPOSAL_PDF_HIDE_PAYMENTMODE"), 'chaine', 0, '', $conf->entity);
56  }
57  if (GETPOSTISSET('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')) {
58  dolibarr_set_const($db, "MAIN_GENERATE_PROPOSALS_WITH_PICTURE", GETPOST("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), 'chaine', 0, '', $conf->entity);
59  }
60  if (GETPOSTISSET('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH')) {
61  dolibarr_set_const($db, "MAIN_DOCUMENTS_WITH_PICTURE_WIDTH", GETPOST("MAIN_DOCUMENTS_WITH_PICTURE_WIDTH", 'int'), 'chaine', 0, '', $conf->entity);
62  }
63  if (GETPOSTISSET('INVOICE_ADD_ZATCA_QR_CODE')) {
64  dolibarr_set_const($db, "INVOICE_ADD_ZATCA_QR_CODE", GETPOST("INVOICE_ADD_ZATCA_QR_CODE", 'int'), 'chaine', 0, '', $conf->entity);
65  dolibarr_del_const($db, "INVOICE_ADD_SWISS_QR_CODE", $conf->entity);
66  }
67  if (GETPOSTISSET('INVOICE_ADD_SWISS_QR_CODE')) {
68  dolibarr_set_const($db, "INVOICE_ADD_SWISS_QR_CODE", GETPOST("INVOICE_ADD_SWISS_QR_CODE", 'int'), 'chaine', 0, '', $conf->entity);
69  dolibarr_del_const($db, "INVOICE_ADD_ZATCA_QR_CODE", $conf->entity);
70  }
71 
72  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
73 
74  header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
75  exit;
76 }
77 
78 
79 
80 /*
81  * View
82  */
83 
84 $wikihelp = 'EN:First_setup|FR:Premiers_param&eacute;trages|ES:Primeras_configuraciones';
85 llxHeader('', $langs->trans("Setup"), $wikihelp);
86 
87 $form = new Form($db);
88 $formother = new FormOther($db);
89 $formadmin = new FormAdmin($db);
90 
91 print load_fiche_titre($langs->trans("PDF"), '', 'title_setup');
92 
93 $head = pdf_admin_prepare_head();
94 
95 print dol_get_fiche_head($head, 'other', '', -1, '');
96 
97 $tooltiptext = '';
98 print '<span class="opacitymedium">'.$form->textwithpicto($langs->trans("PDFOtherDesc"), $tooltiptext)."</span><br>\n";
99 print "<br>\n";
100 
101 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
102 print '<input type="hidden" name="token" value="'.newToken().'">';
103 print '<input type="hidden" name="action" value="update">';
104 
105 if (!empty($conf->propal->enabled)) {
106  print load_fiche_titre($langs->trans("Proposal"), '', '');
107 
108  print '<div class="div-table-responsive-no-min">';
109  print '<table summary="more" class="noborder centpercent">';
110  print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
111 
112  print '<tr class="oddeven"><td>';
113  print $form->textwithpicto($langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral"));
114  print '</td><td>';
115  if ($conf->use_javascript_ajax) {
116  print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE');
117  } else {
118  $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
119  print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, $conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE);
120  }
121  print '</td></tr>';
122 
123  print '</table>';
124  print '</div>';
125 }
126 
127 
128 if (isModEnabled('facture')) {
129  print load_fiche_titre($langs->trans("Invoices"), '', '');
130 
131  print '<div class="div-table-responsive-no-min">';
132  print '<table summary="more" class="noborder centpercent">';
133  print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
134 
135  print '<tr class="oddeven"><td>';
136  print $form->textwithpicto($langs->trans("INVOICE_ADD_ZATCA_QR_CODE"), $langs->trans("INVOICE_ADD_ZATCA_QR_CODEMore"));
137  print '</td><td>';
138  if ($conf->use_javascript_ajax) {
139  print ajax_constantonoff('INVOICE_ADD_ZATCA_QR_CODE');
140  } else {
141  $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
142  print $form->selectarray("INVOICE_ADD_ZATCA_QR_CODE", $arrval, $conf->global->INVOICE_ADD_ZATCA_QR_CODE);
143  }
144  print '</td></tr>';
145 
146  print '<tr class="oddeven"><td>';
147  print $form->textwithpicto($langs->trans("INVOICE_ADD_SWISS_QR_CODE"), '');
148  print '</td><td>';
149  if ($conf->use_javascript_ajax) {
150  print ajax_constantonoff('INVOICE_ADD_SWISS_QR_CODE');
151  } else {
152  $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
153  print $form->selectarray("INVOICE_ADD_SWISS_QR_CODE", $arrval, $conf->global->INVOICE_ADD_SWISS_QR_CODE);
154  }
155  print '</td></tr>';
156 
157  /*
158  print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").'</td><td>';
159  if ($conf->use_javascript_ajax) {
160  print ajax_constantonoff('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING');
161  } else {
162  $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
163  print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, $conf->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING);
164  }
165  print '</td></tr>';
166  */
167 
168  print '</table>';
169  print '</div>';
170 }
171 
172 print '<br><div class="center">';
173 print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
174 print '</div>';
175 
176 print '</form>';
177 
178 
179 // End of page
180 llxFooter();
181 $db->close();
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
dolibarr_del_const
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
Definition: admin.lib.php:552
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5204
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
FormOther
Classe permettant la generation de composants html autre Only common components are here.
Definition: html.formother.class.php:39
FormAdmin
Class to generate html code for admin pages.
Definition: html.formadmin.class.php:30
pdf_admin_prepare_head
pdf_admin_prepare_head()
Return array head with list of tabs to view object informations.
Definition: pdf.lib.php:46
$wikihelp
if($actionsave) if(!isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) $wikihelp
View.
Definition: agenda_xcal.php:72
ajax_constantonoff
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0, $setzeroinsteadofdel=0, $suffix='', $mode='')
On/off button for constant.
Definition: ajax.lib.php:573
dol_get_fiche_head
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
Definition: functions.lib.php:1822
isModEnabled
isModEnabled($module)
Is Dolibarr module enabled.
Definition: functions.lib.php:105
dolibarr_set_const
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
Definition: admin.lib.php:627
GETPOSTISSET
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
Definition: functions.lib.php:386
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8137
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59