'."\n";
+// Get on url call
+/*
+$token = $PAYBOXTOKEN;
+*/
+$fulltag = $PAYBOXFULLTAG;
+/*$payerID = $PAYBOXPAYERID;
+// Set by newpayment.php
+$paymentType = $_SESSION['PaymentType'];
+$currencyCodeType = $_SESSION['currencyCodeType'];
+$FinalPaymentAmt = $_SESSION["Payment_Amount"];
+// From env
+$ipaddress = $_SESSION['ipaddress'];
+
+dol_syslog("Call newpaymentok with token=".$token." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag);
+*/
+
+// Send an email
+if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fulltag))
+{
+ $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL;
+ $from=$conf->global->MAILING_EMAIL_FROM;
+ require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
+ $mailfile = new CMailFile(
+ 'New subscription payed',
+ $sendto,
+ $from,
+ 'New subscription payed '.$fulltag
+ );
+
+ $result=$mailfile->sendfile();
+ if ($result)
+ {
+ dol_syslog("EMail sent to ".$sendto);
+ }
+ else
+ {
+ dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR);
+ }
+}
+
+
print $langs->trans("YourPaymentHasBeenRecorded")."
\n";
if (! empty($conf->global->PAYBOX_MESSAGE_OK)) print $conf->global->PAYBOX_MESSAGE_OK;
diff --git a/htdocs/public/paypal/paymentko.php b/htdocs/public/paypal/paymentko.php
index 13c4718c361..c6fe53ac7b0 100755
--- a/htdocs/public/paypal/paymentko.php
+++ b/htdocs/public/paypal/paymentko.php
@@ -71,6 +71,31 @@ foreach($_POST as $k => $v) $tracepost .= "{$k} - {$v}\n";
dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_paypal');
+// Send an email
+if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fulltag))
+{
+ $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL;
+ $from=$conf->global->MAILING_EMAIL_FROM;
+ require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
+ $mailfile = new CMailFile(
+ 'New subscription payed',
+ $sendto,
+ $from,
+ 'New subscription payed '.$fulltag
+ );
+
+ $result=$mailfile->sendfile();
+ if ($result)
+ {
+ dol_syslog("EMail sent to ".$sendto);
+ }
+ else
+ {
+ dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR);
+ }
+}
+
+
llxHeaderPaypal($langs->trans("PaymentForm"));
diff --git a/htdocs/public/paypal/paymentok.php b/htdocs/public/paypal/paymentok.php
index 45cd6f46014..ca11bcb5422 100755
--- a/htdocs/public/paypal/paymentok.php
+++ b/htdocs/public/paypal/paymentok.php
@@ -81,6 +81,15 @@ if (empty($PAYPAL_API_SIGNATURE))
return -1;
}
+$source=GETPOST('source');
+$ref=GETPOST('ref');
+$PAYPALTOKEN=GETPOST('TOKEN');
+if (empty($PAYPALTOKEN)) $PAYPALTOKEN=GETPOST('token');
+$PAYPALPAYERID=GETPOST('PAYERID');
+if (empty($PAYPALPAYERID)) $PAYPALPAYERID=GETPOST('PayerID');
+$PAYPALFULLTAG=GETPOST('FULLTAG');
+if (empty($PAYPALFULLTAG)) $PAYPALFULLTAG=GETPOST('fulltag');
+
/*
* Actions
@@ -105,15 +114,6 @@ llxHeaderPaypal($langs->trans("PaymentForm"));
print '
'."\n";
print '
'."\n";
-$source=GETPOST('source');
-$ref=GETPOST('ref');
-$PAYPALTOKEN=GETPOST('TOKEN');
-if (empty($PAYPALTOKEN)) $PAYPALTOKEN=GETPOST('token');
-$PAYPALPAYERID=GETPOST('PAYERID');
-if (empty($PAYPALPAYERID)) $PAYPALPAYERID=GETPOST('PayerID');
-$PAYPALFULLTAG=GETPOST('FULLTAG');
-if (empty($PAYPALFULLTAG)) $PAYPALFULLTAG=GETPOST('fulltag');
-
if ($PAYPALTOKEN)
{
// Get on url call
@@ -129,6 +129,33 @@ if ($PAYPALTOKEN)
dol_syslog("Call newpaymentok with token=".$token." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag);
+
+ // Send an email
+ if (! empty($conf->global->MEMBER_PAYONLINE_SENDEMAIL) && preg_match('/MEM=',$fulltag))
+ {
+ $sendto=$conf->global->MEMBER_PAYONLINE_SENDEMAIL;
+ $from=$conf->global->MAILING_EMAIL_FROM;
+ require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
+ $mailfile = new CMailFile(
+ 'New subscription payed',
+ $sendto,
+ $from,
+ 'New subscription payed '.$fulltag
+ );
+
+ $result=$mailfile->sendfile();
+ if ($result)
+ {
+ dol_syslog("EMail sent to ".$sendto);
+ }
+ else
+ {
+ dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR);
+ }
+ }
+
+
+ // Validate record
if (! empty($paymentType))
{
dol_syslog("We call GetExpressCheckoutDetails");
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 205e88c8272..24339b08f79 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -140,7 +140,7 @@ class Societe extends CommonObject
var $array_options;
- var $oldcopy;
+ var $oldcopy; // To contains a clone of this when we need to save old properties of object
/**
@@ -251,7 +251,7 @@ class Societe extends CommonObject
// Fin appel triggers
}
else $error++;
-
+
if (! $error)
{
dol_syslog(get_class($this)."::Create success id=".$this->id);
@@ -2585,6 +2585,9 @@ class Societe extends CommonObject
$this->email='specimen@specimen.com';
$this->url='http://www.specimen.com';
+ $this->phone='0909090901';
+ $this->fax='0909090909';
+
$this->code_client='CC-'.dol_print_date($now,'dayhourlog');
$this->code_fournisseur='SC-'.dol_print_date($now,'dayhourlog');
$this->capital=10000;