From 23f09b55549e8bae60be4078ddf9784a424ab680 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 26 May 2007 02:18:06 +0000 Subject: [PATCH] =?UTF-8?q?Impl=E9mentation=20permission=20adh=E9rents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/adherents/card_subscriptions.php | 8 ++- htdocs/adherents/fiche.php | 75 +++++++++++++++---------- htdocs/html.form.class.php | 4 +- htdocs/lib/member.lib.php | 15 +++-- 4 files changed, 62 insertions(+), 40 deletions(-) diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index e47e647ef74..398ed1e0cc8 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -220,11 +220,13 @@ print "\n"; print '
'; // Lien nouvelle cotisation si non brouillon et non résilié -if ($action != 'addsubscription' && $adh->statut > 0) +if ($user->rights->adherent->cotisation->creer) { - print "".$langs->trans("NewSubscription").""; + if ($action != 'addsubscription' && $adh->statut > 0) + { + print "".$langs->trans("NewSubscription").""; + } } - print '
'; print "
\n"; diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 398621d58b2..83d13baeb44 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -978,39 +978,56 @@ if ($rowid && $action != 'edit') */ print '
'; - - print "".$langs->trans("Edit").""; - - // Valider - if ($adh->statut == -1) - { - print "".$langs->trans("Validate")."\n"; - } - - // Réactiver - if ($adh->statut == 0) - { - print "".$langs->trans("Reenable")."\n"; - } - - // Envoi fiche par mail - if ($adh->statut >= 1 && $adh->email) + if ($user->rights->adherent->creer) { - print "id&action=sendinfo\">".$langs->trans("SendCardByMail")."\n"; + print "".$langs->trans("Edit").""; } - - // Résilier - if ($adh->statut == 1) - { - print "".$langs->trans("Resiliate")."\n"; - } - - // Barre d'actions - if (! $user->societe_id) + + if ($user->rights->adherent->creer) { - if (! $adh->user_id && $user->rights->user->user->creer) + // Valider + if ($adh->statut == -1) + { + print "".$langs->trans("Validate")."\n"; + } + } + + if ($user->rights->adherent->creer) + { + // Réactiver + if ($adh->statut == 0) + { + print "".$langs->trans("Reenable")."\n"; + } + } + + if ($user->rights->adherent->creer) + { + // Envoi fiche par mail + if ($adh->statut >= 1 && $adh->email) { - print ''.$langs->trans("CreateDolibarrLogin").''; + print "id&action=sendinfo\">".$langs->trans("SendCardByMail")."\n"; + } + } + + if ($user->rights->adherent->supprimer) + { + // Résilier + if ($adh->statut == 1) + { + print "".$langs->trans("Resiliate")."\n"; + } + } + + // Barre d'actions + if ($user->rights->user->user->creer) + { + if (! $user->societe_id) + { + if (! $adh->user_id) + { + print ''.$langs->trans("CreateDolibarrLogin").''; + } } } diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index 7ebc82c93a4..dc61803ed1d 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -819,12 +819,12 @@ class Form if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT) { print ''; - print ''; print ''; - print ''; print ''; print ''; diff --git a/htdocs/lib/member.lib.php b/htdocs/lib/member.lib.php index d9509197494..9e84b7c5440 100644 --- a/htdocs/lib/member.lib.php +++ b/htdocs/lib/member.lib.php @@ -30,7 +30,7 @@ function member_prepare_head($member) { - global $langs, $conf; + global $langs, $conf, $user; $h = 0; $head = array(); @@ -50,16 +50,19 @@ function member_prepare_head($member) $h++; } + if ($user->rights->adherent->cotisation->lire) + { + $head[$h][0] = DOL_URL_ROOT.'/adherents/card_subscriptions.php?rowid='.$member->id; + $head[$h][1] = $langs->trans("Subscriptions"); + $head[$h][2] = 'subscription'; + $h++; + } + $head[$h][0] = DOL_URL_ROOT.'/adherents/note.php?id='.$member->id; $head[$h][1] = $langs->trans("Note"); $head[$h][2] = 'note'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/adherents/card_subscriptions.php?rowid='.$member->id; - $head[$h][1] = $langs->trans("Subscriptions"); - $head[$h][2] = 'subscription'; - $h++; - $head[$h][0] = DOL_URL_ROOT.'/adherents/info.php?id='.$member->id; $head[$h][1] = $langs->trans("Info"); $head[$h][2] = 'info';
'; + print ''; print $langs->trans("RefOrLabel").':'; print ajax_updater_indicator($htmlname,'working'); print ''; + print ' '; print '