diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php index 49a1e909d91..7caac7a9452 100644 --- a/htdocs/core/lib/payments.lib.php +++ b/htdocs/core/lib/payments.lib.php @@ -103,10 +103,10 @@ function showOnlinePaymentUrl($type,$ref) $langs->load("paybox"); $servicename='Online'; - $out.=img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePayment",$servicename).'
'; - $url=getOnlinePaymentUrl(0,$type,$ref); - $out.=''; - $out.=ajax_autoselect("onlinepaymenturl", 0); + $out = img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePayment",$servicename).'
'; + $url = getOnlinePaymentUrl(0,$type,$ref); + $out.= ''; + $out.= ajax_autoselect("onlinepaymenturl", 0); return $out; } @@ -126,6 +126,7 @@ function getOnlinePaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_f global $conf; $ref=str_replace(' ','',$ref); + $out=''; if ($type == 'free') { @@ -210,7 +211,7 @@ function getOnlinePaymentUrl($mode,$type,$ref='',$amount='9.99',$freetag='your_f } // For multicompany - $out.="&entity=".$conf->entity; // Check the entity because He may be the same reference in several entities + if (! empty($out)) $out.="&entity=".$conf->entity; // Check the entity because He may be the same reference in several entities return $out; } diff --git a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php index b3f2a36efab..cd8612cb7d1 100644 --- a/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mailings/mailinglist_mymodule_myobject.modules.php @@ -42,7 +42,7 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets $this->db=$db; if (is_array($conf->modules)) { - $this->enabled=in_array('mymodule',$conf->modules); + $this->enabled=in_array('mymodule',$conf->modules)?1:0; } } @@ -186,15 +186,14 @@ class mailing_mailinglist_mymodule_myobject extends MailingTargets * * @param string $filter Filter * @param string $option Options - * @return int Nb of recipients + * @return int Nb of recipients or -1 if KO */ function getNbOfRecipients($filter=1,$option='') { $a=parent::getNbOfRecipients("select count(distinct(email)) as nb from ".MAIN_DB_PREFIX."myobject as p where email IS NOT NULL AND email != ''"); - if ($a < 0 || $b < 0) return -1; - if ($option == '') return $a; - return ($a+$b); + if ($a < 0) return -1; + return $a; } }