propal.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685
  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. *
  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.'/comm/propal/class/propal.class.php';
  32. require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
  33. $langs->load("admin");
  34. $langs->load("errors");
  35. $langs->load('other');
  36. $langs->load('propal');
  37. if (! $user->admin) accessforbidden();
  38. $action = GETPOST('action','alpha');
  39. $value = GETPOST('value','alpha');
  40. $label = GETPOST('label','alpha');
  41. $scandir = GETPOST('scandir','alpha');
  42. $type='propal';
  43. /*
  44. * Actions
  45. */
  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'); // 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. // Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
  156. if ($action == 'setModuleOptions')
  157. {
  158. $post_size=count($_POST);
  159. $db->begin();
  160. for($i=0;$i < $post_size;$i++)
  161. {
  162. if (array_key_exists('param'.$i,$_POST))
  163. {
  164. $param=GETPOST("param".$i,'alpha');
  165. $value=GETPOST("value".$i,'alpha');
  166. if ($param) $res = dolibarr_set_const($db,$param,$value,'chaine',0,'',$conf->entity);
  167. if (! $res > 0) $error++;
  168. }
  169. }
  170. if (! $error)
  171. {
  172. $db->commit();
  173. setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
  174. }
  175. else
  176. {
  177. $db->rollback();
  178. setEventMessages($langs->trans("Error"), null, 'errors');
  179. }
  180. }
  181. // Activate a model
  182. if ($action == 'set')
  183. {
  184. $ret = addDocumentModel($value, $type, $label, $scandir);
  185. }
  186. else if ($action == 'del')
  187. {
  188. $ret = delDocumentModel($value, $type);
  189. if ($ret > 0)
  190. {
  191. if ($conf->global->PROPALE_ADDON_PDF == "$value") dolibarr_del_const($db, 'PROPALE_ADDON_PDF',$conf->entity);
  192. }
  193. }
  194. else if ($action == 'setdoc')
  195. {
  196. if (dolibarr_set_const($db, "PROPALE_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
  197. {
  198. $conf->global->PROPALE_ADDON_PDF = $value;
  199. }
  200. // On active le modele
  201. $ret = delDocumentModel($value, $type);
  202. if ($ret > 0)
  203. {
  204. $ret = addDocumentModel($value, $type, $label, $scandir);
  205. }
  206. }
  207. else if ($action == 'setmod')
  208. {
  209. // TODO Verifier si module numerotation choisi peut etre active
  210. // par appel methode canBeActivated
  211. dolibarr_set_const($db, "PROPALE_ADDON",$value,'chaine',0,'',$conf->entity);
  212. }
  213. /*
  214. * View
  215. */
  216. $form=new Form($db);
  217. $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
  218. llxHeader('',$langs->trans("PropalSetup"));
  219. //if ($mesg) print $mesg;
  220. $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
  221. print load_fiche_titre($langs->trans("PropalSetup"),$linkback,'title_setup');
  222. $head = propal_admin_prepare_head();
  223. dol_fiche_head($head, 'general', $langs->trans("Proposals"), -1, 'propal');
  224. /*
  225. * Module numerotation
  226. */
  227. print load_fiche_titre($langs->trans("ProposalsNumberingModules"),'','');
  228. print '<table class="noborder" width="100%">';
  229. print '<tr class="liste_titre">';
  230. print '<td>'.$langs->trans("Name")."</td>\n";
  231. print '<td>'.$langs->trans("Description")."</td>\n";
  232. print '<td class="nowrap">'.$langs->trans("Example")."</td>\n";
  233. print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
  234. print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
  235. print '</tr>'."\n";
  236. clearstatcache();
  237. foreach ($dirmodels as $reldir)
  238. {
  239. $dir = dol_buildpath($reldir."core/modules/propale/");
  240. if (is_dir($dir))
  241. {
  242. $handle = opendir($dir);
  243. if (is_resource($handle))
  244. {
  245. $var=true;
  246. while (($file = readdir($handle))!==false)
  247. {
  248. if (substr($file, 0, 12) == 'mod_propale_' && substr($file, dol_strlen($file)-3, 3) == 'php')
  249. {
  250. $file = substr($file, 0, dol_strlen($file)-4);
  251. require_once $dir.$file.'.php';
  252. $module = new $file;
  253. // Show modules according to features level
  254. if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
  255. if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
  256. if ($module->isEnabled())
  257. {
  258. print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
  259. print $module->info();
  260. print '</td>';
  261. // Show example of numbering module
  262. print '<td class="nowrap">';
  263. $tmp=$module->getExample();
  264. if (preg_match('/^Error/',$tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
  265. elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
  266. else print $tmp;
  267. print '</td>'."\n";
  268. print '<td align="center">';
  269. if ($conf->global->PROPALE_ADDON == "$file")
  270. {
  271. print img_picto($langs->trans("Activated"),'switch_on');
  272. }
  273. else
  274. {
  275. print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$file.'">';
  276. print img_picto($langs->trans("Disabled"),'switch_off');
  277. print '</a>';
  278. }
  279. print '</td>';
  280. $propal=new Propal($db);
  281. $propal->initAsSpecimen();
  282. // Info
  283. $htmltooltip='';
  284. $htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
  285. $propal->type=0;
  286. $nextval=$module->getNextValue($mysoc,$propal);
  287. if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
  288. $htmltooltip.=''.$langs->trans("NextValue").': ';
  289. if ($nextval) {
  290. if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
  291. $nextval = $langs->trans($nextval);
  292. $htmltooltip.=$nextval.'<br>';
  293. } else {
  294. $htmltooltip.=$langs->trans($module->error).'<br>';
  295. }
  296. }
  297. print '<td align="center">';
  298. print $form->textwithpicto('',$htmltooltip,1,0);
  299. print '</td>';
  300. print "</tr>\n";
  301. }
  302. }
  303. }
  304. closedir($handle);
  305. }
  306. }
  307. }
  308. print "</table><br>\n";
  309. /*
  310. * Document templates generators
  311. */
  312. print load_fiche_titre($langs->trans("ProposalsPDFModules"),'','');
  313. // Load array def with activated templates
  314. $def = array();
  315. $sql = "SELECT nom";
  316. $sql.= " FROM ".MAIN_DB_PREFIX."document_model";
  317. $sql.= " WHERE type = '".$type."'";
  318. $sql.= " AND entity = ".$conf->entity;
  319. $resql=$db->query($sql);
  320. if ($resql)
  321. {
  322. $i = 0;
  323. $num_rows=$db->num_rows($resql);
  324. while ($i < $num_rows)
  325. {
  326. $array = $db->fetch_array($resql);
  327. array_push($def, $array[0]);
  328. $i++;
  329. }
  330. }
  331. else
  332. {
  333. dol_print_error($db);
  334. }
  335. print "<table class=\"noborder\" width=\"100%\">\n";
  336. print "<tr class=\"liste_titre\">\n";
  337. print " <td>".$langs->trans("Name")."</td>\n";
  338. print " <td>".$langs->trans("Description")."</td>\n";
  339. print '<td align="center" width="40">'.$langs->trans("Status")."</td>\n";
  340. print '<td align="center" width="40">'.$langs->trans("Default")."</td>\n";
  341. print '<td align="center" width="40">'.$langs->trans("ShortInfo").'</td>';
  342. print '<td align="center" width="40">'.$langs->trans("Preview").'</td>';
  343. print "</tr>\n";
  344. clearstatcache();
  345. $var=true;
  346. foreach ($dirmodels as $reldir)
  347. {
  348. foreach (array('','/doc') as $valdir)
  349. {
  350. $dir = dol_buildpath($reldir."core/modules/propale".$valdir);
  351. if (is_dir($dir))
  352. {
  353. $handle=opendir($dir);
  354. if (is_resource($handle))
  355. {
  356. while (($file = readdir($handle))!==false)
  357. {
  358. $filelist[]=$file;
  359. }
  360. closedir($handle);
  361. arsort($filelist);
  362. foreach($filelist as $file)
  363. {
  364. if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
  365. {
  366. if (file_exists($dir.'/'.$file))
  367. {
  368. $name = substr($file, 4, dol_strlen($file) -16);
  369. $classname = substr($file, 0, dol_strlen($file) -12);
  370. require_once $dir.'/'.$file;
  371. $module = new $classname($db);
  372. $modulequalified=1;
  373. if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
  374. if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
  375. if ($modulequalified)
  376. {
  377. $var = !$var;
  378. print '<tr class="oddeven"><td width="100">';
  379. print (empty($module->name)?$name:$module->name);
  380. print "</td><td>\n";
  381. if (method_exists($module,'info')) print $module->info($langs);
  382. else print $module->description;
  383. print '</td>';
  384. // Active
  385. if (in_array($name, $def))
  386. {
  387. print '<td align="center">'."\n";
  388. print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'">';
  389. print img_picto($langs->trans("Enabled"),'switch_on');
  390. print '</a>';
  391. print '</td>';
  392. }
  393. else
  394. {
  395. print "<td align=\"center\">\n";
  396. 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>';
  397. print "</td>";
  398. }
  399. // Defaut
  400. print "<td align=\"center\">";
  401. if ($conf->global->PROPALE_ADDON_PDF == "$name")
  402. {
  403. print img_picto($langs->trans("Default"),'on');
  404. }
  405. else
  406. {
  407. 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>';
  408. }
  409. print '</td>';
  410. // Info
  411. $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
  412. $htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
  413. if ($module->type == 'pdf')
  414. {
  415. $htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
  416. }
  417. $htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
  418. $htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
  419. $htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
  420. $htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
  421. $htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
  422. //$htmltooltip.='<br>'.$langs->trans("Discounts").': '.yn($module->option_escompte,1,1);
  423. //$htmltooltip.='<br>'.$langs->trans("CreditNote").': '.yn($module->option_credit_note,1,1);
  424. $htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftProposal").': '.yn($module->option_draft_watermark,1,1);
  425. print '<td align="center">';
  426. print $form->textwithpicto('',$htmltooltip,1,0);
  427. print '</td>';
  428. // Preview
  429. print '<td align="center">';
  430. if ($module->type == 'pdf')
  431. {
  432. print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
  433. }
  434. else
  435. {
  436. print img_object($langs->trans("PreviewNotAvailable"),'generic');
  437. }
  438. print '</td>';
  439. print "</tr>\n";
  440. }
  441. }
  442. }
  443. }
  444. }
  445. }
  446. }
  447. }
  448. print '</table>';
  449. print '<br>';
  450. /*
  451. * Other options
  452. */
  453. print load_fiche_titre($langs->trans("OtherOptions"),'','');
  454. print "<table class=\"noborder\" width=\"100%\">";
  455. print "<tr class=\"liste_titre\">";
  456. print "<td>".$langs->trans("Parameter")."</td>\n";
  457. print '<td width="60" align="center">'.$langs->trans("Value")."</td>\n";
  458. print "<td>&nbsp;</td>\n";
  459. print "</tr>";
  460. print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
  461. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  462. print "<input type=\"hidden\" name=\"action\" value=\"setdefaultduration\">";
  463. print '<tr class="oddeven">';
  464. print '<td>'.$langs->trans("DefaultProposalDurationValidity").'</td>';
  465. print '<td width="60" align="center">'."<input size=\"3\" class=\"flat\" type=\"text\" name=\"value\" value=\"".$conf->global->PROPALE_VALIDITY_DURATION."\"></td>";
  466. print '<td align="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
  467. print '</tr>';
  468. print '</form>';
  469. /*
  470. $var=! $var;
  471. print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
  472. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  473. print '<input type="hidden" name="action" value="setusecustomercontactasrecipient">';
  474. print '<tr class="oddeven"><td>';
  475. print $langs->trans("UseCustomerContactAsPropalRecipientIfExist");
  476. print '</td><td width="60" align="center">';
  477. print $form->selectyesno("value",$conf->global->PROPALE_USE_CUSTOMER_CONTACT_AS_RECIPIENT,1);
  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. */
  483. $substitutionarray=pdf_getSubstitutionArray($langs);
  484. $substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
  485. $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
  486. foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
  487. $htmltext.='</i>';
  488. print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
  489. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  490. print '<input type="hidden" name="action" value="set_PROPOSAL_FREE_TEXT">';
  491. print '<tr class="oddeven"><td colspan="2">';
  492. print $form->textwithpicto($langs->trans("FreeLegalTextOnProposal"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext).'<br>';
  493. $variablename='PROPOSAL_FREE_TEXT';
  494. if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
  495. {
  496. print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
  497. }
  498. else
  499. {
  500. include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
  501. $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_details');
  502. print $doleditor->Create();
  503. }
  504. print '</td><td align="right">';
  505. print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
  506. print "</td></tr>\n";
  507. print '</form>';
  508. print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
  509. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  510. print "<input type=\"hidden\" name=\"action\" value=\"set_PROPALE_DRAFT_WATERMARK\">";
  511. print '<tr class="oddeven"><td>';
  512. print $form->textwithpicto($langs->trans("WatermarkOnDraftProposal"), $htmltext).'<br>';
  513. print '</td><td>';
  514. print '<input class="flat minwidth200" type="text" name="PROPALE_DRAFT_WATERMARK" value="'.$conf->global->PROPALE_DRAFT_WATERMARK.'">';
  515. print '</td><td align="right">';
  516. print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
  517. print "</td></tr>\n";
  518. print '</form>';
  519. /* Seems to be not so used. So kept hidden for the moment to avoid dangerous options inflation.
  520. if ($conf->banque->enabled)
  521. {
  522. print '<tr class="oddeven"><td>';
  523. print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").'</td><td>&nbsp</td><td align="right">';
  524. if (! empty($conf->use_javascript_ajax))
  525. {
  526. print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL');
  527. }
  528. else
  529. {
  530. if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL))
  531. {
  532. 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>';
  533. }
  534. else
  535. {
  536. 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>';
  537. }
  538. }
  539. print '</td></tr>';
  540. }
  541. else
  542. {
  543. print '<tr class="oddeven"><td>';
  544. print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL").'</td><td>&nbsp;</td><td align="center">'.$langs->trans('NotAvailable').'</td></tr>';
  545. }
  546. */
  547. print '</table>';
  548. /*
  549. * Directory
  550. */
  551. print '<br>';
  552. print load_fiche_titre($langs->trans("PathToDocuments"),'','');
  553. print "<table class=\"noborder\" width=\"100%\">\n";
  554. print "<tr class=\"liste_titre\">\n";
  555. print " <td>".$langs->trans("Name")."</td>\n";
  556. print " <td>".$langs->trans("Value")."</td>\n";
  557. print "</tr>\n";
  558. print "<tr ".$bc[false].">\n <td width=\"140\">".$langs->trans("PathDirectory")."</td>\n <td>".$conf->propal->dir_output."</td>\n</tr>\n";
  559. print "</table>\n<br>";
  560. /*
  561. * Notifications
  562. */
  563. print load_fiche_titre($langs->trans("Notifications"),'','');
  564. print '<table class="noborder" width="100%">';
  565. print '<tr class="liste_titre">';
  566. print '<td>'.$langs->trans("Parameter").'</td>';
  567. print '<td align="center" width="60"></td>';
  568. print '<td width="80">&nbsp;</td>';
  569. print "</tr>\n";
  570. print '<tr class="oddeven"><td colspan="2">';
  571. print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").'<br>';
  572. print '</td><td align="right">';
  573. print "</td></tr>\n";
  574. print '</table>';
  575. llxFooter();
  576. $db->close();