dolibarr  7.0.0-beta
commande.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2013 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 Andre Cianfarani <acianfa@free.fr>
7  * Copyright (C) 2005-2014 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) 2011-2016 Philippe Grand <philippe.grand@atoo-net.com>
11  * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
12  *
13  * This program is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by
15  * the Free Software Foundation; either version 3 of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program. If not, see <http://www.gnu.org/licenses/>.
25  */
26 
33 require '../main.inc.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
35 require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
36 require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
37 require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
38 
39 $langs->load("admin");
40 $langs->load("errors");
41 $langs->load("orders");
42 $langs->load('other');
43 
44 if (! $user->admin) accessforbidden();
45 
46 $action = GETPOST('action','alpha');
47 $value = GETPOST('value','alpha');
48 $label = GETPOST('label','alpha');
49 $scandir = GETPOST('scan_dir','alpha');
50 $type = 'order';
51 
52 
53 /*
54  * Actions
55  */
56 
57 include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
58 
59 if ($action == 'updateMask')
60 {
61  $maskconstorder=GETPOST('maskconstorder','alpha');
62  $maskorder=GETPOST('maskorder','alpha');
63 
64  if ($maskconstorder) $res = dolibarr_set_const($db,$maskconstorder,$maskorder,'chaine',0,'',$conf->entity);
65 
66  if (! $res > 0) $error++;
67 
68  if (! $error)
69  {
70  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
71  }
72  else
73  {
74  setEventMessages($langs->trans("Error"), null, 'errors');
75  }
76 }
77 
78 else if ($action == 'specimen')
79 {
80  $modele=GETPOST('module','alpha');
81 
82  $commande = new Commande($db);
83  $commande->initAsSpecimen();
84 
85  // Search template files
86  $file=''; $classname=''; $filefound=0;
87  $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
88  foreach($dirmodels as $reldir)
89  {
90  $file=dol_buildpath($reldir."core/modules/commande/doc/pdf_".$modele.".modules.php",0);
91  if (file_exists($file))
92  {
93  $filefound=1;
94  $classname = "pdf_".$modele;
95  break;
96  }
97  }
98 
99  if ($filefound)
100  {
101  require_once $file;
102 
103  $module = new $classname($db);
104 
105  if ($module->write_file($commande,$langs) > 0)
106  {
107  header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande&file=SPECIMEN.pdf");
108  return;
109  }
110  else
111  {
112  setEventMessages($module->error, null, 'errors');
113  dol_syslog($module->error, LOG_ERR);
114  }
115  }
116  else
117  {
118  setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
119  dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
120  }
121 }
122 
123 // Activate a model
124 else if ($action == 'set')
125 {
126  $ret = addDocumentModel($value, $type, $label, $scandir);
127 }
128 
129 else if ($action == 'del')
130 {
131  $ret = delDocumentModel($value, $type);
132  if ($ret > 0)
133  {
134  if ($conf->global->COMMANDE_ADDON_PDF == "$value") dolibarr_del_const($db, 'COMMANDE_ADDON_PDF',$conf->entity);
135  }
136 }
137 
138 // Set default model
139 else if ($action == 'setdoc')
140 {
141  if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
142  {
143  // The constant that was read before the new set
144  // We therefore requires a variable to have a coherent view
145  $conf->global->COMMANDE_ADDON_PDF = $value;
146  }
147 
148  // On active le modele
149  $ret = delDocumentModel($value, $type);
150  if ($ret > 0)
151  {
152  $ret = addDocumentModel($value, $type, $label, $scandir);
153  }
154 }
155 
156 else if ($action == 'setmod')
157 {
158  // TODO Check if numbering module chosen can be activated
159  // by calling method canBeActivated
160 
161  dolibarr_set_const($db, "COMMANDE_ADDON",$value,'chaine',0,'',$conf->entity);
162 }
163 
164 else if ($action == 'set_COMMANDE_DRAFT_WATERMARK')
165 {
166  $draft = GETPOST("COMMANDE_DRAFT_WATERMARK");
167  $res = dolibarr_set_const($db, "COMMANDE_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
168 
169  if (! $res > 0) $error++;
170 
171  if (! $error)
172  {
173  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
174  }
175  else
176  {
177  setEventMessages($langs->trans("Error"), null, 'errors');
178  }
179 }
180 
181 else if ($action == 'set_ORDER_FREE_TEXT')
182 {
183  $freetext = GETPOST("ORDER_FREE_TEXT",'none'); // No alpha here, we want exact string
184 
185  $res = dolibarr_set_const($db, "ORDER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
186 
187  if (! $res > 0) $error++;
188 
189  if (! $error)
190  {
191  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
192  }
193  else
194  {
195  setEventMessages($langs->trans("Error"), null, 'errors');
196  }
197 }
198 
199 // Activate Set Shippable Icon In List
200 else if ($action=="setshippableiconinlist") {
201  $setshippableiconinlist = GETPOST('value','int');
202  $res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist,'yesno',0,'',$conf->entity);
203  if (! $res > 0) $error++;
204  if (! $error) {
205  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
206  } else {
207  setEventMessages($langs->trans("Error"), null, 'errors');
208  }
209 }
210 
211 // Activate ask for payment bank
212 else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
213 {
214  $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ORDER",$value,'chaine',0,'',$conf->entity);
215 
216  if (! $res > 0) $error++;
217 
218  if (! $error)
219  {
220  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
221  }
222  else
223  {
224  setEventMessages($langs->trans("Error"), null, 'errors');
225  }
226 }
227 
228 // Activate ask for warehouse
229 else if ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')
230 {
231  $res = dolibarr_set_const($db, "WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER",$value,'chaine',0,'',$conf->entity);
232 
233  if (! $res > 0) $error++;
234 
235  if (! $error)
236  {
237  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
238  }
239  else
240  {
241  setEventMessages($langs->trans("Error"), null, 'errors');
242  }
243 }
244 
245 
246 /*
247  * View
248  */
249 
250 $form=new Form($db);
251 
252 $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
253 
254 llxHeader("",$langs->trans("OrdersSetup"));
255 
256 $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
257 print load_fiche_titre($langs->trans("OrdersSetup"),$linkback,'title_setup');
258 
259 $head = order_admin_prepare_head();
260 
261 dol_fiche_head($head, 'general', $langs->trans("Orders"), -1, 'order');
262 
263 /*
264  * Orders Numbering model
265  */
266 
267 print load_fiche_titre($langs->trans("OrdersNumberingModules"),'','');
268 
269 print '<table class="noborder" width="100%">';
270 print '<tr class="liste_titre">';
271 print '<td>'.$langs->trans("Name").'</td>';
272 print '<td>'.$langs->trans("Description").'</td>';
273 print '<td class="nowrap">'.$langs->trans("Example").'</td>';
274 print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
275 print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
276 print '</tr>'."\n";
277 
278 clearstatcache();
279 
280 foreach ($dirmodels as $reldir)
281 {
282  $dir = dol_buildpath($reldir."core/modules/commande/");
283 
284  if (is_dir($dir))
285  {
286  $handle = opendir($dir);
287  if (is_resource($handle))
288  {
289  $var=true;
290 
291  while (($file = readdir($handle))!==false)
292  {
293  if (substr($file, 0, 13) == 'mod_commande_' && substr($file, dol_strlen($file)-3, 3) == 'php')
294  {
295  $file = substr($file, 0, dol_strlen($file)-4);
296 
297  require_once $dir.$file.'.php';
298 
299  $module = new $file($db);
300 
301  // Show modules according to features level
302  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
303  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
304 
305  if ($module->isEnabled())
306  {
307 
308  print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
309  print $module->info();
310  print '</td>';
311 
312  // Show example of numbering model
313  print '<td class="nowrap">';
314  $tmp=$module->getExample();
315  if (preg_match('/^Error/',$tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
316  elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
317  else print $tmp;
318  print '</td>'."\n";
319 
320  print '<td align="center">';
321  if ($conf->global->COMMANDE_ADDON == $file)
322  {
323  print img_picto($langs->trans("Activated"),'switch_on');
324  }
325  else
326  {
327  print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">';
328  print img_picto($langs->trans("Disabled"),'switch_off');
329  print '</a>';
330  }
331  print '</td>';
332 
333  $commande=new Commande($db);
334  $commande->initAsSpecimen();
335 
336  // Info
337  $htmltooltip='';
338  $htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
339  $commande->type=0;
340  $nextval=$module->getNextValue($mysoc,$commande);
341  if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
342  $htmltooltip.=''.$langs->trans("NextValue").': ';
343  if ($nextval) {
344  if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
345  $nextval = $langs->trans($nextval);
346  $htmltooltip.=$nextval.'<br>';
347  } else {
348  $htmltooltip.=$langs->trans($module->error).'<br>';
349  }
350  }
351 
352  print '<td align="center">';
353  print $form->textwithpicto('',$htmltooltip,1,0);
354  print '</td>';
355 
356  print "</tr>\n";
357  }
358  }
359  }
360  closedir($handle);
361  }
362  }
363 }
364 print "</table><br>\n";
365 
366 
367 /*
368  * Document templates generators
369  */
370 
371 print load_fiche_titre($langs->trans("OrdersModelModule"),'','');
372 
373 // Load array def with activated templates
374 $def = array();
375 $sql = "SELECT nom";
376 $sql.= " FROM ".MAIN_DB_PREFIX."document_model";
377 $sql.= " WHERE type = '".$type."'";
378 $sql.= " AND entity = ".$conf->entity;
379 $resql=$db->query($sql);
380 if ($resql)
381 {
382  $i = 0;
383  $num_rows=$db->num_rows($resql);
384  while ($i < $num_rows)
385  {
386  $array = $db->fetch_array($resql);
387  array_push($def, $array[0]);
388  $i++;
389  }
390 }
391 else
392 {
393  dol_print_error($db);
394 }
395 
396 
397 print "<table class=\"noborder\" width=\"100%\">\n";
398 print "<tr class=\"liste_titre\">\n";
399 print '<td>'.$langs->trans("Name").'</td>';
400 print '<td>'.$langs->trans("Description").'</td>';
401 print '<td align="center" width="60">'.$langs->trans("Status")."</td>\n";
402 print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
403 print '<td align="center" width="38">'.$langs->trans("ShortInfo").'</td>';
404 print '<td align="center" width="38">'.$langs->trans("Preview").'</td>';
405 print "</tr>\n";
406 
407 clearstatcache();
408 
409 $var=true;
410 foreach ($dirmodels as $reldir)
411 {
412  foreach (array('','/doc') as $valdir)
413  {
414  $dir = dol_buildpath($reldir."core/modules/commande".$valdir);
415 
416  if (is_dir($dir))
417  {
418  $handle=opendir($dir);
419  if (is_resource($handle))
420  {
421  while (($file = readdir($handle))!==false)
422  {
423  $filelist[]=$file;
424  }
425  closedir($handle);
426  arsort($filelist);
427 
428  foreach($filelist as $file)
429  {
430  if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
431  {
432 
433  if (file_exists($dir.'/'.$file))
434  {
435  $name = substr($file, 4, dol_strlen($file) -16);
436  $classname = substr($file, 0, dol_strlen($file) -12);
437 
438  require_once $dir.'/'.$file;
439  $module = new $classname($db);
440 
441  $modulequalified=1;
442  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
443  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
444 
445  if ($modulequalified)
446  {
447  $var = !$var;
448  print '<tr class="oddeven"><td width="100">';
449  print (empty($module->name)?$name:$module->name);
450  print "</td><td>\n";
451  if (method_exists($module,'info')) print $module->info($langs);
452  else print $module->description;
453  print '</td>';
454 
455  // Active
456  if (in_array($name, $def))
457  {
458  print '<td align="center">'."\n";
459  print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
460  print img_picto($langs->trans("Enabled"),'switch_on');
461  print '</a>';
462  print '</td>';
463  }
464  else
465  {
466  print '<td align="center">'."\n";
467  print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
468  print "</td>";
469  }
470 
471  // Default
472  print '<td align="center">';
473  if ($conf->global->COMMANDE_ADDON_PDF == $name)
474  {
475  print img_picto($langs->trans("Default"),'on');
476  }
477  else
478  {
479  print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
480  }
481  print '</td>';
482 
483  // Info
484  $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
485  $htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
486  if ($module->type == 'pdf')
487  {
488  $htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
489  }
490  $htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
491  $htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
492  $htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
493  $htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
494  $htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
495  //$htmltooltip.='<br>'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1);
496  //$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
497  $htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1);
498 
499 
500  print '<td align="center">';
501  print $form->textwithpicto('',$htmltooltip,1,0);
502  print '</td>';
503 
504  // Preview
505  print '<td align="center">';
506  if ($module->type == 'pdf')
507  {
508  print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
509  }
510  else
511  {
512  print img_object($langs->trans("PreviewNotAvailable"),'generic');
513  }
514  print '</td>';
515 
516  print "</tr>\n";
517  }
518  }
519  }
520  }
521  }
522  }
523  }
524 }
525 
526 print '</table>';
527 print "<br>";
528 
529 /*
530  * Other options
531  */
532 
533 print load_fiche_titre($langs->trans("OtherOptions"),'','');
534 print '<table class="noborder" width="100%">';
535 print '<tr class="liste_titre">';
536 print '<td>'.$langs->trans("Parameter").'</td>';
537 print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
538 print "<td>&nbsp;</td>\n";
539 print "</tr>\n";
540 $var=true;
541 
542 $substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
543 $substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
544 $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
545 foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
546 $htmltext.='</i>';
547 
548 $var=! $var;
549 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
550 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
551 print '<input type="hidden" name="action" value="set_ORDER_FREE_TEXT">';
552 print '<tr class="oddeven"><td colspan="2">';
553 print $form->textwithpicto($langs->trans("FreeLegalTextOnOrders"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
554 $variablename='ORDER_FREE_TEXT';
555 if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
556 {
557  print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
558 }
559 else
560 {
561  include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
562  $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes');
563  print $doleditor->Create();
564 }
565 print '</td><td align="right">';
566 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
567 print "</td></tr>\n";
568 print '</form>';
569 
570 //Use draft Watermark
571 
572 print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
573 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
574 print "<input type=\"hidden\" name=\"action\" value=\"set_COMMANDE_DRAFT_WATERMARK\">";
575 print '<tr class="oddeven"><td>';
576 print $form->textwithpicto($langs->trans("WatermarkOnDraftOrders"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
577 print '</td><td>';
578 print '<input class="flat minwidth200" type="text" name="COMMANDE_DRAFT_WATERMARK" value="'.$conf->global->COMMANDE_DRAFT_WATERMARK.'">';
579 print '</td><td align="right">';
580 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
581 print "</td></tr>\n";
582 print '</form>';
583 
584 // Shippable Icon in List
585 /* Kept as hidden feature for the moment, result seems bugged.
586 Whet is definition of "shippable" according to all different STOCK_CALCULATE_... options ?
587 
588 print '<tr class="oddeven">';
589 print '<td>'.$langs->trans("ShippableOrderIconInList").'</td>';
590 print '<td>&nbsp</td>';
591 print '<td align="center">';
592 if (!empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) {
593  print '<a href="'.$_SERVER['PHP_SELF'].'?action=setshippableiconinlist&value=0">';
594  print img_picto($langs->trans("Activated"),'switch_on');
595 } else {
596  print '<a href="'.$_SERVER['PHP_SELF'].'?action=setshippableiconinlist&value=1">';
597  print img_picto($langs->trans("Disabled"),'switch_off');
598 }
599 print '</a></td>';
600 print '</tr>';
601 
602 /* Seems to be not so used. So kept hidden for the moment to avoid dangerous options inflation.
603 /*
604 // Ask for payment bank during order
605 if ($conf->banque->enabled)
606 {
607 
608  print '<tr class="oddeven"><td>';
609  print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").'</td><td>&nbsp</td><td align="center">';
610  if (! empty($conf->use_javascript_ajax))
611  {
612  print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_ORDER');
613  }
614  else
615  {
616  if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER))
617  {
618  print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_ORDER&amp;value=1">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
619  }
620  else
621  {
622  print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_ORDER&amp;value=0">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
623  }
624  }
625  print '</td></tr>';
626 }
627 else
628 {
629 
630  print '<tr class="oddeven"><td>';
631  print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_ORDER").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
632 }
633 
634 // Ask for warehouse during order
635 if ($conf->stock->enabled)
636 {
637 
638  print '<tr class="oddeven"><td>';
639  print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td>&nbsp</td><td align="center">';
640  if (! empty($conf->use_javascript_ajax))
641  {
642  print ajax_constantonoff('WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER');
643  }
644  else
645  {
646  if (empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER))
647  {
648  print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER&amp;value=1">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
649  }
650  else
651  {
652  print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER&amp;value=0">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
653  }
654  }
655  print '</td></tr>';
656 }
657 else
658 {
659 
660  print '<tr class="oddeven"><td>';
661  print $langs->trans("WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
662 }
663 */
664 
665 print '</table>';
666 print '<br>';
667 
668 
669 /*
670  * Notifications
671  */
672 
673 print load_fiche_titre($langs->trans("Notifications"),'','');
674 print '<table class="noborder" width="100%">';
675 print '<tr class="liste_titre">';
676 print '<td>'.$langs->trans("Parameter").'</td>';
677 print '<td align="center" width="60"></td>';
678 print '<td width="80">&nbsp;</td>';
679 print "</tr>\n";
680 
681 print '<tr class="oddeven"><td colspan="2">';
682 print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
683 print '</td><td align="right">';
684 print "</td></tr>\n";
685 
686 print '</table>';
687 
688 
689 llxFooter();
690 
691 $db->close();
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 ...
order_admin_prepare_head()
Return array head with list of tabs to view object informations.
Definition: order.lib.php:123
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
Class to manage customers orders.
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
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.