dolibarr 21.0.0-alpha
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 $res = 0;
66 if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
67 $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
68 }
69
70 if (!($res > 0)) {
71 $error++;
72 }
73
74 if (!$error) {
75 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
76 } else {
77 setEventMessages($langs->trans("Error"), null, 'errors');
78 }
79} elseif ($action == 'specimen') { // For contract
80 $modele = GETPOST('module', 'alpha');
81
82 $contract = new Contrat($db);
83 $contract->initAsSpecimen();
84
85 // Search template files
86 $file = '';
87 $classname = '';
88 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
89 foreach ($dirmodels as $reldir) {
90 $file = dol_buildpath($reldir."core/modules/contract/doc/pdf_".$modele.".modules.php", 0);
91 if (file_exists($file)) {
92 $classname = "pdf_".$modele;
93 break;
94 }
95 }
96
97 if ($classname !== '') {
98 require_once $file;
99
100 $module = new $classname($db);
101 '@phan-var-force ModelePDFContract $module';
102
104 if ($module->write_file($contract, $langs) > 0) {
105 header("Location: ".DOL_URL_ROOT."/document.php?modulepart=contract&file=SPECIMEN.pdf");
106 return;
107 } else {
108 setEventMessages($module->error, $module->errors, 'errors');
109 dol_syslog($module->error, LOG_ERR);
110 }
111 } else {
112 setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
113 dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
114 }
115} elseif ($action == 'set') {
116 // Activate a model
117 $ret = addDocumentModel($value, $type, $label, $scandir);
118} elseif ($action == 'del') {
119 $ret = delDocumentModel($value, $type);
120 if ($ret > 0) {
121 if ($conf->global->CONTRACT_ADDON_PDF == "$value") {
122 dolibarr_del_const($db, 'CONTRACT_ADDON_PDF', $conf->entity);
123 }
124 }
125} elseif ($action == 'setdoc') {
126 // Set default model
127 if (dolibarr_set_const($db, "CONTRACT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
128 // La constante qui a ete lue en avant du nouveau set
129 // on passe donc par une variable pour avoir un affichage coherent
130 $conf->global->CONTRACT_ADDON_PDF = $value;
131 }
132
133 // On active le modele
134 $ret = delDocumentModel($value, $type);
135 if ($ret > 0) {
136 $ret = addDocumentModel($value, $type, $label, $scandir);
137 }
138} elseif ($action == 'unsetdoc') {
139 dolibarr_del_const($db, "CONTRACT_ADDON_PDF", $conf->entity);
140} elseif ($action == 'setmod') {
141 // TODO Verify si the chosen numbering module can be activated by
142 // the method call canBeActivated
143
144 dolibarr_set_const($db, "CONTRACT_ADDON", $value, 'chaine', 0, '', $conf->entity);
145} elseif ($action == 'set_other') {
146 $freetext = GETPOST('CONTRACT_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
147 $res1 = dolibarr_set_const($db, "CONTRACT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
148
149 $draft = GETPOST('CONTRACT_DRAFT_WATERMARK', 'alpha');
150 $res2 = dolibarr_set_const($db, "CONTRACT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
151
152 $value = GETPOST('activate_hideClosedServiceByDefault', 'alpha');
153 $res3 = dolibarr_set_const($db, "CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT", $value, 'chaine', 0, '', $conf->entity);
154
155 if (!($res1 > 0) || !($res2 > 0) || !($res3 > 0)) {
156 $error++;
157 }
158
159 if (!$error) {
160 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
161 } else {
162 setEventMessages($langs->trans("Error"), null, 'errors');
163 }
164} elseif ($action == "allowonlinesign") {
165 if (!dolibarr_set_const($db, "CONTRACT_ALLOW_ONLINESIGN", $value, 'int', 0, '', $conf->entity)) {
166 $error++;
167 }
168} elseif (preg_match('/set_(.*)/', $action, $reg)) {
169 $code = $reg[1];
170 $value = (GETPOST($code) ? GETPOST($code) : 1);
171
172 $res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
173 if (!($res > 0)) {
174 $error++;
175 }
176
177 if ($error) {
178 setEventMessages($langs->trans('Error'), null, 'errors');
179 } else {
180 setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
181 header("Location: " . $_SERVER["PHP_SELF"]);
182 exit();
183 }
184} elseif (preg_match('/del_(.*)/', $action, $reg)) {
185 $code = $reg[1];
186 $res = dolibarr_del_const($db, $code, $conf->entity);
187
188 if (!($res > 0)) {
189 $error++;
190 }
191
192 if ($error) {
193 setEventMessages($langs->trans('Error'), null, 'errors');
194 } else {
195 setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
196 header("Location: " . $_SERVER["PHP_SELF"]);
197 exit();
198 }
199}
200
201
202
203/*
204 * View
205 */
206
207$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
208
209llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-contract');
210
211$form = new Form($db);
212
213$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
214print load_fiche_titre($langs->trans("ContractsSetup"), $linkback, 'title_setup');
215
217
218print dol_get_fiche_head($head, 'contract', $langs->trans("Contracts"), -1, 'contract');
219
220/*
221 * Contracts Numbering model
222 */
223
224print load_fiche_titre($langs->trans("ContractsNumberingModules"), '', '');
225
226print '<div class="div-table-responsive-no-min">';
227print '<table class="noborder centpercent">';
228print '<tr class="liste_titre">';
229print '<td width="100">'.$langs->trans("Name").'</td>';
230print '<td>'.$langs->trans("Description").'</td>';
231print '<td>'.$langs->trans("Example").'</td>';
232print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
233print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
234print "</tr>\n";
235
236clearstatcache();
237
238foreach ($dirmodels as $reldir) {
239 $dir = dol_buildpath($reldir."core/modules/contract/");
240
241 if (is_dir($dir)) {
242 $handle = opendir($dir);
243 if (is_resource($handle)) {
244 while (($file = readdir($handle)) !== false) {
245 if (substr($file, 0, 13) == 'mod_contract_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
246 $file = substr($file, 0, dol_strlen($file) - 4);
247
248 require_once $dir.$file.'.php';
250 $module = new $file($db);
251
252 '@phan-var-force ModelNumRefContracts $module';
253
254 // Show modules according to features level
255 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
256 continue;
257 }
258 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
259 continue;
260 }
261
262 if ($module->isEnabled()) {
263 print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
264 print $module->info($langs);
265 print '</td>';
266
267 // Show example of numbering model
268 print '<td class="nowrap">';
269 $tmp = $module->getExample();
270 if (preg_match('/^Error/', $tmp)) {
271 $langs->load("errors");
272 print '<div class="error">'.$langs->trans($tmp).'</div>';
273 } elseif ($tmp == 'NotConfigured') {
274 print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
275 } else {
276 print $tmp;
277 }
278 print '</td>'."\n";
279
280 print '<td class="center">';
281 if ($conf->global->CONTRACT_ADDON == "$file") {
282 print img_picto($langs->trans("Activated"), 'switch_on');
283 } else {
284 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.urlencode($file).'">';
285 print img_picto($langs->trans("Disabled"), 'switch_off');
286 print '</a>';
287 }
288 print '</td>';
289
290 $contract = new Contrat($db);
291 $contract->initAsSpecimen();
292
293 // Info
294 $htmltooltip = '';
295 $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
296 $nextval = $module->getNextValue($mysoc, $contract);
297 if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
298 $htmltooltip .= ''.$langs->trans("NextValue").': ';
299 if ($nextval) {
300 if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
301 $nextval = $langs->trans($nextval);
302 }
303 $htmltooltip .= $nextval.'<br>';
304 } else {
305 $htmltooltip .= $langs->trans($module->error).'<br>';
306 }
307 }
308
309 print '<td class="center">';
310 print $form->textwithpicto('', $htmltooltip, 1, 0);
311 print '</td>';
312
313 print '</tr>';
314 }
315 }
316 }
317 closedir($handle);
318 }
319 }
320}
321
322print '</table></div><br>';
323
324/*
325 * Documents models for Contracts
326 */
327
328print load_fiche_titre($langs->trans("TemplatePDFContracts"), '', '');
329
330// Defini tableau def des modeles
331$def = array();
332$sql = "SELECT nom";
333$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
334$sql .= " WHERE type = '".$db->escape($type)."'";
335$sql .= " AND entity = ".$conf->entity;
336$resql = $db->query($sql);
337if ($resql) {
338 $i = 0;
339 $num_rows = $db->num_rows($resql);
340 while ($i < $num_rows) {
341 $array = $db->fetch_array($resql);
342 if (is_array($array)) {
343 array_push($def, $array[0]);
344 }
345 $i++;
346 }
347} else {
348 dol_print_error($db);
349}
350
351
352print '<div class="div-table-responsive-no-min">';
353print '<table class="noborder centpercent">';
354print '<tr class="liste_titre">';
355print '<td>'.$langs->trans("Name").'</td>';
356print '<td>'.$langs->trans("Description").'</td>';
357print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
358print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
359print '<td class="center" width="80">'.$langs->trans("ShortInfo").'</td>';
360print '<td class="center" width="80">'.$langs->trans("Preview").'</td>';
361print "</tr>\n";
362
363clearstatcache();
364
365foreach ($dirmodels as $reldir) {
366 foreach (array('', '/doc') as $valdir) {
367 $realpath = $reldir."core/modules/contract".$valdir;
368 $dir = dol_buildpath($realpath);
369
370 if (is_dir($dir)) {
371 $handle = opendir($dir);
372 if (is_resource($handle)) {
373 $filelist = array();
374 while (($file = readdir($handle)) !== false) {
375 $filelist[] = $file;
376 }
377 closedir($handle);
378 arsort($filelist);
379
380 foreach ($filelist as $file) {
381 if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
382 if (file_exists($dir.'/'.$file)) {
383 $name = substr($file, 4, dol_strlen($file) - 16);
384 $classname = substr($file, 0, dol_strlen($file) - 12);
385
386 require_once $dir.'/'.$file;
388 $module = new $classname($db);
389
390 '@phan-var-force ModelePDFContract $module';
391
392 $modulequalified = 1;
393 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
394 $modulequalified = 0;
395 }
396 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
397 $modulequalified = 0;
398 }
399
400 if ($modulequalified) {
401 print '<tr class="oddeven"><td width="100">';
402 print(empty($module->name) ? $name : $module->name);
403 print "</td><td>\n";
404 if (method_exists($module, 'info')) {
405 print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
406 } else {
407 print $module->description;
408 }
409 print '</td>';
410
411 // Active
412 if (in_array($name, $def)) {
413 print '<td class="center">'."\n";
414 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'">';
415 print img_picto($langs->trans("Enabled"), 'switch_on');
416 print '</a>';
417 print '</td>';
418 } else {
419 print '<td class="center">'."\n";
420 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>';
421 print "</td>";
422 }
423
424 // Default
425 print '<td class="center">';
426 if (getDolGlobalString('CONTRACT_ADDON_PDF') == $name) {
427 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>';
428 } else {
429 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>';
430 }
431 print '</td>';
432
433 // Info
434 $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
435 $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
436 if ($module->type == 'pdf') {
437 $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
438 }
439 $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
440
441 $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
442 $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
443 $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
444 $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
445 $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
446 $htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
447
448
449 print '<td class="center">';
450 print $form->textwithpicto('', $htmltooltip, 1, 0);
451 print '</td>';
452
453 // Preview
454 print '<td class="center">';
455 if ($module->type == 'pdf') {
456 print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
457 } else {
458 print img_object($langs->trans("PreviewNotAvailable"), 'generic');
459 }
460 print '</td>';
461
462 print "</tr>\n";
463 }
464 }
465 }
466 }
467 }
468 }
469 }
470}
471
472print '</table>';
473print '</div>';
474print "<br>";
475
476/*
477 * Other options
478 *
479 */
480
481print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
482print '<input type="hidden" name="token" value="'.newToken().'">';
483print '<input type="hidden" name="action" value="set_other">';
484
485print load_fiche_titre($langs->trans("OtherOptions"), '', '');
486
487print '<div class="div-table-responsive-no-min">';
488print '<table class="noborder centpercent">';
489print '<tr class="liste_titre">';
490print '<td>'.$langs->trans("Parameter").'</td>';
491print '<td class="right">'.$langs->trans("Value").'</td>';
492print "</tr>\n";
493
494$substitutionarray = pdf_getSubstitutionArray($langs, array('objectamount'), null, 2);
495$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
496$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
497foreach ($substitutionarray as $key => $val) {
498 $htmltext .= $key.'<br>';
499}
500$htmltext .= '</i>';
501
502print '<tr class="oddeven"><td colspan="2">';
503print $form->textwithpicto($langs->trans("FreeLegalTextOnContracts"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'tooltiphelp');
504print '<br>';
505$variablename = 'CONTRACT_FREE_TEXT';
506if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
507 print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
508} else {
509 include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
510 $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
511 print $doleditor->Create();
512}
513print '</td></tr>'."\n";
514
515//Use draft Watermark
516
517print '<tr class="oddeven"><td>';
518print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
519print '</td><td class="right">';
520print '<input class="flat minwidth200" type="text" name="CONTRACT_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('CONTRACT_DRAFT_WATERMARK')).'">';
521print '</td></tr>'."\n";
522
523print '<tr class="oddeven">';
524print '<td>'.$langs->trans("HideClosedServiceByDefault").'</td>';
525print '<td class="right">';
526print $form->selectyesno("activate_hideClosedServiceByDefault", getDolGlobalInt('CONTRACT_HIDE_CLOSED_SERVICES_BY_DEFAULT', 0), 1);
527print '</td>';
528print '</tr>';
529
530// Allow online signing
531print '<tr class="oddeven">';
532print '<td>'.$langs->trans("AllowOnlineSign").'</td>';
533print '<td class="right">';
534if (getDolGlobalString('CONTRACT_ALLOW_ONLINESIGN')) {
535 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=allowonlinesign&token='.newToken().'&value=0">';
536 print img_picto($langs->trans("Activated"), 'switch_on');
537 print '</a>';
538} else {
539 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=allowonlinesign&token='.newToken().'&value=1">';
540 print img_picto($langs->trans("Disabled"), 'switch_off');
541 print '</a>';
542}
543print '</td>';
544print '</tr>';
545
546// Allow external download
547print '<tr class="oddeven">';
548print '<td>'.$langs->trans("AllowExternalDownload").'</td>';
549print '<td class="right">';
550print ajax_constantonoff('CONTRACT_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1);
551print '</td>';
552print '</tr>';
553print '</table>';
554print '</div>';
555
556print $form->buttonsSaveCancel("Save", '');
557
558print '</form>';
559
560print dol_get_fiche_end();
561
562// End of page
563llxFooter();
564$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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:70
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.
llxFooter()
Footer empty.
Definition document.php:107
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)
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)
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)
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'.
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...
getDolGlobalString($key, $default='')
Return a 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:765
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:140
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.