2004-10-19 22:35:36 +02:00
|
|
|
<?php
|
2012-07-11 10:14:56 +02:00
|
|
|
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
|
|
|
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
2012-12-30 15:13:49 +01:00
|
|
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
2013-04-09 17:18:07 +02:00
|
|
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
2002-12-19 19:55:38 +01:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
2013-01-16 15:36:08 +01:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2002-12-19 19:55:38 +01:00
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2011-08-03 02:45:22 +02:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2002-12-19 19:55:38 +01:00
|
|
|
*/
|
2004-09-04 17:56:12 +02:00
|
|
|
|
2005-08-11 22:28:11 +02:00
|
|
|
/**
|
2008-11-14 12:56:47 +01:00
|
|
|
* \file htdocs/compta/dons/fiche.php
|
|
|
|
|
* \ingroup don
|
2011-06-12 17:47:10 +02:00
|
|
|
* \brief Page of donation card
|
2008-11-14 12:56:47 +01:00
|
|
|
*/
|
2004-09-04 17:56:12 +02:00
|
|
|
|
2012-08-22 23:24:21 +02:00
|
|
|
require '../../main.inc.php';
|
2012-08-22 23:11:24 +02:00
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/modules/dons/modules_don.php';
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/compta/dons/class/don.class.php';
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
2013-06-14 22:33:01 +02:00
|
|
|
if (! empty($conf->projet->enabled)) {
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
|
|
|
|
}
|
2002-12-19 19:55:38 +01:00
|
|
|
|
2006-06-24 22:29:06 +02:00
|
|
|
$langs->load("companies");
|
2004-11-16 21:11:30 +01:00
|
|
|
$langs->load("donations");
|
|
|
|
|
$langs->load("bills");
|
2004-09-04 17:56:12 +02:00
|
|
|
|
2012-07-11 10:14:56 +02:00
|
|
|
$id=GETPOST('rowid')?GETPOST('rowid','int'):GETPOST('id','int');
|
|
|
|
|
$action=GETPOST('action','alpha');
|
|
|
|
|
$cancel=GETPOST('cancel');
|
|
|
|
|
$amount=GETPOST('amount');
|
2012-02-01 14:20:22 +01:00
|
|
|
|
2004-09-04 17:56:12 +02:00
|
|
|
$mesg="";
|
2011-06-12 17:47:10 +02:00
|
|
|
$mesgs=array();
|
2004-09-04 17:56:12 +02:00
|
|
|
|
2010-02-13 17:28:03 +01:00
|
|
|
$don = new Don($db);
|
2012-07-11 10:14:56 +02:00
|
|
|
$donation_date=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
|
2010-02-13 17:28:03 +01:00
|
|
|
|
2012-02-01 14:20:22 +01:00
|
|
|
// Security check
|
|
|
|
|
$result = restrictedArea($user, 'don', $id);
|
|
|
|
|
|
Add: hooks and triggers for a lot of core modules (action/calendrier, deplacement, dons, tva, contact/tiers, contrat, product lines, expedition, fournisseur commandes et factures, fiche intervention, projet et taches)
Signed-off-by: Stephen L. <lrq3000@gmail.com>
2012-08-14 15:50:45 +02:00
|
|
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
|
|
|
|
$hookmanager->initHooks(array('doncard'));
|
|
|
|
|
|
2006-06-24 22:29:06 +02:00
|
|
|
|
2006-01-14 15:36:21 +01:00
|
|
|
/*
|
|
|
|
|
* Actions
|
|
|
|
|
*/
|
2008-11-15 19:20:40 +01:00
|
|
|
|
2012-02-01 14:20:22 +01:00
|
|
|
if ($action == 'update')
|
2002-12-19 19:55:38 +01:00
|
|
|
{
|
2012-07-11 10:14:56 +02:00
|
|
|
if (! empty($cancel))
|
2010-04-05 03:25:44 +02:00
|
|
|
{
|
2012-08-31 05:58:38 +02:00
|
|
|
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
2010-04-05 03:25:44 +02:00
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
2010-02-13 17:28:03 +01:00
|
|
|
$error=0;
|
|
|
|
|
|
2011-06-12 17:47:10 +02:00
|
|
|
if (empty($donation_date))
|
|
|
|
|
{
|
|
|
|
|
$mesgs[]=$langs->trans("ErrorFieldRequired",$langs->trans("Date"));
|
2012-02-01 14:20:22 +01:00
|
|
|
$action = "create";
|
2011-06-12 17:47:10 +02:00
|
|
|
$error++;
|
|
|
|
|
}
|
2010-02-13 17:28:03 +01:00
|
|
|
|
2012-07-11 10:14:56 +02:00
|
|
|
if (empty($amount))
|
2008-11-15 19:20:40 +01:00
|
|
|
{
|
2011-06-12 17:47:10 +02:00
|
|
|
$mesgs[]=$langs->trans("ErrorFieldRequired",$langs->trans("Amount"));
|
2012-02-01 14:20:22 +01:00
|
|
|
$action = "create";
|
2011-06-12 17:47:10 +02:00
|
|
|
$error++;
|
2010-02-13 17:28:03 +01:00
|
|
|
}
|
2008-11-15 19:20:40 +01:00
|
|
|
|
2010-02-13 17:28:03 +01:00
|
|
|
if (! $error)
|
|
|
|
|
{
|
2012-07-11 10:14:56 +02:00
|
|
|
$don->fetch($id);
|
2008-11-15 19:20:40 +01:00
|
|
|
|
2013-02-23 15:46:12 +01:00
|
|
|
$don->firstname = $_POST["firstname"];
|
|
|
|
|
$don->lastname = $_POST["lastname"];
|
2008-11-15 19:20:40 +01:00
|
|
|
$don->societe = $_POST["societe"];
|
2013-02-15 19:26:09 +01:00
|
|
|
$don->address = $_POST["address"];
|
2011-01-04 01:09:09 +01:00
|
|
|
$don->amount = price2num($_POST["amount"]);
|
2013-02-22 16:33:48 +01:00
|
|
|
$don->town = $_POST["town"];
|
2011-06-12 17:47:10 +02:00
|
|
|
$don->zip = $_POST["zipcode"];
|
2013-02-25 17:56:41 +01:00
|
|
|
$don->country = $_POST["country"];
|
2008-11-15 19:20:40 +01:00
|
|
|
$don->email = $_POST["email"];
|
2010-02-13 17:28:03 +01:00
|
|
|
$don->date = $donation_date;
|
2008-11-15 19:20:40 +01:00
|
|
|
$don->note = $_POST["note"];
|
|
|
|
|
$don->public = $_POST["public"];
|
2010-03-11 15:31:16 +01:00
|
|
|
$don->fk_project = $_POST["projectid"];
|
2013-04-09 17:18:07 +02:00
|
|
|
$don->note_private= GETPOST("note_private");
|
|
|
|
|
$don->note_public = GETPOST("note_public");
|
2008-11-15 19:20:40 +01:00
|
|
|
$don->modepaiementid = $_POST["modepaiement"];
|
|
|
|
|
|
|
|
|
|
if ($don->update($user) > 0)
|
|
|
|
|
{
|
2012-08-31 05:58:38 +02:00
|
|
|
header("Location: ".$_SERVER['PHP_SELF']."?id=".$don->id);
|
2008-11-15 19:20:40 +01:00
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-09-04 17:56:12 +02:00
|
|
|
}
|
|
|
|
|
|
2012-02-01 14:20:22 +01:00
|
|
|
if ($action == 'add')
|
2004-09-04 17:56:12 +02:00
|
|
|
{
|
2012-07-11 10:14:56 +02:00
|
|
|
if (! empty($cancel))
|
2010-04-05 03:25:44 +02:00
|
|
|
{
|
2012-08-31 05:58:38 +02:00
|
|
|
header("Location: index.php");
|
2010-04-05 03:25:44 +02:00
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
2010-02-13 17:28:03 +01:00
|
|
|
$error=0;
|
|
|
|
|
|
2011-06-12 17:47:10 +02:00
|
|
|
if (empty($donation_date))
|
|
|
|
|
{
|
|
|
|
|
$mesgs[]=$langs->trans("ErrorFieldRequired",$langs->trans("Date"));
|
2012-07-11 10:14:56 +02:00
|
|
|
$action = "create";
|
2011-06-12 17:47:10 +02:00
|
|
|
$error++;
|
|
|
|
|
}
|
2010-02-13 17:28:03 +01:00
|
|
|
|
2012-07-11 10:14:56 +02:00
|
|
|
if (empty($amount))
|
2010-02-13 17:28:03 +01:00
|
|
|
{
|
2011-06-12 17:47:10 +02:00
|
|
|
$mesgs[]=$langs->trans("ErrorFieldRequired",$langs->trans("Amount"));
|
2012-07-11 10:14:56 +02:00
|
|
|
$action = "create";
|
2011-06-12 17:47:10 +02:00
|
|
|
$error++;
|
2010-02-13 17:28:03 +01:00
|
|
|
}
|
2008-11-15 19:20:40 +01:00
|
|
|
|
2010-02-13 17:28:03 +01:00
|
|
|
if (! $error)
|
|
|
|
|
{
|
2013-02-23 15:46:12 +01:00
|
|
|
$don->firstname = $_POST["firstname"];
|
|
|
|
|
$don->lastname = $_POST["lastname"];
|
2008-11-15 19:20:40 +01:00
|
|
|
$don->societe = $_POST["societe"];
|
2013-02-15 19:26:09 +01:00
|
|
|
$don->address = $_POST["address"];
|
2011-01-04 01:09:09 +01:00
|
|
|
$don->amount = price2num($_POST["amount"]);
|
2013-02-22 16:33:48 +01:00
|
|
|
$don->town = $_POST["town"];
|
2011-06-12 17:47:10 +02:00
|
|
|
$don->zip = $_POST["zipcode"];
|
|
|
|
|
$don->town = $_POST["town"];
|
2013-02-25 17:56:41 +01:00
|
|
|
$don->country = $_POST["country"];
|
2008-11-15 19:20:40 +01:00
|
|
|
$don->email = $_POST["email"];
|
2010-02-13 17:28:03 +01:00
|
|
|
$don->date = $donation_date;
|
2013-04-09 17:18:07 +02:00
|
|
|
$don->note_private= GETPOST("note_private");
|
|
|
|
|
$don->note_public = GETPOST("note_public");
|
2008-11-15 19:20:40 +01:00
|
|
|
$don->public = $_POST["public"];
|
2010-03-11 15:31:16 +01:00
|
|
|
$don->fk_project = $_POST["projectid"];
|
2008-11-15 19:20:40 +01:00
|
|
|
$don->modepaiementid = $_POST["modepaiement"];
|
|
|
|
|
|
|
|
|
|
if ($don->create($user) > 0)
|
|
|
|
|
{
|
2012-08-31 05:58:38 +02:00
|
|
|
header("Location: index.php");
|
2008-11-15 19:20:40 +01:00
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-12-27 22:54:03 +01:00
|
|
|
}
|
2002-12-19 19:55:38 +01:00
|
|
|
|
2012-02-01 14:20:22 +01:00
|
|
|
if ($action == 'delete')
|
2002-12-19 19:55:38 +01:00
|
|
|
{
|
2012-07-11 10:14:56 +02:00
|
|
|
$don->delete($id);
|
2012-08-31 05:58:38 +02:00
|
|
|
header("Location: liste.php");
|
2008-11-15 19:20:40 +01:00
|
|
|
exit;
|
2002-12-19 19:55:38 +01:00
|
|
|
}
|
2012-02-01 14:20:22 +01:00
|
|
|
if ($action == 'commentaire')
|
2002-12-26 11:22:14 +01:00
|
|
|
{
|
2012-07-11 10:14:56 +02:00
|
|
|
$don->fetch($id);
|
2008-11-15 19:20:40 +01:00
|
|
|
$don->update_note($_POST["commentaire"]);
|
2002-12-26 11:22:14 +01:00
|
|
|
}
|
2012-02-01 14:20:22 +01:00
|
|
|
if ($action == 'valid_promesse')
|
2002-12-19 19:55:38 +01:00
|
|
|
{
|
2012-07-11 10:14:56 +02:00
|
|
|
if ($don->valid_promesse($id, $user->id) >= 0)
|
2008-11-15 19:20:40 +01:00
|
|
|
{
|
2012-08-31 05:58:38 +02:00
|
|
|
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
2008-11-15 19:20:40 +01:00
|
|
|
exit;
|
|
|
|
|
}
|
2011-06-12 17:47:10 +02:00
|
|
|
else $mesg=$don->error;
|
|
|
|
|
}
|
2012-02-01 14:20:22 +01:00
|
|
|
if ($action == 'set_cancel')
|
2011-06-12 17:47:10 +02:00
|
|
|
{
|
2012-07-11 10:14:56 +02:00
|
|
|
if ($don->set_cancel($id) >= 0)
|
2011-06-12 17:47:10 +02:00
|
|
|
{
|
2012-08-31 05:58:38 +02:00
|
|
|
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
2011-06-12 17:47:10 +02:00
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
else $mesg=$don->error;
|
2002-12-19 19:55:38 +01:00
|
|
|
}
|
2012-02-01 14:20:22 +01:00
|
|
|
if ($action == 'set_paid')
|
2002-12-19 19:55:38 +01:00
|
|
|
{
|
2012-07-11 10:14:56 +02:00
|
|
|
if ($don->set_paye($id, $modepaiement) >= 0)
|
2008-11-15 19:20:40 +01:00
|
|
|
{
|
2012-08-31 05:58:38 +02:00
|
|
|
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
2008-11-15 19:20:40 +01:00
|
|
|
exit;
|
|
|
|
|
}
|
2011-06-12 17:47:10 +02:00
|
|
|
else $mesg=$don->error;
|
2002-12-19 19:55:38 +01:00
|
|
|
}
|
2012-02-01 14:20:22 +01:00
|
|
|
if ($action == 'set_encaisse')
|
2002-12-19 19:55:38 +01:00
|
|
|
{
|
2012-07-11 10:14:56 +02:00
|
|
|
if ($don->set_encaisse($id) >= 0)
|
2008-11-15 19:20:40 +01:00
|
|
|
{
|
2012-08-31 05:58:38 +02:00
|
|
|
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
2008-11-15 19:20:40 +01:00
|
|
|
exit;
|
|
|
|
|
}
|
2011-06-12 17:47:10 +02:00
|
|
|
else $mesg=$don->error;
|
2002-12-19 19:55:38 +01:00
|
|
|
}
|
|
|
|
|
|
2005-11-11 21:11:57 +01:00
|
|
|
/*
|
2009-02-27 19:35:17 +01:00
|
|
|
* Build doc
|
2005-11-11 21:11:57 +01:00
|
|
|
*/
|
2012-02-01 14:20:22 +01:00
|
|
|
if ($action == 'builddoc')
|
2005-11-11 21:11:57 +01:00
|
|
|
{
|
2013-09-06 13:25:45 +02:00
|
|
|
$object = new Don($db);
|
|
|
|
|
$object->fetch($id);
|
2008-11-14 12:56:47 +01:00
|
|
|
|
2013-09-06 13:25:45 +02:00
|
|
|
// Save last template used to generate document
|
|
|
|
|
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
|
2008-11-14 12:56:47 +01:00
|
|
|
|
2010-02-27 14:37:13 +01:00
|
|
|
// Define output language
|
2008-11-14 12:56:47 +01:00
|
|
|
$outputlangs = $langs;
|
2010-02-27 14:37:13 +01:00
|
|
|
$newlang='';
|
|
|
|
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
|
2013-09-06 13:25:45 +02:00
|
|
|
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
|
2010-02-27 14:37:13 +01:00
|
|
|
if (! empty($newlang))
|
2008-11-14 12:56:47 +01:00
|
|
|
{
|
|
|
|
|
$outputlangs = new Translate("",$conf);
|
2010-02-27 14:37:13 +01:00
|
|
|
$outputlangs->setDefaultLang($newlang);
|
2008-11-14 12:56:47 +01:00
|
|
|
}
|
2013-09-06 13:25:45 +02:00
|
|
|
$result=don_create($db, $object->id, '', $object->modelpdf, $outputlangs);
|
2008-11-14 12:56:47 +01:00
|
|
|
if ($result <= 0)
|
|
|
|
|
{
|
2009-02-20 23:53:15 +01:00
|
|
|
dol_print_error($db,$result);
|
2008-11-14 12:56:47 +01:00
|
|
|
exit;
|
|
|
|
|
}
|
2005-11-11 21:11:57 +01:00
|
|
|
}
|
|
|
|
|
|
2002-12-19 19:55:38 +01:00
|
|
|
|
2008-11-14 12:56:47 +01:00
|
|
|
/*
|
|
|
|
|
* View
|
|
|
|
|
*/
|
2002-12-19 19:55:38 +01:00
|
|
|
|
2012-07-30 03:18:17 +02:00
|
|
|
llxHeader('',$langs->trans("Donations"),'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones');
|
2002-12-19 19:55:38 +01:00
|
|
|
|
2011-11-08 10:18:45 +01:00
|
|
|
$form=new Form($db);
|
2008-01-20 14:53:02 +01:00
|
|
|
$formfile = new FormFile($db);
|
2011-11-08 10:18:45 +01:00
|
|
|
$formcompany = new FormCompany($db);
|
2005-03-28 15:52:40 +02:00
|
|
|
|
2004-09-04 17:56:12 +02:00
|
|
|
|
2002-12-26 11:22:14 +01:00
|
|
|
/* ************************************************************************** */
|
|
|
|
|
/* */
|
2009-02-27 19:35:17 +01:00
|
|
|
/* Creation */
|
2002-12-26 11:22:14 +01:00
|
|
|
/* */
|
|
|
|
|
/* ************************************************************************** */
|
|
|
|
|
|
2012-02-01 14:20:22 +01:00
|
|
|
if ($action == 'create')
|
2005-11-11 21:11:57 +01:00
|
|
|
{
|
2009-01-15 02:14:03 +01:00
|
|
|
print_fiche_titre($langs->trans("AddDonation"));
|
2008-11-15 19:20:40 +01:00
|
|
|
|
2011-06-12 17:47:10 +02:00
|
|
|
dol_htmloutput_errors($mesg,$mesgs);
|
2009-03-09 22:59:29 +01:00
|
|
|
|
2008-11-15 19:20:40 +01:00
|
|
|
print '<form name="add" action="fiche.php" method="post">';
|
2009-05-17 10:01:54 +02:00
|
|
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
2008-11-15 19:20:40 +01:00
|
|
|
print '<table class="border" width="100%">';
|
|
|
|
|
|
|
|
|
|
print '<input type="hidden" name="action" value="add">';
|
|
|
|
|
|
2011-06-12 17:47:10 +02:00
|
|
|
$nbrows=11;
|
2012-09-15 10:01:35 +02:00
|
|
|
if (! empty($conf->projet->enabled)) $nbrows++;
|
2011-06-12 17:47:10 +02:00
|
|
|
|
|
|
|
|
// Date
|
2010-08-22 15:42:48 +02:00
|
|
|
print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
|
2011-11-08 10:18:45 +01:00
|
|
|
$form->select_date($donation_date?$donation_date:-1,'','','','',"add",1,1);
|
2008-11-15 19:20:40 +01:00
|
|
|
print '</td>';
|
|
|
|
|
|
2011-06-12 17:47:10 +02:00
|
|
|
print '<td rowspan="'.$nbrows.'" valign="top">'.$langs->trans("Comments").' :<br>';
|
2013-04-09 17:18:07 +02:00
|
|
|
print "<textarea name=\"note_private\" wrap=\"soft\" cols=\"40\" rows=\"15\">".GETPOST("note_private")."</textarea></td>";
|
2011-06-12 17:47:10 +02:00
|
|
|
print "</tr>";
|
2008-11-15 19:20:40 +01:00
|
|
|
|
2011-06-12 17:47:10 +02:00
|
|
|
// Amount
|
2011-11-23 14:55:36 +01:00
|
|
|
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>';
|
2008-11-15 19:20:40 +01:00
|
|
|
|
2010-02-08 15:57:39 +01:00
|
|
|
print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
|
2011-11-08 10:18:45 +01:00
|
|
|
print $form->selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1);
|
2008-11-15 19:20:40 +01:00
|
|
|
print "</td></tr>\n";
|
|
|
|
|
|
2009-11-30 02:12:54 +01:00
|
|
|
print "<tr>".'<td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" value="'.$_POST["societe"].'" size="40"></td></tr>';
|
2013-02-23 15:46:12 +01:00
|
|
|
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" value="'.$_POST["firstname"].'" size="40"></td></tr>';
|
|
|
|
|
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" value="'.$_POST["lastname"].'" size="40"></td></tr>';
|
2008-11-15 19:20:40 +01:00
|
|
|
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
|
2013-02-15 19:26:09 +01:00
|
|
|
print '<textarea name="address" wrap="soft" cols="40" rows="3">'.$_POST["address"].'</textarea></td></tr>';
|
2011-06-12 17:47:10 +02:00
|
|
|
|
|
|
|
|
// Zip / Town
|
|
|
|
|
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
|
2013-02-27 11:58:50 +01:00
|
|
|
print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$don->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
|
2011-06-12 17:47:10 +02:00
|
|
|
print ' ';
|
2013-02-27 11:58:50 +01:00
|
|
|
print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$don->town),'town',array('zipcode','selectcountry_id','state_id'));
|
2011-06-12 17:47:10 +02:00
|
|
|
print '</tr>';
|
|
|
|
|
|
2013-02-25 17:56:41 +01:00
|
|
|
print "<tr>".'<td>'.$langs->trans("Country").'</td><td><input type="text" name="country" value="'.$_POST["country"].'" size="40"></td></tr>';
|
2009-11-30 02:12:54 +01:00
|
|
|
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" value="'.$_POST["email"].'" size="40"></td></tr>';
|
2011-06-12 17:47:10 +02:00
|
|
|
|
|
|
|
|
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
|
2011-11-08 10:18:45 +01:00
|
|
|
$form->select_types_paiements('', 'modepaiement', 'CRDT', 0, 1);
|
2011-06-12 17:47:10 +02:00
|
|
|
print "</td></tr>\n";
|
|
|
|
|
|
2012-09-15 10:01:35 +02:00
|
|
|
if (! empty($conf->projet->enabled))
|
2011-06-12 17:47:10 +02:00
|
|
|
{
|
2013-06-14 22:33:01 +02:00
|
|
|
|
|
|
|
|
$formproject=new FormProjets($db);
|
|
|
|
|
|
2011-06-12 17:47:10 +02:00
|
|
|
// Si module projet actif
|
|
|
|
|
print "<tr><td>".$langs->trans("Project")."</td><td>";
|
2013-06-14 22:33:01 +02:00
|
|
|
$formproject->select_projects('',$_POST["projectid"],"projectid");
|
2011-06-12 17:47:10 +02:00
|
|
|
print "</td></tr>\n";
|
|
|
|
|
}
|
|
|
|
|
|
Add: hooks and triggers for a lot of core modules (action/calendrier, deplacement, dons, tva, contact/tiers, contrat, product lines, expedition, fournisseur commandes et factures, fiche intervention, projet et taches)
Signed-off-by: Stephen L. <lrq3000@gmail.com>
2012-08-14 15:50:45 +02:00
|
|
|
// Other attributes
|
|
|
|
|
$parameters=array('colspan' => ' colspan="1"');
|
|
|
|
|
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$don,$action); // Note that $action and $object may have been modified by hook
|
|
|
|
|
|
2008-11-15 19:20:40 +01:00
|
|
|
print "</table>\n";
|
2010-04-05 03:25:44 +02:00
|
|
|
print '<br><center><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
|
2008-11-15 19:20:40 +01:00
|
|
|
print "</form>\n";
|
|
|
|
|
}
|
2004-09-04 17:56:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ************************************************************ */
|
|
|
|
|
/* */
|
|
|
|
|
/* Fiche don en mode edition */
|
|
|
|
|
/* */
|
|
|
|
|
/* ************************************************************ */
|
|
|
|
|
|
2012-07-11 10:14:56 +02:00
|
|
|
if (! empty($id) && $action == 'edit')
|
2004-09-04 17:56:12 +02:00
|
|
|
{
|
2012-02-01 14:20:22 +01:00
|
|
|
$don->fetch($id);
|
2008-11-15 19:20:40 +01:00
|
|
|
|
|
|
|
|
$h=0;
|
2012-07-11 10:14:56 +02:00
|
|
|
$head[$h][0] = $_SERVER['PHP_SELF']."?id=".$don->id;
|
2010-04-05 03:25:44 +02:00
|
|
|
$head[$h][1] = $langs->trans("Card");
|
2008-11-15 19:20:40 +01:00
|
|
|
$hselected=$h;
|
|
|
|
|
$h++;
|
|
|
|
|
|
2010-04-05 03:25:44 +02:00
|
|
|
dol_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'generic');
|
2008-11-15 19:20:40 +01:00
|
|
|
|
|
|
|
|
print '<form name="update" action="fiche.php" method="post">';
|
2009-05-17 10:01:54 +02:00
|
|
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
2008-11-15 19:20:40 +01:00
|
|
|
print '<table class="border" width="100%">';
|
|
|
|
|
|
|
|
|
|
print '<input type="hidden" name="action" value="update">';
|
|
|
|
|
print '<input type="hidden" name="rowid" value="'.$don->id.'">';
|
|
|
|
|
|
|
|
|
|
// Ref
|
|
|
|
|
print "<tr>".'<td>'.$langs->trans("Ref").'</td><td colspan="2">';
|
|
|
|
|
print $don->getNomUrl();
|
|
|
|
|
print '</td>';
|
|
|
|
|
print '</tr>';
|
2008-11-15 19:13:25 +01:00
|
|
|
|
2011-06-12 17:47:10 +02:00
|
|
|
$nbrows=12;
|
2012-09-15 10:01:35 +02:00
|
|
|
if (! empty($conf->projet->enabled)) $nbrows++;
|
2011-06-12 17:47:10 +02:00
|
|
|
|
|
|
|
|
// Date
|
|
|
|
|
print "<tr>".'<td width="25%" class="fieldrequired">'.$langs->trans("Date").'</td><td>';
|
2011-11-08 10:18:45 +01:00
|
|
|
$form->select_date($don->date,'','','','',"update");
|
2008-11-15 19:20:40 +01:00
|
|
|
print '</td>';
|
2008-11-15 19:13:25 +01:00
|
|
|
|
2011-06-12 17:47:10 +02:00
|
|
|
print '<td rowspan="'.$nbrows.'" valign="top">'.$langs->trans("Comments").' :<br>';
|
2013-04-09 17:18:07 +02:00
|
|
|
print "<textarea name=\"note_private\" wrap=\"soft\" cols=\"40\" rows=\"15\">".$don->note_private."</textarea></td>";
|
2011-06-12 17:47:10 +02:00
|
|
|
print "</tr>";
|
2008-11-15 19:20:40 +01:00
|
|
|
|
2011-06-12 17:47:10 +02:00
|
|
|
// Amount
|
2011-11-23 14:55:36 +01:00
|
|
|
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>';
|
2008-11-15 19:20:40 +01:00
|
|
|
|
2010-02-08 15:57:39 +01:00
|
|
|
print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
|
2011-11-08 10:18:45 +01:00
|
|
|
print $form->selectyesno("public",1,1);
|
2008-11-15 19:20:40 +01:00
|
|
|
print "</td>";
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
|
|
|
|
|
$langs->load("companies");
|
|
|
|
|
print "<tr>".'<td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" size="40" value="'.$don->societe.'"></td></tr>';
|
2013-02-23 15:46:12 +01:00
|
|
|
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" size="40" value="'.$don->firstname.'"></td></tr>';
|
|
|
|
|
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" size="40" value="'.$don->lastname.'"></td></tr>';
|
2008-11-15 19:20:40 +01:00
|
|
|
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
|
2013-02-15 19:26:09 +01:00
|
|
|
print '<textarea name="address" wrap="soft" cols="40" rows="'.ROWS_3.'">'.$don->address.'</textarea></td></tr>';
|
2011-06-12 17:47:10 +02:00
|
|
|
|
|
|
|
|
// Zip / Town
|
|
|
|
|
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
|
2013-02-27 11:58:50 +01:00
|
|
|
print $formcompany->select_ziptown((isset($_POST["zipcode"])?$_POST["zipcode"]:$don->zip),'zipcode',array('town','selectcountry_id','state_id'),6);
|
2011-06-12 17:47:10 +02:00
|
|
|
print ' ';
|
2013-02-27 11:58:50 +01:00
|
|
|
print $formcompany->select_ziptown((isset($_POST["town"])?$_POST["town"]:$don->town),'town',array('zipcode','selectcountry_id','state_id'));
|
2011-06-12 17:47:10 +02:00
|
|
|
print '</tr>';
|
|
|
|
|
|
2013-02-25 17:56:41 +01:00
|
|
|
print "<tr>".'<td>'.$langs->trans("Country").'</td><td><input type="text" name="country" size="40" value="'.$don->country.'"></td></tr>';
|
2008-11-15 19:20:40 +01:00
|
|
|
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" size="40" value="'.$don->email.'"></td></tr>';
|
|
|
|
|
|
2011-06-12 17:47:10 +02:00
|
|
|
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
|
2012-12-29 00:46:25 +01:00
|
|
|
|
|
|
|
|
if ($don->modepaiementid) $selected = $don->modepaiementid;
|
|
|
|
|
else $selected = '';
|
|
|
|
|
|
|
|
|
|
$form->select_types_paiements($selected, 'modepaiement', 'CRDT', 0, 1);
|
2011-06-12 17:47:10 +02:00
|
|
|
print "</td></tr>\n";
|
2008-11-15 19:20:40 +01:00
|
|
|
|
|
|
|
|
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>';
|
|
|
|
|
|
2011-06-12 17:47:10 +02:00
|
|
|
// Project
|
2012-07-11 10:14:56 +02:00
|
|
|
if (! empty($conf->projet->enabled))
|
2011-06-12 17:47:10 +02:00
|
|
|
{
|
2013-06-14 22:33:01 +02:00
|
|
|
$formproject=new FormProjets($db);
|
|
|
|
|
|
2011-06-12 17:47:10 +02:00
|
|
|
$langs->load('projects');
|
|
|
|
|
print '<tr><td>'.$langs->trans('Project').'</td><td>';
|
2013-06-14 22:33:01 +02:00
|
|
|
$formproject->select_projects(-1, (isset($_POST["projectid"])?$_POST["projectid"]:$don->fk_project), 'projectid');
|
2011-06-12 17:47:10 +02:00
|
|
|
print '</td></tr>';
|
|
|
|
|
}
|
|
|
|
|
|
Add: hooks and triggers for a lot of core modules (action/calendrier, deplacement, dons, tva, contact/tiers, contrat, product lines, expedition, fournisseur commandes et factures, fiche intervention, projet et taches)
Signed-off-by: Stephen L. <lrq3000@gmail.com>
2012-08-14 15:50:45 +02:00
|
|
|
// Other attributes
|
|
|
|
|
$parameters=array('colspan' => ' colspan="1"');
|
|
|
|
|
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$don,$action); // Note that $action and $object may have been modified by hook
|
|
|
|
|
|
2008-11-15 19:20:40 +01:00
|
|
|
print "</table>\n";
|
2010-04-05 03:25:44 +02:00
|
|
|
|
|
|
|
|
print '<br><center><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'"> <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
|
|
|
|
|
|
2008-11-15 19:20:40 +01:00
|
|
|
print "</form>\n";
|
|
|
|
|
|
|
|
|
|
print "</div>\n";
|
2004-09-04 17:56:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ************************************************************ */
|
|
|
|
|
/* */
|
|
|
|
|
/* Fiche don en mode visu */
|
|
|
|
|
/* */
|
|
|
|
|
/* ************************************************************ */
|
2012-07-11 10:14:56 +02:00
|
|
|
if (! empty($id) && $action != 'edit')
|
2002-12-19 19:55:38 +01:00
|
|
|
{
|
2012-02-01 14:20:22 +01:00
|
|
|
$result=$don->fetch($id);
|
2008-11-15 19:20:40 +01:00
|
|
|
|
|
|
|
|
$h=0;
|
2012-07-11 10:14:56 +02:00
|
|
|
$head[$h][0] = $_SERVER['PHP_SELF']."?id=".$don->id;
|
2009-11-30 02:12:54 +01:00
|
|
|
$head[$h][1] = $langs->trans("Card");
|
2008-11-15 19:20:40 +01:00
|
|
|
$hselected=$h;
|
|
|
|
|
$h++;
|
|
|
|
|
|
2010-04-05 03:25:44 +02:00
|
|
|
dol_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'generic');
|
2008-11-15 19:20:40 +01:00
|
|
|
|
|
|
|
|
print "<form action=\"fiche.php\" method=\"post\">";
|
2009-05-17 10:01:54 +02:00
|
|
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
2008-11-15 19:20:40 +01:00
|
|
|
print '<table class="border" width="100%">';
|
|
|
|
|
|
2012-07-28 21:22:59 +02:00
|
|
|
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/dons/liste.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
|
|
|
|
|
2011-06-12 17:47:10 +02:00
|
|
|
$nbrows=12;
|
2012-09-15 10:01:35 +02:00
|
|
|
if (! empty($conf->projet->enabled)) $nbrows++;
|
2011-06-12 17:47:10 +02:00
|
|
|
|
2008-11-15 19:20:40 +01:00
|
|
|
// Ref
|
|
|
|
|
print "<tr>".'<td>'.$langs->trans("Ref").'</td><td colspan="2">';
|
2012-07-28 21:22:59 +02:00
|
|
|
print $form->showrefnav($don, 'rowid', $linkback, 1, 'rowid', 'ref', '');
|
2008-11-15 19:20:40 +01:00
|
|
|
print '</td>';
|
2008-11-15 19:13:25 +01:00
|
|
|
print '</tr>';
|
2009-01-15 02:14:03 +01:00
|
|
|
|
2008-11-15 19:13:25 +01:00
|
|
|
// Date
|
2011-06-12 17:47:10 +02:00
|
|
|
print '<tr><td width="25%">'.$langs->trans("Date").'</td><td>';
|
2009-02-20 23:53:15 +01:00
|
|
|
print dol_print_date($don->date,"day");
|
2008-11-15 19:20:40 +01:00
|
|
|
print "</td>";
|
|
|
|
|
|
2011-06-12 17:47:10 +02:00
|
|
|
print '<td rowspan="'.$nbrows.'" valign="top" width="50%">'.$langs->trans("Comments").' :<br>';
|
2013-04-09 17:18:07 +02:00
|
|
|
print nl2br($don->note_private).'</td></tr>';
|
2008-11-15 19:20:40 +01:00
|
|
|
|
2013-06-17 11:58:55 +02:00
|
|
|
print "<tr>".'<td>'.$langs->trans("Amount").'</td><td>'.price($don->amount,0,$langs,0,0,-1,$conf->currency).'</td></tr>';
|
2008-11-15 19:20:40 +01:00
|
|
|
|
|
|
|
|
print "<tr><td>".$langs->trans("PublicDonation")."</td><td>";
|
2009-11-30 02:12:54 +01:00
|
|
|
print yn($don->public);
|
2008-11-15 19:20:40 +01:00
|
|
|
print "</td></tr>\n";
|
|
|
|
|
|
|
|
|
|
print "<tr>".'<td>'.$langs->trans("Company").'</td><td>'.$don->societe.'</td></tr>';
|
2013-02-23 15:46:12 +01:00
|
|
|
print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td>'.$don->firstname.'</td></tr>';
|
|
|
|
|
print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td>'.$don->lastname.'</td></tr>';
|
2013-02-15 19:26:09 +01:00
|
|
|
print "<tr>".'<td>'.$langs->trans("Address").'</td><td>'.dol_nl2br($don->address).'</td></tr>';
|
2011-06-12 17:47:10 +02:00
|
|
|
|
|
|
|
|
// Zip / Town
|
2013-02-24 17:08:52 +01:00
|
|
|
print "<tr>".'<td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>'.$don->zip.($don->zip && $don->town?' / ':'').$don->town.'</td></tr>';
|
2011-06-12 17:47:10 +02:00
|
|
|
|
|
|
|
|
// Country
|
2013-02-25 17:56:41 +01:00
|
|
|
print "<tr>".'<td>'.$langs->trans("Country").'</td><td>'.$don->country.'</td></tr>';
|
2011-06-12 17:47:10 +02:00
|
|
|
|
|
|
|
|
// EMail
|
|
|
|
|
print "<tr>".'<td>'.$langs->trans("EMail").'</td><td>'.dol_print_email($don->email).'</td></tr>';
|
|
|
|
|
|
|
|
|
|
// Payment mode
|
2008-11-15 19:20:40 +01:00
|
|
|
print "<tr><td>".$langs->trans("PaymentMode")."</td><td>";
|
2012-12-29 00:46:25 +01:00
|
|
|
print $form->form_modes_reglement(null, $don->modepaiementid,'none');
|
2008-11-15 19:20:40 +01:00
|
|
|
print "</td></tr>\n";
|
|
|
|
|
|
|
|
|
|
print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$don->getLibStatut(4).'</td></tr>';
|
|
|
|
|
|
2011-06-12 17:47:10 +02:00
|
|
|
// Project
|
2012-09-15 10:01:35 +02:00
|
|
|
if (! empty($conf->projet->enabled))
|
2011-06-12 17:47:10 +02:00
|
|
|
{
|
|
|
|
|
print "<tr>".'<td>'.$langs->trans("Project").'</td><td>'.$don->projet.'</td></tr>';
|
|
|
|
|
}
|
|
|
|
|
|
Add: hooks and triggers for a lot of core modules (action/calendrier, deplacement, dons, tva, contact/tiers, contrat, product lines, expedition, fournisseur commandes et factures, fiche intervention, projet et taches)
Signed-off-by: Stephen L. <lrq3000@gmail.com>
2012-08-14 15:50:45 +02:00
|
|
|
// Other attributes
|
|
|
|
|
$parameters=array('colspan' => ' colspan="1"');
|
|
|
|
|
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$don,$action); // Note that $action and $object may have been modified by hook
|
|
|
|
|
|
2008-11-15 19:20:40 +01:00
|
|
|
print "</table>\n";
|
|
|
|
|
print "</form>\n";
|
|
|
|
|
|
|
|
|
|
print "</div>";
|
|
|
|
|
|
2011-03-08 12:13:14 +01:00
|
|
|
// TODO Gerer action emettre paiement
|
2008-11-15 19:20:40 +01:00
|
|
|
$resteapayer = 0;
|
2009-01-15 02:14:03 +01:00
|
|
|
|
|
|
|
|
|
2008-11-15 19:20:40 +01:00
|
|
|
/**
|
|
|
|
|
* Barre d'actions
|
|
|
|
|
*/
|
|
|
|
|
print '<div class="tabsAction">';
|
2004-09-04 17:56:12 +02:00
|
|
|
|
2013-04-03 18:37:54 +02:00
|
|
|
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?action=edit&rowid='.$don->id.'">'.$langs->trans('Modify').'</a></div>';
|
2004-11-16 21:11:30 +01:00
|
|
|
|
2008-11-15 19:20:40 +01:00
|
|
|
if ($don->statut == 0)
|
|
|
|
|
{
|
2013-04-03 18:37:54 +02:00
|
|
|
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$don->id.'&action=valid_promesse">'.$langs->trans("ValidPromess").'</a></div>';
|
2008-11-15 19:20:40 +01:00
|
|
|
}
|
2002-12-21 18:34:05 +01:00
|
|
|
|
2011-06-12 17:47:10 +02:00
|
|
|
if (($don->statut == 0 || $don->statut == 1) && $resteapayer == 0 && $don->paye == 0)
|
|
|
|
|
{
|
2013-04-03 18:37:54 +02:00
|
|
|
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$don->id.'&action=set_cancel">'.$langs->trans("ClassifyCanceled")."</a></div>";
|
2011-06-12 17:47:10 +02:00
|
|
|
}
|
|
|
|
|
|
2011-03-08 12:13:14 +01:00
|
|
|
// TODO Gerer action emettre paiement
|
2008-11-15 19:20:40 +01:00
|
|
|
if ($don->statut == 1 && $resteapayer > 0)
|
|
|
|
|
{
|
2013-04-03 18:37:54 +02:00
|
|
|
print '<div class="inline-block divButAction"><a class="butAction" href="paiement.php?rowid='.$don->id.'&action=create">'.$langs->trans("DoPayment")."</a></div>";
|
2008-11-15 19:20:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($don->statut == 1 && $resteapayer == 0 && $don->paye == 0)
|
|
|
|
|
{
|
2013-04-03 18:37:54 +02:00
|
|
|
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?rowid='.$don->id.'&action=set_paid">'.$langs->trans("ClassifyPaid")."</a></div>";
|
2008-11-15 19:20:40 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ($user->rights->don->supprimer)
|
|
|
|
|
{
|
2013-04-03 18:37:54 +02:00
|
|
|
print '<div class="inline-block divButAction"><a class="butActionDelete" href="fiche.php?rowid='.$don->id.'&action=delete">'.$langs->trans("Delete")."</a></div>";
|
2008-11-15 19:20:40 +01:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2013-04-03 18:37:54 +02:00
|
|
|
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#">'.$langs->trans("Delete")."</a></div>";
|
2008-11-15 19:20:40 +01:00
|
|
|
}
|
2002-12-19 19:55:38 +01:00
|
|
|
|
2008-11-15 19:20:40 +01:00
|
|
|
print "</div>";
|
2005-11-11 23:36:56 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
print '<table width="100%"><tr><td width="50%" valign="top">';
|
|
|
|
|
|
|
|
|
|
/*
|
2009-11-30 02:12:54 +01:00
|
|
|
* Documents generes
|
2005-11-11 23:36:56 +01:00
|
|
|
*/
|
2009-04-29 20:02:50 +02:00
|
|
|
$filename=dol_sanitizeFileName($don->id);
|
2006-09-02 22:53:20 +02:00
|
|
|
$filedir=$conf->don->dir_output . '/' . get_exdir($filename,2);
|
2005-11-11 23:36:56 +01:00
|
|
|
$urlsource=$_SERVER['PHP_SELF'].'?rowid='.$don->id;
|
2008-11-15 19:20:40 +01:00
|
|
|
// $genallowed=($fac->statut == 1 && ($fac->paye == 0 || $user->admin) && $user->rights->facture->creer);
|
|
|
|
|
// $delallowed=$user->rights->facture->supprimer;
|
2008-11-14 12:56:47 +01:00
|
|
|
$genallowed=1;
|
2005-11-11 23:36:56 +01:00
|
|
|
$delallowed=0;
|
|
|
|
|
|
|
|
|
|
$var=true;
|
|
|
|
|
|
|
|
|
|
print '<br>';
|
2008-11-14 12:56:47 +01:00
|
|
|
$formfile->show_documents('donation',$filename,$filedir,$urlsource,$genallowed,$delallowed);
|
2005-11-11 23:36:56 +01:00
|
|
|
|
2008-11-15 19:20:40 +01:00
|
|
|
print '</td><td> </td>';
|
2005-11-11 23:36:56 +01:00
|
|
|
|
2008-11-15 19:20:40 +01:00
|
|
|
print '</tr></table>';
|
2002-12-26 11:22:14 +01:00
|
|
|
|
2002-12-19 19:55:38 +01:00
|
|
|
}
|
|
|
|
|
|
2004-09-04 17:56:12 +02:00
|
|
|
|
2011-08-27 16:24:16 +02:00
|
|
|
llxFooter();
|
2012-07-11 10:14:56 +02:00
|
|
|
$db->close();
|
2002-12-19 19:55:38 +01:00
|
|
|
?>
|