supplier_proposal.php 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  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@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) 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 <https://www.gnu.org/licenses/>.
  24. */
  25. // Load Dolibarr environment
  26. require '../main.inc.php';
  27. require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
  28. require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
  29. require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
  30. require_once DOL_DOCUMENT_ROOT.'/core/lib/supplier_proposal.lib.php';
  31. // Load translation files required by the page
  32. $langs->loadLangs(array("admin", "errors", "other", "supplier_proposal"));
  33. if (!$user->admin) {
  34. accessforbidden();
  35. }
  36. $action = GETPOST('action', 'aZ09');
  37. $value = GETPOST('value', 'alpha');
  38. $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
  39. $label = GETPOST('label', 'alpha');
  40. $scandir = GETPOST('scan_dir', 'alpha');
  41. $type = 'supplier_proposal';
  42. $error = 0;
  43. /*
  44. * Actions
  45. */
  46. include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
  47. if ($action == 'updateMask') {
  48. $maskconstsupplier_proposal = GETPOST('maskconstsupplier_proposal', 'aZ09');
  49. $masksupplier_proposal = GETPOST('masksupplier_proposal', 'alpha');
  50. if ($maskconstsupplier_proposal && preg_match('/_MASK$/', $maskconstsupplier_proposal)) {
  51. $res = dolibarr_set_const($db, $maskconstsupplier_proposal, $masksupplier_proposal, 'chaine', 0, '', $conf->entity);
  52. }
  53. if (!($res > 0)) {
  54. $error++;
  55. }
  56. if (!$error) {
  57. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  58. } else {
  59. setEventMessages($langs->trans("Error"), null, 'errors');
  60. }
  61. }
  62. if ($action == 'specimen') {
  63. $modele = GETPOST('module', 'alpha');
  64. $supplier_proposal = new SupplierProposal($db);
  65. $supplier_proposal->initAsSpecimen();
  66. // Search template files
  67. $file = '';
  68. $classname = '';
  69. $filefound = 0;
  70. $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
  71. foreach ($dirmodels as $reldir) {
  72. $file = dol_buildpath($reldir."core/modules/supplier_proposal/doc/pdf_".$modele.".modules.php");
  73. if (file_exists($file)) {
  74. $filefound = 1;
  75. $classname = "pdf_".$modele;
  76. break;
  77. }
  78. }
  79. if ($filefound) {
  80. require_once $file;
  81. $module = new $classname($db);
  82. if ($module->write_file($supplier_proposal, $langs) > 0) {
  83. header("Location: ".DOL_URL_ROOT."/document.php?modulepart=supplier_proposal&file=SPECIMEN.pdf");
  84. return;
  85. } else {
  86. setEventMessages($module->error, null, 'errors');
  87. dol_syslog($module->error, LOG_ERR);
  88. }
  89. } else {
  90. setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
  91. dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
  92. }
  93. }
  94. if ($action == 'set_SUPPLIER_PROPOSAL_DRAFT_WATERMARK') {
  95. $draft = GETPOST('SUPPLIER_PROPOSAL_DRAFT_WATERMARK', 'alpha');
  96. $res = dolibarr_set_const($db, "SUPPLIER_PROPOSAL_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
  97. if (!($res > 0)) {
  98. $error++;
  99. }
  100. if (!$error) {
  101. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  102. } else {
  103. setEventMessages($langs->trans("Error"), null, 'errors');
  104. }
  105. }
  106. if ($action == 'set_SUPPLIER_PROPOSAL_FREE_TEXT') {
  107. $freetext = GETPOST('SUPPLIER_PROPOSAL_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
  108. $res = dolibarr_set_const($db, "SUPPLIER_PROPOSAL_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
  109. if (!($res > 0)) {
  110. $error++;
  111. }
  112. if (!$error) {
  113. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  114. } else {
  115. setEventMessages($langs->trans("Error"), null, 'errors');
  116. }
  117. }
  118. if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL') {
  119. $res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL", $value, 'chaine', 0, '', $conf->entity);
  120. if (!($res > 0)) {
  121. $error++;
  122. }
  123. if (!$error) {
  124. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  125. } else {
  126. setEventMessages($langs->trans("Error"), null, 'errors');
  127. }
  128. }
  129. // Activate a model
  130. if ($action == 'set') {
  131. $ret = addDocumentModel($value, $type, $label, $scandir);
  132. } elseif ($action == 'del') {
  133. $ret = delDocumentModel($value, $type);
  134. if ($ret > 0) {
  135. if ($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF == "$value") {
  136. dolibarr_del_const($db, 'SUPPLIER_PROPOSAL_ADDON_PDF', $conf->entity);
  137. }
  138. }
  139. } elseif ($action == 'setdoc') {
  140. if (dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
  141. $conf->global->SUPPLIER_PROPOSAL_ADDON_PDF = $value;
  142. }
  143. // On active le modele
  144. $ret = delDocumentModel($value, $type);
  145. if ($ret > 0) {
  146. $ret = addDocumentModel($value, $type, $label, $scandir);
  147. }
  148. } elseif ($action == 'setmod') {
  149. // TODO Verifier si module numerotation choisi peut etre active
  150. // par appel methode canBeActivated
  151. dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON", $value, 'chaine', 0, '', $conf->entity);
  152. } elseif (preg_match('/set_(.*)/', $action, $reg)) {
  153. $code = $reg[1];
  154. $value = (GETPOST($code) ? GETPOST($code) : 1);
  155. $res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity);
  156. if (!($res > 0)) {
  157. $error++;
  158. }
  159. if ($error) {
  160. setEventMessages($langs->trans('Error'), null, 'errors');
  161. } else {
  162. setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
  163. header("Location: " . $_SERVER["PHP_SELF"]);
  164. exit();
  165. }
  166. } elseif (preg_match('/del_(.*)/', $action, $reg)) {
  167. $code = $reg[1];
  168. $res = dolibarr_del_const($db, $code, $conf->entity);
  169. if (!($res > 0)) {
  170. $error++;
  171. }
  172. if ($error) {
  173. setEventMessages($langs->trans('Error'), null, 'errors');
  174. } else {
  175. setEventMessages($langs->trans('SetupSaved'), null, 'mesgs');
  176. header("Location: " . $_SERVER["PHP_SELF"]);
  177. exit();
  178. }
  179. }
  180. /*
  181. * Affiche page
  182. */
  183. $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
  184. llxHeader('', $langs->trans("SupplierProposalSetup"));
  185. $form = new Form($db);
  186. //if ($mesg) print $mesg;
  187. $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
  188. print load_fiche_titre($langs->trans("SupplierProposalSetup"), $linkback, 'title_setup');
  189. $head = supplier_proposal_admin_prepare_head();
  190. print dol_get_fiche_head($head, 'general', $langs->trans("CommRequests"), -1, 'supplier_proposal');
  191. /*
  192. * Module numerotation
  193. */
  194. print load_fiche_titre($langs->trans("SupplierProposalNumberingModules"), '', '');
  195. print '<table class="noborder centpercent">';
  196. print '<tr class="liste_titre">';
  197. print '<td>'.$langs->trans("Name")."</td>\n";
  198. print '<td>'.$langs->trans("Description")."</td>\n";
  199. print '<td class="nowrap">'.$langs->trans("Example")."</td>\n";
  200. print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
  201. print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
  202. print '</tr>'."\n";
  203. clearstatcache();
  204. foreach ($dirmodels as $reldir) {
  205. $dir = dol_buildpath($reldir."core/modules/supplier_proposal");
  206. if (is_dir($dir)) {
  207. $handle = opendir($dir);
  208. if (is_resource($handle)) {
  209. while (($file = readdir($handle)) !== false) {
  210. if (substr($file, 0, 22) == 'mod_supplier_proposal_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
  211. $file = substr($file, 0, dol_strlen($file) - 4);
  212. require_once $dir.'/'.$file.'.php';
  213. $module = new $file();
  214. // Show modules according to features level
  215. if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
  216. continue;
  217. }
  218. if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
  219. continue;
  220. }
  221. if ($module->isEnabled()) {
  222. print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
  223. print $module->info($langs);
  224. print '</td>';
  225. // Show example of numbering module
  226. print '<td class="nowrap">';
  227. $tmp = $module->getExample();
  228. if (preg_match('/^Error/', $tmp)) {
  229. $langs->load("errors");
  230. print '<div class="error">'.$langs->trans($tmp).'</div>';
  231. } elseif ($tmp == 'NotConfigured') {
  232. print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
  233. } else {
  234. print $tmp;
  235. }
  236. print '</td>'."\n";
  237. print '<td class="center">';
  238. if ($conf->global->SUPPLIER_PROPOSAL_ADDON == "$file") {
  239. print img_picto($langs->trans("Activated"), 'switch_on');
  240. } else {
  241. print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.urlencode($file).'">';
  242. print img_picto($langs->trans("Disabled"), 'switch_off');
  243. print '</a>';
  244. }
  245. print '</td>';
  246. $supplier_proposal = new SupplierProposal($db);
  247. $supplier_proposal->initAsSpecimen();
  248. // Info
  249. $htmltooltip = '';
  250. $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
  251. $nextval = $module->getNextValue($mysoc, $supplier_proposal);
  252. if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
  253. $htmltooltip .= ''.$langs->trans("NextValue").': ';
  254. if ($nextval) {
  255. if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
  256. $nextval = $langs->trans($nextval);
  257. }
  258. $htmltooltip .= $nextval.'<br>';
  259. } else {
  260. $htmltooltip .= $langs->trans($module->error).'<br>';
  261. }
  262. }
  263. print '<td class="center">';
  264. print $form->textwithpicto('', $htmltooltip, 1, 0);
  265. print '</td>';
  266. print "</tr>\n";
  267. }
  268. }
  269. }
  270. closedir($handle);
  271. }
  272. }
  273. }
  274. print "</table><br>\n";
  275. /*
  276. * Document templates generators
  277. */
  278. print load_fiche_titre($langs->trans("SupplierProposalPDFModules"), '', '');
  279. // Load array def with activated templates
  280. $def = array();
  281. $sql = "SELECT nom";
  282. $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
  283. $sql .= " WHERE type = '".$db->escape($type)."'";
  284. $sql .= " AND entity = ".$conf->entity;
  285. $resql = $db->query($sql);
  286. if ($resql) {
  287. $i = 0;
  288. $num_rows = $db->num_rows($resql);
  289. while ($i < $num_rows) {
  290. $array = $db->fetch_array($resql);
  291. array_push($def, $array[0]);
  292. $i++;
  293. }
  294. } else {
  295. dol_print_error($db);
  296. }
  297. print "<table class=\"noborder\" width=\"100%\">\n";
  298. print "<tr class=\"liste_titre\">\n";
  299. print " <td>".$langs->trans("Name")."</td>\n";
  300. print " <td>".$langs->trans("Description")."</td>\n";
  301. print '<td align="center" width="40">'.$langs->trans("Status")."</td>\n";
  302. print '<td align="center" width="40">'.$langs->trans("Default")."</td>\n";
  303. print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>';
  304. print '<td align="center" width="40">'.$langs->trans("Preview").'</td>';
  305. print "</tr>\n";
  306. clearstatcache();
  307. foreach ($dirmodels as $reldir) {
  308. foreach (array('', '/doc') as $valdir) {
  309. $realpath = $reldir."core/modules/supplier_proposal".$valdir;
  310. $dir = dol_buildpath($realpath);
  311. if (is_dir($dir)) {
  312. $handle = opendir($dir);
  313. if (is_resource($handle)) {
  314. while (($file = readdir($handle)) !== false) {
  315. $filelist[] = $file;
  316. }
  317. closedir($handle);
  318. arsort($filelist);
  319. foreach ($filelist as $file) {
  320. if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
  321. if (file_exists($dir.'/'.$file)) {
  322. $name = substr($file, 4, dol_strlen($file) - 16);
  323. $classname = substr($file, 0, dol_strlen($file) - 12);
  324. require_once $dir.'/'.$file;
  325. $module = new $classname($db);
  326. $modulequalified = 1;
  327. if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
  328. $modulequalified = 0;
  329. }
  330. if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
  331. $modulequalified = 0;
  332. }
  333. if ($modulequalified) {
  334. print '<tr class="oddeven"><td width="100">';
  335. print(empty($module->name) ? $name : $module->name);
  336. print "</td><td>\n";
  337. if (method_exists($module, 'info')) {
  338. print $module->info($langs);
  339. } else {
  340. print $module->description;
  341. }
  342. print '</td>';
  343. // Active
  344. if (in_array($name, $def)) {
  345. print '<td class="center">'."\n";
  346. print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'">';
  347. print img_picto($langs->trans("Enabled"), 'switch_on');
  348. print '</a>';
  349. print '</td>';
  350. } else {
  351. print '<td align="center">'."\n";
  352. print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
  353. print "</td>";
  354. }
  355. // Defaut
  356. print '<td align="center">';
  357. if ($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF == "$name") {
  358. print img_picto($langs->trans("Default"), 'on');
  359. } else {
  360. print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
  361. }
  362. print '</td>';
  363. // Info
  364. $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
  365. $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
  366. if ($module->type == 'pdf') {
  367. $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
  368. }
  369. $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
  370. $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
  371. $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
  372. $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
  373. $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
  374. $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
  375. //$htmltooltip.='<br>'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1);
  376. //$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
  377. $htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftProposal").': '.yn($module->option_draft_watermark, 1, 1);
  378. print '<td class="center">';
  379. print $form->textwithpicto('', $htmltooltip, 1, 0);
  380. print '</td>';
  381. // Preview
  382. print '<td class="center">';
  383. if ($module->type == 'pdf') {
  384. print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
  385. } else {
  386. print img_object($langs->trans("PreviewNotAvailable"), 'generic');
  387. }
  388. print '</td>';
  389. print "</tr>\n";
  390. }
  391. }
  392. }
  393. }
  394. }
  395. }
  396. }
  397. }
  398. print '</table>';
  399. print '<br>';
  400. /*
  401. * Other options
  402. *
  403. */
  404. print load_fiche_titre($langs->trans("OtherOptions"), '', '');
  405. print "<table class=\"noborder\" width=\"100%\">";
  406. print "<tr class=\"liste_titre\">";
  407. print "<td>".$langs->trans("Parameter")."</td>\n";
  408. print '<td width="60" align="center">'.$langs->trans("Value")."</td>\n";
  409. print "<td>&nbsp;</td>\n";
  410. print "</tr>";
  411. $substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
  412. $substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
  413. $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
  414. foreach ($substitutionarray as $key => $val) {
  415. $htmltext .= $key.'<br>';
  416. }
  417. $htmltext .= '</i>';
  418. print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
  419. print '<input type="hidden" name="token" value="'.newToken().'">';
  420. print '<input type="hidden" name="action" value="set_SUPPLIER_PROPOSAL_FREE_TEXT">';
  421. print '<tr class="oddeven"><td colspan="2">';
  422. print $form->textwithpicto($langs->trans("FreeLegalTextOnSupplierProposal"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
  423. $variablename = 'SUPPLIER_PROPOSAL_FREE_TEXT';
  424. if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
  425. print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
  426. } else {
  427. include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
  428. $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
  429. print $doleditor->Create();
  430. }
  431. print '</td><td class="right">';
  432. print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
  433. print "</td></tr>\n";
  434. print '</form>';
  435. print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
  436. print '<input type="hidden" name="token" value="'.newToken().'">';
  437. print "<input type=\"hidden\" name=\"action\" value=\"set_SUPPLIER_PROPOSAL_DRAFT_WATERMARK\">";
  438. print '<tr class="oddeven"><td>';
  439. print $form->textwithpicto($langs->trans("WatermarkOnDraftProposal"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
  440. print '</td><td>';
  441. print '<input class="flat minwidth200" type="text" name="SUPPLIER_PROPOSAL_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('SUPPLIER_PROPOSAL_DRAFT_WATERMARK')).'">';
  442. print '</td><td class="right">';
  443. print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
  444. print "</td></tr>\n";
  445. print '</form>';
  446. if (isModEnabled('banque')) {
  447. print '<tr class="oddeven"><td>';
  448. print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'</td><td>&nbsp;</td><td class="right">';
  449. print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL');
  450. print '</td></tr>';
  451. } else {
  452. print '<tr class="oddeven"><td>';
  453. print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
  454. }
  455. // Allow external download
  456. print '<tr class="oddeven">';
  457. print '<td>'.$langs->trans("AllowExternalDownload").'</td><td>&nbsp;</td>';
  458. print '<td class="right">';
  459. print ajax_constantonoff('PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1);
  460. print '</td></tr>';
  461. print '</table>';
  462. /*
  463. * Directory
  464. */
  465. print '<br>';
  466. print load_fiche_titre($langs->trans("PathToDocuments"), '', '');
  467. print "<table class=\"noborder\" width=\"100%\">\n";
  468. print "<tr class=\"liste_titre\">\n";
  469. print " <td>".$langs->trans("Name")."</td>\n";
  470. print " <td>".$langs->trans("Value")."</td>\n";
  471. print "</tr>\n";
  472. print "<tr class=\"oddeven\">\n <td width=\"140\">".$langs->trans("PathDirectory")."</td>\n <td>".$conf->supplier_proposal->dir_output."</td>\n</tr>\n";
  473. print "</table>\n<br>";
  474. // End of page
  475. llxFooter();
  476. $db->close();