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