PageRenderTime 50ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 1ms

/htdocs/admin/fournisseur.php

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