dolibarr  16.0.5
supplier_proposal.php
1 <?php
2 /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
5  * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
6  * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
7  * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
8  * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
9  * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
10  * Copyright (C) 2015 Jean-Fran├žois Ferry <jfefe@aternatik.fr>
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program. If not, see <https://www.gnu.org/licenses/>.
24  */
25 
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.'/supplier_proposal/class/supplier_proposal.class.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php';
31 
32 // Load translation files required by the page
33 $langs->loadLangs(array("admin", "errors", "other", "supplier_proposal"));
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 = 'supplier_proposal';
46 
47 $error = 0;
48 
49 
50 /*
51  * Actions
52  */
53 
54 include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
55 
56 if ($action == 'updateMask') {
57  $maskconstsupplier_proposal = GETPOST('maskconstsupplier_proposal', 'alpha');
58  $masksupplier_proposal = GETPOST('masksupplier_proposal', 'alpha');
59  if ($maskconstsupplier_proposal) {
60  $res = dolibarr_set_const($db, $maskconstsupplier_proposal, $masksupplier_proposal, 'chaine', 0, '', $conf->entity);
61  }
62 
63  if (!($res > 0)) {
64  $error++;
65  }
66 
67  if (!$error) {
68  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
69  } else {
70  setEventMessages($langs->trans("Error"), null, 'errors');
71  }
72 }
73 
74 if ($action == 'specimen') {
75  $modele = GETPOST('module', 'alpha');
76 
77  $supplier_proposal = new SupplierProposal($db);
78  $supplier_proposal->initAsSpecimen();
79 
80  // Search template files
81  $file = ''; $classname = ''; $filefound = 0;
82  $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
83  foreach ($dirmodels as $reldir) {
84  $file = dol_buildpath($reldir."core/modules/supplier_proposal/doc/pdf_".$modele.".modules.php");
85  if (file_exists($file)) {
86  $filefound = 1;
87  $classname = "pdf_".$modele;
88  break;
89  }
90  }
91 
92  if ($filefound) {
93  require_once $file;
94 
95  $module = new $classname($db);
96 
97  if ($module->write_file($supplier_proposal, $langs) > 0) {
98  header("Location: ".DOL_URL_ROOT."/document.php?modulepart=supplier_proposal&file=SPECIMEN.pdf");
99  return;
100  } else {
101  setEventMessages($module->error, null, 'errors');
102  dol_syslog($module->error, LOG_ERR);
103  }
104  } else {
105  setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
106  dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
107  }
108 }
109 
110 if ($action == 'set_SUPPLIER_PROPOSAL_DRAFT_WATERMARK') {
111  $draft = GETPOST('SUPPLIER_PROPOSAL_DRAFT_WATERMARK', 'alpha');
112 
113  $res = dolibarr_set_const($db, "SUPPLIER_PROPOSAL_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
114  if (!($res > 0)) {
115  $error++;
116  }
117 
118  if (!$error) {
119  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
120  } else {
121  setEventMessages($langs->trans("Error"), null, 'errors');
122  }
123 }
124 
125 if ($action == 'set_SUPPLIER_PROPOSAL_FREE_TEXT') {
126  $freetext = GETPOST('SUPPLIER_PROPOSAL_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
127 
128  $res = dolibarr_set_const($db, "SUPPLIER_PROPOSAL_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
129 
130  if (!($res > 0)) {
131  $error++;
132  }
133 
134  if (!$error) {
135  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
136  } else {
137  setEventMessages($langs->trans("Error"), null, 'errors');
138  }
139 }
140 
141 if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL') {
142  $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL", $value, 'chaine', 0, '', $conf->entity);
143 
144  if (!($res > 0)) {
145  $error++;
146  }
147 
148  if (!$error) {
149  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
150  } else {
151  setEventMessages($langs->trans("Error"), null, 'errors');
152  }
153 }
154 
155 // Activate a model
156 if ($action == 'set') {
157  $ret = addDocumentModel($value, $type, $label, $scandir);
158 } elseif ($action == 'del') {
159  $ret = delDocumentModel($value, $type);
160  if ($ret > 0) {
161  if ($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF == "$value") {
162  dolibarr_del_const($db, 'SUPPLIER_PROPOSAL_ADDON_PDF', $conf->entity);
163  }
164  }
165 } elseif ($action == 'setdoc') {
166  if (dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
167  $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF = $value;
168  }
169 
170  // On active le modele
171  $ret = delDocumentModel($value, $type);
172  if ($ret > 0) {
173  $ret = addDocumentModel($value, $type, $label, $scandir);
174  }
175 } elseif ($action == 'setmod') {
176  // TODO Verifier si module numerotation choisi peut etre active
177  // par appel methode canBeActivated
178 
179  dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON", $value, 'chaine', 0, '', $conf->entity);
180 }
181 
182 
183 /*
184  * Affiche page
185  */
186 
187 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
188 
189 
190 llxHeader('', $langs->trans("SupplierProposalSetup"));
191 
192 $form = new Form($db);
193 
194 //if ($mesg) print $mesg;
195 
196 $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
197 print load_fiche_titre($langs->trans("SupplierProposalSetup"), $linkback, 'title_setup');
198 
199 $head = supplier_proposal_admin_prepare_head();
200 
201 print dol_get_fiche_head($head, 'general', $langs->trans("CommRequests"), -1, 'supplier_proposal');
202 
203 /*
204  * Module numerotation
205  */
206 print load_fiche_titre($langs->trans("SupplierProposalNumberingModules"), '', '');
207 
208 print '<table class="noborder centpercent">';
209 print '<tr class="liste_titre">';
210 print '<td>'.$langs->trans("Name")."</td>\n";
211 print '<td>'.$langs->trans("Description")."</td>\n";
212 print '<td class="nowrap">'.$langs->trans("Example")."</td>\n";
213 print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
214 print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
215 print '</tr>'."\n";
216 
217 clearstatcache();
218 foreach ($dirmodels as $reldir) {
219  $dir = dol_buildpath($reldir."core/modules/supplier_proposal");
220 
221  if (is_dir($dir)) {
222  $handle = opendir($dir);
223  if (is_resource($handle)) {
224  while (($file = readdir($handle)) !== false) {
225  if (substr($file, 0, 22) == 'mod_supplier_proposal_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
226  $file = substr($file, 0, dol_strlen($file) - 4);
227 
228  require_once $dir.'/'.$file.'.php';
229 
230  $module = new $file;
231 
232  // Show modules according to features level
233  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
234  continue;
235  }
236  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
237  continue;
238  }
239 
240  if ($module->isEnabled()) {
241  print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
242  print $module->info();
243  print '</td>';
244 
245  // Show example of numbering module
246  print '<td class="nowrap">';
247  $tmp = $module->getExample();
248  if (preg_match('/^Error/', $tmp)) {
249  $langs->load("errors");
250  print '<div class="error">'.$langs->trans($tmp).'</div>';
251  } elseif ($tmp == 'NotConfigured') {
252  print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
253  } else {
254  print $tmp;
255  }
256  print '</td>'."\n";
257 
258  print '<td class="center">';
259  if ($conf->global->SUPPLIER_PROPOSAL_ADDON == "$file") {
260  print img_picto($langs->trans("Activated"), 'switch_on');
261  } else {
262  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.urlencode($file).'">';
263  print img_picto($langs->trans("Disabled"), 'switch_off');
264  print '</a>';
265  }
266  print '</td>';
267 
268  $supplier_proposal = new SupplierProposal($db);
269  $supplier_proposal->initAsSpecimen();
270 
271  // Info
272  $htmltooltip = '';
273  $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
274  $nextval = $module->getNextValue($mysoc, $supplier_proposal);
275  if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
276  $htmltooltip .= ''.$langs->trans("NextValue").': ';
277  if ($nextval) {
278  if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
279  $nextval = $langs->trans($nextval);
280  }
281  $htmltooltip .= $nextval.'<br>';
282  } else {
283  $htmltooltip .= $langs->trans($module->error).'<br>';
284  }
285  }
286 
287  print '<td class="center">';
288  print $form->textwithpicto('', $htmltooltip, 1, 0);
289  print '</td>';
290 
291  print "</tr>\n";
292  }
293  }
294  }
295  closedir($handle);
296  }
297  }
298 }
299 print "</table><br>\n";
300 
301 
302 /*
303  * Document templates generators
304  */
305 
306 print load_fiche_titre($langs->trans("SupplierProposalPDFModules"), '', '');
307 
308 // Load array def with activated templates
309 $def = array();
310 $sql = "SELECT nom";
311 $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
312 $sql .= " WHERE type = '".$db->escape($type)."'";
313 $sql .= " AND entity = ".$conf->entity;
314 $resql = $db->query($sql);
315 if ($resql) {
316  $i = 0;
317  $num_rows = $db->num_rows($resql);
318  while ($i < $num_rows) {
319  $array = $db->fetch_array($resql);
320  array_push($def, $array[0]);
321  $i++;
322  }
323 } else {
324  dol_print_error($db);
325 }
326 
327 
328 print "<table class=\"noborder\" width=\"100%\">\n";
329 print "<tr class=\"liste_titre\">\n";
330 print " <td>".$langs->trans("Name")."</td>\n";
331 print " <td>".$langs->trans("Description")."</td>\n";
332 print '<td align="center" width="40">'.$langs->trans("Status")."</td>\n";
333 print '<td align="center" width="40">'.$langs->trans("Default")."</td>\n";
334 print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>';
335 print '<td align="center" width="40">'.$langs->trans("Preview").'</td>';
336 print "</tr>\n";
337 
338 clearstatcache();
339 
340 foreach ($dirmodels as $reldir) {
341  foreach (array('', '/doc') as $valdir) {
342  $realpath = $reldir."core/modules/supplier_proposal".$valdir;
343  $dir = dol_buildpath($realpath);
344 
345  if (is_dir($dir)) {
346  $handle = opendir($dir);
347  if (is_resource($handle)) {
348  while (($file = readdir($handle)) !== false) {
349  $filelist[] = $file;
350  }
351  closedir($handle);
352  arsort($filelist);
353 
354  foreach ($filelist as $file) {
355  if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
356  if (file_exists($dir.'/'.$file)) {
357  $name = substr($file, 4, dol_strlen($file) - 16);
358  $classname = substr($file, 0, dol_strlen($file) - 12);
359 
360  require_once $dir.'/'.$file;
361  $module = new $classname($db);
362 
363  $modulequalified = 1;
364  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
365  $modulequalified = 0;
366  }
367  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
368  $modulequalified = 0;
369  }
370 
371  if ($modulequalified) {
372  print '<tr class="oddeven"><td width="100">';
373  print (empty($module->name) ? $name : $module->name);
374  print "</td><td>\n";
375  if (method_exists($module, 'info')) {
376  print $module->info($langs);
377  } else {
378  print $module->description;
379  }
380  print '</td>';
381 
382  // Active
383  if (in_array($name, $def)) {
384  print '<td class="center">'."\n";
385  print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'">';
386  print img_picto($langs->trans("Enabled"), 'switch_on');
387  print '</a>';
388  print '</td>';
389  } else {
390  print '<td align="center">'."\n";
391  print '<a 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>';
392  print "</td>";
393  }
394 
395  // Defaut
396  print '<td align="center">';
397  if ($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF == "$name") {
398  print img_picto($langs->trans("Default"), 'on');
399  } else {
400  print '<a 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>';
401  }
402  print '</td>';
403 
404  // Info
405  $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
406  $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
407  if ($module->type == 'pdf') {
408  $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
409  }
410  $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
411 
412  $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
413  $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
414  $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
415  $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
416  $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
417  //$htmltooltip.='<br>'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1);
418  //$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
419  $htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftProposal").': '.yn($module->option_draft_watermark, 1, 1);
420 
421 
422  print '<td class="center">';
423  print $form->textwithpicto('', $htmltooltip, 1, 0);
424  print '</td>';
425 
426  // Preview
427  print '<td class="center">';
428  if ($module->type == 'pdf') {
429  print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
430  } else {
431  print img_object($langs->trans("PreviewNotAvailable"), 'generic');
432  }
433  print '</td>';
434 
435  print "</tr>\n";
436  }
437  }
438  }
439  }
440  }
441  }
442  }
443 }
444 
445 print '</table>';
446 print '<br>';
447 
448 
449 /*
450  * Other options
451  *
452  */
453 print load_fiche_titre($langs->trans("OtherOptions"), '', '');
454 
455 print "<table class=\"noborder\" width=\"100%\">";
456 print "<tr class=\"liste_titre\">";
457 print "<td>".$langs->trans("Parameter")."</td>\n";
458 print '<td width="60" align="center">'.$langs->trans("Value")."</td>\n";
459 print "<td>&nbsp;</td>\n";
460 print "</tr>";
461 
462 $substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
463 $substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
464 $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
465 foreach ($substitutionarray as $key => $val) {
466  $htmltext .= $key.'<br>';
467 }
468 $htmltext .= '</i>';
469 
470 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
471 print '<input type="hidden" name="token" value="'.newToken().'">';
472 print '<input type="hidden" name="action" value="set_SUPPLIER_PROPOSAL_FREE_TEXT">';
473 print '<tr class="oddeven"><td colspan="2">';
474 print $form->textwithpicto($langs->trans("FreeLegalTextOnSupplierProposal"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
475 $variablename = 'SUPPLIER_PROPOSAL_FREE_TEXT';
476 if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
477  print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
478 } else {
479  include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
480  $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
481  print $doleditor->Create();
482 }
483 print '</td><td class="right">';
484 print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
485 print "</td></tr>\n";
486 print '</form>';
487 
488 
489 print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
490 print '<input type="hidden" name="token" value="'.newToken().'">';
491 print "<input type=\"hidden\" name=\"action\" value=\"set_SUPPLIER_PROPOSAL_DRAFT_WATERMARK\">";
492 print '<tr class="oddeven"><td>';
493 print $form->textwithpicto($langs->trans("WatermarkOnDraftProposal"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
494 print '</td><td>';
495 print '<input class="flat minwidth200" type="text" name="SUPPLIER_PROPOSAL_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('SUPPLIER_PROPOSAL_DRAFT_WATERMARK')).'">';
496 print '</td><td class="right">';
497 print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
498 print "</td></tr>\n";
499 print '</form>';
500 
501 if (!empty($conf->banque->enabled)) {
502  print '<tr class="oddeven"><td>';
503  print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'</td><td>&nbsp;</td><td class="right">';
504  if (!empty($conf->use_javascript_ajax)) {
505  print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL');
506  } else {
507  if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL)) {
508  print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL&token='.newToken().'&value=1">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
509  } else {
510  print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL&token='.newToken().'&value=0">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>';
511  }
512  }
513  print '</td></tr>';
514 } else {
515  print '<tr class="oddeven"><td>';
516  print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
517 }
518 
519 print '</table>';
520 
521 
522 
523 /*
524  * Directory
525  */
526 print '<br>';
527 print load_fiche_titre($langs->trans("PathToDocuments"), '', '');
528 
529 print "<table class=\"noborder\" width=\"100%\">\n";
530 print "<tr class=\"liste_titre\">\n";
531 print " <td>".$langs->trans("Name")."</td>\n";
532 print " <td>".$langs->trans("Value")."</td>\n";
533 print "</tr>\n";
534 print "<tr class=\"oddeven\">\n <td width=\"140\">".$langs->trans("PathDirectory")."</td>\n <td>".$conf->supplier_proposal->dir_output."</td>\n</tr>\n";
535 print "</table>\n<br>";
536 
537 // End of page
538 llxFooter();
539 $db->close();
yn
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
Definition: functions.lib.php:6491
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
dolibarr_del_const
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
Definition: admin.lib.php:552
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5204
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:484
dol_print_error
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Definition: functions.lib.php:4844
dol_buildpath
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
Definition: functions.lib.php:1062
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:3880
delDocumentModel
delDocumentModel($name, $type)
Delete document model used by doc generator.
Definition: admin.lib.php:1894
dol_syslog
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
Definition: functions.lib.php:1603
ajax_constantonoff
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:573
dol_get_fiche_head
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
Definition: functions.lib.php:1822
getDolGlobalString
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
Definition: functions.lib.php:80
dol_strlen
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
Definition: functions.lib.php:3747
newToken
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Definition: functions.lib.php:10877
dolibarr_set_const
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:627
addDocumentModel
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
Definition: admin.lib.php:1863
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
img_object
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
Definition: functions.lib.php:4211
$resql
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->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->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:742
pdf_getSubstitutionArray
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:737
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8136
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Definition: security.lib.php:933
SupplierProposal
Class to manage price ask supplier.
Definition: supplier_proposal.class.php:50
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59
DolEditor
Class to manage a WYSIWYG editor.
Definition: doleditor.class.php:30