dolibarr 25.0.0-alpha
order.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
5 * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
6 * Copyright (C) 2004 Andre Cianfarani <acianfa@free.fr>
7 * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com>
8 * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
9 * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
10 * Copyright (C) 2011-2016 Philippe Grand <philippe.grand@atoo-net.com>
11 * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
12 * Copyright (C) 2021-2026 Frédéric France <frederic.france@free.fr>
13 * Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program. If not, see <https://www.gnu.org/licenses/>.
27 */
28
35// Load Dolibarr environment
36require '../main.inc.php';
45require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
46require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
47require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
48require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
49
50// Load translation files required by the page
51$langs->loadLangs(array('admin', 'orders', 'other'));
52
53if (!$user->admin) {
55}
56
57$action = GETPOST('action', 'aZ09');
58$value = GETPOST('value', 'alpha');
59$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
60
61$label = GETPOST('label', 'alpha');
62$scandir = GETPOST('scan_dir', 'alpha');
63$type = 'order';
64
65
66/*
67 * Actions
68 */
69
70$error = 0;
71
72include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
73
74if ($action == 'updateMask') {
75 $maskconstorder = GETPOST('maskconstorder', 'aZ09');
76 $maskorder = GETPOST('maskorder', 'alpha');
77
78 $res = 0;
79
80 if ($maskconstorder && preg_match('/_MASK$/', $maskconstorder)) {
81 $res = dolibarr_set_const($db, $maskconstorder, $maskorder, 'chaine', 0, '', $conf->entity);
82 }
83
84 if (!($res > 0)) {
85 $error++;
86 }
87
88 if (!$error) {
89 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
90 } else {
91 setEventMessages($langs->trans("Error"), null, 'errors');
92 }
93} elseif ($action == 'specimen') {
94 $modele = GETPOST('module', 'alpha');
95
96 $commande = new Commande($db);
97 $commande->initAsSpecimen();
98
99 // Search template files
100 $file = '';
101 $classname = '';
102 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
103 foreach ($dirmodels as $reldir) {
104 $file = dol_buildpath($reldir."core/modules/commande/doc/pdf_".$modele.".modules.php", 0);
105 if (file_exists($file)) {
106 $classname = "pdf_".$modele;
107 break;
108 }
109 }
110
111 if ($classname !== '') {
112 require_once $file;
113
114 $module = new $classname($db);
115 '@phan-var-force ModelePDFCommandes $module';
118 if ($module->write_file($commande, $langs) > 0) {
119 header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande&file=SPECIMEN.pdf");
120 return;
121 } else {
122 setEventMessages($module->error, $module->errors, 'errors');
123 dol_syslog($module->error, LOG_ERR);
124 }
125 } else {
126 $langs->load('errors');
127 setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
128 dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
129 }
130} elseif ($action == 'set') {
131 // Activate a model
132 $ret = addDocumentModel($value, $type, $label, $scandir);
133} elseif ($action == 'del') {
134 $ret = delDocumentModel($value, $type);
135 if ($ret > 0) {
136 if (getDolGlobalString('COMMANDE_ADDON_PDF') == (string) $value) {
137 dolibarr_del_const($db, 'COMMANDE_ADDON_PDF', $conf->entity);
138 }
139 }
140} elseif ($action == 'setdoc') {
141 // Set default model
142 if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
143 // The constant that was read before the new set
144 // We therefore requires a variable to have a coherent view
145 $conf->global->COMMANDE_ADDON_PDF = $value;
146 }
147
148 // On active le modele
149 $ret = delDocumentModel($value, $type);
150 if ($ret > 0) {
151 $ret = addDocumentModel($value, $type, $label, $scandir);
152 }
153} elseif ($action == 'setmod') {
154 // TODO Check if numbering module chosen can be activated
155 // by calling method canBeActivated
156
157 dolibarr_set_const($db, "COMMANDE_ADDON", $value, 'chaine', 0, '', $conf->entity);
158} elseif ($action == 'set_COMMANDE_DRAFT_WATERMARK') {
159 $draft = GETPOST("COMMANDE_DRAFT_WATERMARK");
160 $res = dolibarr_set_const($db, "COMMANDE_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
161
162 if (!($res > 0)) {
163 $error++;
164 }
165
166 if (!$error) {
167 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
168 } else {
169 setEventMessages($langs->trans("Error"), null, 'errors');
170 }
171} elseif ($action == 'set_ORDER_FREE_TEXT') {
172 $freetext = GETPOST("ORDER_FREE_TEXT", 'restricthtml'); // No alpha here, we want exact string
173
174 $res = dolibarr_set_const($db, "ORDER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
175
176 if (!($res > 0)) {
177 $error++;
178 }
179
180 if (!$error) {
181 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
182 } else {
183 setEventMessages($langs->trans("Error"), null, 'errors');
184 }
185} elseif ($action == 'setribchq') {
186 $rib = GETPOST('rib', 'alpha');
187 $chq = GETPOST('chq', 'alpha');
188
189 $res = dolibarr_set_const($db, "FACTURE_RIB_NUMBER", $rib, 'chaine', 0, '', $conf->entity);
190 $res = dolibarr_set_const($db, "FACTURE_CHQ_NUMBER", $chq, 'chaine', 0, '', $conf->entity);
191
192 if (!($res > 0)) {
193 $error++;
194 }
195
196 if (!$error) {
197 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
198 } else {
199 setEventMessages($langs->trans("Error"), null, 'errors');
200 }
201} elseif (preg_match('/set_(.*)/', $action, $reg)) {
202 $code = $reg[1];
203 $value = (GETPOST($code) ? GETPOST($code) : 1);
204
205 $res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
206 if (!($res > 0)) {
207 $error++;
208 }
209
210 if ($error) {
211 setEventMessages($langs->trans('Error'), null, 'errors');
212 } else {
213 setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
214 header("Location: " . $_SERVER["PHP_SELF"]);
215 exit();
216 }
217} elseif (preg_match('/del_(.*)/', $action, $reg)) {
218 $code = $reg[1];
219 $res = dolibarr_del_const($db, $code, $conf->entity);
220
221 if (!($res > 0)) {
222 $error++;
223 }
224
225 if ($error) {
226 setEventMessages($langs->trans('Error'), null, 'errors');
227 } else {
228 setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
229 header("Location: " . $_SERVER["PHP_SELF"]);
230 exit();
231 }
232}
233/*elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER') {
234 // Activate ask for payment bank
235 $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ORDER", $value, 'chaine', 0, '', $conf->entity);
236
237 if (!($res > 0)) {
238 $error++;
239 }
240
241 if (!$error) {
242 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
243 } else {
244 setEventMessages($langs->trans("Error"), null, 'errors');
245 }
246} */
247
248
249
250/*
251 * View
252 */
253
254$form = new Form($db);
255
256$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
257
258llxHeader("", $langs->trans("OrdersSetup"), '', '', 0, 0, '', '', '', 'mod-admin page-order');
259
260$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>';
261
262print load_fiche_titre($langs->trans("OrdersSetup"), $linkback, 'title_setup');
263
265
266print dol_get_fiche_head($head, 'general', $langs->trans("Orders"), -1, 'order');
267
268
269// Numbering module
270
271print load_fiche_titre($langs->trans("OrdersNumberingModules"), '', '');
272
273print '<div class="div-table-responsive-no-min">';
274print '<table class="noborder centpercent">';
275print '<tr class="liste_titre">';
276print '<td>'.$langs->trans("Name").'</td>';
277print '<td>'.$langs->trans("Description").'</td>';
278print '<td class="nowrap">'.$langs->trans("Example").'</td>';
279print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
280print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
281print '</tr>'."\n";
282
283clearstatcache();
284
285$arrayofmodules = array();
286
287
288foreach ($dirmodels as $reldir) {
289 $dir = dol_buildpath($reldir."core/modules/commande/");
290
291 if (is_dir($dir)) {
292 $handle = opendir($dir);
293 if (is_resource($handle)) {
294 while (($file = readdir($handle)) !== false) {
295 if (dol_substr($file, 0, 13) == 'mod_commande_' && dol_substr($file, dol_strlen($file) - 3, 3) == 'php') {
296 $file = dol_substr($file, 0, dol_strlen($file) - 4);
297
298 if (!class_exists($file)) {
299 require_once $dir.$file.'.php';
300
301 $module = new $file($db);
303 '@phan-var-force ModeleNumRefCommandes $module';
304
305 $arrayofmodules[] = $module;
306 }
307 }
308 }
309 closedir($handle);
310 }
311 }
312}
313
314$arrayofmodules = dol_sort_array($arrayofmodules, 'position');
316'@phan-var-force ModeleNumRefCommandes[] $arrayofmodules';
317
318foreach ($arrayofmodules as $module) {
319 $file = strtolower($module->getName($langs));
320 if (!preg_match('/^mod_commande_/', $file)) {
321 $file = 'mod_commande_'.$file;
322 }
323
324 // Show modules according to features level
325 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
326 continue;
327 }
328 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
329 continue;
330 }
331
332 if ($module->isEnabled()) {
333 print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
334 print $module->info($langs);
335 print '</td>';
336
337 // Show example of numbering model
338 print '<td class="nowrap">';
339 $tmp = $module->getExample();
340 if (preg_match('/^Error/', $tmp)) {
341 $langs->load("errors");
342 print '<div class="error">'.$langs->trans($tmp).'</div>';
343 } elseif ($tmp == 'NotConfigured') {
344 print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
345 } else {
346 print $tmp;
347 }
348 print '</td>'."\n";
349
350 print '<td class="center">';
351 if (getDolGlobalString('COMMANDE_ADDON') == $file) {
352 print img_picto($langs->trans("Activated"), 'switch_on');
353 } else {
354 print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.urlencode($file).'">';
355 print img_picto($langs->trans("Disabled"), 'switch_off');
356 print '</a>';
357 }
358 print '</td>';
359
360 $commande = new Commande($db);
361 $commande->initAsSpecimen();
362
363 // Info
364 $htmltooltip = '';
365 $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
366 $commande->type = 0;
367
368 $nextval = $module->getNextValue($mysoc, $commande);
369 if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
370 $htmltooltip .= ''.$langs->trans("NextValue").': ';
371 if ($nextval) {
372 if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
373 $langs->load('errors');
374 $nextval = $langs->trans($nextval);
375 }
376 $htmltooltip .= $nextval.'<br>';
377 } else {
378 $langs->load('errors');
379 $htmltooltip .= $langs->trans($module->error).'<br>';
380 }
381 }
382
383 print '<td class="center">';
384 print $form->textwithpicto('', $htmltooltip, 1, 'info');
385 print '</td>';
386
387 print "</tr>\n";
388 }
389}
390print "</table></div><br>\n";
391
392
393/*
394 * Document templates generators
395 */
396
397printDocumentModelList($type, 'commande', 'COMMANDE_ADDON_PDF', $langs->trans("OrdersModelModule"), array(
398 'Logo' => 'option_logo',
399 'PaymentMode' => 'option_modereg',
400 'PaymentConditions' => 'option_condreg',
401 'MultiLanguage' => 'option_multilang',
402 'WatermarkOnDraftOrders' => 'option_draft_watermark',
403));
404
405
406/*
407 * Payment mode
408 */
409
410print '<br>';
411print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInOrder"), '', '');
412
413print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" spellcheck="false">';
414print '<input type="hidden" name="token" value="'.newToken().'" />';
415
416print '<div class="div-table-responsive-no-min">';
417print '<table class="noborder centpercent">';
418
419print '<tr class="liste_titre">';
420print '<td>';
421print '<input type="hidden" name="action" value="setribchq">';
422print $langs->trans("PaymentMode").'</td>';
423print '<td align="right">';
424if (!isModEnabled('invoice')) {
425 print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
426}
427print '</td>';
428print "</tr>\n";
429
430print '<tr class="oddeven">';
431print "<td>".$langs->trans("SuggestPaymentByRIBOnAccount")."</td>";
432print "<td>";
433if (!isModEnabled('invoice')) {
434 if (isModEnabled("bank")) {
435 $sql = "SELECT rowid, label";
436 $sql .= " FROM ".MAIN_DB_PREFIX."bank_account";
437 $sql .= " WHERE clos = 0";
438 $sql .= " AND courant = 1";
439 $sql .= " AND entity IN (".getEntity('bank_account').")";
440 $resql = $db->query($sql);
441 if ($resql) {
442 $num = $db->num_rows($resql);
443 $i = 0;
444 if ($num > 0) {
445 print '<select name="rib" class="flat" id="rib">';
446 print '<option value="0">'.$langs->trans("DoNotSuggestPaymentMode").'</option>';
447 while ($i < $num) {
448 $row = $db->fetch_row($resql);
449
450 print '<option value="'.$row[0].'"';
451 print getDolGlobalString('FACTURE_RIB_NUMBER') == $row[0] ? ' selected' : '';
452 print '>'.$row[1].'</option>';
453
454 $i++;
455 }
456 print "</select>";
457 } else {
458 print "<i>".$langs->trans("NoActiveBankAccountDefined")."</i>";
459 }
460 }
461 } else {
462 print '<span class="opacitymedium">'.$langs->trans("BankModuleNotActive").'</span>';
463 }
464} else {
465 print '<span class="opacitymedium">'.$langs->trans("SeeSetupOfModule", $langs->transnoentitiesnoconv("Module30Name")).'</span>';
466}
467print "</td></tr>";
468
469print '<tr class="oddeven">';
470print "<td>".$langs->trans("SuggestPaymentByChequeToAddress")."</td>";
471print "<td>";
472if (!isModEnabled('invoice')) {
473 print '<select class="flat" name="chq" id="chq">';
474 print '<option value="0">'.$langs->trans("DoNotSuggestPaymentMode").'</option>';
475 print '<option value="-1"'.($conf->global->FACTURE_CHQ_NUMBER ? ' selected' : '').'>'.$langs->trans("MenuCompanySetup").' ('.($mysoc->name ? $mysoc->name : $langs->trans("NotDefined")).')</option>';
476
477 $sql = "SELECT rowid, label";
478 $sql .= " FROM ".MAIN_DB_PREFIX."bank_account";
479 $sql .= " WHERE clos = 0";
480 $sql .= " AND courant = 1";
481 $sql .= " AND entity IN (".getEntity('bank_account').")";
482
483 $resql = $db->query($sql);
484 if ($resql) {
485 $num = $db->num_rows($resql);
486 $i = 0;
487 while ($i < $num) {
488 $row = $db->fetch_row($resql);
489
490 print '<option value="'.$row[0].'"';
491 print getDolGlobalString('FACTURE_CHQ_NUMBER') == $row[0] ? ' selected' : '';
492 print '>'.$langs->trans("OwnerOfBankAccount", $row[1]).'</option>';
493
494 $i++;
495 }
496 }
497 print "</select>";
498} else {
499 print '<span class="opacitymedium">'.$langs->trans("SeeSetupOfModule", $langs->transnoentitiesnoconv("Module30Name")).'</span>';
500}
501print "</td></tr>";
502print "</table>";
503print '</div>';
504
505print "</form>";
506
507
508print '<br>';
509
510/*
511 * Other options
512 */
513
514print load_fiche_titre($langs->trans("OtherOptions"), '', '');
515
516print '<div class="div-table-responsive-no-min">';
517print '<table class="noborder centpercent">';
518print '<tr class="liste_titre">';
519print '<td>'.$langs->trans("Parameter").'</td>';
520print '<td class="center" width="60"></td>';
521print "<td>&nbsp;</td>\n";
522print "</tr>\n";
523
524$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
525$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
526$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
527foreach ($substitutionarray as $key => $val) {
528 $htmltext .= $key.'<br>';
529}
530$htmltext .= '</i>';
531
532print '<form action="'.$_SERVER["PHP_SELF"].'" method="post" spellcheck="false">';
533print '<input type="hidden" name="token" value="'.newToken().'">';
534print '<input type="hidden" name="action" value="set_ORDER_FREE_TEXT">';
535print '<tr class="oddeven"><td colspan="2">';
536print $form->textwithpicto($langs->trans("FreeLegalTextOnOrders"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
537$variablename = 'ORDER_FREE_TEXT';
538if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
539 print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
540} else {
541 include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
542 $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
543 print $doleditor->Create();
544}
545print '</td><td class="right">';
546print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
547print "</td></tr>\n";
548print '</form>';
549
550//Use draft Watermark
551
552print '<form method="post" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'" spellcheck="false">';
553print '<input type="hidden" name="token" value="'.newToken().'">';
554print '<input type="hidden" name="action" value="set_COMMANDE_DRAFT_WATERMARK">';
555print '<tr class="oddeven"><td>';
556print $form->textwithpicto($langs->trans("WatermarkOnDraftOrders"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
557print '</td><td>';
558print '<input class="flat minwidth200" type="text" name="COMMANDE_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('COMMANDE_DRAFT_WATERMARK')).'">';
559print '</td><td class="right">';
560print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
561print "</td></tr>\n";
562
563// Allow external download
564print '<tr class="oddeven">';
565print '<td>'.$langs->trans("AllowExternalDownload").'</td>';
566print '<td class="left" colspan="2">';
567print ajax_constantonoff('ORDER_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1);
568print '</td></tr>';
569print '</form>';
570
571// Disallow to classify billed an order without invoice, only if module invoice is enable
572if (isModEnabled('invoice')) {
573 print '<tr class="oddeven"><td>'.$langs->trans("InvoiceClassifyBilledSupplierOrderWithoutInvoice"). '&nbsp;' ;
574 print $form->textwithpicto('', $langs->trans("InvoiceClassifyBilledSupplierOrderWithoutInvoiceHelp"), 1, 'help') . '</td>';
575 print '<td class="left" colspan="2">';
576 print ajax_constantonoff('ORDER_DISABLE_CLASSIFY_BILLED_FROM_ORDER');
577 print '</td></tr>';
578}
579
580// Notifications
581print '<tr class="oddeven">';
582print '<td>'.img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("Notifications").'</td>';
583print '<td colspan="2">';
584print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification");
585print '</td></tr>';
586
587// More PDF options
588print '<tr class="oddeven">';
589print '<td>'.img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("MoreOptionsRelatedToPDF").'</td>';
590print '<td colspan="2">';
591print img_picto('', 'url', 'class="pictofixedwidth"').'<a href="'.DOL_URL_ROOT.'/admin/pdf_other.php">'.$langs->trans("SeeInPDFSetupPage").'</a>';
592print '</td></tr>';
593
594
595print '</table>';
596print '</div>';
597
598print '<br>';
599
600
601// End of page
602llxFooter();
603$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
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
Class to manage customers orders.
Class to manage a WYSIWYG editor.
Class to manage generation of HTML components Only common components must be here.
if(! $sortfield) if(! $sortorder) $module
Definition list.php:193
global $mysoc
dol_strlen($string, $stringencoding='UTF-8', $binarycount=0)
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
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, $nodefault=0)
Return value of a param into GET or POST supervariable.
dol_substr($string, $start, $length=null, $stringencoding='', $trunconbytes=0)
Make a substring.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
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.
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.
Definition html.lib.php:542
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
order_admin_prepare_head()
Return array head with list of tabs to view object information.
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:1180
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.