FIX Content of email for subscription
This commit is contained in:
parent
808d6ba389
commit
c01ac05aec
@ -128,10 +128,11 @@ class Subscription extends CommonObject
|
|||||||
|
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note)";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note)";
|
||||||
|
|
||||||
if ($this->fk_type == null) {
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
$member=new Adherent($this->db);
|
||||||
$member=new Adherent($this->db);
|
$result=$member->fetch($this->fk_adherent);
|
||||||
$result=$member->fetch($this->fk_adherent);
|
|
||||||
|
if ($this->fk_type == null) { // If type not defined, we use the type of member
|
||||||
$type=$member->typeid;
|
$type=$member->typeid;
|
||||||
} else {
|
} else {
|
||||||
$type=$this->fk_type;
|
$type=$this->fk_type;
|
||||||
@ -151,11 +152,13 @@ class Subscription extends CommonObject
|
|||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element);
|
||||||
|
$this->fk_type = $type;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error && ! $notrigger)
|
if (! $error && ! $notrigger)
|
||||||
{
|
{
|
||||||
// Call triggers
|
$this->context = array('member'=>$member);
|
||||||
|
// Call triggers
|
||||||
$result=$this->call_trigger('MEMBER_SUBSCRIPTION_CREATE', $user);
|
$result=$this->call_trigger('MEMBER_SUBSCRIPTION_CREATE', $user);
|
||||||
if ($result < 0) { $error++; }
|
if ($result < 0) { $error++; }
|
||||||
// End call triggers
|
// End call triggers
|
||||||
@ -257,7 +260,8 @@ class Subscription extends CommonObject
|
|||||||
$result=$member->update_end_date($user);
|
$result=$member->update_end_date($user);
|
||||||
|
|
||||||
if (! $error && ! $notrigger) {
|
if (! $error && ! $notrigger) {
|
||||||
// Call triggers
|
$this->context = array('member'=>$member);
|
||||||
|
// Call triggers
|
||||||
$result=$this->call_trigger('MEMBER_SUBSCRIPTION_MODIFY', $user);
|
$result=$this->call_trigger('MEMBER_SUBSCRIPTION_MODIFY', $user);
|
||||||
if ($result < 0) { $error++; } //Do also here what you must do to rollback action if trigger fail
|
if ($result < 0) { $error++; } //Do also here what you must do to rollback action if trigger fail
|
||||||
// End call triggers
|
// End call triggers
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2007-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -205,18 +205,18 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
|
|||||||
print $form->showrefnav($object, 'rowid', $linkback, 1);
|
print $form->showrefnav($object, 'rowid', $linkback, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Type
|
// Member
|
||||||
|
$adh->ref=$adh->getFullName($langs);
|
||||||
|
print '<tr>';
|
||||||
|
print '<td>'.$langs->trans("Member").'</td><td class="valeur" colspan="3">'.$adh->getNomUrl(1, 0, 'subscription').'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Type
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("Type").'</td><td class="valeur" colspan="3">';
|
print '<td>'.$langs->trans("Type").'</td><td class="valeur" colspan="3">';
|
||||||
print $form->selectarray("typeid", $adht->liste_array(), (isset($_POST["typeid"])?$_POST["typeid"]:$object->fk_type));
|
print $form->selectarray("typeid", $adht->liste_array(), (isset($_POST["typeid"])?$_POST["typeid"]:$object->fk_type));
|
||||||
print'</td></tr>';
|
print'</td></tr>';
|
||||||
|
|
||||||
// Member
|
|
||||||
$adh->ref=$adh->getFullName($langs);
|
|
||||||
print '<tr>';
|
|
||||||
print '<td>'.$langs->trans("Member").'</td><td class="valeur" colspan="3">'.$adh->getNomUrl(1, 0, 'subscription').'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Date start subscription
|
// Date start subscription
|
||||||
print '<tr><td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="2">';
|
print '<tr><td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="2">';
|
||||||
print $form->selectDate($object->dateh, 'datesub', 1, 1, 0, 'update', 1);
|
print $form->selectDate($object->dateh, 'datesub', 1, 1, 0, 'update', 1);
|
||||||
@ -309,6 +309,12 @@ if ($rowid && $action != 'edit')
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
|
// Member
|
||||||
|
$adh->ref=$adh->getFullName($langs);
|
||||||
|
print '<tr>';
|
||||||
|
print '<td class="titlefield">'.$langs->trans("Member").'</td><td class="valeur">'.$adh->getNomUrl(1, 0, 'subscription').'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="titlefield">'.$langs->trans("Type").'</td>';
|
print '<td class="titlefield">'.$langs->trans("Type").'</td>';
|
||||||
@ -322,17 +328,6 @@ if ($rowid && $action != 'edit')
|
|||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Member
|
|
||||||
$adh->ref=$adh->getFullName($langs);
|
|
||||||
print '<tr>';
|
|
||||||
print '<td class="titlefield">'.$langs->trans("Member").'</td><td class="valeur">'.$adh->getNomUrl(1, 0, 'subscription').'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
// Date record
|
|
||||||
/*print '<tr>';
|
|
||||||
print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur">'.dol_print_date($object->datec,'dayhour').'</td>';
|
|
||||||
print '</tr>';*/
|
|
||||||
|
|
||||||
// Date subscription
|
// Date subscription
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur">'.dol_print_date($object->dateh, 'day').'</td>';
|
print '<td>'.$langs->trans("DateSubscription").'</td><td class="valeur">'.dol_print_date($object->dateh, 'day').'</td>';
|
||||||
|
|||||||
@ -649,12 +649,20 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("agenda","other","members"));
|
$langs->loadLangs(array("agenda","other","members"));
|
||||||
|
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberSubscriptionAddedInDolibarr", $object->ref, $object->getFullName($langs));
|
$member = $this->context['member'];
|
||||||
$object->actionmsg=$langs->transnoentities("MemberSubscriptionAddedInDolibarr", $object->ref, $object->getFullName($langs));
|
if (! is_object($member)) // This should not happen
|
||||||
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
|
{
|
||||||
$object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type;
|
include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||||
$object->actionmsg.="\n".$langs->transnoentities("Amount").': '.$object->last_subscription_amount;
|
$member = new Adherent($this->db);
|
||||||
$object->actionmsg.="\n".$langs->transnoentities("Period").': '.dol_print_date($object->last_subscription_date_start, 'day').' - '.dol_print_date($object->last_subscription_date_end, 'day');
|
$member->fetch($this->fk_adherent);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberSubscriptionAddedInDolibarr", $object->id, $member->getFullName($langs));
|
||||||
|
$object->actionmsg=$langs->transnoentities("MemberSubscriptionAddedInDolibarr", $object->id, $member->getFullName($langs));
|
||||||
|
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$member->getFullName($langs);
|
||||||
|
$object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->fk_type;
|
||||||
|
$object->actionmsg.="\n".$langs->transnoentities("Amount").': '.$object->amount;
|
||||||
|
$object->actionmsg.="\n".$langs->transnoentities("Period").': '.dol_print_date($object->dateh, 'day').' - '.dol_print_date($object->datef, 'day');
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
if ($object->fk_soc > 0) $object->socid=$object->fk_soc;
|
if ($object->fk_soc > 0) $object->socid=$object->fk_soc;
|
||||||
@ -664,12 +672,20 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array("agenda","other","members"));
|
$langs->loadLangs(array("agenda","other","members"));
|
||||||
|
|
||||||
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberSubscriptionModifiedInDolibarr", $object->ref, $object->getFullName($langs));
|
$member = $this->context['member'];
|
||||||
$object->actionmsg=$langs->transnoentities("MemberSubscriptionModifiedInDolibarr", $object->ref, $object->getFullName($langs));
|
if (! is_object($member)) // This should not happen
|
||||||
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs);
|
{
|
||||||
$object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type;
|
include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||||
$object->actionmsg.="\n".$langs->transnoentities("Amount").': '.$object->last_subscription_amount;
|
$member = new Adherent($this->db);
|
||||||
$object->actionmsg.="\n".$langs->transnoentities("Period").': '.dol_print_date($object->last_subscription_date_start, 'day').' - '.dol_print_date($object->last_subscription_date_end, 'day');
|
$member->fetch($this->fk_adherent);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("MemberSubscriptionModifiedInDolibarr", $object->id, $member->getFullName($langs));
|
||||||
|
$object->actionmsg=$langs->transnoentities("MemberSubscriptionModifiedInDolibarr", $object->id, $member->getFullName($langs));
|
||||||
|
$object->actionmsg.="\n".$langs->transnoentities("Member").': '.$member->getFullName($langs);
|
||||||
|
$object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->fk_type;
|
||||||
|
$object->actionmsg.="\n".$langs->transnoentities("Amount").': '.$object->amount;
|
||||||
|
$object->actionmsg.="\n".$langs->transnoentities("Period").': '.dol_print_date($object->dateh, 'day').' - '.dol_print_date($object->datef, 'day');
|
||||||
|
|
||||||
$object->sendtoid=0;
|
$object->sendtoid=0;
|
||||||
if ($object->fk_soc > 0) $object->socid=$object->fk_soc;
|
if ($object->fk_soc > 0) $object->socid=$object->fk_soc;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user