dolibarr  7.0.0-beta
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@capnetworks.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 <http://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 $langs->load("admin");
32 $langs->load("errors");
33 $langs->load('other');
34 $langs->load('supplier_proposal');
35 
36 if (! $user->admin) accessforbidden();
37 
38 $action = GETPOST('action','alpha');
39 $value = GETPOST('value','alpha');
40 $label = GETPOST('label','alpha');
41 $scandir = GETPOST('scan_dir','alpha');
42 $type='supplier_proposal';
43 
44 $error=0;
45 
46 
47 /*
48  * Actions
49  */
50 
51 include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
52 
53 if ($action == 'updateMask')
54 {
55  $maskconstsupplier_proposal=GETPOST('maskconstsupplier_proposal','alpha');
56  $masksupplier_proposal=GETPOST('masksupplier_proposal','alpha');
57  if ($maskconstsupplier_proposal) $res = dolibarr_set_const($db,$maskconstsupplier_proposal,$masksupplier_proposal,'chaine',0,'',$conf->entity);
58 
59  if (! $res > 0) $error++;
60 
61  if (! $error)
62  {
63  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
64  }
65  else
66  {
67  setEventMessages($langs->trans("Error"), null, 'errors');
68  }
69 }
70 
71 if ($action == 'specimen')
72 {
73  $modele=GETPOST('module','alpha');
74 
75  $supplier_proposal = new SupplierProposal($db);
76  $supplier_proposal->initAsSpecimen();
77 
78  // Search template files
79  $file=''; $classname=''; $filefound=0;
80  $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
81  foreach($dirmodels as $reldir)
82  {
83  $file=dol_buildpath($reldir."core/modules/supplier_proposal/doc/pdf_".$modele.".modules.php");
84  if (file_exists($file))
85  {
86  $filefound=1;
87  $classname = "pdf_".$modele;
88  break;
89  }
90  }
91 
92  if ($filefound)
93  {
94  require_once $file;
95 
96  $module = new $classname($db);
97 
98  if ($module->write_file($supplier_proposal,$langs) > 0)
99  {
100  header("Location: ".DOL_URL_ROOT."/document.php?modulepart=supplier_proposal&file=SPECIMEN.pdf");
101  return;
102  }
103  else
104  {
105  setEventMessages($module->error, null, 'errors');
106  dol_syslog($module->error, LOG_ERR);
107  }
108  }
109  else
110  {
111  setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
112  dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
113  }
114 }
115 
116 if ($action == 'set_SUPPLIER_PROPOSAL_DRAFT_WATERMARK')
117 {
118  $draft = GETPOST('SUPPLIER_PROPOSAL_DRAFT_WATERMARK','alpha');
119 
120  $res = dolibarr_set_const($db, "SUPPLIER_PROPOSAL_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
121  if (! $res > 0) $error++;
122 
123  if (! $error)
124  {
125  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
126  }
127  else
128  {
129  setEventMessages($langs->trans("Error"), null, 'errors');
130  }
131 }
132 
133 if ($action == 'set_SUPPLIER_PROPOSAL_FREE_TEXT')
134 {
135  $freetext = GETPOST('SUPPLIER_PROPOSAL_FREE_TEXT','none'); // No alpha here, we want exact string
136 
137  $res = dolibarr_set_const($db, "SUPPLIER_PROPOSAL_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
138 
139  if (! $res > 0) $error++;
140 
141  if (! $error)
142  {
143  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
144  }
145  else
146  {
147  setEventMessages($langs->trans("Error"), null, 'errors');
148  }
149 }
150 
151 if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL')
152 {
153  $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL",$value,'chaine',0,'',$conf->entity);
154 
155  if (! $res > 0) $error++;
156 
157  if (! $error)
158  {
159  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
160  }
161  else
162  {
163  setEventMessages($langs->trans("Error"), null, 'errors');
164  }
165 }
166 
167 // Activate a model
168 if ($action == 'set')
169 {
170  $ret = addDocumentModel($value, $type, $label, $scandir);
171 }
172 
173 else if ($action == 'del')
174 {
175  $ret = delDocumentModel($value, $type);
176  if ($ret > 0)
177  {
178  if ($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF == "$value") dolibarr_del_const($db, 'SUPPLIER_PROPOSAL_ADDON_PDF',$conf->entity);
179  }
180 }
181 
182 else if ($action == 'setdoc')
183 {
184  if (dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
185  {
186  $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF = $value;
187  }
188 
189  // On active le modele
190  $ret = delDocumentModel($value, $type);
191  if ($ret > 0)
192  {
193  $ret = addDocumentModel($value, $type, $label, $scandir);
194  }
195 }
196 
197 else if ($action == 'setmod')
198 {
199  // TODO Verifier si module numerotation choisi peut etre active
200  // par appel methode canBeActivated
201 
202  dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON",$value,'chaine',0,'',$conf->entity);
203 }
204 
205 
206 /*
207  * Affiche page
208  */
209 
210 $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
211 
212 
213 llxHeader('',$langs->trans("SupplierProposalSetup"));
214 
215 $form=new Form($db);
216 
217 //if ($mesg) print $mesg;
218 
219 $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
220 print load_fiche_titre($langs->trans("SupplierProposalSetup"),$linkback,'title_setup');
221 
222 $head = supplier_proposal_admin_prepare_head();
223 
224 dol_fiche_head($head, 'general', $langs->trans("CommRequests"), 0, 'supplier_proposal');
225 
226 /*
227  * Module numerotation
228  */
229 print load_fiche_titre($langs->trans("SupplierProposalNumberingModules"),'','');
230 
231 print '<table class="noborder" width="100%">';
232 print '<tr class="liste_titre">';
233 print '<td>'.$langs->trans("Name")."</td>\n";
234 print '<td>'.$langs->trans("Description")."</td>\n";
235 print '<td class="nowrap">'.$langs->trans("Example")."</td>\n";
236 print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
237 print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
238 print '</tr>'."\n";
239 
240 clearstatcache();
241 foreach ($dirmodels as $reldir)
242 {
243  $dir = dol_buildpath($reldir."core/modules/supplier_proposal/");
244 
245  if (is_dir($dir))
246  {
247  $handle = opendir($dir);
248  if (is_resource($handle))
249  {
250  $var=true;
251 
252  while (($file = readdir($handle))!==false)
253  {
254  if (substr($file, 0, 22) == 'mod_supplier_proposal_' && substr($file, dol_strlen($file)-3, 3) == 'php')
255  {
256  $file = substr($file, 0, dol_strlen($file)-4);
257 
258  require_once $dir.$file.'.php';
259 
260  $module = new $file;
261 
262  // Show modules according to features level
263  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
264  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
265 
266  if ($module->isEnabled())
267  {
268 
269  print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
270  print $module->info();
271  print '</td>';
272 
273  // Show example of numbering module
274  print '<td class="nowrap">';
275  $tmp=$module->getExample();
276  if (preg_match('/^Error/',$tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
277  elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
278  else print $tmp;
279  print '</td>'."\n";
280 
281  print '<td align="center">';
282  if ($conf->global->SUPPLIER_PROPOSAL_ADDON == "$file")
283  {
284  print img_picto($langs->trans("Activated"),'switch_on');
285  }
286  else
287  {
288  print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">';
289  print img_picto($langs->trans("Disabled"),'switch_off');
290  print '</a>';
291  }
292  print '</td>';
293 
294  $supplier_proposal=new SupplierProposal($db);
295  $supplier_proposal->initAsSpecimen();
296 
297  // Info
298  $htmltooltip='';
299  $htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
300  $nextval=$module->getNextValue($mysoc,$supplier_proposal);
301  if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
302  $htmltooltip.=''.$langs->trans("NextValue").': ';
303  if ($nextval) {
304  if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
305  $nextval = $langs->trans($nextval);
306  $htmltooltip.=$nextval.'<br>';
307  } else {
308  $htmltooltip.=$langs->trans($module->error).'<br>';
309  }
310  }
311 
312  print '<td align="center">';
313  print $form->textwithpicto('',$htmltooltip,1,0);
314  print '</td>';
315 
316  print "</tr>\n";
317  }
318  }
319  }
320  closedir($handle);
321  }
322  }
323 }
324 print "</table><br>\n";
325 
326 
327 /*
328  * Document templates generators
329  */
330 
331 print load_fiche_titre($langs->trans("SupplierProposalPDFModules"),'','');
332 
333 // Load array def with activated templates
334 $def = array();
335 $sql = "SELECT nom";
336 $sql.= " FROM ".MAIN_DB_PREFIX."document_model";
337 $sql.= " WHERE type = '".$type."'";
338 $sql.= " AND entity = ".$conf->entity;
339 $resql=$db->query($sql);
340 if ($resql)
341 {
342  $i = 0;
343  $num_rows=$db->num_rows($resql);
344  while ($i < $num_rows)
345  {
346  $array = $db->fetch_array($resql);
347  array_push($def, $array[0]);
348  $i++;
349  }
350 }
351 else
352 {
353  dol_print_error($db);
354 }
355 
356 
357 print "<table class=\"noborder\" width=\"100%\">\n";
358 print "<tr class=\"liste_titre\">\n";
359 print " <td>".$langs->trans("Name")."</td>\n";
360 print " <td>".$langs->trans("Description")."</td>\n";
361 print '<td align="center" width="40">'.$langs->trans("Status")."</td>\n";
362 print '<td align="center" width="40">'.$langs->trans("Default")."</td>\n";
363 print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>';
364 print '<td align="center" width="40">'.$langs->trans("Preview").'</td>';
365 print "</tr>\n";
366 
367 clearstatcache();
368 
369 $var=true;
370 foreach ($dirmodels as $reldir)
371 {
372  foreach (array('','/doc') as $valdir)
373  {
374  $dir = dol_buildpath($reldir."core/modules/supplier_proposal".$valdir);
375 
376  if (is_dir($dir))
377  {
378  $handle=opendir($dir);
379  if (is_resource($handle))
380  {
381  while (($file = readdir($handle))!==false)
382  {
383  $filelist[]=$file;
384  }
385  closedir($handle);
386  arsort($filelist);
387 
388  foreach($filelist as $file)
389  {
390  if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
391  {
392  if (file_exists($dir.'/'.$file))
393  {
394  $name = substr($file, 4, dol_strlen($file) -16);
395  $classname = substr($file, 0, dol_strlen($file) -12);
396 
397  require_once $dir.'/'.$file;
398  $module = new $classname($db);
399 
400  $modulequalified=1;
401  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
402  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
403 
404  if ($modulequalified)
405  {
406  $var = !$var;
407  print '<tr class="oddeven"><td width="100">';
408  print (empty($module->name)?$name:$module->name);
409  print "</td><td>\n";
410  if (method_exists($module,'info')) print $module->info($langs);
411  else print $module->description;
412  print '</td>';
413 
414  // Active
415  if (in_array($name, $def))
416  {
417  print '<td align="center">'."\n";
418  print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'">';
419  print img_picto($langs->trans("Enabled"),'switch_on');
420  print '</a>';
421  print '</td>';
422  }
423  else
424  {
425  print "<td align=\"center\">\n";
426  print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
427  print "</td>";
428  }
429 
430  // Defaut
431  print "<td align=\"center\">";
432  if ($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF == "$name")
433  {
434  print img_picto($langs->trans("Default"),'on');
435  }
436  else
437  {
438  print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
439  }
440  print '</td>';
441 
442  // Info
443  $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
444  $htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
445  if ($module->type == 'pdf')
446  {
447  $htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
448  }
449  $htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
450  $htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
451  $htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
452  $htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
453  $htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
454  //$htmltooltip.='<br>'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1);
455  //$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
456  $htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftProposal").': '.yn($module->option_draft_watermark,1,1);
457 
458 
459  print '<td align="center">';
460  print $form->textwithpicto('',$htmltooltip,1,0);
461  print '</td>';
462 
463  // Preview
464  print '<td align="center">';
465  if ($module->type == 'pdf')
466  {
467  print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
468  }
469  else
470  {
471  print img_object($langs->trans("PreviewNotAvailable"),'generic');
472  }
473  print '</td>';
474 
475  print "</tr>\n";
476  }
477  }
478  }
479  }
480  }
481  }
482  }
483 }
484 
485 print '</table>';
486 print '<br>';
487 
488 
489 /*
490  * Other options
491  *
492  */
493 print load_fiche_titre($langs->trans("OtherOptions"),'','');
494 
495 $var=true;
496 print "<table class=\"noborder\" width=\"100%\">";
497 print "<tr class=\"liste_titre\">";
498 print "<td>".$langs->trans("Parameter")."</td>\n";
499 print '<td width="60" align="center">'.$langs->trans("Value")."</td>\n";
500 print "<td>&nbsp;</td>\n";
501 print "</tr>";
502 
503 $substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
504 $substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
505 $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
506 foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
507 $htmltext.='</i>';
508 
509 $var=! $var;
510 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
511 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
512 print '<input type="hidden" name="action" value="set_SUPPLIER_PROPOSAL_FREE_TEXT">';
513 print '<tr class="oddeven"><td colspan="2">';
514 print $form->textwithpicto($langs->trans("FreeLegalTextOnSupplierProposal"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
515 $variablename='SUPPLIER_PROPOSAL_FREE_TEXT';
516 if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
517 {
518  print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
519 }
520 else
521 {
522  include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
523  $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes');
524  print $doleditor->Create();
525 }
526 print '</td><td align="right">';
527 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
528 print "</td></tr>\n";
529 print '</form>';
530 
531 
532 print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
533 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
534 print "<input type=\"hidden\" name=\"action\" value=\"set_SUPPLIER_PROPOSAL_DRAFT_WATERMARK\">";
535 print '<tr class="oddeven"><td>';
536 print $form->textwithpicto($langs->trans("WatermarkOnDraftProposal"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
537 print '</td><td>';
538 print '<input size="50" class="flat" type="text" name="SUPPLIER_PROPOSAL_DRAFT_WATERMARK" value="'.$conf->global->SUPPLIER_PROPOSAL_DRAFT_WATERMARK.'">';
539 print '</td><td align="right">';
540 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
541 print "</td></tr>\n";
542 print '</form>';
543 
544 if ($conf->banque->enabled)
545 {
546 
547  print '<tr class="oddeven"><td>';
548  print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'</td><td>&nbsp</td><td align="right">';
549  if (! empty($conf->use_javascript_ajax))
550  {
551  print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL');
552  }
553  else
554  {
555  if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL))
556  {
557  print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL&amp;value=1">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
558  }
559  else
560  {
561  print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL&amp;value=0">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
562  }
563  }
564  print '</td></tr>';
565 }
566 else
567 {
568 
569  print '<tr class="oddeven"><td>';
570  print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
571 }
572 
573 print '</table>';
574 
575 
576 
577 /*
578  * Directory
579  */
580 print '<br>';
581 print load_fiche_titre($langs->trans("PathToDocuments"),'','');
582 
583 print "<table class=\"noborder\" width=\"100%\">\n";
584 print "<tr class=\"liste_titre\">\n";
585 print " <td>".$langs->trans("Name")."</td>\n";
586 print " <td>".$langs->trans("Value")."</td>\n";
587 print "</tr>\n";
588 print "<tr ".$bc[false].">\n <td width=\"140\">".$langs->trans("PathDirectory")."</td>\n <td>".$conf->supplier_proposal->dir_output."</td>\n</tr>\n";
589 print "</table>\n<br>";
590 
591 llxFooter();
592 $db->close();
593 
delDocumentModel($name, $type)
Delete document model used by doc generator.
Definition: admin.lib.php:1540
llxFooter()
Empty footer.
Definition: wrapper.php:58
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='')
Show picto whatever it's its name (generic function)
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
setEventMessages($mesg, $mesgs, $style='mesgs')
Set event messages in dol_events session object.
if(!GETPOST('transkey')&&!GETPOST('transphrase')) else
View.
Definition: notice.php:43
dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='')
Show tab header of a card.
if(GETPOST('cancel','alpha')) if(!GETPOST('confirmmassaction','alpha')&&$massaction!= 'presend'&&$massaction!= 'confirm_presend')
Draft customers invoices.
Definition: list.php:147
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:485
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
Definition: admin.lib.php:1506
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
if(empty($reshook)) $form
View.
Definition: perms.php:103
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
Return value of a param into GET or POST supervariable.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Class to manage generation of HTML components Only common components must be here.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='')
Write log message into outputs.
dolibarr_del_const($db, $name, $entity=1)
Effacement d'une constante dans la base de donnees.
Definition: admin.lib.php:410
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id=0, $morecssontable='', $morehtmlcenter='')
Load a title with picto.
llxHeader()
Empty header.
Definition: wrapper.php:46
img_object($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
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:603
print
Draft customers invoices.
Definition: index.php:91
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0)
On/off button for constant.
Definition: ajax.lib.php:500
Class to manage price ask supplier.
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if(!empty($conf->fournisseur->enabled)&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->societe->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if(!empty($conf->fournisseur->enabled)&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1013
Class to manage a WYSIWYG editor.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.