32require
'../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formadmin.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/lib/usergroups.lib.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
52$langs->loadLangs(array(
'admin',
'bills',
'companies',
'languages',
'members',
'other',
'products',
'propal',
'receptions',
'stocks',
'trips',
'orders'));
58$action =
GETPOST(
'action',
'aZ09');
65if ($action ==
'update') {
66 if (GETPOSTISSET(
'MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING')) {
67 dolibarr_set_const($db,
"MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING",
GETPOST(
"MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING"),
'chaine', 0,
'',
$conf->entity);
69 if (GETPOSTISSET(
'PROPOSAL_PDF_HIDE_PAYMENTTERM')) {
72 if (GETPOSTISSET(
'PROPOSAL_PDF_HIDE_PAYMENTMODE')) {
75 if (GETPOSTISSET(
'MAIN_GENERATE_PROPOSALS_WITH_PICTURE')) {
78 if (GETPOSTISSET(
'SALES_ORDER_SHOW_SHIPPING_ADDRESS')) {
82 if (GETPOSTISSET(
'MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE')) {
83 dolibarr_set_const($db,
"MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE",
GETPOST(
"MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE"),
'chaine', 0,
'',
$conf->entity);
85 if (GETPOSTISSET(
'MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN')) {
86 dolibarr_set_const($db,
"MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN",
GETPOST(
"MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN"),
'chaine', 0,
'',
$conf->entity);
88 if (GETPOSTISSET(
'MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE')) {
89 dolibarr_set_const($db,
"MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE",
GETPOST(
"MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE"),
'chaine', 0,
'',
$conf->entity);
91 if (GETPOSTISSET(
'MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN')) {
92 dolibarr_set_const($db,
"MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN",
GETPOST(
"MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN"),
'chaine', 0,
'',
$conf->entity);
94 if (GETPOSTISSET(
'MAIN_DOCUMENTS_WITH_PICTURE_WIDTH')) {
97 if (GETPOSTISSET(
'MAIN_PDF_ADD_TERMSOFSALE_PROPAL')) {
100 if (GETPOSTISSET(
'MAIN_PDF_ADD_TERMSOFSALE_ORDER')) {
103 if (GETPOSTISSET(
'MAIN_PDF_ADD_TERMSOFSALE_INVOICE')) {
106 if (GETPOSTISSET(
'INVOICE_ADD_ZATCA_QR_CODE')) {
108 if (
GETPOSTINT(
'INVOICE_ADD_ZATCA_QR_CODE') == 1) {
112 if (GETPOSTISSET(
'INVOICE_ADD_EPC_QR_CODE')) {
114 if (
GETPOSTINT(
'INVOICE_ADD_EPC_QR_CODE') == 1) {
118 if (GETPOSTISSET(
'INVOICE_ADD_SWISS_QR_CODE')) {
120 if (
GETPOST(
'INVOICE_ADD_SWISS_QR_CODE',
'alpha') !=
'0') {
124 if (GETPOSTISSET(
'INVOICE_CATEGORY_OF_OPERATION')) {
127 if (GETPOSTISSET(
'INVOICE_SHOW_SHIPPING_ADDRESS')) {
131 if (GETPOSTISSET(
'PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
135 if (GETPOSTISSET(
'BARCODE_ON_SHIPPING_PDF')) {
138 if (GETPOSTISSET(
'BARCODE_ON_RECEPTION_PDF')) {
141 if (GETPOSTISSET(
'BARCODE_ON_STOCKTRANSFER_PDF')) {
146 if ($_FILES[
'termsofsale'][
"name"]) {
147 if (!preg_match(
'/(\.pdf)$/i', $_FILES[
'termsofsale'][
"name"])) {
148 $langs->load(
"errors");
151 $dirforterms =
$conf->mycompany->dir_output.
'/';
152 if (!is_dir($dirforterms)) {
155 $original_file = $_FILES[
'termsofsale'][
"name"];
156 $result =
dol_move_uploaded_file($_FILES[
'termsofsale'][
"tmp_name"], $dirforterms.$original_file, 1, 0, $_FILES[
'termsofsale'][
'error']);
167 header(
"Location: ".$_SERVER[
"PHP_SELF"].
"?mainmenu=home&leftmenu=setup");
173if ($action ==
'removetermsofsale') {
174 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
176 $filename = $mysoc->termsofsale;
177 $file =
$conf->mycompany->dir_output.
'/'.$filename;
179 if ($filename !=
'') {
184 $mysoc->termsofsale =
'';
192$wikihelp =
'EN:First_setup|FR:Premiers_paramétrages|ES:Primeras_configuraciones';
193llxHeader(
'', $langs->trans(
"Setup"), $wikihelp,
'', 0, 0,
'',
'',
'',
'mod-admin page-pdf_other');
195$form =
new Form($db);
207print
'<span class="opacitymedium">'.$form->textwithpicto($langs->trans(
"PDFOtherDesc"), $tooltiptext).
"</span><br>\n";
210print
'<form enctype="multipart/form-data" method="post" action="'.$_SERVER[
"PHP_SELF"].
'">';
211print
'<input type="hidden" name="token" value="'.newToken().
'">';
212print
'<input type="hidden" name="action" value="update">';
214if (isModEnabled(
'propal')) {
217 print
'<div class="div-table-responsive-no-min">';
218 print
'<table summary="more" class="noborder centpercent">';
219 print
'<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans(
"Parameter").
'</td><td width="200px"></td></tr>';
234 print
'<tr class="oddeven"><td>';
235 print $form->textwithpicto($langs->trans(
"MAIN_PDF_ADD_TERMSOFSALE_PROPAL"), $langs->trans(
"PdfAddTermOfSaleHelp"));
237 if (
$conf->use_javascript_ajax) {
238 print ajax_constantonoff(
'MAIN_PDF_ADD_TERMSOFSALE_PROPAL');
240 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
241 print $form->selectarray(
"MAIN_PDF_ADD_TERMSOFSALE_PROPAL", $arrval,
$conf->global->MAIN_PDF_ADD_TERMSOFSALE_PROPAL);
245 print
'<tr class="oddeven"><td>';
246 print $form->textwithpicto($langs->trans(
"MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), $langs->trans(
"RandomlySelectedIfSeveral"));
248 if (
$conf->use_javascript_ajax) {
249 print ajax_constantonoff(
'MAIN_GENERATE_PROPOSALS_WITH_PICTURE');
251 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
252 print $form->selectarray(
"MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval,
$conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE);
260if (isModEnabled(
'order')) {
261 $langs->load(
"orders");
264 print
'<div class="div-table-responsive-no-min">';
265 print
'<table summary="more" class="noborder centpercent">';
266 print
'<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans(
"Parameters").
'</td><td width="200px"></td></tr>';
267 print
'<tr class="oddeven"><td>';
268 print $form->textwithpicto($langs->trans(
"MAIN_PDF_ADD_TERMSOFSALE_ORDER"), $langs->trans(
"PdfAddTermOfSaleHelp"));
270 if (
$conf->use_javascript_ajax) {
271 print ajax_constantonoff(
'MAIN_PDF_ADD_TERMSOFSALE_ORDER');
273 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
274 print $form->selectarray(
"MAIN_PDF_ADD_TERMSOFSALE_ORDER", $arrval,
$conf->global->MAIN_PDF_ADD_TERMSOFSALE_ORDER);
278 print
'<tr class="oddeven"><td>';
279 print $form->textwithpicto($langs->trans(
"SALES_ORDER_SHOW_SHIPPING_ADDRESS"), $langs->trans(
"SALES_ORDER_SHOW_SHIPPING_ADDRESSMore"));
281 if (
$conf->use_javascript_ajax) {
282 print ajax_constantonoff(
'SALES_ORDER_SHOW_SHIPPING_ADDRESS');
284 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
285 print $form->selectarray(
"SALES_ORDER_SHOW_SHIPPING_ADDRESS", $arrval,
$conf->global->SALES_ORDER_SHOW_SHIPPING_ADDRESS);
294if (isModEnabled(
'supplier_proposal')) {
295 $langs->load(
"supplier_proposal");
296 print
load_fiche_titre($langs->trans(
"SupplierProposal"),
'',
'supplier_proposal');
298 print
'<div class="div-table-responsive-no-min">';
299 print
'<table summary="more" class="noborder centpercent">';
300 print
'<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans(
"Parameter").
'</td><td width="200px"></td></tr>';
302 print
'<tr class="oddeven"><td>';
303 print $form->textwithpicto($langs->trans(
"MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE"),
'');
305 if (
$conf->use_javascript_ajax) {
306 print ajax_constantonoff(
'MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE');
308 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
309 print $form->selectarray(
"MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE", $arrval,
$conf->global->MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE);
313 print
'<tr class="oddeven"><td>';
314 print $form->textwithpicto($langs->trans(
"MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN"),
'');
316 if (
$conf->use_javascript_ajax) {
317 print ajax_constantonoff(
'MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN');
319 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
320 print $form->selectarray(
"MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN", $arrval,
$conf->global->MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN);
329if (isModEnabled(
'supplier_order')) {
330 $langs->load(
"supplier_order");
331 print
load_fiche_titre($langs->trans(
"SupplierOrder"),
'',
'supplier_proposal');
333 print
'<div class="div-table-responsive-no-min">';
334 print
'<table summary="more" class="noborder centpercent">';
335 print
'<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans(
"Parameter").
'</td><td width="200px"></td></tr>';
337 print
'<tr class="oddeven"><td>';
338 print $form->textwithpicto($langs->trans(
"MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE"),
'');
340 if (
$conf->use_javascript_ajax) {
341 print ajax_constantonoff(
'MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE');
343 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
344 print $form->selectarray(
"MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE", $arrval,
$conf->global->MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE);
348 print
'<tr class="oddeven"><td>';
349 print $form->textwithpicto($langs->trans(
"MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN"),
'');
351 if (
$conf->use_javascript_ajax) {
352 print ajax_constantonoff(
'MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN');
354 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
355 print $form->selectarray(
"MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN", $arrval,
$conf->global->MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN);
363if (isModEnabled(
'invoice')) {
366 print
'<div class="div-table-responsive-no-min">';
367 print
'<table summary="more" class="noborder centpercent">';
368 print
'<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans(
"Parameters").
'</td><td width="200px"></td></tr>';
370 print
'<tr class="oddeven"><td>';
371 print $form->textwithpicto($langs->trans(
"MAIN_PDF_ADD_TERMSOFSALE_INVOICE"), $langs->trans(
"PdfAddTermOfSaleHelp"));
373 if (
$conf->use_javascript_ajax) {
374 print ajax_constantonoff(
'MAIN_PDF_ADD_TERMSOFSALE_INVOICE');
376 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
377 print $form->selectarray(
"MAIN_PDF_ADD_TERMSOFSALE_INVOICE", $arrval,
$conf->global->MAIN_PDF_ADD_TERMSOFSALE_INVOICE);
380 print
'<tr class="oddeven"><td>';
381 print $form->textwithpicto($langs->trans(
"INVOICE_ADD_ZATCA_QR_CODE"), $langs->trans(
"INVOICE_ADD_ZATCA_QR_CODEMore"));
383 if (
$conf->use_javascript_ajax) {
384 print ajax_constantonoff(
'INVOICE_ADD_ZATCA_QR_CODE');
386 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
387 print $form->selectarray(
"INVOICE_ADD_ZATCA_QR_CODE", $arrval,
getDolGlobalString(
'INVOICE_ADD_ZATCA_QR_CODE'));
391 print
'<tr class="oddeven"><td>';
392 print $form->textwithpicto($langs->trans(
"INVOICE_ADD_EPC_QR_CODE"), $langs->trans(
"INVOICE_ADD_EPC_QR_CODEMore"));
394 if (
$conf->use_javascript_ajax) {
395 print ajax_constantonoff(
'INVOICE_ADD_EPC_QR_CODE');
397 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
398 print $form->selectarray(
"INVOICE_ADD_EPC_QR_CODE", $arrval,
getDolGlobalString(
'INVOICE_ADD_EPC_QR_CODE'));
402 print
'<tr class="oddeven"><td>';
404 print $form->textwithpicto($langs->trans(
"INVOICE_ADD_SWISS_QR_CODE"), $langs->trans(
"INVOICE_ADD_SWISS_QR_CODEMore"));
406 print $langs->trans(
"INVOICE_ADD_SWISS_QR_CODE");
409 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
411 $arrval[
'bottom'] = $langs->trans(
"AtBottomOfPage").
' ('.$langs->trans(
"Experimental").
' - Need PHP 8.1+ and some PHP libs)';
413 print $form->selectarray(
"INVOICE_ADD_SWISS_QR_CODE", $arrval,
getDolGlobalString(
'INVOICE_ADD_SWISS_QR_CODE'));
418 print
'<tr class="oddeven"><td>';
419 print $form->textwithpicto($langs->trans(
"InvoiceOptionCategoryOfOperations"), $langs->trans(
'InvoiceOptionCategoryOfOperationsHelp'), 1);
421 $arrval = array(
'0'=>$langs->trans(
"No"),
422 '1'=>$langs->trans(
"InvoiceOptionCategoryOfOperationsYes1"),
423 '2'=>$langs->trans(
"InvoiceOptionCategoryOfOperationsYes2")
425 print $form->selectarray(
"INVOICE_CATEGORY_OF_OPERATION", $arrval,
getDolGlobalString(
'INVOICE_CATEGORY_OF_OPERATION'), 0, 0, 0,
'', 0, 0, 0,
'',
'minwidth75imp');
428 print
'<tr class="oddeven"><td>';
429 print $form->textwithpicto($langs->trans(
"INVOICE_SHOW_SHIPPING_ADDRESS"), $langs->trans(
"INVOICE_SHOW_SHIPPING_ADDRESSMore"));
431 if (
$conf->use_javascript_ajax) {
432 print ajax_constantonoff(
'INVOICE_SHOW_SHIPPING_ADDRESS');
434 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
435 print $form->selectarray(
"INVOICE_SHOW_SHIPPING_ADDRESS", $arrval,
$conf->global->INVOICE_SHOW_SHIPPING_ADDRESS);
469if (isModEnabled(
'shipping')) {
472 print
'<div class="div-table-responsive-no-min">';
473 print
'<table summary="more" class="noborder centpercent">';
474 print
'<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans(
"Parameters").
'</td><td width="200px"></td></tr>';
476 print
'<tr class="oddeven"><td>';
477 print $langs->trans(
"BARCODE_ON_SHIPPING_PDF");
479 if (
$conf->use_javascript_ajax) {
480 print ajax_constantonoff(
'BARCODE_ON_SHIPPING_PDF');
482 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
483 print $form->selectarray(
"BARCODE_ON_SHIPPING_PDF", $arrval,
getDolGlobalString(
'BARCODE_ON_SHIPPING_PDF'));
491if (isModEnabled(
'reception')) {
494 print
'<div class="div-table-responsive-no-min">';
495 print
'<table summary="more" class="noborder centpercent">';
496 print
'<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans(
"Parameters").
'</td><td width="200px"></td></tr>';
498 print
'<tr class="oddeven"><td>';
499 print $langs->trans(
"RECEPTION_PDF_HIDE_ORDERED");
501 if (
$conf->use_javascript_ajax) {
502 print ajax_constantonoff(
'RECEPTION_PDF_HIDE_ORDERED');
504 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
505 print $form->selectarray(
"RECEPTION_PDF_HIDE_ORDERED", $arrval,
getDolGlobalString(
'RECEPTION_PDF_HIDE_ORDERED'));
509 print
'<tr class="oddeven"><td>';
510 print $langs->trans(
"MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT");
512 if (
$conf->use_javascript_ajax) {
513 print ajax_constantonoff(
'MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT');
515 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
516 print $form->selectarray(
"MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT", $arrval,
getDolGlobalString(
'MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT'));
520 print
'<tr class="oddeven"><td>';
521 print $langs->trans(
"BARCODE_ON_RECEPTION_PDF");
523 if (
$conf->use_javascript_ajax) {
524 print ajax_constantonoff(
'BARCODE_ON_RECEPTION_PDF');
526 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
527 print $form->selectarray(
"BARCODE_ON_RECEPTION_PDF", $arrval,
getDolGlobalString(
'BARCODE_ON_RECEPTION_PDF'));
534if (isModEnabled(
'stocktransfer')) {
537 print
'<div class="div-table-responsive-no-min">';
538 print
'<table summary="more" class="noborder centpercent">';
539 print
'<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans(
"Parameters").
'</td><td width="200px"></td></tr>';
541 print
'<tr class="oddeven"><td>';
542 print $langs->trans(
"BARCODE_ON_STOCKTRANSFER_PDF");
544 if (
$conf->use_javascript_ajax) {
545 print ajax_constantonoff(
'BARCODE_ON_STOCKTRANSFER_PDF');
547 $arrval = array(
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
548 print $form->selectarray(
"BARCODE_ON_STOCKTRANSFER_PDF", $arrval,
getDolGlobalString(
'BARCODE_ON_STOCKTRANSFER_PDF'));
557print
'<div class="div-table-responsive-no-min">';
558print
'<table summary="more" class="noborder centpercent">';
559print
'<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans(
"Parameters").
'</td><td width="200px"></td></tr>';
562$tooltiptermsofsale = $langs->trans(
'AvailableFormats').
' : pdf';
564$tooltiptermsofsale .= ($maxfilesizearray[
'maxmin'] > 0) ?
'<br>'.$langs->trans(
'MaxSize').
' : '.$maxfilesizearray[
'maxmin'].
' '.$langs->trans(
'Kb') :
'';
565$documenturl = DOL_URL_ROOT.
'/document.php';
566if (isset(
$conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) {
567 $documenturl =
$conf->global->DOL_URL_ROOT_DOCUMENT_PHP;
569$modulepart =
'mycompany';
571print
'<tr class="oddeven"><td><label for="logo">'.$form->textwithpicto($langs->trans(
"TERMSOFSALE"), $tooltiptermsofsale).
'</label></td><td>';
572print
'<div class="centpercent nobordernopadding valignmiddle "><div class="inline-block marginrightonly">';
573print
'<input type="file" class="flat minwidth100 maxwidthinputfileonsmartphone" name="termsofsale" id="termsofsale" accept="application/pdf">';
575if (!empty($mysoc->termsofsale)) {
576 if (file_exists(
$conf->mycompany->dir_output.
'/'.$mysoc->termsofsale)) {
577 print
'<div class="inline-block valignmiddle marginrightonly"><a href="'.$documenturl.
'?modulepart='.$modulepart.
'&file='.urlencode($mysoc->termsofsale).
'">'.$mysoc->termsofsale.
'</a>'.$formfile->showPreview($mysoc->termsofsale, $modulepart, $mysoc->termsofsale, 0,
'');
578 print
'<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=removetermsofsale&token='.
newToken().
'">'.
img_delete($langs->trans(
"Delete"),
'',
'marginleftonly').
'</a></div>';
586print
'<br><div class="center">';
587print
'<input class="button button-save" type="submit" name="save" value="'.$langs->trans(
"Save").
'">';
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).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $nohook=0, $varfiles='addedfile', $upload_dir='')
Check validity of a file upload from an GUI page, and move it to its final destination.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
pdf_admin_prepare_head()
Return array head with list of tabs to view object information.
getMaxFileSizeArray()
Return the max allowed for file upload.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.