dolibarr 24.0.0-beta
supplier_order.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
6 * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
7 * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
8 * Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
9 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
10 * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
11 * Copyright (C) 2026 Pierre Ardoin <developpeur@lesmetiersdubatiment.fr>
12 * Copyright (C) 2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program. If not, see <https://www.gnu.org/licenses/>.
26 */
27
34// Load Dolibarr environment
35require '../../main.inc.php';
36
46require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
47require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
48if (getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) {
49 require_once DOL_DOCUMENT_ROOT . '/core/lib/supplier_order.lib.php';
50} else {
51 require_once DOL_DOCUMENT_ROOT . '/core/lib/fourn.lib.php';
52}
53require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
54require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
55
56
57// Load translation files required by the page
58$langs->loadLangs(array("admin", "other", "orders", "stocks"));
59
60$action = GETPOST('action', 'aZ09');
61
62$type = GETPOST('type', 'alpha');
63$value = GETPOST('value', 'alpha');
64$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
65
66$label = GETPOST('label', 'alpha');
67$scandir = GETPOST('scan_dir', 'alpha');
68
69$specimenthirdparty = new Societe($db);
70$specimenthirdparty->initAsSpecimen();
71
72$error = 0;
73
74if (!$user->admin) {
76}
77
78
79/*
80 * Actions
81 */
82
83include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
84
85if ($action == 'updateMask') {
86 $maskconstorder = GETPOST('maskconstorder', 'aZ09');
87 $maskvalue = GETPOST('maskorder', 'alpha');
88
89 $res = 0;
90
91 if ($maskconstorder && preg_match('/_MASK$/', $maskconstorder)) {
92 $res = dolibarr_set_const($db, $maskconstorder, $maskvalue, 'chaine', 0, '', $conf->entity);
93 }
94
95 if (!($res > 0)) {
96 $error++;
97 }
98
99 if (!$error) {
100 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
101 } else {
102 setEventMessages($langs->trans("Error"), null, 'errors');
103 }
104}
105
106if ($action == 'specimen') { // For orders
107 $modele = GETPOST('module', 'alpha');
108
109 $commande = new CommandeFournisseur($db);
110 $commande->initAsSpecimen();
111 $commande->thirdparty = $specimenthirdparty;
112
113 // Search template files
114 $file = '';
115 $classname = '';
116 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
117 foreach ($dirmodels as $reldir) {
118 $file = dol_buildpath($reldir."core/modules/supplier_order/doc/pdf_".$modele.".modules.php", 0);
119 if (file_exists($file)) {
120 $classname = "pdf_".$modele;
121 break;
122 }
123 }
124
125 if ($classname !== '') {
126 require_once $file;
127
128 $module = new $classname($db, $commande);
129 '@phan-var-force ModelePDFSuppliersOrders $module';
130
131 if ($module->write_file($commande, $langs) > 0) {
132 header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande_fournisseur&file=SPECIMEN.pdf");
133 return;
134 } else {
135 setEventMessages($module->error, $module->errors, 'errors');
136 dol_syslog($module->error, LOG_ERR);
137 }
138 } else {
139 setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
140 dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
141 }
142} elseif ($action == 'set') {
143 // Activate a model
144 $ret = addDocumentModel($value, $type, $label, $scandir);
145} elseif ($action == 'del') {
146 $ret = delDocumentModel($value, $type);
147 if ($ret > 0) {
148 if (getDolGlobalString('COMMANDE_SUPPLIER_ADDON_PDF') == "$value") {
149 dolibarr_del_const($db, 'COMMANDE_SUPPLIER_ADDON_PDF', $conf->entity);
150 }
151 }
152} elseif ($action == 'setdoc') {
153 // Set default model
154 if (dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
155 // La constante qui a ete lue en avant du nouveau set
156 // on passe donc par une variable pour avoir un affichage coherent
157 $conf->global->COMMANDE_SUPPLIER_ADDON_PDF = $value;
158 }
159
160 // On active le modele
161 $ret = delDocumentModel($value, $type);
162 if ($ret > 0) {
163 $ret = addDocumentModel($value, $type, $label, $scandir);
164 }
165} elseif ($action == 'unsetdoc') {
166 dolibarr_del_const($db, "COMMANDE_SUPPLIER_ADDON_PDF", $conf->entity);
167} elseif ($action == 'setmod') {
168 // TODO Verify if the chosen numbering module can be activated
169 // by calling method canBeActivated
170
171 dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity);
172} elseif ($action == 'addcat') {
173 $fourn = new Fournisseur($db);
174 $fourn->CreateCategory($user, GETPOST('cat', 'alphanohtml'));
175} elseif ($action == 'set_SUPPLIER_ORDER_OTHER') {
176 $freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
177 $doubleapproval = GETPOST('SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED', 'alpha');
178 $doubleapproval = price2num($doubleapproval);
179
180 $res1 = dolibarr_set_const($db, "SUPPLIER_ORDER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
181 $res2 = dolibarr_set_const($db, "SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED", $doubleapproval, 'chaine', 0, '', $conf->entity);
182
183 // TODO We add/delete permission here until permission can have a condition on a global var
184 include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
185 $newmodule = new modFournisseur($db);
186
187 if ($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) {
188 // clear default rights array
189 $newmodule->rights = array();
190 // add new right
191 $r = 0;
192 $newmodule->rights[$r][0] = 1190;
193 $newmodule->rights[$r][1] = $langs->trans("Permission1190");
194 $newmodule->rights[$r][2] = 'w';
195 $newmodule->rights[$r][3] = 0;
196 $newmodule->rights[$r][4] = 'commande';
197 $newmodule->rights[$r][5] = 'approve2';
198
199 // Insert
200 $newmodule->insert_permissions(1);
201 } else {
202 // Remove all rights with Permission1190
203 $newmodule->delete_permissions();
204
205 // Add all right without Permission1190
206 $newmodule->insert_permissions(1);
207 }
208} elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER') {
209 // Activate ask for payment bank
210 $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER", $value, 'chaine', 0, '', $conf->entity);
211
212 if (!($res > 0)) {
213 $error++;
214 }
215
216 if (!$error) {
217 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
218 } else {
219 setEventMessages($langs->trans("Error"), null, 'errors');
220 }
221}
222
223
224/*
225* View
226*/
227
228$form = new Form($db);
229
230$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
231
232llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-supplier_order');
233
234$linkback = '<a href="'.dolBuildUrl(DOL_URL_ROOT.'/admin/modules.php', ['restore_lastsearch_values' => 1]).'">'.img_picto($langs->trans("BackToModuleList"), 'back', 'class="pictofixedwidth"').'<span class="hideonsmartphone">'.$langs->trans("BackToModuleList").'</span></a>';
235
236print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup');
237
238print "<br>";
239
240if (getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) {
241 $head = supplier_order_admin_prepare_head();
242} else {
244}
245
246print dol_get_fiche_head($head, 'order', $langs->trans("Suppliers"), -1, 'company');
247
248
249// Supplier order numbering module
250
251print load_fiche_titre($langs->trans("OrdersNumberingModules"), '', '');
252
253print '<div class="div-table-responsive-no-min">';
254print '<table class="noborder centpercent">';
255print '<tr class="liste_titre">';
256print '<td width="100">'.$langs->trans("Name").'</td>';
257print '<td>'.$langs->trans("Description").'</td>';
258print '<td>'.$langs->trans("Example").'</td>';
259print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
260print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
261print "</tr>\n";
262
263clearstatcache();
264
265foreach ($dirmodels as $reldir) {
266 $dir = dol_buildpath($reldir."core/modules/supplier_order/");
267
268 if (is_dir($dir)) {
269 $handle = opendir($dir);
270 if (is_resource($handle)) {
271 while (($file = readdir($handle)) !== false) {
272 if (substr($file, 0, 25) == 'mod_commande_fournisseur_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
273 $file = substr($file, 0, dol_strlen($file) - 4);
274
275 require_once $dir.$file.'.php';
276
277 $module = new $file();
278
279 '@phan-var-force ModeleNumRefSuppliersOrders $module';
280
281 if ($module->isEnabled()) {
282 // Show modules according to features level
283 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
284 continue;
285 }
286 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
287 continue;
288 }
289
290
291 print '<tr class="oddeven"><td>'.$module->getName($langs)."</td><td>\n";
292 print $module->info($langs);
293 print '</td>';
294
295 // Show example of numbering module
296 print '<td class="nowrap">';
297 $tmp = $module->getExample();
298 if (preg_match('/^Error/', $tmp)) {
299 $langs->load("errors");
300 print '<div class="error">'.$langs->trans($tmp).'</div>';
301 } elseif ($tmp == 'NotConfigured') {
302 print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
303 } else {
304 print $tmp;
305 }
306 print '</td>'."\n";
307
308 print '<td class="center">';
309 if (getDolGlobalString('COMMANDE_SUPPLIER_ADDON_NUMBER') == "$file") {
310 print img_picto($langs->trans("Activated"), 'switch_on');
311 } else {
312 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.urlencode($file).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
313 }
314 print '</td>';
315
316 $commande = new CommandeFournisseur($db);
317 $commande->initAsSpecimen();
318
319 // Info
320 $htmltooltip = '';
321 $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
322 $nextval = $module->getNextValue($mysoc, $commande);
323 if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
324 $htmltooltip .= ''.$langs->trans("NextValue").': ';
325 if ($nextval) {
326 if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
327 $nextval = $langs->trans($nextval);
328 }
329 $htmltooltip .= $nextval.'<br>';
330 } else {
331 $htmltooltip .= $langs->trans($module->error).'<br>';
332 }
333 }
334
335 print '<td class="center">';
336 print $form->textwithpicto('', $htmltooltip, 1, 'info');
337 print '</td>';
338
339 print '</tr>';
340 }
341 }
342 }
343 closedir($handle);
344 }
345 }
346}
347
348print '</table></div><br>';
349
350
351/*
352 * Documents models for supplier orders
353 */
354
355print load_fiche_titre($langs->trans("OrdersModelModule"), '', '');
356
357// Defini tableau def de modele
358$def = array();
359
360$sql = "SELECT nom";
361$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
362$sql .= " WHERE type = 'order_supplier'";
363$sql .= " AND entity = ".((int) $conf->entity);
364
365$resql = $db->query($sql);
366if ($resql) {
367 $i = 0;
368 $num_rows = $db->num_rows($resql);
369 while ($i < $num_rows) {
370 $array = $db->fetch_array($resql);
371 if (is_array($array)) {
372 array_push($def, $array[0]);
373 }
374 $i++;
375 }
376} else {
378}
379
380print '<div class="div-table-responsive-no-min">';
381print '<table class="noborder centpercent">'."\n";
382print '<tr class="liste_titre">'."\n";
383print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
384print '<td>'.$langs->trans("Description").'</td>'."\n";
385print '<td align="center" width="60">'.$langs->trans("Status").'</td>'."\n";
386print '<td align="center" width="60">'.$langs->trans("Default").'</td>'."\n";
387print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>';
388print '<td align="center" width="40">'.$langs->trans("Preview").'</td>';
389print '</tr>'."\n";
390
391clearstatcache();
392
393foreach ($dirmodels as $reldir) {
394 $realpath = $reldir."core/modules/supplier_order/doc";
395 $dir = dol_buildpath($realpath);
396
397 if (is_dir($dir)) {
398 $handle = opendir($dir);
399 if (is_resource($handle)) {
400 while (($file = readdir($handle)) !== false) {
401 if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
402 $name = substr($file, 4, dol_strlen($file) - 16);
403 $classname = substr($file, 0, dol_strlen($file) - 12);
404
405 require_once $dir.'/'.$file;
406 $module = new $classname($db, new CommandeFournisseur($db));
407
408 '@phan-var-force ModelePDFSuppliersOrders $module';
409
410 print "<tr class=\"oddeven\">\n";
411 print "<td>";
412 print(empty($module->name) ? $name : $module->name);
413 print "</td>\n";
414 print "<td>\n";
415 require_once $dir.'/'.$file;
416 $module = new $classname($db, $specimenthirdparty);
417 '@phan-var-force ModelePDFSuppliersOrders $module';
418 if (method_exists($module, 'info')) {
419 print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
420 } else {
421 print $module->description;
422 }
423 print "</td>\n";
424
425 // Active
426 if (in_array($name, $def)) {
427 print '<td class="center">'."\n";
428 if (getDolGlobalString('COMMANDE_SUPPLIER_ADDON_PDF') != "$name") {
429 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier">';
430 print img_picto($langs->trans("Enabled"), 'switch_on');
431 print '</a>';
432 } else {
433 print img_picto($langs->trans("Enabled"), 'switch_on');
434 }
435 print "</td>";
436 } else {
437 print '<td class="center">'."\n";
438 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
439 print "</td>";
440 }
441
442 // Default
443 print '<td class="center">';
444 if (getDolGlobalString('COMMANDE_SUPPLIER_ADDON_PDF') == "$name") {
445 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
446 } else {
447 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
448 }
449 print '</td>';
450
451 // Info
452 $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
453 $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
454 $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
455 $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
456
457 $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
458 $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
459 $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
460 $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
461 print '<td class="center">';
462 print $form->textwithpicto('', $htmltooltip, 1, 'info');
463 print '</td>';
464 print '<td class="center">';
465 print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.urlencode($name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
466 print '</td>';
467
468 print "</tr>\n";
469 }
470 }
471
472 closedir($handle);
473 }
474 }
475}
476
477print '</table></div><br>';
478
479/*
480 * Other options
481 */
482
483print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
484print '<input type="hidden" name="token" value="'.newToken().'">';
485print '<input type="hidden" name="action" value="set_SUPPLIER_ORDER_OTHER">';
486
487print load_fiche_titre($langs->trans("OtherOptions"), '', '');
488
489print '<div class="div-table-responsive-no-min">';
490print '<table class="noborder centpercent">';
491print '<tr class="liste_titre">';
492print '<td>'.$langs->trans("Parameter").'</td>';
493print '<td></td>';
494print '<td width="80">&nbsp;</td>';
495print "</tr>\n";
496
497print '<tr class="oddeven"><td>';
498print $form->textwithpicto($langs->trans("UseDoubleApproval"), $langs->trans("Use3StepsApproval"), 1, 'help').'<br>';
499print '<span class="opacitymedium">'.$langs->trans("IfSetToYesDontForgetPermission").'</span>';
500print '</td><td>';
501print '<input type="text" size="6" name="SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED" value="'.getDolGlobalString("SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED").'">';
502print '</td><td class="right">';
503print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
504print "</td></tr>\n";
505
506$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
507$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
508$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
509foreach ($substitutionarray as $key => $val) {
510 $htmltext .= $key.'<br>';
511}
512$htmltext .= '</i>';
513
514print '<tr class="oddeven"><td colspan="2">';
515print $form->textwithpicto($langs->trans("FreeLegalTextOnOrders"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
516$variablename = 'SUPPLIER_ORDER_FREE_TEXT';
517if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
518 print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
519} else {
520 include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
521 $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
522 print $doleditor->Create();
523}
524print '</td><td class="right">';
525print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
526print "</td></tr>\n";
527
528// Option to add a quality/validation step, on products, after reception.
529print '<tr class="oddeven">';
530print '<td>'.$langs->trans("UseDispatchStatus").'</td>';
531print '<td colspan="2">';
532if (isModEnabled('reception')) {
533 print '<span class="opacitymedium">'.$langs->trans("FeatureNotAvailableWithReceptionModule").'</span>';
534} else {
535 if ($conf->use_javascript_ajax) {
536 print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS');
537 } else {
538 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
539 print $form->selectarray("SUPPLIER_ORDER_USE_DISPATCH_STATUS", $arrval, $conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS);
540 }
541}
542print "</td>\n";
543print "</tr>\n";
544
545
546// Disallow to classify billed a supplier order without invoice
547print '<tr class="oddeven"><td>'.$langs->trans("SupplierOrderClassifyBilledWithoutInvoice"). '&nbsp;' ;
548print $form->textwithpicto('', $langs->trans("SupplierOrderClassifyBilledWithoutInvoiceHelp"), 1, 'help') . '</td>';
549print '<td colspan="2">';
550print ajax_constantonoff('SUPPLIER_ORDER_DISABLE_CLASSIFY_BILLED_FROM_SUPPLIER_ORDER');
551print '</td></tr>';
552
553// Allow external download
554print '<tr class="oddeven">';
555print '<td>'.$langs->trans("AllowExternalDownload").'</td>';
556print '<td class="left" colspan="2">';
557print ajax_constantonoff('SUPPLIER_ORDER_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1);
558print '</td></tr>';
559
560// Notifications
561print '<tr class="oddeven">';
562print '<td>'.img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("Notifications").'</td>';
563print '<td colspan="2">';
564print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification");
565print '</td></tr>';
566
567// More PDF options
568print '<tr class="oddeven">';
569print '<td>'.img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("MoreOptionsRelatedToPDF").'</td>';
570print '<td colspan="2">';
571print img_picto('', 'url', 'class="pictofixedwidth"').'<a href="'.DOL_URL_ROOT.'/admin/pdf_other.php">'.$langs->trans("SeeInPDFSetupPage").'</a>';
572print '</td></tr>';
573
574
575print '</table></div><br>';
576
577print '</form>';
578
579
580// End of page
581llxFooter();
582$db->close();
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
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.
delDocumentModel($name, $type)
Delete document model used by doc generator.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
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.
Definition wrapper.php:73
Class to manage predefined suppliers products.
Class to manage a WYSIWYG editor.
Class to manage generation of HTML components Only common components must be here.
Class to manage suppliers.
Class to manage third parties objects (customers, suppliers, prospects...)
global $mysoc
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
supplierorder_admin_prepare_head()
Return array head with list of tabs to view object information.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
pdf_getSubstitutionArray($outputlangs, $exclude=null, $object=null, $onlykey=0, $include=null)
Return array of possible substitutions for PDF content (without external module substitutions).
Definition pdf.lib.php:1135
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:133
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.