diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php index a18b2dc54a5..5a2febe5a33 100644 --- a/htdocs/projet/graph_opportunities.inc.php +++ b/htdocs/projet/graph_opportunities.inc.php @@ -1,4 +1,22 @@ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +// variable $listofopplabel and $listofoppstatus should be defined + if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) { $sql = "SELECT p.fk_opp_status as opp_status, cls.code, COUNT(p.rowid) as nb, SUM(p.opp_amount) as opp_amount, SUM(p.opp_amount * p.opp_percent) as ponderated_opp_amount"; @@ -54,7 +72,7 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) $labelStatus = ''; $code = dol_getIdFromCode($db, $status, 'c_lead_status', 'rowid', 'code'); - if ($code) $labelStatus = $langs->trans("OppStatus".$code); + if ($code) $labelStatus = $langs->transnoentitiesnoconv("OppStatus".$code); if (empty($labelStatus)) $labelStatus = $listofopplabel[$status]; //$labelStatus .= ' ('.$langs->trans("Coeff").': '.price2num($listofoppstatus[$status]).')'; diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index c42677d8b21..4b87cf45b03 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -127,10 +127,12 @@ if (!empty($_SESSION['ipaddress'])) // To avoid to make action twice $ipaddress = $_SESSION['ipaddress']; $errormessage = $_SESSION['errormessage']; - // Call trigger - $result = $object->call_trigger('PAYMENTONLINE_PAYMENT_KO', $user); - if ($result < 0) $error++; - // End call triggers + if (is_object($object) && method_exists($object, 'call_trigger')) { + // Call trigger + $result = $object->call_trigger('PAYMENTONLINE_PAYMENT_KO', $user); + if ($result < 0) $error++; + // End call triggers + } // Send an email $sendemail = ''; diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 4bb899b930e..2d58f2bd2f9 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -593,8 +593,8 @@ if ($ispaymentok) { // Record payment include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; - $invoice = new Facture($db); - $result = $invoice->fetch($tmptag['INV']); + $object = new Facture($db); + $result = $object->fetch($tmptag['INV']); if ($result) { $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; @@ -623,9 +623,9 @@ if ($ispaymentok) $paiement->datepaye = $now; if ($currencyCodeType == $conf->currency) { - $paiement->amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id + $paiement->amounts = array($object->id => $FinalPaymentAmt); // Array with all payments dispatching with invoice id } else { - $paiement->multicurrency_amounts = array($invoice->id => $FinalPaymentAmt); // Array with all payments dispatching + $paiement->multicurrency_amounts = array($object->id => $FinalPaymentAmt); // Array with all payments dispatching $postactionmessages[] = 'Payment was done in a different currency that currency expected of company'; $ispostactionok = -1; @@ -662,7 +662,7 @@ if ($ispaymentok) if ($bankaccountid > 0) { $label = '(CustomerInvoicePayment)'; - if ($invoice->type == Facture::TYPE_CREDIT_NOTE) $label = '(CustomerInvoicePaymentBack)'; // Refund of a credit note + if ($object->type == Facture::TYPE_CREDIT_NOTE) $label = '(CustomerInvoicePaymentBack)'; // Refund of a credit note $result = $paiement->addPaymentToBank($user, 'payment', $label, $bankaccountid, '', ''); if ($result < 0) { @@ -709,10 +709,12 @@ if ($ispaymentok) $currencyCodeType = $_SESSION['currencyCodeType']; $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; - // Call trigger - $result = $object->call_trigger('PAYMENTONLINE_PAYMENT_OK', $user); - if ($result < 0) $error++; - // End call triggers + if (is_object($object) && method_exists($object, 'call_trigger')) { + // Call trigger + $result = $object->call_trigger('PAYMENTONLINE_PAYMENT_OK', $user); + if ($result < 0) $error++; + // End call triggers + } print $langs->trans("YourPaymentHasBeenRecorded")."
\n"; if ($TRANSACTIONID) print $langs->trans("ThisIsTransactionId", $TRANSACTIONID)."

\n"; @@ -831,10 +833,12 @@ if ($ispaymentok) $currencyCodeType = $_SESSION['currencyCodeType']; $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; - // Call trigger - $result = $object->call_trigger('PAYMENTONLINE_PAYMENT_KO', $user); - if ($result < 0) $error++; - // End call triggers + if (is_object($object) && method_exists($object, 'call_trigger')) { + // Call trigger + $result = $object->call_trigger('PAYMENTONLINE_PAYMENT_KO', $user); + if ($result < 0) $error++; + // End call triggers + } print $langs->trans('DoExpressCheckoutPaymentAPICallFailed')."
\n"; print $langs->trans('DetailedErrorMessage').": ".$ErrorLongMsg."
\n";