PageRenderTime 61ms CodeModel.GetById 30ms RepoModel.GetById 0ms app.codeStats 0ms

/htdocs/compta/dons/fiche.php

https://github.com/abhimanyumohan/dolibarr
PHP | 593 lines | 394 code | 119 blank | 80 comment | 82 complexity | e2ce2e409df440d6013afce95c102121 MD5 | raw file
Possible License(s): GPL-3.0, CC-BY-SA-4.0, Apache-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception
  1. <?php
  2. /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
  5. * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. /**
  21. * \file htdocs/compta/dons/fiche.php
  22. * \ingroup don
  23. * \brief Page of donation card
  24. */
  25. require '../../main.inc.php';
  26. require_once DOL_DOCUMENT_ROOT.'/core/modules/dons/modules_don.php';
  27. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
  28. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
  29. require_once DOL_DOCUMENT_ROOT.'/compta/dons/class/don.class.php';
  30. require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
  31. if (! empty($conf->projet->enabled)) {
  32. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
  33. }
  34. $langs->load("companies");
  35. $langs->load("donations");
  36. $langs->load("bills");
  37. $id=GETPOST('rowid')?GETPOST('rowid','int'):GETPOST('id','int');
  38. $action=GETPOST('action','alpha');
  39. $cancel=GETPOST('cancel');
  40. $amount=GETPOST('amount');
  41. $don = new Don($db);
  42. $donation_date=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
  43. // Security check
  44. $result = restrictedArea($user, 'don', $id);
  45. // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
  46. $hookmanager->initHooks(array('doncard'));
  47. /*
  48. * Actions
  49. */
  50. if ($action == 'update')
  51. {
  52. if (! empty($cancel))
  53. {
  54. header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
  55. exit;
  56. }
  57. $error=0;
  58. if (empty($donation_date))
  59. {
  60. setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")), 'errors');
  61. $action = "create";
  62. $error++;
  63. }
  64. if (empty($amount))
  65. {
  66. $setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Amount")), 'errors');
  67. $action = "create";
  68. $error++;
  69. }
  70. if (! $error)
  71. {
  72. $don->fetch($id);
  73. $don->firstname = $_POST["firstname"];
  74. $don->lastname = $_POST["lastname"];
  75. $don->societe = $_POST["societe"];
  76. $don->address = $_POST["address"];
  77. $don->amount = price2num($_POST["amount"]);
  78. $don->town = $_POST["town"];
  79. $don->zip = $_POST["zipcode"];
  80. $don->country = $_POST["country"];
  81. $don->email = $_POST["email"];
  82. $don->date = $donation_date;
  83. $don->note = $_POST["note"];
  84. $don->public = $_POST["public"];
  85. $don->fk_project = $_POST["projectid"];
  86. $don->note_private= GETPOST("note_private");
  87. $don->note_public = GETPOST("note_public");
  88. $don->modepaiementid = $_POST["modepaiement"];
  89. if ($don->update($user) > 0)
  90. {
  91. header("Location: ".$_SERVER['PHP_SELF']."?id=".$don->id);
  92. exit;
  93. }
  94. }
  95. }
  96. if ($action == 'add')
  97. {
  98. if (! empty($cancel))
  99. {
  100. header("Location: index.php");
  101. exit;
  102. }
  103. $error=0;
  104. if (empty($donation_date))
  105. {
  106. setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")), 'errors');
  107. $action = "create";
  108. $error++;
  109. }
  110. if (empty($amount))
  111. {
  112. setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Amount")), 'errors');
  113. $action = "create";
  114. $error++;
  115. }
  116. if (! $error)
  117. {
  118. $don->firstname = $_POST["firstname"];
  119. $don->lastname = $_POST["lastname"];
  120. $don->societe = $_POST["societe"];
  121. $don->address = $_POST["address"];
  122. $don->amount = price2num($_POST["amount"]);
  123. $don->town = $_POST["town"];
  124. $don->zip = $_POST["zipcode"];
  125. $don->town = $_POST["town"];
  126. $don->country = $_POST["country"];
  127. $don->email = $_POST["email"];
  128. $don->date = $donation_date;
  129. $don->note_private= GETPOST("note_private");
  130. $don->note_public = GETPOST("note_public");
  131. $don->public = $_POST["public"];
  132. $don->fk_project = $_POST["projectid"];
  133. $don->modepaiementid = $_POST["modepaiement"];
  134. if ($don->create($user) > 0)
  135. {
  136. header("Location: index.php");
  137. exit;
  138. }
  139. }
  140. }
  141. if ($action == 'delete')
  142. {
  143. $don->delete($id);
  144. header("Location: liste.php");
  145. exit;
  146. }
  147. if ($action == 'commentaire')
  148. {
  149. $don->fetch($id);
  150. $don->update_note($_POST["commentaire"]);
  151. }
  152. if ($action == 'valid_promesse')
  153. {
  154. if ($don->valid_promesse($id, $user->id) >= 0)
  155. {
  156. header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
  157. exit;
  158. }
  159. else {
  160. setEventMessage($don->error, 'errors');
  161. }
  162. }
  163. if ($action == 'set_cancel')
  164. {
  165. if ($don->set_cancel($id) >= 0)
  166. {
  167. header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
  168. exit;
  169. }
  170. else {
  171. setEventMessage($don->error, 'errors');
  172. }
  173. }
  174. if ($action == 'set_paid')
  175. {
  176. if ($don->set_paye($id, $modepaiement) >= 0)
  177. {
  178. header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
  179. exit;
  180. }
  181. else {
  182. setEventMessage($don->error, 'errors');
  183. }
  184. }
  185. if ($action == 'set_encaisse')
  186. {
  187. if ($don->set_encaisse($id) >= 0)
  188. {
  189. header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
  190. exit;
  191. }
  192. else {
  193. setEventMessage($don->error, 'errors');
  194. }
  195. }
  196. /*
  197. * Build doc
  198. */
  199. if ($action == 'builddoc')
  200. {
  201. $object = new Don($db);
  202. $object->fetch($id);
  203. // Save last template used to generate document
  204. if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
  205. // Define output language
  206. $outputlangs = $langs;
  207. $newlang='';
  208. if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
  209. if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
  210. if (! empty($newlang))
  211. {
  212. $outputlangs = new Translate("",$conf);
  213. $outputlangs->setDefaultLang($newlang);
  214. }
  215. $result=don_create($db, $object->id, '', $object->modelpdf, $outputlangs);
  216. if ($result <= 0)
  217. {
  218. dol_print_error($db,$result);
  219. exit;
  220. }
  221. }
  222. /*
  223. * View
  224. */
  225. llxHeader('',$langs->trans("Donations"),'EN:Module_Donations|FR:Module_Dons|ES:M&oacute;dulo_Donaciones');
  226. $form=new Form($db);
  227. $formfile = new FormFile($db);
  228. $formcompany = new FormCompany($db);
  229. /* ************************************************************************** */
  230. /* */
  231. /* Creation */
  232. /* */
  233. /* ************************************************************************** */
  234. if ($action == 'create')
  235. {
  236. print_fiche_titre($langs->trans("AddDonation"));
  237. print '<form name="add" action="fiche.php" method="post">';
  238. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  239. print '<table class="border" width="100%">';
  240. print '<input type="hidden" name="action" value="add">';
  241. $nbrows=11;
  242. if (! empty($conf->projet->enabled)) $nbrows++;
  243. // Date
  244. print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
  245. $form->select_date($donation_date?$donation_date:-1,'','','','',"add",1,1);
  246. print '</td>';
  247. print '<td rowspan="'.$nbrows.'" valign="top">'.$langs->trans("Comments").' :<br>';
  248. print "<textarea name=\"note_private\" wrap=\"soft\" cols=\"40\" rows=\"15\">".GETPOST("note_private")."</textarea></td>";
  249. print "</tr>";
  250. // Amount
  251. print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" value="'.$_POST["amount"].'" size="10"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
  252. print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
  253. print $form->selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1);
  254. print "</td></tr>\n";
  255. print "<tr>".'<td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" value="'.$_POST["societe"].'" size="40"></td></tr>';
  256. print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" value="'.$_POST["firstname"].'" size="40"></td></tr>';
  257. print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" value="'.$_POST["lastname"].'" size="40"></td></tr>';
  258. print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
  259. print '<textarea name="address" wrap="soft" cols="40" rows="3">'.$_POST["address"].'</textarea></td></tr>';
  260. // Zip / Town
  261. print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
  262. print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$don->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
  263. print ' ';
  264. print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$don->town),'town',array('zipcode','selectcountry_id','state_id'));
  265. print '</tr>';
  266. print "<tr>".'<td>'.$langs->trans("Country").'</td><td><input type="text" name="country" value="'.$_POST["country"].'" size="40"></td></tr>';
  267. print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" value="'.$_POST["email"].'" size="40"></td></tr>';
  268. print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
  269. $form->select_types_paiements('', 'modepaiement', 'CRDT', 0, 1);
  270. print "</td></tr>\n";
  271. if (! empty($conf->projet->enabled))
  272. {
  273. $formproject=new FormProjets($db);
  274. // Si module projet actif
  275. print "<tr><td>".$langs->trans("Project")."</td><td>";
  276. $formproject->select_projects('',$_POST["projectid"],"projectid");
  277. print "</td></tr>\n";
  278. }
  279. // Other attributes
  280. $parameters=array('colspan' => ' colspan="1"');
  281. $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$don,$action); // Note that $action and $object may have been modified by hook
  282. print "</table>\n";
  283. print '<br><center><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> &nbsp; &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
  284. print "</form>\n";
  285. }
  286. /* ************************************************************ */
  287. /* */
  288. /* Fiche don en mode edition */
  289. /* */
  290. /* ************************************************************ */
  291. if (! empty($id) && $action == 'edit')
  292. {
  293. $don->fetch($id);
  294. $h=0;
  295. $head[$h][0] = $_SERVER['PHP_SELF']."?id=".$don->id;
  296. $head[$h][1] = $langs->trans("Card");
  297. $hselected=$h;
  298. $h++;
  299. dol_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'generic');
  300. print '<form name="update" action="fiche.php" method="post">';
  301. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  302. print '<table class="border" width="100%">';
  303. print '<input type="hidden" name="action" value="update">';
  304. print '<input type="hidden" name="rowid" value="'.$don->id.'">';
  305. // Ref
  306. print "<tr>".'<td>'.$langs->trans("Ref").'</td><td colspan="2">';
  307. print $don->getNomUrl();
  308. print '</td>';
  309. print '</tr>';
  310. $nbrows=12;
  311. if (! empty($conf->projet->enabled)) $nbrows++;
  312. // Date
  313. print "<tr>".'<td width="25%" class="fieldrequired">'.$langs->trans("Date").'</td><td>';
  314. $form->select_date($don->date,'','','','',"update");
  315. print '</td>';
  316. print '<td rowspan="'.$nbrows.'" valign="top">'.$langs->trans("Comments").' :<br>';
  317. print "<textarea name=\"note_private\" wrap=\"soft\" cols=\"40\" rows=\"15\">".$don->note_private."</textarea></td>";
  318. print "</tr>";
  319. // Amount
  320. print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" size="10" value="'.$don->amount.'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
  321. print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
  322. print $form->selectyesno("public",1,1);
  323. print "</td>";
  324. print "</tr>\n";
  325. $langs->load("companies");
  326. print "<tr>".'<td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.$don->societe.'"></td></tr>';
  327. print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.$don->firstname.'"></td></tr>';
  328. print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" size="40" value="'.$don->lastname.'"></td></tr>';
  329. print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
  330. print '<textarea name="address" wrap="soft" cols="40" rows="'.ROWS_3.'">'.$don->address.'</textarea></td></tr>';
  331. // Zip / Town
  332. print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
  333. print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$don->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
  334. print ' ';
  335. print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$don->town),'town',array('zipcode','selectcountry_id','state_id'));
  336. print '</tr>';
  337. print "<tr>".'<td>'.$langs->trans("Country").'</td><td><input type="text" name="country" size="40" value="'.$don->country.'"></td></tr>';
  338. print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" size="40" value="'.$don->email.'"></td></tr>';
  339. print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
  340. if ($don->modepaiementid) $selected = $don->modepaiementid;
  341. else $selected = '';
  342. $form->select_types_paiements($selected, 'modepaiement', 'CRDT', 0, 1);
  343. print "</td></tr>\n";
  344. print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>';
  345. // Project
  346. if (! empty($conf->projet->enabled))
  347. {
  348. $formproject=new FormProjets($db);
  349. $langs->load('projects');
  350. print '<tr><td>'.$langs->trans('Project').'</td><td>';
  351. $formproject->select_projects(-1, (isset($_POST["projectid"])?$_POST["projectid"]:$don->fk_project), 'projectid');
  352. print '</td></tr>';
  353. }
  354. // Other attributes
  355. $parameters=array('colspan' => ' colspan="1"');
  356. $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$don,$action); // Note that $action and $object may have been modified by hook
  357. print "</table>\n";
  358. print '<br><center><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> &nbsp; &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
  359. print "</form>\n";
  360. print "</div>\n";
  361. }
  362. /* ************************************************************ */
  363. /* */
  364. /* Fiche don en mode visu */
  365. /* */
  366. /* ************************************************************ */
  367. if (! empty($id) && $action != 'edit')
  368. {
  369. $result=$don->fetch($id);
  370. $h=0;
  371. $head[$h][0] = $_SERVER['PHP_SELF']."?id=".$don->id;
  372. $head[$h][1] = $langs->trans("Card");
  373. $hselected=$h;
  374. $h++;
  375. dol_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'generic');
  376. print "<form action=\"fiche.php\" method=\"post\">";
  377. print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
  378. print '<table class="border" width="100%">';
  379. $linkback = '<a href="'.DOL_URL_ROOT.'/compta/dons/liste.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
  380. $nbrows=12;
  381. if (! empty($conf->projet->enabled)) $nbrows++;
  382. // Ref
  383. print "<tr>".'<td>'.$langs->trans("Ref").'</td><td colspan="2">';
  384. print $form->showrefnav($don, 'rowid', $linkback, 1, 'rowid', 'ref', '');
  385. print '</td>';
  386. print '</tr>';
  387. // Date
  388. print '<tr><td width="25%">'.$langs->trans("Date").'</td><td>';
  389. print dol_print_date($don->date,"day");
  390. print "</td>";
  391. print '<td rowspan="'.$nbrows.'" valign="top" width="50%">'.$langs->trans("Comments").' :<br>';
  392. print nl2br($don->note_private).'</td></tr>';
  393. print "<tr>".'<td>'.$langs->trans("Amount").'</td><td>'.price($don->amount,0,$langs,0,0,-1,$conf->currency).'</td></tr>';
  394. print "<tr><td>".$langs->trans("PublicDonation")."</td><td>";
  395. print yn($don->public);
  396. print "</td></tr>\n";
  397. print "<tr>".'<td>'.$langs->trans("Company").'</td><td>'.$don->societe.'</td></tr>';
  398. print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td>'.$don->firstname.'</td></tr>';
  399. print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td>'.$don->lastname.'</td></tr>';
  400. print "<tr>".'<td>'.$langs->trans("Address").'</td><td>'.dol_nl2br($don->address).'</td></tr>';
  401. // Zip / Town
  402. print "<tr>".'<td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>'.$don->zip.($don->zip && $don->town?' / ':'').$don->town.'</td></tr>';
  403. // Country
  404. print "<tr>".'<td>'.$langs->trans("Country").'</td><td>'.$don->country.'</td></tr>';
  405. // EMail
  406. print "<tr>".'<td>'.$langs->trans("EMail").'</td><td>'.dol_print_email($don->email).'</td></tr>';
  407. // Payment mode
  408. print "<tr><td>".$langs->trans("PaymentMode")."</td><td>";
  409. print $form->form_modes_reglement(null, $don->modepaiementid,'none');
  410. print "</td></tr>\n";
  411. print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>';
  412. // Project
  413. if (! empty($conf->projet->enabled))
  414. {
  415. print "<tr>".'<td>'.$langs->trans("Project").'</td><td>'.$don->projet.'</td></tr>';
  416. }
  417. // Other attributes
  418. $parameters=array('colspan' => ' colspan="1"');
  419. $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$don,$action); // Note that $action and $object may have been modified by hook
  420. print "</table>\n";
  421. print "</form>\n";
  422. print "</div>";
  423. // TODO Gerer action emettre paiement
  424. $resteapayer = 0;
  425. /**
  426. * Barre d'actions
  427. */
  428. print '<div class="tabsAction">';
  429. print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?action=edit&rowid='.$don->id.'">'.$langs->trans('Modify').'</a></div>';
  430. if ($don->statut == 0)
  431. {
  432. print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$don->id.'&action=valid_promesse">'.$langs->trans("ValidPromess").'</a></div>';
  433. }
  434. if (($don->statut == 0 || $don->statut == 1) && $resteapayer == 0 && $don->paye == 0)
  435. {
  436. print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$don->id.'&action=set_cancel">'.$langs->trans("ClassifyCanceled")."</a></div>";
  437. }
  438. // TODO Gerer action emettre paiement
  439. if ($don->statut == 1 && $resteapayer > 0)
  440. {
  441. print '<div class="inline-block divButAction"><a class="butAction" href="paiement.php?rowid='.$don->id.'&action=create">'.$langs->trans("DoPayment")."</a></div>";
  442. }
  443. if ($don->statut == 1 && $resteapayer == 0 && $don->paye == 0)
  444. {
  445. print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$don->id.'&action=set_paid">'.$langs->trans("ClassifyPaid")."</a></div>";
  446. }
  447. if ($user->rights->don->supprimer)
  448. {
  449. print '<div class="inline-block divButAction"><a class="butActionDelete" href="fiche.php?rowid='.$don->id.'&action=delete">'.$langs->trans("Delete")."</a></div>";
  450. }
  451. else
  452. {
  453. print '<div class="inline-block divButAction"><a class="butActionRefused" href="#">'.$langs->trans("Delete")."</a></div>";
  454. }
  455. print "</div>";
  456. print '<table width="100%"><tr><td width="50%" valign="top">';
  457. /*
  458. * Documents generes
  459. */
  460. $filename=dol_sanitizeFileName($don->id);
  461. $filedir=$conf->don->dir_output . '/' . get_exdir($filename,2);
  462. $urlsource=$_SERVER['PHP_SELF'].'?rowid='.$don->id;
  463. // $genallowed=($fac->statut == 1 && ($fac->paye == 0 || $user->admin) && $user->rights->facture->creer);
  464. // $delallowed=$user->rights->facture->supprimer;
  465. $genallowed=1;
  466. $delallowed=0;
  467. $var=true;
  468. print '<br>';
  469. $formfile->show_documents('donation',$filename,$filedir,$urlsource,$genallowed,$delallowed);
  470. print '</td><td>&nbsp;</td>';
  471. print '</tr></table>';
  472. }
  473. llxFooter();
  474. $db->close();