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