New: Ajout onglet info sur adhsions
This commit is contained in:
parent
f0c127cfa8
commit
163408e249
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2007 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@ -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 "<input type=\"hidden\" name=\"fk_bank\" value=\"".$subscription->fk_bank."\">";
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
$htmls = new Form($db);
|
||||
|
||||
// Ref
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td class="valeur" colspan="2">'.$subscription->ref.' </td></tr>';
|
||||
|
||||
// Date start subscription
|
||||
print '<tr><td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="2">';
|
||||
$htmls->select_date($subscription->dateh,'datesub',1,1,0,'update',1);
|
||||
$form->select_date($subscription->dateh,'datesub',1,1,0,'update',1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date end subscription
|
||||
print '<tr><td>'.$langs->trans("DateEndSubscription").'</td><td class="valeur" colspan="2">';
|
||||
$htmls->select_date($subscription->datef,'datesubend',0,0,0,'update',1);
|
||||
$form->select_date($subscription->datef,'datesubend',0,0,0,'update',1);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -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 '<div class="error">'.$msg.'</div>';
|
||||
@ -260,7 +267,7 @@ if ($rowid && $action != 'edit')
|
||||
//$formquestion['text']='<b>'.$langs->trans("ThisWillAlsoDeleteBankRecord").'</b>';
|
||||
$text=$langs->trans("ConfirmDeleteSubscription");
|
||||
if ($conf->banque->enabled && $conf->global->ADHERENT_BANK_USE) $text.='<br>'.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 '<br>';
|
||||
}
|
||||
|
||||
@ -270,7 +277,7 @@ if ($rowid && $action != 'edit')
|
||||
// Ref
|
||||
print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
|
||||
print '<td class="valeur" colspan="3">';
|
||||
print $html->showrefnav($subscription,'rowid','',1);
|
||||
print $form->showrefnav($subscription,'rowid','',1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Member
|
||||
|
||||
89
htdocs/adherents/info_subscription.php
Normal file
89
htdocs/adherents/info_subscription.php
Normal file
@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2006 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* 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 '<table width="100%"><tr><td>';
|
||||
dolibarr_print_object_info($subscription);
|
||||
print '</td></tr></table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
// Juste pour éviter bug IE qui réorganise mal div précédents si celui-ci absent
|
||||
print '<div class="tabsAction">';
|
||||
print '</div>';
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter('$Date$ - $Revision$');
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user