Add function to get html online payment link
This commit is contained in:
parent
729a5677ad
commit
b04dfcadc7
@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2020 Abbes Bahfir <bafbes@gmail.com>
|
||||
* Copyright (C) 2021 Waël Almoman <info@almoman.com>
|
||||
*
|
||||
* 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
|
||||
@ -26,8 +27,7 @@
|
||||
* @param Paiement $object Current payment object
|
||||
* @return array Tabs for the payment section
|
||||
*/
|
||||
function payment_prepare_head(Paiement $object)
|
||||
{
|
||||
function payment_prepare_head(Paiement $object) {
|
||||
global $langs, $conf;
|
||||
|
||||
$h = 0;
|
||||
@ -61,8 +61,7 @@ function payment_prepare_head(Paiement $object)
|
||||
* @param int $id ID of bank line
|
||||
* @return array Tabs for the Bankline section
|
||||
*/
|
||||
function bankline_prepare_head($id)
|
||||
{
|
||||
function bankline_prepare_head($id) {
|
||||
global $langs, $conf;
|
||||
|
||||
$h = 0;
|
||||
@ -96,8 +95,7 @@ function bankline_prepare_head($id)
|
||||
* @param Paiement $object Current payment object
|
||||
* @return array Tabs for the payment section
|
||||
*/
|
||||
function payment_supplier_prepare_head(Paiement $object)
|
||||
{
|
||||
function payment_supplier_prepare_head(Paiement $object) {
|
||||
global $langs, $conf;
|
||||
|
||||
$h = 0;
|
||||
@ -130,8 +128,7 @@ function payment_supplier_prepare_head(Paiement $object)
|
||||
* @param string $paymentmethod Filter on this payment method (''=none, 'paypal', ...)
|
||||
* @return array Array of valid payment method
|
||||
*/
|
||||
function getValidOnlinePaymentMethods($paymentmethod = '')
|
||||
{
|
||||
function getValidOnlinePaymentMethods($paymentmethod = '') {
|
||||
global $conf, $langs;
|
||||
|
||||
$validpaymentmethod = array();
|
||||
@ -155,14 +152,13 @@ function getValidOnlinePaymentMethods($paymentmethod = '')
|
||||
}
|
||||
|
||||
/**
|
||||
* Return string with full Url
|
||||
* Return string with full online payment Url
|
||||
*
|
||||
* @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...)
|
||||
* @param string $ref Ref of object
|
||||
* @return string Url string
|
||||
*/
|
||||
function showOnlinePaymentUrl($type, $ref)
|
||||
{
|
||||
function showOnlinePaymentUrl($type, $ref) {
|
||||
global $langs;
|
||||
|
||||
// Load translation files required by the page
|
||||
@ -178,6 +174,21 @@ function showOnlinePaymentUrl($type, $ref)
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return string with HTML link for online payment
|
||||
*
|
||||
* @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...)
|
||||
* @param string $ref Ref of object
|
||||
* @param string $label Text or HTML tag to display, if empty it display the URL
|
||||
* @return string Url string
|
||||
*/
|
||||
function getHtmlOnlinePaymentLink($type, $ref, $label='') {
|
||||
$url = getOnlinePaymentUrl(0, $type, $ref);
|
||||
$label = $label ? $label : $url;
|
||||
return'<a href="'.$url.'" target="_blank">'.$label.'</a>';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return string with full Url
|
||||
*
|
||||
@ -189,8 +200,7 @@ function showOnlinePaymentUrl($type, $ref)
|
||||
* @param string $localorexternal 0=Url for browser, 1=Url for external access
|
||||
* @return string Url string
|
||||
*/
|
||||
function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag = 'your_tag', $localorexternal = 0)
|
||||
{
|
||||
function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag = 'your_tag', $localorexternal = 0) {
|
||||
global $conf, $dolibarr_main_url_root;
|
||||
|
||||
$ref = str_replace(' ', '', $ref);
|
||||
@ -355,8 +365,7 @@ function getOnlinePaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag
|
||||
* @param Object $object Object related to payment
|
||||
* @return void
|
||||
*/
|
||||
function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage = 0, $suffix = '', $object = null)
|
||||
{
|
||||
function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage = 0, $suffix = '', $object = null) {
|
||||
global $conf;
|
||||
|
||||
// Juridical status
|
||||
|
||||
Loading…
Reference in New Issue
Block a user