add hook on public new member card

This commit is contained in:
Frédéric FRANCE 2020-10-23 18:49:06 +02:00
parent ae4020c9fe
commit 76a0eba1a0
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
2 changed files with 12 additions and 5 deletions

View File

@ -73,6 +73,9 @@ if (empty($conf->global->MEMBER_ENABLE_PUBLIC))
exit;
}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('publicnewmembercard', 'globalcard'));
$extrafields = new ExtraFields($db);
$object = new Adherent($db);
@ -152,10 +155,15 @@ function llxFooterVierge()
/*
* Actions
*/
$parameters = array('');
// Note that $action and $object may have been modified by some hooks
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action);
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
// Action called when page is submitted
if ($action == 'add')
{
if (empty($reshook) && $action == 'add') {
$error = 0;
$urlback = '';
@ -454,8 +462,7 @@ if ($action == 'add')
// Action called after a submitted was send and member created successfully
// If MEMBER_URL_REDIRECT_SUBSCRIPTION is set to url we never go here because a redirect was done to this url.
// backtopage parameter with an url was set on member submit page, we never go here because a redirect was done to this url.
if ($action == 'added')
{
if (empty($reshook) && $action == 'added') {
llxHeaderVierge($langs->trans("NewMemberForm"));
// Si on a pas ete redirige

View File

@ -92,7 +92,7 @@ if ($id > 0)
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur" width="35%">'.$object->firstname.'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$object->lastname.'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Gender").'</td><td class="valeur">'.$object->gender.'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->societe.'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->company.'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Address").'</td><td class="valeur">'.nl2br($object->address).'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td class="valeur">'.$object->zip.' '.$object->town.'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Country").'</td><td class="valeur">'.$object->country.'&nbsp;</td></tr>';