supplier_proposal.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. <?php
  2. /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2004-2011 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 Eric Seigne <eric.seigne@ryxeo.com>
  7. * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.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) 2015 Jean-François Ferry <jfefe@aternatik.fr>
  11. *
  12. * This program is free software; you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation; either version 3 of the License, or
  15. * (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. */
  25. require '../main.inc.php';
  26. require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
  27. require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
  28. require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
  29. require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php';
  30. $langs->load("admin");
  31. $langs->load("errors");
  32. $langs->load('other');
  33. $langs->load('supplier_proposal');
  34. if (! $user->admin) accessforbidden();
  35. $action = GETPOST('action','alpha');
  36. $value = GETPOST('value','alpha');
  37. $label = GETPOST('label','alpha');
  38. $scandir = GETPOST('scandir','alpha');
  39. $type='supplier_proposal';
  40. /*
  41. * Actions
  42. */
  43. $error=0;
  44. if ($action == 'updateMask')
  45. {
  46. $maskconstsupplier_proposal=GETPOST('maskconstsupplier_proposal','alpha');
  47. $masksupplier_proposal=GETPOST('masksupplier_proposal','alpha');
  48. if ($maskconstsupplier_proposal) $res = dolibarr_set_const($db,$maskconstsupplier_proposal,$masksupplier_proposal,'chaine',0,'',$conf->entity);
  49. if (! $res > 0) $error++;
  50. if (! $error)
  51. {
  52. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  53. }
  54. else
  55. {
  56. setEventMessages($langs->trans("Error"), null, 'errors');
  57. }
  58. }
  59. if ($action == 'specimen')
  60. {
  61. $modele=GETPOST('module','alpha');
  62. $supplier_proposal = new SupplierProposal($db);
  63. $supplier_proposal->initAsSpecimen();
  64. // Search template files
  65. $file=''; $classname=''; $filefound=0;
  66. $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
  67. foreach($dirmodels as $reldir)
  68. {
  69. $file=dol_buildpath($reldir."core/modules/supplier_proposal/doc/pdf_".$modele.".modules.php");
  70. if (file_exists($file))
  71. {
  72. $filefound=1;
  73. $classname = "pdf_".$modele;
  74. break;
  75. }
  76. }
  77. if ($filefound)
  78. {
  79. require_once $file;
  80. $module = new $classname($db);
  81. if ($module->write_file($supplier_proposal,$langs) > 0)
  82. {
  83. header("Location: ".DOL_URL_ROOT."/document.php?modulepart=supplier_proposal&file=SPECIMEN.pdf");
  84. return;
  85. }
  86. else
  87. {
  88. setEventMessages($module->error, null, 'errors');
  89. dol_syslog($module->error, LOG_ERR);
  90. }
  91. }
  92. else
  93. {
  94. setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
  95. dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
  96. }
  97. }
  98. if ($action == 'set_SUPPLIER_PROPOSAL_DRAFT_WATERMARK')
  99. {
  100. $draft = GETPOST('SUPPLIER_PROPOSAL_DRAFT_WATERMARK','alpha');
  101. $res = dolibarr_set_const($db, "SUPPLIER_PROPOSAL_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
  102. if (! $res > 0) $error++;
  103. if (! $error)
  104. {
  105. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  106. }
  107. else
  108. {
  109. setEventMessages($langs->trans("Error"), null, 'errors');
  110. }
  111. }
  112. if ($action == 'set_SUPPLIER_PROPOSAL_FREE_TEXT')
  113. {
  114. $freetext = GETPOST('SUPPLIER_PROPOSAL_FREE_TEXT'); // No alpha here, we want exact string
  115. $res = dolibarr_set_const($db, "SUPPLIER_PROPOSAL_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
  116. if (! $res > 0) $error++;
  117. if (! $error)
  118. {
  119. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  120. }
  121. else
  122. {
  123. setEventMessages($langs->trans("Error"), null, 'errors');
  124. }
  125. }
  126. if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL')
  127. {
  128. $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL",$value,'chaine',0,'',$conf->entity);
  129. if (! $res > 0) $error++;
  130. if (! $error)
  131. {
  132. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  133. }
  134. else
  135. {
  136. setEventMessages($langs->trans("Error"), null, 'errors');
  137. }
  138. }
  139. // Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
  140. if ($action == 'setModuleOptions')
  141. {
  142. $post_size=count($_POST);
  143. $db->begin();
  144. for($i=0;$i < $post_size;$i++)
  145. {
  146. if (array_key_exists('param'.$i,$_POST))
  147. {
  148. $param=GETPOST("param".$i,'alpha');
  149. $value=GETPOST("value".$i,'alpha');
  150. if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
  151. if (! $res > 0) $error++;
  152. }
  153. }
  154. if (! $error)
  155. {
  156. $db->commit();
  157. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  158. }
  159. else
  160. {
  161. $db->rollback();
  162. setEventMessages($langs->trans("Error"), null, 'errors');
  163. }
  164. }
  165. // Activate a model
  166. if ($action == 'set')
  167. {
  168. $ret = addDocumentModel($value, $type, $label, $scandir);
  169. }
  170. else if ($action == 'del')
  171. {
  172. $ret = delDocumentModel($value, $type);
  173. if ($ret > 0)
  174. {
  175. if ($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF == "$value") dolibarr_del_const($db, 'SUPPLIER_PROPOSAL_ADDON_PDF',$conf->entity);
  176. }
  177. }
  178. else if ($action == 'setdoc')
  179. {
  180. if (dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
  181. {
  182. $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF = $value;
  183. }
  184. // On active le modele
  185. $ret = delDocumentModel($value, $type);
  186. if ($ret > 0)
  187. {
  188. $ret = addDocumentModel($value, $type, $label, $scandir);
  189. }
  190. }
  191. else if ($action == 'setmod')
  192. {
  193. // TODO Verifier si module numerotation choisi peut etre active
  194. // par appel methode canBeActivated
  195. dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON",$value,'chaine',0,'',$conf->entity);
  196. }
  197. /*
  198. * Affiche page
  199. */
  200. $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
  201. llxHeader('',$langs->trans("SupplierProposalSetup"));
  202. $form=new Form($db);
  203. //if ($mesg) print $mesg;
  204. $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
  205. print load_fiche_titre($langs->trans("SupplierProposalSetup"),$linkback,'title_setup');
  206. $head = supplier_proposal_admin_prepare_head();
  207. dol_fiche_head($head, 'general', $langs->trans("CommRequests"), 0, 'supplier_proposal');
  208. /*
  209. * Module numerotation
  210. */
  211. print load_fiche_titre($langs->trans("SupplierProposalNumberingModules"),'','');
  212. print '<table class="noborder" width="100%">';
  213. print '<tr class="liste_titre">';
  214. print '<td>'.$langs->trans("Name")."</td>\n";
  215. print '<td>'.$langs->trans("Description")."</td>\n";
  216. print '<td class="nowrap">'.$langs->trans("Example")."</td>\n";
  217. print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
  218. print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
  219. print '</tr>'."\n";
  220. clearstatcache();
  221. foreach ($dirmodels as $reldir)
  222. {
  223. $dir = dol_buildpath($reldir."core/modules/supplier_proposal/");
  224. if (is_dir($dir))
  225. {
  226. $handle = opendir($dir);
  227. if (is_resource($handle))
  228. {
  229. $var=true;
  230. while (($file = readdir($handle))!==false)
  231. {
  232. if (substr($file, 0, 22) == 'mod_supplier_proposal_' && substr($file, dol_strlen($file)-3, 3) == 'php')
  233. {
  234. $file = substr($file, 0, dol_strlen($file)-4);
  235. require_once $dir.$file.'.php';
  236. $module = new $file;
  237. // Show modules according to features level
  238. if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
  239. if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
  240. if ($module->isEnabled())
  241. {
  242. print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
  243. print $module->info();
  244. print '</td>';
  245. // Show example of numbering module
  246. print '<td class="nowrap">';
  247. $tmp=$module->getExample();
  248. if (preg_match('/^Error/',$tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
  249. elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
  250. else print $tmp;
  251. print '</td>'."\n";
  252. print '<td align="center">';
  253. if ($conf->global->SUPPLIER_PROPOSAL_ADDON == "$file")
  254. {
  255. print img_picto($langs->trans("Activated"),'switch_on');
  256. }
  257. else
  258. {
  259. print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">';
  260. print img_picto($langs->trans("Disabled"),'switch_off');
  261. print '</a>';
  262. }
  263. print '</td>';
  264. $supplier_proposal=new SupplierProposal($db);
  265. $supplier_proposal->initAsSpecimen();
  266. // Info
  267. $htmltooltip='';
  268. $htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
  269. $nextval=$module->getNextValue($mysoc,$supplier_proposal);
  270. if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
  271. $htmltooltip.=''.$langs->trans("NextValue").': ';
  272. if ($nextval) {
  273. if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
  274. $nextval = $langs->trans($nextval);
  275. $htmltooltip.=$nextval.'<br>';
  276. } else {
  277. $htmltooltip.=$langs->trans($module->error).'<br>';
  278. }
  279. }
  280. print '<td align="center">';
  281. print $form->textwithpicto('',$htmltooltip,1,0);
  282. print '</td>';
  283. print "</tr>\n";
  284. }
  285. }
  286. }
  287. closedir($handle);
  288. }
  289. }
  290. }
  291. print "</table><br>\n";
  292. /*
  293. * Document templates generators
  294. */
  295. print load_fiche_titre($langs->trans("SupplierProposalPDFModules"),'','');
  296. // Load array def with activated templates
  297. $def = array();
  298. $sql = "SELECT nom";
  299. $sql.= " FROM ".MAIN_DB_PREFIX."document_model";
  300. $sql.= " WHERE type = '".$type."'";
  301. $sql.= " AND entity = ".$conf->entity;
  302. $resql=$db->query($sql);
  303. if ($resql)
  304. {
  305. $i = 0;
  306. $num_rows=$db->num_rows($resql);
  307. while ($i < $num_rows)
  308. {
  309. $array = $db->fetch_array($resql);
  310. array_push($def, $array[0]);
  311. $i++;
  312. }
  313. }
  314. else
  315. {
  316. dol_print_error($db);
  317. }
  318. print "<table class=\"noborder\" width=\"100%\">\n";
  319. print "<tr class=\"liste_titre\">\n";
  320. print " <td>".$langs->trans("Name")."</td>\n";
  321. print " <td>".$langs->trans("Description")."</td>\n";
  322. print '<td align="center" width="40">'.$langs->trans("Status")."</td>\n";
  323. print '<td align="center" width="40">'.$langs->trans("Default")."</td>\n";
  324. print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>';
  325. print '<td align="center" width="40">'.$langs->trans("Preview").'</td>';
  326. print "</tr>\n";
  327. clearstatcache();
  328. $var=true;
  329. foreach ($dirmodels as $reldir)
  330. {
  331. foreach (array('','/doc') as $valdir)
  332. {
  333. $dir = dol_buildpath($reldir."core/modules/supplier_proposal".$valdir);
  334. if (is_dir($dir))
  335. {
  336. $handle=opendir($dir);
  337. if (is_resource($handle))
  338. {
  339. while (($file = readdir($handle))!==false)
  340. {
  341. $filelist[]=$file;
  342. }
  343. closedir($handle);
  344. arsort($filelist);
  345. foreach($filelist as $file)
  346. {
  347. if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
  348. {
  349. if (file_exists($dir.'/'.$file))
  350. {
  351. $name = substr($file, 4, dol_strlen($file) -16);
  352. $classname = substr($file, 0, dol_strlen($file) -12);
  353. require_once $dir.'/'.$file;
  354. $module = new $classname($db);
  355. $modulequalified=1;
  356. if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
  357. if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
  358. if ($modulequalified)
  359. {
  360. $var = !$var;
  361. print '<tr class="oddeven"><td width="100">';
  362. print (empty($module->name)?$name:$module->name);
  363. print "</td><td>\n";
  364. if (method_exists($module,'info')) print $module->info($langs);
  365. else print $module->description;
  366. print '</td>';
  367. // Active
  368. if (in_array($name, $def))
  369. {
  370. print '<td align="center">'."\n";
  371. print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'">';
  372. print img_picto($langs->trans("Enabled"),'switch_on');
  373. print '</a>';
  374. print '</td>';
  375. }
  376. else
  377. {
  378. print "<td align=\"center\">\n";
  379. print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
  380. print "</td>";
  381. }
  382. // Defaut
  383. print "<td align=\"center\">";
  384. if ($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF == "$name")
  385. {
  386. print img_picto($langs->trans("Default"),'on');
  387. }
  388. else
  389. {
  390. print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scandir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
  391. }
  392. print '</td>';
  393. // Info
  394. $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
  395. $htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
  396. if ($module->type == 'pdf')
  397. {
  398. $htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
  399. }
  400. $htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
  401. $htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
  402. $htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
  403. $htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
  404. $htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
  405. //$htmltooltip.='<br>'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1);
  406. //$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
  407. $htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftProposal").': '.yn($module->option_draft_watermark,1,1);
  408. print '<td align="center">';
  409. print $form->textwithpicto('',$htmltooltip,1,0);
  410. print '</td>';
  411. // Preview
  412. print '<td align="center">';
  413. if ($module->type == 'pdf')
  414. {
  415. print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
  416. }
  417. else
  418. {
  419. print img_object($langs->trans("PreviewNotAvailable"),'generic');
  420. }
  421. print '</td>';
  422. print "</tr>\n";
  423. }
  424. }
  425. }
  426. }
  427. }
  428. }
  429. }
  430. }
  431. print '</table>';
  432. print '<br>';
  433. /*
  434. * Other options
  435. *
  436. */
  437. print load_fiche_titre($langs->trans("OtherOptions"),'','');
  438. $var=true;
  439. print "<table class=\"noborder\" width=\"100%\">";
  440. print "<tr class=\"liste_titre\">";
  441. print "<td>".$langs->trans("Parameter")."</td>\n";
  442. print '<td width="60" align="center">'.$langs->trans("Value")."</td>\n";
  443. print "<td>&nbsp;</td>\n";
  444. print "</tr>";
  445. $substitutionarray=pdf_getSubstitutionArray($langs);
  446. $substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
  447. $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
  448. foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
  449. $htmltext.='</i>';
  450. $var=! $var;
  451. print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
  452. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  453. print '<input type="hidden" name="action" value="set_SUPPLIER_PROPOSAL_FREE_TEXT">';
  454. print '<tr class="oddeven"><td colspan="2">';
  455. print $form->textwithpicto($langs->trans("FreeLegalTextOnSupplierProposal"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext).'<br>';
  456. $variablename='SUPPLIER_PROPOSAL_FREE_TEXT';
  457. if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
  458. {
  459. print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
  460. }
  461. else
  462. {
  463. include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
  464. $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_details');
  465. print $doleditor->Create();
  466. }
  467. print '</td><td align="right">';
  468. print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
  469. print "</td></tr>\n";
  470. print '</form>';
  471. print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
  472. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  473. print "<input type=\"hidden\" name=\"action\" value=\"set_SUPPLIER_PROPOSAL_DRAFT_WATERMARK\">";
  474. print '<tr class="oddeven"><td>';
  475. print $form->textwithpicto($langs->trans("WatermarkOnDraftProposal"), $htmltext).'<br>';
  476. print '</td><td>';
  477. print '<input size="50" class="flat" type="text" name="SUPPLIER_PROPOSAL_DRAFT_WATERMARK" value="'.$conf->global->SUPPLIER_PROPOSAL_DRAFT_WATERMARK.'">';
  478. print '</td><td align="right">';
  479. print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
  480. print "</td></tr>\n";
  481. print '</form>';
  482. if ($conf->banque->enabled)
  483. {
  484. print '<tr class="oddeven"><td>';
  485. print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'</td><td>&nbsp</td><td align="right">';
  486. if (! empty($conf->use_javascript_ajax))
  487. {
  488. print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL');
  489. }
  490. else
  491. {
  492. if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL))
  493. {
  494. print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL&amp;value=1">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
  495. }
  496. else
  497. {
  498. print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL&amp;value=0">'.img_picto($langs->trans("Enabled"),'switch_on').'</a>';
  499. }
  500. }
  501. print '</td></tr>';
  502. }
  503. else
  504. {
  505. print '<tr class="oddeven"><td>';
  506. print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
  507. }
  508. print '</table>';
  509. /*
  510. * Directory
  511. */
  512. print '<br>';
  513. print load_fiche_titre($langs->trans("PathToDocuments"),'','');
  514. print "<table class=\"noborder\" width=\"100%\">\n";
  515. print "<tr class=\"liste_titre\">\n";
  516. print " <td>".$langs->trans("Name")."</td>\n";
  517. print " <td>".$langs->trans("Value")."</td>\n";
  518. print "</tr>\n";
  519. print "<tr ".$bc[false].">\n <td width=\"140\">".$langs->trans("PathDirectory")."</td>\n <td>".$conf->supplier_proposal->dir_output."</td>\n</tr>\n";
  520. print "</table>\n<br>";
  521. llxFooter();
  522. $db->close();