propal.php 22 KB

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