new.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. <?php
  2. /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2001-2002 Jean-Louis Bergamo <jlb@j1b.org>
  4. * Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
  5. * Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
  6. * Copyright (C) 2012 J. Fernando Lagrange <fernando@demo-tic.org>
  7. * Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
  8. * Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 3 of the License, or
  13. * (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  22. */
  23. /**
  24. * \file htdocs/public/project/new.php
  25. * \ingroup project
  26. * \brief Page to record a message/lead into a project/lead
  27. */
  28. if (!defined('NOLOGIN')) {
  29. define("NOLOGIN", 1); // This means this output page does not require to be logged.
  30. }
  31. if (!defined('NOCSRFCHECK')) {
  32. define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
  33. }
  34. if (!defined('NOIPCHECK')) {
  35. define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
  36. }
  37. if (!defined('NOBROWSERNOTIF')) {
  38. define('NOBROWSERNOTIF', '1');
  39. }
  40. if (!defined('NOIPCHECK')) {
  41. define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
  42. }
  43. // For MultiCompany module.
  44. // Do not use GETPOST here, function is not defined and define must be done before including main.inc.php
  45. $entity = (!empty($_GET['entity']) ? (int) $_GET['entity'] : (!empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
  46. if (is_numeric($entity)) {
  47. define("DOLENTITY", $entity);
  48. }
  49. require '../../main.inc.php';
  50. require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
  51. require_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php';
  52. require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
  53. require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
  54. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
  55. // Init vars
  56. $errmsg = '';
  57. $error = 0;
  58. $backtopage = GETPOST('backtopage', 'alpha');
  59. $action = GETPOST('action', 'aZ09');
  60. // Load translation files
  61. $langs->loadLangs(array("members", "companies", "install", "other", "projects"));
  62. if (empty($conf->global->PROJECT_ENABLE_PUBLIC)) {
  63. print $langs->trans("Form for public lead registration has not been enabled");
  64. exit;
  65. }
  66. // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
  67. $hookmanager->initHooks(array('publicnewleadcard', 'globalcard'));
  68. $extrafields = new ExtraFields($db);
  69. $object = new Project($db);
  70. $user->loadDefaultValues();
  71. // Security check
  72. if (empty($conf->project->enabled)) {
  73. httponly_accessforbidden('Module Project not enabled');
  74. }
  75. /**
  76. * Show header for new member
  77. *
  78. * @param string $title Title
  79. * @param string $head Head array
  80. * @param int $disablejs More content into html header
  81. * @param int $disablehead More content into html header
  82. * @param array $arrayofjs Array of complementary js files
  83. * @param array $arrayofcss Array of complementary css files
  84. * @return void
  85. */
  86. function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '')
  87. {
  88. global $user, $conf, $langs, $mysoc;
  89. top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers
  90. print '<body id="mainbody" class="publicnewmemberform">';
  91. // Define urllogo
  92. $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png';
  93. if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) {
  94. $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/thumbs/'.$mysoc->logo_small);
  95. } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
  96. $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&amp;modulepart=mycompany&amp;file='.urlencode('logos/'.$mysoc->logo);
  97. } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) {
  98. $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg';
  99. }
  100. print '<div class="center">';
  101. // Output html code for logo
  102. if ($urllogo) {
  103. print '<div class="backgreypublicpayment">';
  104. print '<div class="logopublicpayment">';
  105. print '<img id="dolpaymentlogo" src="'.$urllogo.'"';
  106. print '>';
  107. print '</div>';
  108. if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
  109. print '<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans("PoweredBy").'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
  110. }
  111. print '</div>';
  112. }
  113. if (!empty($conf->global->PROJECT_IMAGE_PUBLIC_NEWLEAD)) {
  114. print '<div class="backimagepublicnewlead">';
  115. print '<img id="idPROJECT_IMAGE_PUBLIC_NEWLEAD" src="'.$conf->global->PROJECT_IMAGE_PUBLIC_NEWLEAD.'">';
  116. print '</div>';
  117. }
  118. print '</div>';
  119. print '<div class="divmainbodylarge">';
  120. }
  121. /**
  122. * Show footer for new member
  123. *
  124. * @return void
  125. */
  126. function llxFooterVierge()
  127. {
  128. print '</div>';
  129. printCommonFooter('public');
  130. print "</body>\n";
  131. print "</html>\n";
  132. }
  133. /*
  134. * Actions
  135. */
  136. $parameters = array();
  137. // Note that $action and $object may have been modified by some hooks
  138. $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
  139. if ($reshook < 0) {
  140. setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
  141. }
  142. // Action called when page is submitted
  143. if (empty($reshook) && $action == 'add') {
  144. $error = 0;
  145. $urlback = '';
  146. $db->begin();
  147. if (!GETPOST("lastname")) {
  148. $error++;
  149. $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."<br>\n";
  150. }
  151. if (!GETPOST("firstname")) {
  152. $error++;
  153. $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."<br>\n";
  154. }
  155. if (!GETPOST("email")) {
  156. $error++;
  157. $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."<br>\n";
  158. }
  159. if (!GETPOST("description")) {
  160. $error++;
  161. $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Message"))."<br>\n";
  162. }
  163. if (GETPOST("email") && !isValidEmail(GETPOST("email"))) {
  164. $error++;
  165. $langs->load("errors");
  166. $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."<br>\n";
  167. }
  168. // Set default opportunity status
  169. $defaultoppstatus = getDolGlobalString('PROJECT_DEFAULT_OPPORTUNITY_STATUS_FOR_ONLINE_LEAD');
  170. if (empty($defaultoppstatus)) {
  171. $error++;
  172. $langs->load("errors");
  173. $errmsg .= $langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Project"))."<br>\n";
  174. }
  175. $proj = new Project($db);
  176. $thirdparty = new Societe($db);
  177. if (!$error) {
  178. // Search thirdparty and set it if found to the new created project
  179. $result = $thirdparty->fetch(0, '', '', '', '', '', '', '', '', '', $object->email);
  180. if ($result > 0) {
  181. $proj->socid = $thirdparty->id;
  182. } else {
  183. // Create the prospect
  184. if (GETPOST('societe')) {
  185. $thirdparty->name = GETPOST('societe');
  186. $thirdparty->name_alias = dolGetFirstLastname(GETPOST('firstname'), GETPOST('lastname'));
  187. } else {
  188. $thirdparty->name = dolGetFirstLastname(GETPOST('firstname'), GETPOST('lastname'));
  189. }
  190. $thirdparty->address = GETPOST('address');
  191. $thirdparty->zip = GETPOST('zip');
  192. $thirdparty->town = GETPOST('town');
  193. $thirdparty->country_id = GETPOST('country_id', 'int');
  194. $thirdparty->state_id = GETPOST('state_id');
  195. $thirdparty->client = $thirdparty::PROSPECT;
  196. $thirdparty->code_client = 'auto';
  197. $thirdparty->code_fournisseur = 'auto';
  198. // Fill array 'array_options' with data from the form
  199. $extrafields->fetch_name_optionals_label($thirdparty->table_element);
  200. $ret = $extrafields->setOptionalsFromPost(null, $thirdparty, '', 1);
  201. //var_dump($thirdparty->array_options);exit;
  202. if ($ret < 0) {
  203. $error++;
  204. $errmsg = ($extrafields->error ? $extrafields->error.'<br>' : '').join('<br>', $extrafields->errors);
  205. }
  206. if (!$error) {
  207. $result = $thirdparty->create($user);
  208. if ($result <= 0) {
  209. $error++;
  210. $errmsg = ($thirdparty->error ? $thirdparty->error.'<br>' : '').join('<br>', $thirdparty->errors);
  211. } else {
  212. $proj->socid = $thirdparty->id;
  213. }
  214. }
  215. }
  216. }
  217. if (!$error) {
  218. // Defined the ref into $defaultref
  219. $defaultref = '';
  220. $modele = empty($conf->global->PROJECT_ADDON) ? 'mod_project_simple' : $conf->global->PROJECT_ADDON;
  221. // Search template files
  222. $file = ''; $classname = ''; $filefound = 0;
  223. $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
  224. foreach ($dirmodels as $reldir) {
  225. $file = dol_buildpath($reldir."core/modules/project/".$modele.'.php', 0);
  226. if (file_exists($file)) {
  227. $filefound = 1;
  228. $classname = $modele;
  229. break;
  230. }
  231. }
  232. if ($filefound) {
  233. $result = dol_include_once($reldir."core/modules/project/".$modele.'.php');
  234. $modProject = new $classname;
  235. $defaultref = $modProject->getNextValue($thirdparty, $object);
  236. }
  237. if (is_numeric($defaultref) && $defaultref <= 0) {
  238. $defaultref = '';
  239. }
  240. if (empty($defaultref)) {
  241. $defaultref = 'PJ'.dol_print_date(dol_now(), 'dayrfc');
  242. }
  243. $proj->ref = $defaultref;
  244. $proj->statut = $proj::STATUS_DRAFT;
  245. $proj->status = $proj::STATUS_DRAFT;
  246. $proj->email = GETPOST("email");
  247. $proj->public = 1;
  248. $proj->usage_opportunity = 1;
  249. $proj->title = $langs->trans("LeadFromPublicForm");
  250. $proj->description = GETPOST("description", "alphanohtml");
  251. $proj->opp_status = $defaultoppstatus;
  252. $proj->fk_opp_status = $defaultoppstatus;
  253. // Fill array 'array_options' with data from the form
  254. $extrafields->fetch_name_optionals_label($proj->table_element);
  255. $ret = $extrafields->setOptionalsFromPost(null, $proj);
  256. if ($ret < 0) {
  257. $error++;
  258. }
  259. // Create the project
  260. $result = $proj->create($user);
  261. if ($result > 0) {
  262. require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
  263. $object = $proj;
  264. if ($object->email) {
  265. $subject = '';
  266. $msg = '';
  267. // Send subscription email
  268. include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
  269. $formmail = new FormMail($db);
  270. // Set output language
  271. $outputlangs = new Translate('', $conf);
  272. $outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
  273. // Load traductions files required by page
  274. $outputlangs->loadLangs(array("main", "members", "projects"));
  275. // Get email content from template
  276. $arraydefaultmessage = null;
  277. $labeltouse = $conf->global->PROJECT_EMAIL_TEMPLATE_AUTOLEAD;
  278. if (!empty($labeltouse)) {
  279. $arraydefaultmessage = $formmail->getEMailTemplate($db, 'project', $user, $outputlangs, 0, 1, $labeltouse);
  280. }
  281. if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
  282. $subject = $arraydefaultmessage->topic;
  283. $msg = $arraydefaultmessage->content;
  284. }
  285. if (empty($labeltosue)) {
  286. $labeltouse = '['.$mysoc->name.'] '.$langs->trans("YourMessage");
  287. $msg = $langs->trans("YourMessageHasBeenReceived");
  288. }
  289. $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $object);
  290. complete_substitutions_array($substitutionarray, $outputlangs, $object);
  291. $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
  292. $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs);
  293. if ($subjecttosend && $texttosend) {
  294. $moreinheader = 'X-Dolibarr-Info: send_an_email by public/lead/new.php'."\r\n";
  295. $result = $object->send_an_email($texttosend, $subjecttosend, array(), array(), array(), "", "", 0, -1, '', $moreinheader);
  296. }
  297. /*if ($result < 0) {
  298. $error++;
  299. setEventMessages($object->error, $object->errors, 'errors');
  300. }*/
  301. }
  302. if (!empty($backtopage)) {
  303. $urlback = $backtopage;
  304. } elseif (!empty($conf->global->PROJECT_URL_REDIRECT_LEAD)) {
  305. $urlback = $conf->global->PROJECT_URL_REDIRECT_LEAD;
  306. // TODO Make replacement of __AMOUNT__, etc...
  307. } else {
  308. $urlback = $_SERVER["PHP_SELF"]."?action=added&token=".newToken();
  309. }
  310. if (!empty($entity)) {
  311. $urlback .= '&entity='.$entity;
  312. }
  313. dol_syslog("project lead ".$proj->ref." has been created, we redirect to ".$urlback);
  314. } else {
  315. $error++;
  316. $errmsg .= $proj->error.'<br>'.join('<br>', $proj->errors);
  317. }
  318. }
  319. if (!$error) {
  320. $db->commit();
  321. Header("Location: ".$urlback);
  322. exit;
  323. } else {
  324. $db->rollback();
  325. }
  326. }
  327. // Action called after a submitted was send and member created successfully
  328. // If MEMBER_URL_REDIRECT_SUBSCRIPTION is set to url we never go here because a redirect was done to this url.
  329. // backtopage parameter with an url was set on member submit page, we never go here because a redirect was done to this url.
  330. if (empty($reshook) && $action == 'added') {
  331. llxHeaderVierge($langs->trans("NewLeadForm"));
  332. // Si on a pas ete redirige
  333. print '<br><br>';
  334. print '<div class="center">';
  335. print $langs->trans("NewLeadbyWeb");
  336. print '</div>';
  337. llxFooterVierge();
  338. exit;
  339. }
  340. /*
  341. * View
  342. */
  343. $form = new Form($db);
  344. $formcompany = new FormCompany($db);
  345. $extrafields->fetch_name_optionals_label($object->table_element); // fetch optionals attributes and labels
  346. llxHeaderVierge($langs->trans("NewContact"));
  347. print load_fiche_titre($langs->trans("NewContact"), '', '', 0, 0, 'center');
  348. print '<div align="center">';
  349. print '<div id="divsubscribe">';
  350. print '<div class="center subscriptionformhelptext justify">';
  351. if (!empty($conf->global->PROJECT_NEWFORM_TEXT)) {
  352. print $langs->trans($conf->global->PROJECT_NEWFORM_TEXT)."<br>\n";
  353. } else {
  354. print $langs->trans("FormForNewLeadDesc", getDolGlobalString("MAIN_INFO_SOCIETE_MAIL"))."<br>\n";
  355. }
  356. print '</div>';
  357. dol_htmloutput_errors($errmsg);
  358. // Print form
  359. print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" name="newlead">'."\n";
  360. print '<input type="hidden" name="token" value="'.newToken().'" / >';
  361. print '<input type="hidden" name="entity" value="'.$entity.'" />';
  362. print '<input type="hidden" name="action" value="add" />';
  363. print '<br>';
  364. print '<br><span class="opacitymedium">'.$langs->trans("FieldsWithAreMandatory", '*').'</span><br>';
  365. //print $langs->trans("FieldsWithIsForPublic",'**').'<br>';
  366. print dol_get_fiche_head('');
  367. print '<script type="text/javascript">
  368. jQuery(document).ready(function () {
  369. jQuery(document).ready(function () {
  370. jQuery("#selectcountry_id").change(function() {
  371. document.newlead.action.value="create";
  372. document.newlead.submit();
  373. });
  374. });
  375. });
  376. </script>';
  377. print '<table class="border" summary="form to subscribe" id="tablesubscribe">'."\n";
  378. // Lastname
  379. print '<tr><td>'.$langs->trans("Lastname").' <span style="color: red">*</span></td><td><input type="text" name="lastname" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('lastname')).'" required></td></tr>'."\n";
  380. // Firstname
  381. print '<tr><td>'.$langs->trans("Firstname").' <span style="color: red">*</span></td><td><input type="text" name="firstname" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('firstname')).'" required></td></tr>'."\n";
  382. // EMail
  383. print '<tr><td>'.$langs->trans("Email").' <span style="color: red">*</span></td><td><input type="text" name="email" maxlength="255" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('email')).'" required></td></tr>'."\n";
  384. // Company
  385. print '<tr id="trcompany" class="trcompany"><td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('societe')).'"></td></tr>'."\n";
  386. // Address
  387. print '<tr><td>'.$langs->trans("Address").'</td><td>'."\n";
  388. print '<textarea name="address" id="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_2.'">'.dol_escape_htmltag(GETPOST('address', 'restricthtml'), 0, 1).'</textarea></td></tr>'."\n";
  389. // Zip / Town
  390. print '<tr><td>'.$langs->trans('Zip').' / '.$langs->trans('Town').'</td><td>';
  391. print $formcompany->select_ziptown(GETPOST('zipcode'), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6, 1);
  392. print ' / ';
  393. print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1);
  394. print '</td></tr>';
  395. // Country
  396. print '<tr><td>'.$langs->trans('Country').'</td><td>';
  397. $country_id = GETPOST('country_id');
  398. if (!$country_id && !empty($conf->global->PROJECT_NEWFORM_FORCECOUNTRYCODE)) {
  399. $country_id = getCountry($conf->global->PROJECT_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs);
  400. }
  401. if (!$country_id && !empty($conf->geoipmaxmind->enabled)) {
  402. $country_code = dol_user_country();
  403. //print $country_code;
  404. if ($country_code) {
  405. $new_country_id = getCountry($country_code, 3, $db, $langs);
  406. //print 'xxx'.$country_code.' - '.$new_country_id;
  407. if ($new_country_id) {
  408. $country_id = $new_country_id;
  409. }
  410. }
  411. }
  412. $country_code = getCountry($country_id, 2, $db, $langs);
  413. print $form->select_country($country_id, 'country_id');
  414. print '</td></tr>';
  415. // State
  416. if (empty($conf->global->SOCIETE_DISABLE_STATE)) {
  417. print '<tr><td>'.$langs->trans('State').'</td><td>';
  418. if ($country_code) {
  419. print $formcompany->select_state(GETPOST("state_id", 'int'), $country_code);
  420. } else {
  421. print '';
  422. }
  423. print '</td></tr>';
  424. }
  425. // Other attributes
  426. $tpl_context = 'public'; // define template context to public
  427. include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
  428. // Comments
  429. print '<tr>';
  430. print '<td class="tdtop">'.$langs->trans("Message").' <span style="color: red">*</span></td>';
  431. print '<td class="tdtop"><textarea name="description" id="description" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_5.'" required>'.dol_escape_htmltag(GETPOST('description', 'restricthtml'), 0, 1).'</textarea></td>';
  432. print '</tr>'."\n";
  433. print "</table>\n";
  434. print dol_get_fiche_end();
  435. // Save
  436. print '<div class="center">';
  437. print '<input type="submit" value="'.$langs->trans("Submit").'" id="submitsave" class="button">';
  438. if (!empty($backtopage)) {
  439. print ' &nbsp; &nbsp; <input type="submit" value="'.$langs->trans("Cancel").'" id="submitcancel" class="button button-cancel">';
  440. }
  441. print '</div>';
  442. print "</form>\n";
  443. print "<br>";
  444. print '</div></div>';
  445. llxFooterVierge();
  446. $db->close();