27 require
'../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/usergroups.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
36 $langs->loadLangs(array(
'admin',
'languages',
'other',
'companies',
'products',
'members',
'stocks'));
40 $action =
GETPOST(
'action',
'aZ09');
41 $cancel =
GETPOST(
'cancel',
'alpha');
52 if ($action ==
'update')
67 dolibarr_set_const($db,
"MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT",
GETPOST(
"MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"),
'chaine', 0,
'', $conf->entity);
69 dolibarr_set_const($db,
"MAIN_TVAINTRA_NOT_IN_ADDRESS",
GETPOST(
"MAIN_TVAINTRA_NOT_IN_ADDRESS"),
'chaine', 0,
'', $conf->entity);
70 dolibarr_set_const($db,
"MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS",
GETPOST(
"MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"),
'chaine', 0,
'', $conf->entity);
71 dolibarr_set_const($db,
"MAIN_GENERATE_DOCUMENTS_HIDE_DESC",
GETPOST(
"MAIN_GENERATE_DOCUMENTS_HIDE_DESC"),
'chaine', 0,
'', $conf->entity);
72 dolibarr_set_const($db,
"MAIN_GENERATE_DOCUMENTS_HIDE_REF",
GETPOST(
"MAIN_GENERATE_DOCUMENTS_HIDE_REF"),
'chaine', 0,
'', $conf->entity);
74 dolibarr_set_const($db,
"MAIN_DOCUMENTS_LOGO_HEIGHT",
GETPOST(
"MAIN_DOCUMENTS_LOGO_HEIGHT",
'int'),
'chaine', 0,
'', $conf->entity);
75 dolibarr_set_const($db,
"MAIN_INVERT_SENDER_RECIPIENT",
GETPOST(
"MAIN_INVERT_SENDER_RECIPIENT"),
'chaine', 0,
'', $conf->entity);
76 dolibarr_set_const($db,
"MAIN_PDF_USE_ISO_LOCATION",
GETPOST(
"MAIN_PDF_USE_ISO_LOCATION"),
'chaine', 0,
'', $conf->entity);
77 dolibarr_set_const($db,
"MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS",
GETPOST(
"MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"),
'chaine', 0,
'', $conf->entity);
79 dolibarr_set_const($db,
"MAIN_PDF_MAIN_HIDE_SECOND_TAX",
GETPOST(
"MAIN_PDF_MAIN_HIDE_SECOND_TAX"),
'chaine', 0,
'', $conf->entity);
80 dolibarr_set_const($db,
"MAIN_PDF_MAIN_HIDE_THIRD_TAX",
GETPOST(
"MAIN_PDF_MAIN_HIDE_THIRD_TAX"),
'chaine', 0,
'', $conf->entity);
82 dolibarr_set_const($db,
"PDF_USE_ALSO_LANGUAGE_CODE",
GETPOST(
'PDF_USE_ALSO_LANGUAGE_CODE',
'alpha'),
'chaine', 0,
'', $conf->entity);
83 dolibarr_set_const($db,
"SHOW_SUBPRODUCT_REF_IN_PDF",
GETPOST(
'SHOW_SUBPRODUCT_REF_IN_PDF',
'alpha'),
'chaine', 0,
'', $conf->entity);
87 header(
"Location: ".
$_SERVER[
"PHP_SELF"].
"?mainmenu=home&leftmenu=setup");
97 $wikihelp =
'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
100 $form =
new Form($db);
104 $arraydetailsforpdffoot = array(
105 0 => $langs->transnoentitiesnoconv(
'NoDetails'),
106 1 => $langs->transnoentitiesnoconv(
'DisplayCompanyInfo'),
107 2 => $langs->transnoentitiesnoconv(
'DisplayCompanyManagers'),
108 3 => $langs->transnoentitiesnoconv(
'DisplayCompanyInfoAndManagers')
111 $s = $langs->trans(
"LibraryToBuildPDF").
"<br>";
114 if (class_exists(
'FPDF') && !class_exists(
'TCPDF'))
118 $s .=
' ('.@constant(
'FPDF_PATH').
')';
121 if (class_exists(
'TCPDF'))
125 $s .=
' ('.@constant(
'TCPDF_PATH').
')';
128 if (class_exists(
'FPDI'))
132 $s .=
' ('.@constant(
'FPDI_PATH').
')';
135 if (class_exists(
'TCPDI'))
139 $s .=
' ('.@constant(
'TCPDI_PATH').
')';
145 print '<span class="opacitymedium">'.$form->textwithpicto($langs->trans(
"PDFDesc"), $s).
"</span><br>\n";
148 $noCountryCode = (empty($mysoc->country_code) ?
true :
false);
150 print '<form method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
151 print '<input type="hidden" name="token" value="'.newToken().
'">';
152 print '<input type="hidden" name="action" value="update">';
160 print '<div class="div-table-responsive-no-min">';
161 print
'<table summary="more" class="noborder centpercent">';
162 print
'<tr class="liste_titre"><td>'.$langs->trans(
"Parameter").
'</td><td width="200px">'.$langs->trans(
"Value").
'</td></tr>';
164 $selected = $conf->global->MAIN_PDF_FORMAT;
169 print
'<tr class="oddeven"><td>'.$langs->trans(
"DictionaryPaperFormat").
'</td><td>';
170 print $formadmin->select_paper_format($selected,
'MAIN_PDF_FORMAT');
173 print
'<tr class="oddeven"><td>'.$langs->trans(
"MAIN_PDF_MARGIN_LEFT").
'</td><td>';
174 print
'<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_LEFT" value="'.(empty($conf->global->MAIN_PDF_MARGIN_LEFT) ? 10 : $conf->global->MAIN_PDF_MARGIN_LEFT).
'">';
176 print
'<tr class="oddeven"><td>'.$langs->trans(
"MAIN_PDF_MARGIN_RIGHT").
'</td><td>';
177 print
'<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_RIGHT" value="'.(empty($conf->global->MAIN_PDF_MARGIN_RIGHT) ? 10 : $conf->global->MAIN_PDF_MARGIN_RIGHT).
'">';
179 print
'<tr class="oddeven"><td>'.$langs->trans(
"MAIN_PDF_MARGIN_TOP").
'</td><td>';
180 print
'<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_TOP" value="'.(empty($conf->global->MAIN_PDF_MARGIN_TOP) ? 10 : $conf->global->MAIN_PDF_MARGIN_TOP).
'">';
182 print
'<tr class="oddeven"><td>'.$langs->trans(
"MAIN_PDF_MARGIN_BOTTOM").
'</td><td>';
183 print
'<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_BOTTOM" value="'.(empty($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? 10 : $conf->global->MAIN_PDF_MARGIN_BOTTOM).
'">';
195 print
'<div class="div-table-responsive-no-min">';
196 print
'<table summary="more" class="noborder centpercent">';
197 print
'<tr class="liste_titre"><td>'.$langs->trans(
"Parameter").
'</td><td width="200px">'.$langs->trans(
"Value").
'</td></tr>';
201 print
'<tr class="oddeven"><td>'.$langs->trans(
"ShowVATIntaInAddress").
'</td><td>';
202 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);
206 for ($i = 1; $i <= 6; $i++)
210 $pid = $langs->transcountry(
"ProfId".$i, $mysoc->country_code);
211 if ($pid ==
'-') $pid =
false;
213 $pid =
img_warning().
' <font class="error">'.$langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"CompanyCountry")).
'</font>';
217 print
'<tr class="oddeven"><td>'.$langs->trans(
"ShowProfIdInAddress").
' - '.$pid.
'</td><td>';
218 $keyforconstant =
'MAIN_PROFID'.$i.
'_IN_ADDRESS';
219 print $form->selectyesno($keyforconstant, isset($conf->global->$keyforconstant) ? $conf->global->$keyforconstant : 0, 1, $noCountryCode);
234 if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2))
236 if ($mysoc->useLocalTax(1))
238 $locales = $langs->transcountry(
"LT1", $mysoc->country_code);
239 $text =
'<tr class="oddeven"><td>'.$langs->trans(
"HideLocalTaxOnPDF", $langs->transcountry(
"LT1", $mysoc->country_code)).
'</td><td>';
240 $text .= $form->selectyesno(
'MAIN_PDF_MAIN_HIDE_SECOND_TAX', (!empty($conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX)) ? $conf->global->MAIN_PDF_MAIN_HIDE_SECOND_TAX : 0, 1);
241 $text .=
'</td></tr>';
244 if ($mysoc->useLocalTax(2))
246 $locales .= ($locales ?
' & ' :
'').$langs->transcountry(
"LT2", $mysoc->country_code);
248 $text .=
'<tr class="oddeven"><td>'.$langs->trans(
"HideLocalTaxOnPDF", $langs->transcountry(
"LT2", $mysoc->country_code)).
'</td><td>';
249 $text .= $form->selectyesno(
'MAIN_PDF_MAIN_HIDE_THIRD_TAX', (!empty($conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX)) ? $conf->global->MAIN_PDF_MAIN_HIDE_THIRD_TAX : 0, 1);
250 $text .=
'</td></tr>';
254 $title = $langs->trans(
"PDFRulesForSalesTax");
255 if ($mysoc->useLocalTax(1) || $mysoc->useLocalTax(2))
257 $title .=
' - '.$langs->trans(
"PDFLocaltax", $locales);
262 print
'<table summary="more" class="noborder centpercent">';
263 print
'<tr class="liste_titre"><td>'.$langs->trans(
"Parameter").
'</td><td width="200px">'.$langs->trans(
"Value").
'</td></tr>';
267 print
'<tr class="oddeven"><td>'.$langs->trans(
"HideAnyVATInformationOnPDF").
'</td><td>';
268 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);
281 print
'<div class="div-table-responsive-no-min">';
282 print
'<table summary="more" class="noborder centpercent">';
283 print
'<tr class="liste_titre"><td>'.$langs->trans(
"Parameter").
'</td><td width="200px">'.$langs->trans(
"Value").
'</td></tr>';
287 print
'<tr class="oddeven"><td>'.$langs->trans(
"MAIN_DOCUMENTS_LOGO_HEIGHT").
'</td><td>';
288 print
'<input type="text" class="maxwidth50" name="MAIN_DOCUMENTS_LOGO_HEIGHT" value="'.(!empty($conf->global->MAIN_DOCUMENTS_LOGO_HEIGHT) ? $conf->global->MAIN_DOCUMENTS_LOGO_HEIGHT : 20).
'">';
293 print
'<tr class="oddeven"><td>'.$langs->trans(
"HideDescOnPDF").
'</td><td>';
294 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);
299 print
'<tr class="oddeven"><td>'.$langs->trans(
"HideRefOnPDF").
'</td><td>';
300 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);
305 print
'<tr class="oddeven"><td>'.$langs->trans(
"HideDetailsOnPDF").
'</td><td>';
306 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);
311 print
'<tr class="oddeven"><td>'.$langs->trans(
"SwapSenderAndRecipientOnPDF").
'</td><td>';
312 print $form->selectyesno(
'MAIN_INVERT_SENDER_RECIPIENT', (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) ? $conf->global->MAIN_INVERT_SENDER_RECIPIENT : 0, 1);
317 print
'<tr class="oddeven"><td>'.$langs->trans(
"PlaceCustomerAddressToIsoLocation").
'</td><td>';
318 print $form->selectyesno(
'MAIN_PDF_USE_ISO_LOCATION', (!empty($conf->global->MAIN_PDF_USE_ISO_LOCATION)) ? $conf->global->MAIN_PDF_USE_ISO_LOCATION : 0, 1);
322 print
'<tr class="oddeven"><td>'.$langs->trans(
"ShowDetailsInPDFPageFoot").
'</td><td>';
323 print $form->selectarray(
'MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', $arraydetailsforpdffoot, $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS);
326 print
'<tr class="oddeven"><td>'.$langs->trans(
"PDF_USE_ALSO_LANGUAGE_CODE").
'</td><td>';
329 print $formadmin->select_language(
GETPOSTISSET(
'PDF_USE_ALSO_LANGUAGE_CODE') ?
GETPOST(
'PDF_USE_ALSO_LANGUAGE_CODE') : $conf->global->PDF_USE_ALSO_LANGUAGE_CODE,
'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1);
336 print
'<tr class="oddeven"><td>'.$langs->trans(
"SHOW_SUBPRODUCT_REF_IN_PDF", $langs->transnoentitiesnoconv(
"AssociatedProductsAbility"), $langs->transnoentitiesnoconv(
"Products")).
'</td><td>';
337 print $form->selectyesno(
'SHOW_SUBPRODUCT_REF_IN_PDF', (!empty($conf->global->SHOW_SUBPRODUCT_REF_IN_PDF)) ? $conf->global->SHOW_SUBPRODUCT_REF_IN_PDF : 0, 1);
343 print
'<br><div class="center">';
344 print
'<input class="button button-save" type="submit" name="save" value="'.$langs->trans(
"Save").
'">';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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).
img_warning($titlealt= 'default', $moreatt= '', $morecss= 'pictowarning')
Show warning logo.
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save"&&empty($cancel)) $wikihelp
View.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
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 ...
dol_getDefaultFormat(Translate $outputlangs=null)
Try to guess default paper format according to language into $langs.
print $_SERVER["PHP_SELF"]
Edit parameters.
pdf_getInstance($format= '', $metric= 'mm', $pagetype= 'P')
Return a PDF instance object.
print
Draft customers invoices.