dolibarr  19.0.0-dev
supplier_order.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
6 * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
7 * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
8 * Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 */
23 
30 // Load Dolibarr environment
31 require '../main.inc.php';
32 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
35 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
36 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
37 
38 // Load translation files required by the page
39 $langs->loadLangs(array("admin", "other", "orders", "stocks"));
40 
41 $action = GETPOST('action', 'aZ09');
42 
43 $type = GETPOST('type', 'alpha');
44 $value = GETPOST('value', 'alpha');
45 $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
46 
47 $label = GETPOST('label', 'alpha');
48 $scandir = GETPOST('scan_dir', 'alpha');
49 
50 $specimenthirdparty = new Societe($db);
51 $specimenthirdparty->initAsSpecimen();
52 
53 $error = 0;
54 
55 if (!$user->admin) {
57 }
58 
59 
60 /*
61  * Actions
62  */
63 
64 include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
65 
66 if ($action == 'updateMask') {
67  $maskconstorder = GETPOST('maskconstorder', 'aZ09');
68  $maskvalue = GETPOST('maskorder', 'alpha');
69 
70  if ($maskconstorder && preg_match('/_MASK$/', $maskconstorder)) {
71  $res = dolibarr_set_const($db, $maskconstorder, $maskvalue, 'chaine', 0, '', $conf->entity);
72  }
73 
74  if (!($res > 0)) {
75  $error++;
76  }
77 
78  if (!$error) {
79  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
80  } else {
81  setEventMessages($langs->trans("Error"), null, 'errors');
82  }
83 }
84 
85 if ($action == 'specimen') { // For orders
86  $modele = GETPOST('module', 'alpha');
87 
88  $commande = new CommandeFournisseur($db);
89  $commande->initAsSpecimen();
90  $commande->thirdparty = $specimenthirdparty;
91 
92  // Search template files
93  $file = '';
94  $classname = '';
95  $filefound = 0;
96  $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
97  foreach ($dirmodels as $reldir) {
98  $file = dol_buildpath($reldir."core/modules/supplier_order/doc/pdf_".$modele.".modules.php", 0);
99  if (file_exists($file)) {
100  $filefound = 1;
101  $classname = "pdf_".$modele;
102  break;
103  }
104  }
105 
106  if ($filefound) {
107  require_once $file;
108 
109  $module = new $classname($db, $commande);
110 
111  if ($module->write_file($commande, $langs) > 0) {
112  header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande_fournisseur&file=SPECIMEN.pdf");
113  return;
114  } else {
115  setEventMessages($module->error, $module->errors, 'errors');
116  dol_syslog($module->error, LOG_ERR);
117  }
118  } else {
119  setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
120  dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
121  }
122 } elseif ($action == 'set') {
123  // Activate a model
124  $ret = addDocumentModel($value, $type, $label, $scandir);
125 } elseif ($action == 'del') {
126  $ret = delDocumentModel($value, $type);
127  if ($ret > 0) {
128  if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$value") {
129  dolibarr_del_const($db, 'COMMANDE_SUPPLIER_ADDON_PDF', $conf->entity);
130  }
131  }
132 } elseif ($action == 'setdoc') {
133  // Set default model
134  if (dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
135  // La constante qui a ete lue en avant du nouveau set
136  // on passe donc par une variable pour avoir un affichage coherent
137  $conf->global->COMMANDE_SUPPLIER_ADDON_PDF = $value;
138  }
139 
140  // On active le modele
141  $ret = delDocumentModel($value, $type);
142  if ($ret > 0) {
143  $ret = addDocumentModel($value, $type, $label, $scandir);
144  }
145 } elseif ($action == 'unsetdoc') {
146  dolibarr_del_const($db, "COMMANDE_SUPPLIER_ADDON_PDF", $conf->entity);
147 } elseif ($action == 'setmod') {
148  // TODO Verifier si module numerotation choisi peut etre active
149  // par appel methode canBeActivated
150 
151  dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity);
152 } elseif ($action == 'addcat') {
153  $fourn = new Fournisseur($db);
154  $fourn->CreateCategory($user, GETPOST('cat', 'alphanohtml'));
155 } elseif ($action == 'set_SUPPLIER_ORDER_OTHER') {
156  $freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
157  $doubleapproval = GETPOST('SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED', 'alpha');
158  $doubleapproval = price2num($doubleapproval);
159 
160  $res1 = dolibarr_set_const($db, "SUPPLIER_ORDER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
161  $res2 = dolibarr_set_const($db, "SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED", $doubleapproval, 'chaine', 0, '', $conf->entity);
162 
163  // TODO We add/delete permission here until permission can have a condition on a global var
164  include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
165  $newmodule = new modFournisseur($db);
166 
167  if ($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED) {
168  // clear default rights array
169  $newmodule->rights = array();
170  // add new right
171  $r = 0;
172  $newmodule->rights[$r][0] = 1190;
173  $newmodule->rights[$r][1] = $langs->trans("Permission1190");
174  $newmodule->rights[$r][2] = 'w';
175  $newmodule->rights[$r][3] = 0;
176  $newmodule->rights[$r][4] = 'commande';
177  $newmodule->rights[$r][5] = 'approve2';
178 
179  // Insert
180  $newmodule->insert_permissions(1);
181  } else {
182  // Remove all rights with Permission1190
183  $newmodule->delete_permissions();
184 
185  // Add all right without Permission1190
186  $newmodule->insert_permissions(1);
187  }
188 } elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER') {
189  // Activate ask for payment bank
190  $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER", $value, 'chaine', 0, '', $conf->entity);
191 
192  if (!($res > 0)) {
193  $error++;
194  }
195 
196  if (!$error) {
197  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
198  } else {
199  setEventMessages($langs->trans("Error"), null, 'errors');
200  }
201 }
202 
203 
204 /*
205 * View
206 */
207 
208 $form = new Form($db);
209 
210 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
211 
212 llxHeader("", "");
213 
214 $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
215 print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup');
216 
217 print "<br>";
218 
220 
221 print dol_get_fiche_head($head, 'order', $langs->trans("Suppliers"), -1, 'company');
222 
223 
224 // Supplier order numbering module
225 
226 print load_fiche_titre($langs->trans("OrdersNumberingModules"), '', '');
227 
228 print '<div class="div-table-responsive-no-min">';
229 print '<table class="noborder centpercent">';
230 print '<tr class="liste_titre">';
231 print '<td width="100">'.$langs->trans("Name").'</td>';
232 print '<td>'.$langs->trans("Description").'</td>';
233 print '<td>'.$langs->trans("Example").'</td>';
234 print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
235 print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
236 print "</tr>\n";
237 
238 clearstatcache();
239 
240 foreach ($dirmodels as $reldir) {
241  $dir = dol_buildpath($reldir."core/modules/supplier_order/");
242 
243  if (is_dir($dir)) {
244  $handle = opendir($dir);
245  if (is_resource($handle)) {
246  while (($file = readdir($handle)) !== false) {
247  if (substr($file, 0, 25) == 'mod_commande_fournisseur_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
248  $file = substr($file, 0, dol_strlen($file) - 4);
249 
250  require_once $dir.$file.'.php';
251 
252  $module = new $file;
253 
254  if ($module->isEnabled()) {
255  // Show modules according to features level
256  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
257  continue;
258  }
259  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
260  continue;
261  }
262 
263 
264  print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
265  print $module->info();
266  print '</td>';
267 
268  // Show example of numbering module
269  print '<td class="nowrap">';
270  $tmp = $module->getExample();
271  if (preg_match('/^Error/', $tmp)) {
272  $langs->load("errors");
273  print '<div class="error">'.$langs->trans($tmp).'</div>';
274  } elseif ($tmp == 'NotConfigured') {
275  print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
276  } else {
277  print $tmp;
278  }
279  print '</td>'."\n";
280 
281  print '<td class="center">';
282  if ($conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER == "$file") {
283  print img_picto($langs->trans("Activated"), 'switch_on');
284  } else {
285  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.urlencode($file).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
286  }
287  print '</td>';
288 
289  $commande = new CommandeFournisseur($db);
290  $commande->initAsSpecimen();
291 
292  // Info
293  $htmltooltip = '';
294  $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
295  $nextval = $module->getNextValue($mysoc, $commande);
296  if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
297  $htmltooltip .= ''.$langs->trans("NextValue").': ';
298  if ($nextval) {
299  if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
300  $nextval = $langs->trans($nextval);
301  }
302  $htmltooltip .= $nextval.'<br>';
303  } else {
304  $htmltooltip .= $langs->trans($module->error).'<br>';
305  }
306  }
307 
308  print '<td class="center">';
309  print $form->textwithpicto('', $htmltooltip, 1, 0);
310  print '</td>';
311 
312  print '</tr>';
313  }
314  }
315  }
316  closedir($handle);
317  }
318  }
319 }
320 
321 print '</table></div><br>';
322 
323 
324 /*
325  * Documents models for supplier orders
326  */
327 
328 print load_fiche_titre($langs->trans("OrdersModelModule"), '', '');
329 
330 // Defini tableau def de modele
331 $def = array();
332 
333 $sql = "SELECT nom";
334 $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
335 $sql .= " WHERE type = 'order_supplier'";
336 $sql .= " AND entity = ".$conf->entity;
337 
338 $resql = $db->query($sql);
339 if ($resql) {
340  $i = 0;
341  $num_rows = $db->num_rows($resql);
342  while ($i < $num_rows) {
343  $array = $db->fetch_array($resql);
344  array_push($def, $array[0]);
345  $i++;
346  }
347 } else {
348  dol_print_error($db);
349 }
350 
351 print '<div class="div-table-responsive-no-min">';
352 print '<table class="noborder centpercent">'."\n";
353 print '<tr class="liste_titre">'."\n";
354 print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
355 print '<td>'.$langs->trans("Description").'</td>'."\n";
356 print '<td align="center" width="60">'.$langs->trans("Status").'</td>'."\n";
357 print '<td align="center" width="60">'.$langs->trans("Default").'</td>'."\n";
358 print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>';
359 print '<td align="center" width="40">'.$langs->trans("Preview").'</td>';
360 print '</tr>'."\n";
361 
362 clearstatcache();
363 
364 foreach ($dirmodels as $reldir) {
365  $realpath = $reldir."core/modules/supplier_order/doc";
366  $dir = dol_buildpath($realpath);
367 
368  if (is_dir($dir)) {
369  $handle = opendir($dir);
370  if (is_resource($handle)) {
371  while (($file = readdir($handle)) !== false) {
372  if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
373  $name = substr($file, 4, dol_strlen($file) - 16);
374  $classname = substr($file, 0, dol_strlen($file) - 12);
375 
376  require_once $dir.'/'.$file;
377  $module = new $classname($db, new CommandeFournisseur($db));
378 
379 
380  print "<tr class=\"oddeven\">\n";
381  print "<td>";
382  print(empty($module->name) ? $name : $module->name);
383  print "</td>\n";
384  print "<td>\n";
385  require_once $dir.'/'.$file;
386  $module = new $classname($db, $specimenthirdparty);
387  if (method_exists($module, 'info')) {
388  print $module->info($langs);
389  } else {
390  print $module->description;
391  }
392  print "</td>\n";
393 
394  // Active
395  if (in_array($name, $def)) {
396  print '<td class="center">'."\n";
397  if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name") {
398  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier">';
399  print img_picto($langs->trans("Enabled"), 'switch_on');
400  print '</a>';
401  } else {
402  print img_picto($langs->trans("Enabled"), 'switch_on');
403  }
404  print "</td>";
405  } else {
406  print '<td class="center">'."\n";
407  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
408  print "</td>";
409  }
410 
411  // Default
412  print '<td class="center">';
413  if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") {
414  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
415  } else {
416  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type=order_supplier" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
417  }
418  print '</td>';
419 
420  // Info
421  $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
422  $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
423  $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
424  $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
425 
426  $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
427  $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
428  $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
429  $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
430  print '<td class="center">';
431  print $form->textwithpicto('', $htmltooltip, 1, 0);
432  print '</td>';
433  print '<td class="center">';
434  print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.urlencode($name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
435  print '</td>';
436 
437  print "</tr>\n";
438  }
439  }
440 
441  closedir($handle);
442  }
443  }
444 }
445 
446 print '</table></div><br>';
447 
448 /*
449  * Other options
450  */
451 
452 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
453 print '<input type="hidden" name="token" value="'.newToken().'">';
454 print '<input type="hidden" name="action" value="set_SUPPLIER_ORDER_OTHER">';
455 
456 print load_fiche_titre($langs->trans("OtherOptions"), '', '');
457 
458 print '<div class="div-table-responsive-no-min">';
459 print '<table class="noborder centpercent">';
460 print '<tr class="liste_titre">';
461 print '<td>'.$langs->trans("Parameter").'</td>';
462 print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
463 print '<td width="80">&nbsp;</td>';
464 print "</tr>\n";
465 
466 print '<tr class="oddeven"><td>';
467 print $form->textwithpicto($langs->trans("UseDoubleApproval"), $langs->trans("Use3StepsApproval"), 1, 'help').'<br>';
468 print $langs->trans("IfSetToYesDontForgetPermission");
469 print '</td><td>';
470 print '<input type="text" size="6" name="SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED" value="'.getDolGlobalString("SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED").'">';
471 print '</td><td class="right">';
472 print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
473 print "</td></tr>\n";
474 
475 
476 // Ask for payment bank during supplier order
477 /* Kept as hidden for the moment
478 if (isModEnabled('banque')) {
479 
480 print '<tr class="oddeven"><td>';
481 print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").'</td><td>&nbsp;</td><td align="center">';
482 if (!empty($conf->use_javascript_ajax))
483 {
484 print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER');
485 }
486 else
487 {
488 if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER))
489 {
490 print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER&token='.newToken().'&value=1">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
491 }
492 else
493 {
494 print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER&token='.newToken().'&value=0">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
495 }
496 }
497 print '</td></tr>';
498 }
499 else
500 {
501 
502 print '<tr class="oddeven"><td>';
503 print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
504 }
505 */
506 
507 $substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
508 $substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
509 $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
510 foreach ($substitutionarray as $key => $val) {
511  $htmltext .= $key.'<br>';
512 }
513 $htmltext .= '</i>';
514 
515 print '<tr class="oddeven"><td colspan="2">';
516 print $form->textwithpicto($langs->trans("FreeLegalTextOnOrders"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
517 $variablename = 'SUPPLIER_ORDER_FREE_TEXT';
518 if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
519  print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
520 } else {
521  include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
522  $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
523  print $doleditor->Create();
524 }
525 print '</td><td class="right">';
526 print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
527 print "</td></tr>\n";
528 
529 // Option to add a quality/validation step, on products, after reception.
530 print '<tr class="oddeven">';
531 print '<td>'.$langs->trans("UseDispatchStatus").'</td>';
532 print '<td></td>';
533 print '<td class="center">';
534 if (isModEnabled('reception')) {
535  print '<span class="opacitymedium">'.$langs->trans("FeatureNotAvailableWithReceptionModule").'</span>';
536 } else {
537  if ($conf->use_javascript_ajax) {
538  print ajax_constantonoff('SUPPLIER_ORDER_USE_DISPATCH_STATUS');
539  } else {
540  $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
541  print $form->selectarray("SUPPLIER_ORDER_USE_DISPATCH_STATUS", $arrval, $conf->global->SUPPLIER_ORDER_USE_DISPATCH_STATUS);
542  }
543 }
544 print "</td>\n";
545 print "</tr>\n";
546 
547 print '</table></div><br>';
548 
549 print '</form>';
550 
551 
552 /*
553 * Notifications
554 */
555 
556 print load_fiche_titre($langs->trans("Notifications"), '', '');
557 
558 print '<div class="div-table-responsive-no-min">';
559 print '<table class="noborder centpercent">';
560 print '<tr class="liste_titre">';
561 print '<td>'.$langs->trans("Parameter").'</td>';
562 print '<td align="center" width="60"></td>';
563 print '<td width="80">&nbsp;</td>';
564 print "</tr>\n";
565 
566 print '<tr class="oddeven"><td colspan="2">';
567 print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
568 print '</td><td class="right">';
569 print "</td></tr>\n";
570 
571 print '</table>';
572 print '</div>';
573 
574 // End of page
575 llxFooter();
576 $db->close();
Societe
Class to manage third parties objects (customers, suppliers, prospects...)
Definition: societe.class.php:51
yn
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
Definition: functions.lib.php:6824
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:70
dolibarr_del_const
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
Definition: admin.lib.php:562
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5477
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:609
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:5107
dol_buildpath
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
Definition: functions.lib.php:1158
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
ajax_constantonoff
ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0, $forcereload=0, $marginleftonlyshort=2, $forcenoajax=0, $setzeroinsteadofdel=0, $suffix='', $mode='', $morecss='inline-block')
On/off button for constant.
Definition: ajax.lib.php:630
price2num
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
Definition: functions.lib.php:5955
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:4135
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:56
delDocumentModel
delDocumentModel($name, $type)
Delete document model used by doc generator.
Definition: admin.lib.php:1949
Fournisseur
Class to manage suppliers.
Definition: fournisseur.class.php:34
dol_syslog
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
Definition: functions.lib.php:1741
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
Definition: functions.lib.php:8673
$sql
if(isModEnabled('facture') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $sql
Social contributions to pay.
Definition: index.php:746
dol_strlen
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
Definition: functions.lib.php:3997
newToken
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Definition: functions.lib.php:11654
isModEnabled
isModEnabled($module)
Is Dolibarr module enabled.
Definition: functions.lib.php:207
supplierorder_admin_prepare_head
supplierorder_admin_prepare_head()
Return array head with list of tabs to view object informations.
Definition: fourn.lib.php:251
dol_get_fiche_head
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
Definition: functions.lib.php:1979
getDolGlobalString
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
Definition: functions.lib.php:142
CommandeFournisseur
Class to manage predefined suppliers products.
Definition: fournisseur.commande.class.php:48
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:638
addDocumentModel
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
Definition: admin.lib.php:1918
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:53
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:4473
modFournisseur
Description and activation class for module Fournisseur.
Definition: modFournisseur.class.php:37
pdf_getSubstitutionArray
pdf_getSubstitutionArray($outputlangs, $exclude=null, $object=null, $onlykey=0, $include=null)
Return array of possible substitutions for PDF content (without external module substitutions).
Definition: pdf.lib.php:753
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
Definition: security.lib.php:1169
DolEditor
Class to manage a WYSIWYG editor.
Definition: doleditor.class.php:30