Skip to content

Commit

Permalink
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Nov 19, 2024
2 parents b068fdc + cd6ed63 commit 5a58b8e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
5 changes: 5 additions & 0 deletions htdocs/core/actions_massactions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,11 @@
$substitutionarray['__EMAIL__'] = $thirdparty->email;
$substitutionarray['__CHECK_READ__'] = '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.urlencode($thirdparty->tag).'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>';

if ($oneemailperrecipient) {
$substitutionarray['__ONLINE_PAYMENT_URL__'] = '';
$substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__'] = '';
}

$parameters = array('mode'=>'formemail');

if (!empty($listofobjectthirdparties)) {
Expand Down
11 changes: 6 additions & 5 deletions htdocs/core/class/html.formmail.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -863,12 +863,12 @@ public function get_form($addfileaction = 'addfile', $removefileaction = 'remove

// Complete substitution array with the url to make online payment
$paymenturl = '';
$validpaymentmethod = array();
// Set the online payment url link into __ONLINE_PAYMENT_URL__ key
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
$validpaymentmethod = getValidOnlinePaymentMethods('');
if (empty($this->substit['__REF__'])) {
$paymenturl = '';
} else {
// Set the online payment url link into __ONLINE_PAYMENT_URL__ key
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
$langs->loadLangs(array('paypal', 'other'));
$typeforonlinepayment = 'free';
if ($this->param["models"] == 'order' || $this->param["models"] == 'order_send') {
Expand All @@ -882,14 +882,15 @@ public function get_form($addfileaction = 'addfile', $removefileaction = 'remove
}
$url = getOnlinePaymentUrl(0, $typeforonlinepayment, $this->substit['__REF__']);
$paymenturl = $url;

$validpaymentmethod = getValidOnlinePaymentMethods('');
}

if (count($validpaymentmethod) > 0 && $paymenturl) {
$langs->load('other');
$this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__'] = str_replace('\n', "\n", $langs->transnoentities("PredefinedMailContentLink", $paymenturl));
$this->substit['__ONLINE_PAYMENT_URL__'] = $paymenturl;
} elseif (count($validpaymentmethod) > 0) {
$this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__'] = '__ONLINE_PAYMENT_TEXT_AND_URL__';
$this->substit['__ONLINE_PAYMENT_URL__'] = '__ONLINE_PAYMENT_URL__';
} else {
$this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__'] = '';
$this->substit['__ONLINE_PAYMENT_URL__'] = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function getNextValue($objsoc, $object, $mode = 'next')
}

// Supplier invoices take invoice date instead of creation date for the mask
$numFinal = get_next_value($db, $mask, 'facture_fourn', 'ref', '', $objsoc, $object->date);
$numFinal = get_next_value($db, $mask, 'facture_fourn', 'ref', '', $objsoc, is_object($object) ?$object->date :'');

return $numFinal;
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/fourn/class/fournisseur.commande.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2938,7 +2938,7 @@ public function initAsSpecimen()
$sql .= $this->db->order("rowid", "ASC");
$sql .= $this->db->plimit(1);
$resql = $this->db->query($sql);
if ($resql) {
if ($resql && $this->db->num_rows($resql)) {
$obj = $this->db->fetch_object($resql);
$prodid = $obj->rowid;
}
Expand Down

0 comments on commit 5a58b8e

Please sign in to comment.