dolibarr 25.0.0-alpha
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-2026 MDW <mdeweerd@users.noreply.github.com>
10 * Copyright (C) 2024-2026 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 * Copyright (C) 2026 Joachim Kueter <git-jk@bloxera.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';
37
47require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
48require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
49if (getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) {
50 require_once DOL_DOCUMENT_ROOT . '/core/lib/supplier_order.lib.php';
51} else {
52 require_once DOL_DOCUMENT_ROOT . '/core/lib/fourn.lib.php';
53}
54require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
55require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
56
57
58// Load translation files required by the page
59$langs->loadLangs(array("admin", "other", "orders", "stocks"));
60
61$action = GETPOST('action', 'aZ09');
62
63$type = GETPOST('type', 'alpha');
64$value = GETPOST('value', 'alpha');
65$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
66
67$label = GETPOST('label', 'alpha');
68$scandir = GETPOST('scan_dir', 'alpha');
69
70$specimenthirdparty = new Societe($db);
71$specimenthirdparty->initAsSpecimen();
72
73$error = 0;
74
75if (!$user->admin) {
77}
78
79
80/*
81 * Actions
82 */
83
84include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
85
86if ($action == 'updateMask') {
87 $maskconstorder = GETPOST('maskconstorder', 'aZ09');
88 $maskvalue = GETPOST('maskorder', 'alpha');
89
90 $res = 0;
91
92 if ($maskconstorder && preg_match('/_MASK$/', $maskconstorder)) {
93 $res = dolibarr_set_const($db, $maskconstorder, $maskvalue, 'chaine', 0, '', $conf->entity);
94 }
95
96 if (!($res > 0)) {
97 $error++;
98 }
99
100 if (!$error) {
101 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
102 } else {
103 setEventMessages($langs->trans("Error"), null, 'errors');
104 }
105}
106
107if ($action == 'specimen') { // For orders
108 $modele = GETPOST('module', 'alpha');
109
110 $commande = new CommandeFournisseur($db);
111 $commande->initAsSpecimen();
112 $commande->thirdparty = $specimenthirdparty;
113
114 // Search template files
115 $file = '';
116 $classname = '';
117 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
118 foreach ($dirmodels as $reldir) {
119 $file = dol_buildpath($reldir."core/modules/supplier_order/doc/pdf_".$modele.".modules.php", 0);
120 if (file_exists($file)) {
121 $classname = "pdf_".$modele;
122 break;
123 }
124 }
125
126 if ($classname !== '') {
127 require_once $file;
128
129 $module = new $classname($db, $commande);
130 '@phan-var-force ModelePDFSuppliersOrders $module';
131
132 if ($module->write_file($commande, $langs) > 0) {
133 header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande_fournisseur&file=SPECIMEN.pdf");
134 return;
135 } else {
136 setEventMessages($module->error, $module->errors, 'errors');
137 dol_syslog($module->error, LOG_ERR);
138 }
139 } else {
140 setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
141 dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
142 }
143} elseif ($action == 'set') {
144 // Activate a model
145 $ret = addDocumentModel($value, $type, $label, $scandir);
146} elseif ($action == 'del') {
147 $ret = delDocumentModel($value, $type);
148 if ($ret > 0) {
149 if (getDolGlobalString('COMMANDE_SUPPLIER_ADDON_PDF') == "$value") {
150 dolibarr_del_const($db, 'COMMANDE_SUPPLIER_ADDON_PDF', $conf->entity);
151 }
152 }
153} elseif ($action == 'setdoc') {
154 // Set default model
155 if (dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
156 // The constant that was read before the new set
157 // so we go through a variable to get a consistent display
158 $conf->global->COMMANDE_SUPPLIER_ADDON_PDF = $value;
159 }
160
161 // On active le modele
162 $ret = delDocumentModel($value, $type);
163 if ($ret > 0) {
164 $ret = addDocumentModel($value, $type, $label, $scandir);
165 }
166} elseif ($action == 'unsetdoc') {
167 dolibarr_del_const($db, "COMMANDE_SUPPLIER_ADDON_PDF", $conf->entity);
168} elseif ($action == 'setmod') {
169 // TODO Verify if the chosen numbering module can be activated
170 // by calling method canBeActivated
171
172 dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity);
173} elseif ($action == 'addcat') {
174 $fourn = new Fournisseur($db);
175 $fourn->CreateCategory($user, GETPOST('cat', 'alphanohtml'));
176} elseif ($action == 'set_SUPPLIER_ORDER_OTHER') {
177 $freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
178 $doubleapproval = GETPOST('SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED', 'alpha');
179 $doubleapproval = price2num($doubleapproval);
180
181 $res1 = dolibarr_set_const($db, "SUPPLIER_ORDER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
182 $res2 = dolibarr_set_const($db, "SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED", $doubleapproval, 'chaine', 0, '', $conf->entity);
183
184 // TODO We add/delete permission here until permission can have a condition on a global var
185 include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
186 $newmodule = new modFournisseur($db);
187
188 if (getDolGlobalString('SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED')) {
189 // clear default rights array
190 $newmodule->rights = array();
191 // add new right
192 $r = 0;
193 $newmodule->rights[$r][0] = 1190;
194 $newmodule->rights[$r][1] = $langs->trans("Permission1190");
195 $newmodule->rights[$r][2] = 'w';
196 $newmodule->rights[$r][3] = 0;
197 $newmodule->rights[$r][4] = 'commande';
198 $newmodule->rights[$r][5] = 'approve2';
199
200 // Insert
201 $newmodule->insert_permissions(1);
202 } else {
203 // Remove all rights with Permission1190
204 $newmodule->delete_permissions();
205
206 // Add all right without Permission1190
207 $newmodule->insert_permissions(1);
208 }
209} elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER') {
210 // Activate ask for payment bank
211 $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER", $value, 'chaine', 0, '', $conf->entity);
212
213 if (!($res > 0)) {
214 $error++;
215 }
216
217 if (!$error) {
218 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
219 } else {
220 setEventMessages($langs->trans("Error"), null, 'errors');
221 }
222}
223
224
225/*
226* View
227*/
228
229$form = new Form($db);
230
231$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
232
233llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-supplier_order');
234
235$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>';
236
237print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup');
238
239if (getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD')) {
240 $head = supplier_order_admin_prepare_head();
241} else {
243}
244
245print dol_get_fiche_head($head, 'order', $langs->trans("Suppliers"), -1, 'company');
246
247
248// Supplier order numbering module
249
250$commande = new CommandeFournisseur($db);
251$commande->initAsSpecimen();
252
253printNumberingModuleList('supplier_order', 'mod_commande_fournisseur_', 'COMMANDE_SUPPLIER_ADDON_NUMBER', $langs->trans("SupplierOrdersNumberingModules"), $commande);
254
255print '<br>';
256
257
258/*
259 * Documents models for supplier orders
260 */
261
262print load_fiche_titre($langs->trans("OrdersModelModule"), '', '');
263
264// Define array def of model
265$def = array();
266
267$sql = "SELECT nom";
268$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
269$sql .= " WHERE type = 'order_supplier'";
270$sql .= " AND entity = ".((int) $conf->entity);
271
272$resql = $db->query($sql);
273if ($resql) {
274 $i = 0;
275 $num_rows = $db->num_rows($resql);
276 while ($i < $num_rows) {
277 $array = $db->fetch_array($resql);
278 if (is_array($array)) {
279 array_push($def, $array[0]);
280 }
281 $i++;
282 }
283} else {
284 dol_print_error($db);
285}
286
287print '<div class="div-table-responsive-no-min">';
288print '<table class="noborder centpercent">'."\n";
289print '<tr class="liste_titre">'."\n";
290print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
291print '<td>'.$langs->trans("Description").'</td>'."\n";
292print '<td align="center" width="60">'.$langs->trans("Status").'</td>'."\n";
293print '<td align="center" width="60">'.$langs->trans("Default").'</td>'."\n";
294print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>';
295print '<td align="center" width="40">'.$langs->trans("Preview").'</td>';
296print '</tr>'."\n";
297
298clearstatcache();
299
300foreach ($dirmodels as $reldir) {
301 $realpath = $reldir."core/modules/supplier_order/doc";
302 $dir = dol_buildpath($realpath);
303
304 if (is_dir($dir)) {
305 $handle = opendir($dir);
306 if (is_resource($handle)) {
307 while (($file = readdir($handle)) !== false) {
308 if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
309 $name = dol_substr($file, 4, dol_strlen($file) - 16);
310 $classname = dol_substr($file, 0, dol_strlen($file) - 12);
311
312 require_once $dir.'/'.$file;
313 $module = new $classname($db, new CommandeFournisseur($db));
314
315 '@phan-var-force ModelePDFSuppliersOrders $module';
316
317 print "<tr class=\"oddeven\">\n";
318 print "<td>";
319 print(empty($module->name) ? $name : $module->name);
320 print "</td>\n";
321 print "<td>\n";
322 require_once $dir.'/'.$file;
323 $module = new $classname($db, $specimenthirdparty);
324 '@phan-var-force ModelePDFSuppliersOrders $module';
325 if (method_exists($module, 'info')) {
326 print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
327 } else {
328 print $module->description;
329 }
330 print "</td>\n";
331
332 // Active
333 if (in_array($name, $def)) {
334 print '<td class="center">'."\n";
335 if (getDolGlobalString('COMMANDE_SUPPLIER_ADDON_PDF') != "$name") {
336 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">';
337 print img_picto($langs->trans("Enabled"), 'switch_on');
338 print '</a>';
339 } else {
340 print img_picto($langs->trans("Enabled"), 'switch_on');
341 }
342 print "</td>";
343 } else {
344 print '<td class="center">'."\n";
345 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>';
346 print "</td>";
347 }
348
349 // Default
350 print '<td class="center">';
351 if (getDolGlobalString('COMMANDE_SUPPLIER_ADDON_PDF') == "$name") {
352 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>';
353 } else {
354 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>';
355 }
356 print '</td>';
357
358 // Info
359 $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
360 $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
361 $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
362 $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
363
364 $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
365 $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
366 $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
367 $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
368 print '<td class="center">';
369 print $form->textwithpicto('', $htmltooltip, 1, 'info');
370 print '</td>';
371 print '<td class="center">';
372 print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.urlencode($name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
373 print '</td>';
374
375 print "</tr>\n";
376 }
377 }
378
379 closedir($handle);
380 }
381 }
382}
383
384print '</table></div><br>';
385
386/*
387 * Other options
388 */
389
390print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
391print '<input type="hidden" name="token" value="'.newToken().'">';
392print '<input type="hidden" name="action" value="set_SUPPLIER_ORDER_OTHER">';
393
394print load_fiche_titre($langs->trans("OtherOptions"), '', '');
395
396print '<div class="div-table-responsive-no-min">';
397print '<table class="noborder centpercent">';
398print '<tr class="liste_titre">';
399print '<td>'.$langs->trans("Parameter").'</td>';
400print '<td></td>';
401print '<td width="80">&nbsp;</td>';
402print "</tr>\n";
403
404print '<tr class="oddeven"><td>';
405print $form->textwithpicto($langs->trans("UseDoubleApproval"), $langs->trans("Use3StepsApproval"), 1, 'help').'<br>';
406print '<span class="opacitymedium">'.$langs->trans("IfSetToYesDontForgetPermission").'</span>';
407print '</td><td>';
408print '<input type="text" size="6" name="SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED" value="'.getDolGlobalString("SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED").'">';
409print '</td><td class="right">';
410print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
411print "</td></tr>\n";
412
413$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
414$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
415$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
416foreach ($substitutionarray as $key => $val) {
417 $htmltext .= $key.'<br>';
418}
419$htmltext .= '</i>';
420
421print '<tr class="oddeven"><td colspan="2">';
422print $form->textwithpicto($langs->trans("FreeLegalTextOnSupplierOrders"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
423$variablename = 'SUPPLIER_ORDER_FREE_TEXT';
424if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
425 print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
426} else {
427 include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
428 $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
429 print $doleditor->Create();
430}
431print '</td><td class="right">';
432print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
433print "</td></tr>\n";
434
435// Option to add a quality/validation step, on products, after reception.
436print '<tr class="oddeven">';
437print '<td>'.$langs->trans("UseDispatchStatus").'</td>';
438print '<td colspan="2">';
439if (isModEnabled('reception')) {
440 print '<span class="opacitymedium">'.$langs->trans("FeatureNotAvailableWithReceptionModule").'</span>';
441} else {
442 if ($conf->use_javascript_ajax) {
443 print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS');
444 } else {
445 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
446 print $form->selectarray("SUPPLIER_ORDER_USE_DISPATCH_STATUS", $arrval, $conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS);
447 }
448}
449print "</td>\n";
450print "</tr>\n";
451
452
453// Disallow to classify billed a supplier order without invoice
454print '<tr class="oddeven"><td>'.$langs->trans("SupplierOrderClassifyBilledWithoutInvoice"). '&nbsp;' ;
455print $form->textwithpicto('', $langs->trans("SupplierOrderClassifyBilledWithoutInvoiceHelp"), 1, 'help') . '</td>';
456print '<td colspan="2">';
457print ajax_constantonoff('SUPPLIER_ORDER_DISABLE_CLASSIFY_BILLED_FROM_SUPPLIER_ORDER');
458print '</td></tr>';
459
460// Allow external download
461print '<tr class="oddeven">';
462print '<td>'.$langs->trans("AllowExternalDownload").'</td>';
463print '<td class="left" colspan="2">';
464print ajax_constantonoff('SUPPLIER_ORDER_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1);
465print '</td></tr>';
466
467// Propose to update the supplier price and the cost price of the products when placing the order
468print '<tr class="oddeven"><td>'.$langs->trans("SupplierOrderUpdateBuyingPriceWhenOrdering").'</td>';
469print '<td colspan="2">';
470print ajax_constantonoff('SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_ON_ORDER');
471print '</td></tr>';
472
473// Notifications
474print '<tr class="oddeven">';
475print '<td>'.img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("Notifications").'</td>';
476print '<td colspan="2">';
477print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification");
478print '</td></tr>';
479
480// More PDF options
481print '<tr class="oddeven">';
482print '<td>'.img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("MoreOptionsRelatedToPDF").'</td>';
483print '<td colspan="2">';
484print img_picto('', 'url', 'class="pictofixedwidth"').'<a href="'.DOL_URL_ROOT.'/admin/pdf_other.php">'.$langs->trans("SeeInPDFSetupPage").'</a>';
485print '</td></tr>';
486
487
488print '</table></div><br>';
489
490print '</form>';
491
492
493// End of page
494llxFooter();
495$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 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...)
if(! $sortfield) if(! $sortorder) $module
Definition list.php:193
supplierorder_admin_prepare_head()
Return array head with list of tabs to view object information.
price2num($amount, $rounding='', $option=0, $currencycode='')
Function that return a number with universal decimal format (decimal separator is '.
dol_strlen($string, $stringencoding='UTF-8', $binarycount=0)
Make a strlen call.
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.
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
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:165
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.