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