commande.php 23 KB

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