From 163408e2497c1f0ed046c7441bdbd66173422712 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 25 Jan 2008 23:04:01 +0000 Subject: [PATCH] =?UTF-8?q?New:=20Ajout=20onglet=20info=20sur=20adh=E9sion?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/adherents/cotisation.class.php | 39 +++++++++-- htdocs/adherents/fiche_subscription.php | 29 +++++--- htdocs/adherents/info_subscription.php | 89 +++++++++++++++++++++++++ 3 files changed, 142 insertions(+), 15 deletions(-) create mode 100644 htdocs/adherents/info_subscription.php diff --git a/htdocs/adherents/cotisation.class.php b/htdocs/adherents/cotisation.class.php index d814ca804b2..691e72f7fda 100644 --- a/htdocs/adherents/cotisation.class.php +++ b/htdocs/adherents/cotisation.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2006-2007 Laurent Destailleur + * Copyright (C) 2006-2008 Laurent Destailleur * * 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 @@ -15,15 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** \file htdocs/adherents/cotisation.class.php \ingroup adherent \brief Fichier de la classe permettant de gèrer les cotisations - \version $Revision$ + \version $Id$ */ @@ -265,5 +263,38 @@ class Cotisation extends CommonObject $result.=$lien.$this->ref.$lienfin; return $result; } + + + /** + * \brief Charge les informations d'ordre info dans l'objet cotisation + * \param id Id adhesion a charger + */ + function info($id) + { + $sql = 'SELECT c.rowid, '.$this->db->pdate('c.datec').' as datec,'; + $sql.= ' '.$this->db->pdate('c.tms').' as datem'; + $sql.= ' FROM '.MAIN_DB_PREFIX.'cotisation as c'; + $sql.= ' WHERE c.rowid = '.$id; + + $result=$this->db->query($sql); + if ($result) + { + if ($this->db->num_rows($result)) + { + $obj = $this->db->fetch_object($result); + $this->id = $obj->rowid; + + $this->date_creation = $obj->datec; + $this->date_modification = $obj->datem; + } + + $this->db->free($result); + + } + else + { + dolibarr_print_error($this->db); + } + } } ?> diff --git a/htdocs/adherents/fiche_subscription.php b/htdocs/adherents/fiche_subscription.php index 13b5f0f1adc..d612ff84f5a 100644 --- a/htdocs/adherents/fiche_subscription.php +++ b/htdocs/adherents/fiche_subscription.php @@ -14,15 +14,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ */ /** \file htdocs/adherents/fiche_subscription.php \ingroup adherent \brief Page d'ajout, edition, suppression d'une fiche adhésion - \version $Revision$ + \version $Id$ */ require("./pre.inc.php"); @@ -152,6 +150,9 @@ if ($user->rights->adherent->cotisation->creer && $_POST["action"] == 'confirm_d llxHeader(); +$form = new Form($db); + + if ($errmsg) { @@ -181,6 +182,11 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') $head[$h][2] = 'general'; $h++; + $head[$h][0] = DOL_URL_ROOT.'/adherents/info_subscription.php?rowid='.$subscription->id; + $head[$h][1] = $langs->trans("Info"); + $head[$h][2] = 'info'; + $h++; + dolibarr_fiche_head($head, 'general', $langs->trans("Subscription")); print "\n"; @@ -190,20 +196,18 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') print "fk_bank."\">"; print ''; - $htmls = new Form($db); - // Ref print ''; // Date start subscription print ''; print ''; // Date end subscription print ''; print ''; @@ -236,8 +240,6 @@ if ($rowid && $action != 'edit') $result=$subscription->fetch($rowid); $result=$adh->fetch($subscription->fk_adherent); - $html = new Form($db); - /* * Affichage onglets */ @@ -249,6 +251,11 @@ if ($rowid && $action != 'edit') $head[$h][2] = 'general'; $h++; + $head[$h][0] = DOL_URL_ROOT.'/adherents/info_subscription.php?rowid='.$subscription->id; + $head[$h][1] = $langs->trans("Info"); + $head[$h][2] = 'info'; + $h++; + dolibarr_fiche_head($head, 'general', $langs->trans("Subscription")); if ($msg) print '
'.$msg.'
'; @@ -260,7 +267,7 @@ if ($rowid && $action != 'edit') //$formquestion['text']=''.$langs->trans("ThisWillAlsoDeleteBankRecord").''; $text=$langs->trans("ConfirmDeleteSubscription"); if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) $text.='
'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord"); - $html->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$subscription->id,$langs->trans("DeleteSubscription"),$text,"confirm_delete",$formquestion); + $form->form_confirm($_SERVER["PHP_SELF"]."?rowid=".$subscription->id,$langs->trans("DeleteSubscription"),$text,"confirm_delete",$formquestion); print '
'; } @@ -270,7 +277,7 @@ if ($rowid && $action != 'edit') // Ref print ''; print ''; // Member diff --git a/htdocs/adherents/info_subscription.php b/htdocs/adherents/info_subscription.php new file mode 100644 index 00000000000..cdf8613c742 --- /dev/null +++ b/htdocs/adherents/info_subscription.php @@ -0,0 +1,89 @@ + + * Copyright (C) 2005-2006 Regis Houssin + * + * 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 + * the Free Software Foundation; either version 2 of the License, or + * (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 + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/** + \file htdocs/adherents/info.php + \ingroup member + \brief Page des informations d'un adherent + \version $Id$ +*/ + +require("./pre.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/member.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/adherents/cotisation.class.php"); + +$langs->load("companies"); +$langs->load("bills"); +$langs->load("members"); +$langs->load("users"); + +$user->getrights('adherent'); +if (!$user->rights->adherent->lire) + accessforbidden(); + +$rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"]; + + + +/* + * Visualisation de la fiche + * + */ + +llxHeader(); + +$form = new Form($db); + +$subscription = new Cotisation($db); +$result=$subscription->fetch($rowid); + +$h = 0; +$head = array(); + +$head[$h][0] = DOL_URL_ROOT.'/adherents/fiche_subscription.php?rowid='.$subscription->id; +$head[$h][1] = $langs->trans("SubscriptionCard"); +$head[$h][2] = 'general'; +$h++; + +$head[$h][0] = DOL_URL_ROOT.'/adherents/info_subscription.php?rowid='.$subscription->id; +$head[$h][1] = $langs->trans("Info"); +$head[$h][2] = 'info'; +$h++; + + +dolibarr_fiche_head($head, 'info', $langs->trans("Subscription")); + +$subscription->info($rowid); + +print '
'.$langs->trans("Ref").''.$subscription->ref.' 
'.$langs->trans("DateSubscription").''; - $htmls->select_date($subscription->dateh,'datesub',1,1,0,'update',1); + $form->select_date($subscription->dateh,'datesub',1,1,0,'update',1); print '
'.$langs->trans("DateEndSubscription").''; - $htmls->select_date($subscription->datef,'datesubend',0,0,0,'update',1); + $form->select_date($subscription->datef,'datesubend',0,0,0,'update',1); print '
'.$langs->trans("Ref").''; - print $html->showrefnav($subscription,'rowid','',1); + print $form->showrefnav($subscription,'rowid','',1); print '
'; +dolibarr_print_object_info($subscription); +print '
'; + +print ''; + +// Juste pour éviter bug IE qui réorganise mal div précédents si celui-ci absent +print '
'; +print '
'; + + +$db->close(); + +llxFooter('$Date$ - $Revision$'); +?>