Implmentation permission adhrents

This commit is contained in:
Laurent Destailleur 2007-05-26 02:18:06 +00:00
parent be2943aba5
commit 23f09b5554
4 changed files with 62 additions and 40 deletions

View File

@ -220,11 +220,13 @@ print "</div>\n";
print '<div class="tabsAction">';
// Lien nouvelle cotisation si non brouillon et non résilié
if ($action != 'addsubscription' && $adh->statut > 0)
if ($user->rights->adherent->cotisation->creer)
{
print "<a class=\"butAction\" href=\"card_subscriptions.php?rowid=$rowid&action=addsubscription\">".$langs->trans("NewSubscription")."</a>";
if ($action != 'addsubscription' && $adh->statut > 0)
{
print "<a class=\"butAction\" href=\"card_subscriptions.php?rowid=$rowid&action=addsubscription\">".$langs->trans("NewSubscription")."</a>";
}
}
print '</div>';
print "<br>\n";

View File

@ -978,39 +978,56 @@ if ($rowid && $action != 'edit')
*/
print '<div class="tabsAction">';
print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=edit\">".$langs->trans("Edit")."</a>";
// Valider
if ($adh->statut == -1)
{
print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=valid\">".$langs->trans("Validate")."</a>\n";
}
// Réactiver
if ($adh->statut == 0)
{
print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=valid\">".$langs->trans("Reenable")."</a>\n";
}
// Envoi fiche par mail
if ($adh->statut >= 1 && $adh->email)
if ($user->rights->adherent->creer)
{
print "<a class=\"butAction\" href=\"fiche.php?rowid=$adh->id&action=sendinfo\">".$langs->trans("SendCardByMail")."</a>\n";
print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=edit\">".$langs->trans("Edit")."</a>";
}
// Résilier
if ($adh->statut == 1)
{
print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=resign\">".$langs->trans("Resiliate")."</a>\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 "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=valid\">".$langs->trans("Validate")."</a>\n";
}
}
if ($user->rights->adherent->creer)
{
// Réactiver
if ($adh->statut == 0)
{
print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=valid\">".$langs->trans("Reenable")."</a>\n";
}
}
if ($user->rights->adherent->creer)
{
// Envoi fiche par mail
if ($adh->statut >= 1 && $adh->email)
{
print '<a class="tabAction" href="fiche.php?rowid='.$adh->id.'&amp;action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a>';
print "<a class=\"butAction\" href=\"fiche.php?rowid=$adh->id&action=sendinfo\">".$langs->trans("SendCardByMail")."</a>\n";
}
}
if ($user->rights->adherent->supprimer)
{
// Résilier
if ($adh->statut == 1)
{
print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=resign\">".$langs->trans("Resiliate")."</a>\n";
}
}
// Barre d'actions
if ($user->rights->user->user->creer)
{
if (! $user->societe_id)
{
if (! $adh->user_id)
{
print '<a class="tabAction" href="fiche.php?rowid='.$adh->id.'&amp;action=create_user">'.$langs->trans("CreateDolibarrLogin").'</a>';
}
}
}

View File

@ -819,12 +819,12 @@ class Form
if ($conf->global->PRODUIT_USE_SEARCH_TO_SELECT)
{
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding" width="30" nowrap="nowrap">';
print '<td class="nobordernopadding" width="80" nowrap="nowrap">';
print $langs->trans("RefOrLabel").':</td>';
print '<td class="nobordernopadding" align="left" width="16">';
print ajax_updater_indicator($htmlname,'working');
print '</td>';
print '<td><input type="text" size="16" name="keysearch'.$htmlname.'" id="keysearch'.$htmlname.'">';
print '<td align="left"><input type="text" size="16" name="keysearch'.$htmlname.'" id="keysearch'.$htmlname.'"> ';
print '</td>';
print '</tr>';
print '<tr class="nocellnopadd">';

View File

@ -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';