From 69e92adef02226b3458e9fe9d88b71e10a3f11c7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Feb 2007 23:06:18 +0000 Subject: [PATCH] =?UTF-8?q?New:=20Le=20type=20d'adh=E9rent=20est=20clicabl?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/adherents/adherent_type.class.php | 24 +++++++++++++++ htdocs/adherents/card_subscriptions.php | 38 +++++++++--------------- htdocs/adherents/fiche.php | 2 +- 3 files changed, 39 insertions(+), 25 deletions(-) diff --git a/htdocs/adherents/adherent_type.class.php b/htdocs/adherents/adherent_type.class.php index 69714b997df..d63051f873a 100644 --- a/htdocs/adherents/adherent_type.class.php +++ b/htdocs/adherents/adherent_type.class.php @@ -226,5 +226,29 @@ class AdherentType } + + /** + * \brief Renvoie nom clicable (avec eventuellement le picto) + * \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul + * \return string Chaine avec URL + */ + function getNomUrl($withpicto=0) + { + global $langs; + + $result=''; + + $lien = ''; + $lienfin=''; + + $picto='group'; + $label=$langs->trans("ShowType"); + + if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin); + if ($withpicto && $withpicto != 2) $result.=' '; + $result.=$lien.$this->libelle.$lienfin; + return $result; + } + } ?> diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index f6a4403d2fd..3a35960dd86 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -47,6 +47,7 @@ $user->getrights('adherent'); $adh = new Adherent($db); $adho = new AdherentOptions($db); +$adht = new AdherentType($db); $errmsg=''; $action=isset($_GET["action"])?$_GET["action"]:$_POST["action"]; @@ -64,9 +65,8 @@ if ($_POST["action"] == 'cotisation' && ! $_POST["cancel"]) $langs->load("banks"); $adh->id = $rowid; - $adh->fetch($rowid); + $result=$adh->fetch($rowid); - $adht = new AdherentType($db); $adht->fetch($adh->typeid); $reday=$_POST["reday"]; @@ -140,12 +140,14 @@ if ($_POST["action"] == 'cotisation' && ! $_POST["cancel"]) -/* - * - */ +/* ************************************************************************** */ +/* */ +/* Mode affichage */ +/* */ +/* ************************************************************************** */ llxHeader(); - +$html = new Form($db); if ($errmsg) { @@ -153,26 +155,14 @@ if ($errmsg) print "\n"; } -// fetch optionals attributes and labels -$adho->fetch_optionals(); - - - -/* ************************************************************************** */ -/* */ -/* Mode affichage */ -/* */ -/* ************************************************************************** */ - -$adh = new Adherent($db); $adh->id = $rowid; -$adh->fetch($rowid); -$adh->fetch_optionals($rowid); +$result=$adh->fetch($rowid); +$result=$adh->fetch_optionals($rowid); -$adht = new AdherentType($db); $adht->fetch($adh->typeid); -$html = new Form($db); +// fetch optionals attributes and labels +$adho->fetch_optionals(); /* @@ -211,7 +201,7 @@ print ''; print ''.$langs->trans("Login").''.$adh->login.' '; // Type -print ''.$langs->trans("Type").''.$adh->type."\n"; +print ''.$langs->trans("Type").''.$adht->getNomUrl(1)."\n"; // Status print ''.$langs->trans("Status").''.$adh->getLibStatut(4).''; @@ -420,7 +410,7 @@ if ($action == 'addsubscription' && $user->rights->adherent->cotisation->creer) { $s1='global->ADHERENT_MAIL_COTIS?' checked="true"':'').'>'; $s2=$langs->trans("MailFrom").': '.$conf->global->ADHERENT_MAIL_FROM.'
'; - $s2.=$langs->trans("MailTo").': '.$adh->email.''; + $s2.=$langs->trans("MailRecipient").': '.$adh->email.''; //$s2.='
'.$langs->trans("Content").': '.nl2br($conf->global->ADHERENT_MAIL_COTIS); print $html->textwithhelp($s1,$s2,1); } diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 97348d59d8f..7e855650360 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -949,7 +949,7 @@ if ($rowid && $action != 'edit') print ''.$langs->trans("Password").''.eregi_replace('.','*',$adh->pass).''; // Type - print ''.$langs->trans("Type").''.$adh->type."\n"; + print ''.$langs->trans("Type").''.$adht->getNomUrl(1)."\n"; // Morphy print ''.$langs->trans("Person").''.$adh->getmorphylib().'';