From 3cfa76a1209e2b0bd7e1518610d7369d83b4d81e Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Tue, 14 Jul 2015 02:33:17 +0200 Subject: [PATCH] add hook addMoreActionsButtons on adherent Card --- htdocs/adherents/card.php | 196 +++++++++++++++++++------------------- 1 file changed, 99 insertions(+), 97 deletions(-) diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index d87729ee0c5..771955bf970 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1619,131 +1619,133 @@ else * Hotbar */ print '
'; - - if ($action != 'valid' && $action != 'editlogin' && $action != 'editthirdparty') - { - // Modify - if ($user->rights->adherent->creer) - { - print '"; - } - else - { - print '
'.$langs->trans("Modify").'
'; - } - - // Validate - if ($object->statut == -1) + $parameters = array(); + $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been + if (empty($reshook)) { + if ($action != 'valid' && $action != 'editlogin' && $action != 'editthirdparty') { + // Modify if ($user->rights->adherent->creer) { - print '\n"; + print '"; } else { - print '
'.$langs->trans("Validate").'
'; + print '
'.$langs->trans("Modify").'
'; } - } - - // Reactivate - if ($object->statut == 0) - { + + // Validate + if ($object->statut == -1) + { + if ($user->rights->adherent->creer) + { + print '\n"; + } + else + { + print '
'.$langs->trans("Validate").'
'; + } + } + + // Reactivate + if ($object->statut == 0) + { + if ($user->rights->adherent->creer) + { + print '\n"; + } + else + { + print '
'.$langs->trans("Reenable")."
"; + } + } + + // Send card by email if ($user->rights->adherent->creer) { - print '\n"; + if ($object->statut >= 1) + { + if ($object->email) print '\n"; + else print '\n"; + } + else + { + print '
'.$langs->trans("SendCardByMail")."
"; + } } else { - print '
'.$langs->trans("Reenable")."
"; + print '
'.$langs->trans("SendCardByMail")."
"; } - } - - // Send card by email - if ($user->rights->adherent->creer) - { + + // Terminate if ($object->statut >= 1) { - if ($object->email) print '\n"; - else print '\n"; + if ($user->rights->adherent->supprimer) + { + print '\n"; + } + else + { + print '
'.$langs->trans("Resiliate")."
"; + } } - else + + // Create third party + if (! empty($conf->societe->enabled) && ! $object->fk_soc) { - print '
'.$langs->trans("SendCardByMail")."
"; + if ($user->rights->societe->creer) + { + if ($object->statut != -1) print ''; + else print ''; + } + else + { + print '
'.$langs->trans("CreateDolibarrThirdParty")."
"; + } } - } - else - { - print '
'.$langs->trans("SendCardByMail")."
"; - } - - // Terminate - if ($object->statut >= 1) - { + + // Create user + if (! $user->societe_id && ! $object->user_id) + { + if ($user->rights->user->user->creer) + { + if ($object->statut != -1) print ''; + else print ''; + } + else + { + print '
'.$langs->trans("CreateDolibarrLogin")."
"; + } + } + + // Delete if ($user->rights->adherent->supprimer) { - print '\n"; + print '\n"; } else { - print '
'.$langs->trans("Resiliate")."
"; + print '
'.$langs->trans("Delete")."
"; } - } - - // Create third party - if (! empty($conf->societe->enabled) && ! $object->fk_soc) - { - if ($user->rights->societe->creer) + + // Action SPIP + if (! empty($conf->mailmanspip->enabled) && ! empty($conf->global->ADHERENT_USE_SPIP)) { - if ($object->statut != -1) print ''; - else print ''; - } - else - { - print '
'.$langs->trans("CreateDolibarrThirdParty")."
"; + $isinspip = $mailmanspip->is_in_spip($object); + + if ($isinspip == 1) + { + print '\n"; + } + if ($isinspip == 0) + { + print '\n"; + } } + } - - // Create user - if (! $user->societe_id && ! $object->user_id) - { - if ($user->rights->user->user->creer) - { - if ($object->statut != -1) print ''; - else print ''; - } - else - { - print '
'.$langs->trans("CreateDolibarrLogin")."
"; - } - } - - // Delete - if ($user->rights->adherent->supprimer) - { - print '\n"; - } - else - { - print '
'.$langs->trans("Delete")."
"; - } - - // Action SPIP - if (! empty($conf->mailmanspip->enabled) && ! empty($conf->global->ADHERENT_USE_SPIP)) - { - $isinspip = $mailmanspip->is_in_spip($object); - - if ($isinspip == 1) - { - print '\n"; - } - if ($isinspip == 0) - { - print '\n"; - } - } - } - print '
'; if ($isinspip == -1)