fournisseur.php 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  1. <?php
  2. /* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
  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 Juanjo Menent <jmenent@2byte.es>
  8. * Copyright (C) 2011 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 2 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 <http://www.gnu.org/licenses/>.
  22. */
  23. /**
  24. * \file htdocs/admin/fournisseur.php
  25. * \ingroup fournisseur
  26. * \brief Page d'administration-configuration du module Fournisseur
  27. */
  28. require("../main.inc.php");
  29. require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
  30. require_once(DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php');
  31. require_once(DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php');
  32. require_once(DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php');
  33. $langs->load("admin");
  34. $langs->load("bills");
  35. $langs->load("other");
  36. $langs->load("orders");
  37. if (!$user->admin)
  38. accessforbidden();
  39. $type=GETPOST('type');
  40. $value=GETPOST('value');
  41. $action=GETPOST('action');
  42. $specimenthirdparty=new Societe($db);
  43. $specimenthirdparty->initAsSpecimen();
  44. /*
  45. * Actions
  46. */
  47. if ($action == 'updateMask')
  48. {
  49. $maskconstorder=$_POST['maskconstorder'];
  50. $maskorder=$_POST['maskorder'];
  51. if ($maskconstorder) dolibarr_set_const($db,$maskconstorder,$maskorder,'chaine',0,'',$conf->entity);
  52. }
  53. if ($action == 'specimen') // For orders
  54. {
  55. $modele=$_GET["module"];
  56. $commande = new CommandeFournisseur($db);
  57. $commande->initAsSpecimen();
  58. $commande->thirdparty=$specimenthirdparty;
  59. // Charge le modele
  60. $dir = "/includes/modules/supplier_order/pdf/";
  61. $file = "pdf_".$modele.".modules.php";
  62. $file = dol_buildpath($dir.$file);
  63. if (file_exists($file))
  64. {
  65. $classname = "pdf_".$modele;
  66. require_once($file);
  67. $obj = new $classname($db,$commande);
  68. if ($obj->write_file($commande,$langs) > 0)
  69. {
  70. header("Location: ".DOL_URL_ROOT."/document.php?modulepart=commande_fournisseur&file=SPECIMEN.pdf");
  71. return;
  72. }
  73. else
  74. {
  75. $mesg='<div class="error">'.$obj->error.'</div>';
  76. dol_syslog($obj->error, LOG_ERR);
  77. }
  78. }
  79. else
  80. {
  81. $mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>';
  82. dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
  83. }
  84. }
  85. if ($action == 'specimenfacture') // For invoices
  86. {
  87. $modele=$_GET["module"];
  88. $facture = new FactureFournisseur($db);
  89. $facture->initAsSpecimen();
  90. $facture->thirdparty=$specimenthirdparty;
  91. // Charge le modele
  92. $dir = "/includes/modules/supplier_invoice/pdf/";
  93. $file = "pdf_".$modele.".modules.php";
  94. $file = dol_buildpath($dir.$file);
  95. if (file_exists($file))
  96. {
  97. $classname = "pdf_".$modele;
  98. require_once($file);
  99. $obj = new $classname($db,$facture);
  100. if ($obj->write_file($facture,$langs) > 0)
  101. {
  102. header("Location: ".DOL_URL_ROOT."/document.php?modulepart=facture_fournisseur&file=SPECIMEN.pdf");
  103. return;
  104. }
  105. else
  106. {
  107. $mesg='<div class="error">'.$obj->error.'</div>';
  108. dol_syslog($obj->error, LOG_ERR);
  109. }
  110. }
  111. else
  112. {
  113. $mesg='<div class="error">'.$langs->trans("ErrorModuleNotFound").'</div>';
  114. dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
  115. }
  116. }
  117. if ($action == 'set')
  118. {
  119. $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
  120. $sql.= " VALUES ('".$db->escape($value)."','".$type."',".$conf->entity.", ";
  121. $sql.= ($_GET["label"]?"'".$db->escape($_GET["label"])."'":'null').", ";
  122. $sql.= (! empty($_GET["scandir"])?"'".$db->escape($_GET["scandir"])."'":"null");
  123. $sql.= ")";
  124. $res=$db->query($sql);
  125. if ($res)
  126. {
  127. }
  128. // else dol_print_error($db);
  129. }
  130. if ($action == 'del')
  131. {
  132. $sql = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
  133. $sql.= " WHERE nom = '".$value."'";
  134. $sql.= " AND type = '".$type."'";
  135. $sql.= " AND entity = ".$conf->entity;
  136. $db->query($sql);
  137. if ($res)
  138. {
  139. }
  140. // else dol_print_error($db);
  141. }
  142. if ($action == 'setdoc')
  143. {
  144. $db->begin();
  145. if ($_GET["type"] == 'order_supplier' && dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
  146. {
  147. $conf->global->COMMANDE_SUPPLIER_ADDON_PDF = $value;
  148. }
  149. if ($_GET["type"] == 'invoice_supplier' && dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
  150. {
  151. $conf->global->INVOICE_SUPPLIER_ADDON_PDF = $value;
  152. }
  153. // On active le modele
  154. $sql_del = "DELETE FROM ".MAIN_DB_PREFIX."document_model";
  155. $sql_del.= " WHERE nom = '".$db->escape($value)."'";
  156. $sql_del.= " AND type = '".$type."'";
  157. $sql_del.= " AND entity = ".$conf->entity;
  158. $result1=$db->query($sql_del);
  159. $sql = "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity, libelle, description)";
  160. $sql.= " VALUES ('".$db->escape($value)."', '".$type."', ".$conf->entity.", ";
  161. $sql.= ($_GET["label"]?"'".$db->escape($_GET["label"])."'":'null').", ";
  162. $sql.= (! empty($_GET["scandir"])?"'".$db->escape($_GET["scandir"])."'":"null");
  163. $sql.= ")";
  164. $result2=$db->query($sql);
  165. if ($result1 && $result2)
  166. {
  167. $db->commit();
  168. }
  169. else
  170. {
  171. $db->rollback();
  172. }
  173. }
  174. if ($action == 'setmod')
  175. {
  176. // TODO Verifier si module numerotation choisi peut etre active
  177. // par appel methode canBeActivated
  178. dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON",$value,'chaine',0,'',$conf->entity);
  179. }
  180. if ($action == 'addcat')
  181. {
  182. $fourn = new Fournisseur($db);
  183. $fourn->CreateCategory($user,$_POST["cat"]);
  184. }
  185. if ($action == 'set_SUPPLIER_INVOICE_FREE_TEXT')
  186. {
  187. dolibarr_set_const($db, "SUPPLIER_INVOICE_FREE_TEXT",$_POST["SUPPLIER_INVOICE_FREE_TEXT"],'chaine',0,'',$conf->entity);
  188. }
  189. /*
  190. * View
  191. */
  192. $html=new Form($db);
  193. llxHeader();
  194. $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
  195. print_fiche_titre($langs->trans("SuppliersSetup"),$linkback,'setup');
  196. print "<br>";
  197. // Supplier order numbering module
  198. print_titre($langs->trans("OrdersNumberingModules"));
  199. print '<table class="noborder" width="100%">';
  200. print '<tr class="liste_titre">';
  201. print '<td width="100">'.$langs->trans("Name").'</td>';
  202. print '<td>'.$langs->trans("Description").'</td>';
  203. print '<td>'.$langs->trans("Example").'</td>';
  204. print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
  205. print '<td align="center" width="16">'.$langs->trans("Info").'</td>';
  206. print "</tr>\n";
  207. clearstatcache();
  208. foreach ($conf->file->dol_document_root as $dirroot)
  209. {
  210. $dir = $dirroot . "/includes/modules/supplier_order/";
  211. if (is_dir($dir))
  212. {
  213. $handle = opendir($dir);
  214. if (is_resource($handle))
  215. {
  216. $var=true;
  217. while (($file = readdir($handle))!==false)
  218. {
  219. if (substr($file, 0, 25) == 'mod_commande_fournisseur_' && substr($file, dol_strlen($file)-3, 3) == 'php')
  220. {
  221. $file = substr($file, 0, dol_strlen($file)-4);
  222. require_once($dir.$file.".php");
  223. $module = new $file;
  224. if ($module->isEnabled())
  225. {
  226. // Show modules according to features level
  227. if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
  228. if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
  229. $var=!$var;
  230. print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
  231. print $module->info();
  232. print '</td>';
  233. // Show example of numbering module
  234. print '<td nowrap="nowrap">';
  235. $tmp=$module->getExample();
  236. if (preg_match('/^Error/',$tmp)) print $langs->trans($tmp);
  237. else print $tmp;
  238. print '</td>'."\n";
  239. print '<td align="center">';
  240. if ($conf->global->COMMANDE_SUPPLIER_ADDON == "$file")
  241. {
  242. print img_picto($langs->trans("Activated"),'on');
  243. }
  244. else
  245. {
  246. print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
  247. }
  248. print '</td>';
  249. $commande=new CommandeFournisseur($db);
  250. $commande->initAsSpecimen();
  251. // Info
  252. $htmltooltip='';
  253. $htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
  254. $facture->type=0;
  255. $nextval=$module->getNextValue($mysoc,$commande);
  256. if ("$nextval" != $langs->trans("NotAvailable")) // Keep " on nextval
  257. {
  258. $htmltooltip.=''.$langs->trans("NextValue").': ';
  259. if ($nextval)
  260. {
  261. $htmltooltip.=$nextval.'<br>';
  262. }
  263. else
  264. {
  265. $htmltooltip.=$langs->trans($module->error).'<br>';
  266. }
  267. }
  268. print '<td align="center">';
  269. print $html->textwithpicto('',$htmltooltip,1,0);
  270. print '</td>';
  271. print '</tr>';
  272. }
  273. }
  274. }
  275. closedir($handle);
  276. }
  277. }
  278. }
  279. print '</table><br>';
  280. /*
  281. * Modeles documents for supplier orders
  282. */
  283. print_titre($langs->trans("OrdersModelModule"));
  284. // Defini tableau def de modele
  285. $def = array();
  286. $sql = "SELECT nom";
  287. $sql.= " FROM ".MAIN_DB_PREFIX."document_model";
  288. $sql.= " WHERE type = 'order_supplier'";
  289. $sql.= " AND entity = ".$conf->entity;
  290. $resql=$db->query($sql);
  291. if ($resql)
  292. {
  293. $i = 0;
  294. $num_rows=$db->num_rows($resql);
  295. while ($i < $num_rows)
  296. {
  297. $array = $db->fetch_array($resql);
  298. array_push($def, $array[0]);
  299. $i++;
  300. }
  301. }
  302. else
  303. {
  304. dol_print_error($db);
  305. }
  306. print '<table class="noborder" width="100%">'."\n";
  307. print '<tr class="liste_titre">'."\n";
  308. print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
  309. print '<td>'.$langs->trans("Description").'</td>'."\n";
  310. print '<td align="center" width="60">'.$langs->trans("Status").'</td>'."\n";
  311. print '<td align="center" width="60">'.$langs->trans("Default").'</td>'."\n";
  312. print '<td align="center" width="40" colspan="2">'.$langs->trans("Info").'</td>';
  313. print '</tr>'."\n";
  314. clearstatcache();
  315. foreach ($conf->file->dol_document_root as $dirroot)
  316. {
  317. $dir = $dirroot . "/includes/modules/supplier_order/pdf/";
  318. if (is_dir($dir))
  319. {
  320. $var=true;
  321. $handle=opendir($dir);
  322. if (is_resource($handle))
  323. {
  324. while (($file = readdir($handle))!==false)
  325. {
  326. if (preg_match('/\.modules\.php$/i',$file) && substr($file,0,4) == 'pdf_')
  327. {
  328. $name = substr($file, 4, dol_strlen($file) -16);
  329. $classname = substr($file, 0, dol_strlen($file) -12);
  330. $var=!$var;
  331. print "<tr ".$bc[$var].">\n";
  332. print "<td>".$name."</td>\n";
  333. print "<td>\n";
  334. require_once($dir.$file);
  335. $module = new $classname($db,$specimenthirdparty);
  336. print $module->description;
  337. print "</td>\n";
  338. // Active
  339. if (in_array($name, $def))
  340. {
  341. print '<td align="center">'."\n";
  342. if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name")
  343. {
  344. print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=order_supplier">';
  345. print img_picto($langs->trans("Enabled"),'on');
  346. print '</a>';
  347. }
  348. else
  349. {
  350. print img_picto($langs->trans("Enabled"),'on');
  351. }
  352. print "</td>";
  353. }
  354. else
  355. {
  356. print '<td align="center">'."\n";
  357. print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=order_supplier">'.img_picto($langs->trans("Disabled"),'off').'</a>';
  358. print "</td>";
  359. }
  360. // Defaut
  361. print '<td align="center">';
  362. if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name")
  363. {
  364. print img_picto($langs->trans("Default"),'on');
  365. }
  366. else
  367. {
  368. print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
  369. }
  370. print '</td>';
  371. // Info
  372. $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
  373. $htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
  374. $htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
  375. $htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
  376. $htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
  377. $htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
  378. $htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
  379. print '<td align="center">';
  380. print $html->textwithpicto('',$htmltooltip,1,0);
  381. print '</td>';
  382. print '<td align="center">';
  383. print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&amp;module='.$name.'">'.img_object($langs->trans("Preview"),'order').'</a>';
  384. print '</td>';
  385. print "</tr>\n";
  386. }
  387. }
  388. closedir($handle);
  389. }
  390. }
  391. }
  392. print '</table><br/>';
  393. /*
  394. * Modeles documents for supplier invoices
  395. */
  396. print_titre($langs->trans("BillsPDFModules"));
  397. // Defini tableau def de modele
  398. $def = array();
  399. $sql = "SELECT nom";
  400. $sql.= " FROM ".MAIN_DB_PREFIX."document_model";
  401. $sql.= " WHERE type = 'invoice_supplier'";
  402. $sql.= " AND entity = ".$conf->entity;
  403. $resql=$db->query($sql);
  404. if ($resql)
  405. {
  406. $i = 0;
  407. $num_rows=$db->num_rows($resql);
  408. while ($i < $num_rows)
  409. {
  410. $array = $db->fetch_array($resql);
  411. array_push($def, $array[0]);
  412. $i++;
  413. }
  414. }
  415. else
  416. {
  417. dol_print_error($db);
  418. }
  419. print '<table class="noborder" width="100%">'."\n";
  420. print '<tr class="liste_titre">'."\n";
  421. print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
  422. print '<td>'.$langs->trans("Description").'</td>'."\n";
  423. print '<td align="center" width="60">'.$langs->trans("Status").'</td>'."\n";
  424. print '<td align="center" width="60">'.$langs->trans("Default").'</td>'."\n";
  425. print '<td align="center" width="40" colspan="2">'.$langs->trans("Info").'</td>';
  426. print '</tr>'."\n";
  427. clearstatcache();
  428. foreach ($conf->file->dol_document_root as $dirroot)
  429. {
  430. $dir = $dirroot . "/includes/modules/supplier_invoice/pdf/";
  431. if (is_dir($dir))
  432. {
  433. $var=true;
  434. $handle=opendir($dir);
  435. if (is_resource($handle))
  436. {
  437. while (($file = readdir($handle)) !== false)
  438. {
  439. if (preg_match('/\.modules\.php$/i',$file) && substr($file,0,4) == 'pdf_')
  440. {
  441. $name = substr($file, 4, dol_strlen($file) -16);
  442. $classname = substr($file, 0, dol_strlen($file) -12);
  443. $var=!$var;
  444. print "<tr ".$bc[$var].">\n";
  445. print "<td>".$name."</td>\n";
  446. print "<td>";
  447. require_once($dir.$file);
  448. $module = new $classname($db,$specimenthirdparty);
  449. print $module->description;
  450. print "</td>\n";
  451. // Active
  452. if (in_array($name, $def))
  453. {
  454. print "<td align=\"center\">\n";
  455. if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name")
  456. {
  457. print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier">';
  458. print img_picto($langs->trans("Enabled"),'on');
  459. print '</a>';
  460. }
  461. else
  462. {
  463. print img_picto($langs->trans("Enabled"),'on');
  464. }
  465. print "</td>";
  466. }
  467. else
  468. {
  469. print "<td align=\"center\">\n";
  470. print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier">'.img_picto($langs->trans("Disabled"),'off').'</a>';
  471. print "</td>";
  472. }
  473. // Defaut
  474. print "<td align=\"center\">";
  475. if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF == "$name")
  476. {
  477. print img_picto($langs->trans("Default"),'on');
  478. }
  479. else
  480. {
  481. print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'&amp;type=invoice_supplier" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
  482. }
  483. print '</td>';
  484. // Info
  485. $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
  486. $htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
  487. $htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
  488. $htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
  489. $htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
  490. $htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
  491. $htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
  492. print '<td align="center">';
  493. print $html->textwithpicto('',$htmltooltip,1,0);
  494. print '</td>';
  495. print '<td align="center">';
  496. print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimenfacture&amp;module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
  497. print '</td>';
  498. print "</tr>\n";
  499. }
  500. }
  501. closedir($handle);
  502. }
  503. }
  504. }
  505. print '</table><br/>';
  506. print_titre($langs->trans("OtherOptions"));
  507. print '<table class="noborder" width="100%">';
  508. print '<tr class="liste_titre">';
  509. print '<td>'.$langs->trans("Parameter").'</td>';
  510. print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
  511. print '<td width="80">&nbsp;</td>';
  512. print "</tr>\n";
  513. print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
  514. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  515. print '<input type="hidden" name="action" value="set_SUPPLIER_INVOICE_FREE_TEXT">';
  516. print '<tr '.$bc[$var].'><td colspan="2">';
  517. print $langs->trans("FreeLegalTextOnInvoices").' ('.$langs->trans("AddCRIfTooLong").')<br>';
  518. print '<textarea name="SUPPLIER_INVOICE_FREE_TEXT" class="flat" cols="120">'.$conf->global->SUPPLIER_INVOICE_FREE_TEXT.'</textarea>';
  519. print '</td><td align="right">';
  520. print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
  521. print "</td></tr>\n";
  522. print '</form>';
  523. llxFooter();
  524. ?>