| ';
print $langs->trans("ForceMemberType");
- print ' | ';
- $listofval = array(-1 => $langs->trans("Undefined"));
+ print ' | ';
+ $listofval = array();
$listofval += $adht->liste_array();
$forcetype = $conf->global->MEMBER_NEWFORM_FORCETYPE ?: -1;
print $form->selectarray("MEMBER_NEWFORM_FORCETYPE", $listofval, $forcetype, count($listofval)>1?1:0);
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index 2de1b00c683..95cbd6beb7a 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -514,9 +514,10 @@ class ActionComm extends CommonObject
{
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."actioncomm", "id");
- // Now insert assignedusers
+ // Now insert assigned users
if (!$error)
{
+ //dol_syslog(var_export($this->userassigned, true));
foreach ($this->userassigned as $key => $val)
{
if (!is_array($val)) // For backward compatibility when val=id
@@ -524,16 +525,20 @@ class ActionComm extends CommonObject
$val = array('id'=>$val);
}
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
- $sql .= " VALUES(".$this->id.", 'user', ".$val['id'].", ".(empty($val['mandatory']) ? '0' : $val['mandatory']).", ".(empty($val['transparency']) ? '0' : $val['transparency']).", ".(empty($val['answer_status']) ? '0' : $val['answer_status']).")";
+ if ($val['id'] > 0)
+ {
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
+ $sql .= " VALUES(".$this->id.", 'user', ".$val['id'].", ".(empty($val['mandatory']) ? '0' : $val['mandatory']).", ".(empty($val['transparency']) ? '0' : $val['transparency']).", ".(empty($val['answer_status']) ? '0' : $val['answer_status']).")";
- $resql = $this->db->query($sql);
- if (!$resql)
- {
- $error++;
- $this->errors[] = $this->db->lasterror();
- }
- //var_dump($sql);exit;
+ $resql = $this->db->query($sql);
+ if (!$resql)
+ {
+ $error++;
+ dol_syslog('Error to process userassigned: '.$this->db->lasterror(), LOG_ERR);
+ $this->errors[] = $this->db->lasterror();
+ }
+ //var_dump($sql);exit;
+ }
}
}
@@ -541,7 +546,7 @@ class ActionComm extends CommonObject
{
if (!empty($this->socpeopleassigned))
{
- foreach ($this->socpeopleassigned as $id => $Tab)
+ foreach ($this->socpeopleassigned as $id => $val)
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
$sql .= " VALUES(".$this->id.", 'socpeople', ".$id.", 0, 0, 0)";
@@ -550,6 +555,7 @@ class ActionComm extends CommonObject
if (!$resql)
{
$error++;
+ dol_syslog('Error to process socpeopleassigned: '.$this->db->lasterror(), LOG_ERR);
$this->errors[] = $this->db->lasterror();
}
}
@@ -558,8 +564,6 @@ class ActionComm extends CommonObject
if (!$error)
{
- $action = 'create';
-
// Actions on extra fields
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{
diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
index e72da40d6b0..26958aed875 100644
--- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
+++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
@@ -954,8 +954,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
}
else
{
- $error ="Failed to insert event : ".$actioncomm->error." ".join(',', $actioncomm->errors);
- $this->error=$error;
+ $this->error="Failed to insert event : ".$actioncomm->error." ".join(',', $actioncomm->errors);
$this->errors=$actioncomm->errors;
dol_syslog("interface_modAgenda_ActionsAuto.class.php: ".$this->error, LOG_ERR);
diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php
index 39208170213..4661067b78e 100644
--- a/htdocs/public/payment/paymentok.php
+++ b/htdocs/public/payment/paymentok.php
@@ -109,7 +109,7 @@ $ErrorCode=$ErrorShortMsg=$ErrorLongMsg=$ErrorSeverityCode='';
$object = new stdClass(); // For triggers
-
+$error = 0;
/*
@@ -205,11 +205,11 @@ if (! empty($conf->paypal->enabled))
if ($ack=="SUCCESS" || $ack=="SUCCESSWITHWARNING")
{
// Nothing to do
- dol_syslog("Call to GetExpressCheckoutDetails return ".$ack);
+ dol_syslog("Call to GetExpressCheckoutDetails return ".$ack, LOG_DEBUG, 0, '_payment');
}
else
{
- dol_syslog("Call to GetExpressCheckoutDetails return error: ".json_encode($resArray), LOG_WARNING);
+ dol_syslog("Call to GetExpressCheckoutDetails return error: ".json_encode($resArray), LOG_WARNING, '_payment');
}
dol_syslog("We call DoExpressCheckoutPayment token=".$onlinetoken." paymentType=".$paymentType." currencyCodeType=".$currencyCodeType." payerID=".$payerID." ipaddress=".$ipaddress." FinalPaymentAmt=".$FinalPaymentAmt." fulltag=".$fulltag, LOG_DEBUG, 0, '_payment');
@@ -219,7 +219,7 @@ if (! empty($conf->paypal->enabled))
$ack = strtoupper($resArray2["ACK"]);
if ($ack=="SUCCESS" || $ack=="SUCCESSWITHWARNING")
{
- dol_syslog("Call to GetExpressCheckoutDetails return ".$ack);
+ dol_syslog("Call to GetExpressCheckoutDetails return ".$ack, LOG_DEBUG, 0, '_payment');
$object->source = $source;
$object->ref = $ref;
@@ -238,7 +238,7 @@ if (! empty($conf->paypal->enabled))
}
else
{
- dol_syslog("Call to DoExpressCheckoutPayment return error: ".json_encode($resArray2), LOG_WARNING);
+ dol_syslog("Call to DoExpressCheckoutPayment return error: ".json_encode($resArray2), LOG_WARNING, 0, '_payment');
//Display a user friendly Error on the page using any of the following error information returned by PayPal
$ErrorCode = urldecode($resArray2["L_ERRORCODE0"]);
@@ -316,6 +316,8 @@ if ($ispaymentok)
$result1 = $object->fetch($tmptag['MEM']);
$result2 = $adht->fetch($object->typeid);
+ dol_syslog("We have to process member with id=".$tmptag['MEM']." result1=".$result1." result2=".$result2, LOG_DEBUG, 0, '_payment');
+
if ($result1 > 0 && $result2 > 0)
{
$paymentTypeId = 0;
@@ -329,7 +331,9 @@ if ($ispaymentok)
$paymentTypeId = dol_getIdFromCode($db, $paymentType, 'c_paiement', 'code', 'id', 1);
}
- $currencyCodeType = $_SESSION['currencyCodeType'];
+ $currencyCodeType = $_SESSION['currencyCodeType'];
+
+ dol_syslog("FinalPaymentAmt=".$FinalPaymentAmt." paymentTypeId=".$paymentTypeId, LOG_DEBUG, 0, '_payment');
// Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time)
if (! empty($FinalPaymentAmt) && $paymentTypeId > 0)
@@ -342,6 +346,7 @@ if ($ispaymentok)
$postactionmessages[] = $errmsg;
$postactionmessages = array_merge($postactionmessages, $object->errors);
$ispostactionok = -1;
+ dol_syslog("Failed to validate member: ".$errmsg, LOG_ERR, 0, '_payment');
}
// Subscription informations
@@ -366,9 +371,10 @@ if ($ispaymentok)
if ($accountid < 0)
{
$error++;
- $errmsg='Setup of bank accout to use for payment is not correctly done for payment method '.$paymentmethod;
+ $errmsg='Setup of bank account to use for payment is not correctly done for payment method '.$paymentmethod;
$postactionmessages[] = $errmsg;
$ispostactionok = -1;
+ dol_syslog("Failed to get the bank account to record payment: ".$errmsg, LOG_ERR, 0, '_payment');
}
$operation=$paymentType; // Payment mode code
@@ -844,10 +850,12 @@ if ($ispaymentok)
if ($result)
{
dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment');
+ //dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0);
}
else
{
dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment');
+ //dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0);
}
}
}
|