dolibarr 20.0.0
contract.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
3 * Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
4 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
5 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
27// Load Dolibarr environment
28require '../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
30require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
31require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
32require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
33
34// Load translation files required by the page
35$langs->loadLangs(array("admin", "errors", "contracts"));
36
37if (!$user->admin) {
39}
40
41$action = GETPOST('action', 'aZ09');
42$value = GETPOST('value', 'alpha');
43$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
44
45$label = GETPOST('label', 'alpha');
46$scandir = GETPOST('scan_dir', 'alpha');
47$type = 'contract';
48
49if (!getDolGlobalString('CONTRACT_ADDON')) {
50 $conf->global->CONTRACT_ADDON = 'mod_contract_serpis';
51}
52
53
54/*
55 * Actions
56 */
57
58include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
59
60$error = 0;
61
62if ($action == 'updateMask') {
63 $maskconst = GETPOST('maskconstcontract', 'aZ09');
64 $maskvalue = GETPOST('maskcontract', 'alpha');
65 if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
66 $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
67 }
68
69 if (!($res > 0)) {
70 $error++;
71 }
72
73 if (!$error) {
74 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
75 } else {
76 setEventMessages($langs->trans("Error"), null, 'errors');
77 }
78} elseif ($action == 'specimen') { // For contract
79 $modele = GETPOST('module', 'alpha');
80
81 $contract = new Contrat($db);
82 $contract->initAsSpecimen();
83
84 // Search template files
85 $file = '';
86 $classname = '';
87 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
88 foreach ($dirmodels as $reldir) {
89 $file = dol_buildpath($reldir."core/modules/contract/doc/pdf_".$modele.".modules.php", 0);
90 if (file_exists($file)) {
91 $classname = "pdf_".$modele;
92 break;
93 }
94 }
95
96 if ($classname !== '') {
97 require_once $file;
98
99 $module = new $classname($db);
100 '@phan-var-force ModelePDFContract $module';
101
102 if ($module->write_file($contract, $langs) > 0) {
103 header("Location: ".DOL_URL_ROOT."/document.php?modulepart=contract&file=SPECIMEN.pdf");
104 return;
105 } else {
106 setEventMessages($obj->error, $obj->errors, 'errors');
107 dol_syslog($obj->error, LOG_ERR);
108 }
109 } else {
110 setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
111 dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
112 }
113} elseif ($action == 'set') {
114 // Activate a model
115 $ret = addDocumentModel($value, $type, $label, $scandir);
116} elseif ($action == 'del') {
117 $ret = delDocumentModel($value, $type);
118 if ($ret > 0) {
119 if ($conf->global->CONTRACT_ADDON_PDF == "$value") {
120 dolibarr_del_const($db, 'CONTRACT_ADDON_PDF', $conf->entity);
121 }
122 }
123} elseif ($action == 'setdoc') {
124 // Set default model
125 if (dolibarr_set_const($db, "CONTRACT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
126 // La constante qui a ete lue en avant du nouveau set
127 // on passe donc par une variable pour avoir un affichage coherent
128 $conf->global->CONTRACT_ADDON_PDF = $value;
129 }
130
131 // On active le modele
132 $ret = delDocumentModel($value, $type);
133 if ($ret > 0) {
134 $ret = addDocumentModel($value, $type, $label, $scandir);
135 }
136} elseif ($action == 'unsetdoc') {
137 dolibarr_del_const($db, "CONTRACT_ADDON_PDF", $conf->entity);
138} elseif ($action == 'setmod') {
139 // TODO Verify si the chosen numbering module can be activated by
140 // the method call canBeActivated
141
142 dolibarr_set_const($db, "CONTRACT_ADDON", $value, 'chaine', 0, '', $conf->entity);
143} elseif ($action == 'set_other') {
144 $freetext = GETPOST('CONTRACT_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
145 $res1 = dolibarr_set_const($db, "CONTRACT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
146
147 $draft = GETPOST('CONTRACT_DRAFT_WATERMARK', 'alpha');
148 $res2 = dolibarr_set_const($db, "CONTRACT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
149
150 $value = GETPOST('activate_hideClosedServiceByDefault', 'alpha');
151 $res3 = dolibarr_set_const($db, "CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT", $value, 'chaine', 0, '', $conf->entity);
152
153 if (!($res1 > 0) || !($res2 > 0) || !($res3 > 0)) {
154 $error++;
155 }
156
157 if (!$error) {
158 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
159 } else {
160 setEventMessages($langs->trans("Error"), null, 'errors');
161 }
162} elseif ($action == "allowonlinesign") {
163 if (!dolibarr_set_const($db, "CONTRACT_ALLOW_ONLINESIGN", $value, 'int', 0, '', $conf->entity)) {
164 $error++;
165 }
166} elseif (preg_match('/set_(.*)/', $action, $reg)) {
167 $code = $reg[1];
168 $value = (GETPOST($code) ? GETPOST($code) : 1);
169
170 $res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
171 if (!($res > 0)) {
172 $error++;
173 }
174
175 if ($error) {
176 setEventMessages($langs->trans('Error'), null, 'errors');
177 } else {
178 setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
179 header("Location: " . $_SERVER["PHP_SELF"]);
180 exit();
181 }
182} elseif (preg_match('/del_(.*)/', $action, $reg)) {
183 $code = $reg[1];
184 $res = dolibarr_del_const($db, $code, $conf->entity);
185
186 if (!($res > 0)) {
187 $error++;
188 }
189
190 if ($error) {
191 setEventMessages($langs->trans('Error'), null, 'errors');
192 } else {
193 setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
194 header("Location: " . $_SERVER["PHP_SELF"]);
195 exit();
196 }
197}
198
199
200
201/*
202 * View
203 */
204
205$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
206
207llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-contract');
208
209$form = new Form($db);
210
211$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
212print load_fiche_titre($langs->trans("ContractsSetup"), $linkback, 'title_setup');
213
215
216print dol_get_fiche_head($head, 'contract', $langs->trans("Contracts"), -1, 'contract');
217
218/*
219 * Contracts Numbering model
220 */
221
222print load_fiche_titre($langs->trans("ContractsNumberingModules"), '', '');
223
224print '<div class="div-table-responsive-no-min">';
225print '<table class="noborder centpercent">';
226print '<tr class="liste_titre">';
227print '<td width="100">'.$langs->trans("Name").'</td>';
228print '<td>'.$langs->trans("Description").'</td>';
229print '<td>'.$langs->trans("Example").'</td>';
230print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
231print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
232print "</tr>\n";
233
234clearstatcache();
235
236foreach ($dirmodels as $reldir) {
237 $dir = dol_buildpath($reldir."core/modules/contract/");
238
239 if (is_dir($dir)) {
240 $handle = opendir($dir);
241 if (is_resource($handle)) {
242 while (($file = readdir($handle)) !== false) {
243 if (substr($file, 0, 13) == 'mod_contract_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
244 $file = substr($file, 0, dol_strlen($file) - 4);
245
246 require_once $dir.$file.'.php';
248 $module = new $file($db);
249
250 // Show modules according to features level
251 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
252 continue;
253 }
254 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
255 continue;
256 }
257
258 if ($module->isEnabled()) {
259 print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
260 print $module->info($langs);
261 print '</td>';
262
263 // Show example of numbering model
264 print '<td class="nowrap">';
265 $tmp = $module->getExample();
266 if (preg_match('/^Error/', $tmp)) {
267 $langs->load("errors");
268 print '<div class="error">'.$langs->trans($tmp).'</div>';
269 } elseif ($tmp == 'NotConfigured') {
270 print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
271 } else {
272 print $tmp;
273 }
274 print '</td>'."\n";
275
276 print '<td class="center">';
277 if ($conf->global->CONTRACT_ADDON == "$file") {
278 print img_picto($langs->trans("Activated"), 'switch_on');
279 } else {
280 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.urlencode($file).'">';
281 print img_picto($langs->trans("Disabled"), 'switch_off');
282 print '</a>';
283 }
284 print '</td>';
285
286 $contract = new Contrat($db);
287 $contract->initAsSpecimen();
288
289 // Info
290 $htmltooltip = '';
291 $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
292 $nextval = $module->getNextValue($mysoc, $contract);
293 if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
294 $htmltooltip .= ''.$langs->trans("NextValue").': ';
295 if ($nextval) {
296 if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
297 $nextval = $langs->trans($nextval);
298 }
299 $htmltooltip .= $nextval.'<br>';
300 } else {
301 $htmltooltip .= $langs->trans($module->error).'<br>';
302 }
303 }
304
305 print '<td class="center">';
306 print $form->textwithpicto('', $htmltooltip, 1, 0);
307 print '</td>';
308
309 print '</tr>';
310 }
311 }
312 }
313 closedir($handle);
314 }
315 }
316}
317
318print '</table></div><br>';
319
320/*
321 * Documents models for Contracts
322 */
323
324print load_fiche_titre($langs->trans("TemplatePDFContracts"), '', '');
325
326// Defini tableau def des modeles
327$def = array();
328$sql = "SELECT nom";
329$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
330$sql .= " WHERE type = '".$db->escape($type)."'";
331$sql .= " AND entity = ".$conf->entity;
332$resql = $db->query($sql);
333if ($resql) {
334 $i = 0;
335 $num_rows = $db->num_rows($resql);
336 while ($i < $num_rows) {
337 $array = $db->fetch_array($resql);
338 if (is_array($array)) {
339 array_push($def, $array[0]);
340 }
341 $i++;
342 }
343} else {
344 dol_print_error($db);
345}
346
347
348print '<div class="div-table-responsive-no-min">';
349print '<table class="noborder centpercent">';
350print '<tr class="liste_titre">';
351print '<td>'.$langs->trans("Name").'</td>';
352print '<td>'.$langs->trans("Description").'</td>';
353print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
354print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
355print '<td class="center" width="80">'.$langs->trans("ShortInfo").'</td>';
356print '<td class="center" width="80">'.$langs->trans("Preview").'</td>';
357print "</tr>\n";
358
359clearstatcache();
360
361foreach ($dirmodels as $reldir) {
362 foreach (array('', '/doc') as $valdir) {
363 $realpath = $reldir."core/modules/contract".$valdir;
364 $dir = dol_buildpath($realpath);
365
366 if (is_dir($dir)) {
367 $handle = opendir($dir);
368 if (is_resource($handle)) {
369 $filelist = array();
370 while (($file = readdir($handle)) !== false) {
371 $filelist[] = $file;
372 }
373 closedir($handle);
374 arsort($filelist);
375
376 foreach ($filelist as $file) {
377 if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
378 if (file_exists($dir.'/'.$file)) {
379 $name = substr($file, 4, dol_strlen($file) - 16);
380 $classname = substr($file, 0, dol_strlen($file) - 12);
381
382 require_once $dir.'/'.$file;
384 $module = new $classname($db);
385
386 $modulequalified = 1;
387 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
388 $modulequalified = 0;
389 }
390 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
391 $modulequalified = 0;
392 }
393
394 if ($modulequalified) {
395 print '<tr class="oddeven"><td width="100">';
396 print(empty($module->name) ? $name : $module->name);
397 print "</td><td>\n";
398 if (method_exists($module, 'info')) {
399 print $module->info($langs);
400 } else {
401 print $module->description;
402 }
403 print '</td>';
404
405 // Active
406 if (in_array($name, $def)) {
407 print '<td class="center">'."\n";
408 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'">';
409 print img_picto($langs->trans("Enabled"), 'switch_on');
410 print '</a>';
411 print '</td>';
412 } else {
413 print '<td class="center">'."\n";
414 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
415 print "</td>";
416 }
417
418 // Default
419 print '<td class="center">';
420 if (getDolGlobalString('CONTRACT_ADDON_PDF') == $name) {
421 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>';
422 } else {
423 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
424 }
425 print '</td>';
426
427 // Info
428 $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
429 $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
430 if ($module->type == 'pdf') {
431 $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
432 }
433 $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
434
435 $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
436 $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
437 $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
438 $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
439 $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
440 $htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
441
442
443 print '<td class="center">';
444 print $form->textwithpicto('', $htmltooltip, 1, 0);
445 print '</td>';
446
447 // Preview
448 print '<td class="center">';
449 if ($module->type == 'pdf') {
450 print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
451 } else {
452 print img_object($langs->trans("PreviewNotAvailable"), 'generic');
453 }
454 print '</td>';
455
456 print "</tr>\n";
457 }
458 }
459 }
460 }
461 }
462 }
463 }
464}
465
466print '</table>';
467print '</div>';
468print "<br>";
469
470/*
471 * Other options
472 *
473 */
474
475print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
476print '<input type="hidden" name="token" value="'.newToken().'">';
477print '<input type="hidden" name="action" value="set_other">';
478
479print load_fiche_titre($langs->trans("OtherOptions"), '', '');
480
481print '<div class="div-table-responsive-no-min">';
482print '<table class="noborder centpercent">';
483print '<tr class="liste_titre">';
484print '<td>'.$langs->trans("Parameter").'</td>';
485print '<td class="right">'.$langs->trans("Value").'</td>';
486print "</tr>\n";
487
488$substitutionarray = pdf_getSubstitutionArray($langs, array('objectamount'), null, 2);
489$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
490$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
491foreach ($substitutionarray as $key => $val) {
492 $htmltext .= $key.'<br>';
493}
494$htmltext .= '</i>';
495
496print '<tr class="oddeven"><td colspan="2">';
497print $form->textwithpicto($langs->trans("FreeLegalTextOnContracts"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'tooltiphelp');
498print '<br>';
499$variablename = 'CONTRACT_FREE_TEXT';
500if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
501 print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
502} else {
503 include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
504 $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
505 print $doleditor->Create();
506}
507print '</td></tr>'."\n";
508
509//Use draft Watermark
510
511print '<tr class="oddeven"><td>';
512print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
513print '</td><td class="right">';
514print '<input class="flat minwidth200" type="text" name="CONTRACT_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('CONTRACT_DRAFT_WATERMARK')).'">';
515print '</td></tr>'."\n";
516
517print '<tr class="oddeven">';
518print '<td>'.$langs->trans("HideClosedServiceByDefault").'</td>';
519print '<td class="right">';
520print $form->selectyesno("activate_hideClosedServiceByDefault", getDolGlobalInt('CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT', 0), 1);
521print '</td>';
522print '</tr>';
523
524// Allow online signing
525print '<tr class="oddeven">';
526print '<td>'.$langs->trans("AllowOnlineSign").'</td>';
527print '<td class="right">';
528if (getDolGlobalString('CONTRACT_ALLOW_ONLINESIGN')) {
529 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=allowonlinesign&token='.newToken().'&value=0">';
530 print img_picto($langs->trans("Activated"), 'switch_on');
531 print '</a>';
532} else {
533 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=allowonlinesign&token='.newToken().'&value=1">';
534 print img_picto($langs->trans("Disabled"), 'switch_off');
535 print '</a>';
536}
537print '</td>';
538print '</tr>';
539
540// Allow external download
541print '<tr class="oddeven">';
542print '<td>'.$langs->trans("AllowExternalDownload").'</td>';
543print '<td class="right">';
544print ajax_constantonoff('CONTRACT_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1);
545print '</td>';
546print '</tr>';
547print '</table>';
548print '</div>';
549
550print $form->buttonsSaveCancel("Save", '');
551
552print '</form>';
553
554print dol_get_fiche_end();
555
556// End of page
557llxFooter();
558$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.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:55
llxFooter()
Empty footer.
Definition wrapper.php:69
Class to manage contracts.
Class to manage a WYSIWYG editor.
Class to manage generation of HTML components Only common components must be here.
contract_admin_prepare_head()
Return array head with list of tabs to view object information.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
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...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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:769
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:142
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.