NEW Can set a dedicated message on payment forms

This commit is contained in:
Laurent Destailleur 2017-09-09 10:03:09 +02:00
parent 591834a807
commit c7537732d2
13 changed files with 46 additions and 22 deletions

View File

@ -1,5 +1,5 @@
<?php
/**
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
*
@ -21,14 +21,14 @@
/**
* Returns an array with the tabs for the "Payment" section
* It loads tabs from modules looking for the entity payment
*
*
* @param Paiement $object Current payment object
* @return array Tabs for the payment section
*/
function payment_prepare_head(Paiement $object) {
global $langs, $conf;
$h = 0;
$head = array();
@ -56,14 +56,14 @@ function payment_prepare_head(Paiement $object) {
/**
* Returns an array with the tabs for the "Supplier payment" section
* It loads tabs from modules looking for the entity payment_supplier
*
*
* @param Paiement $object Current payment object
* @return array Tabs for the payment section
*/
function payment_supplier_prepare_head(Paiement $object) {
global $langs, $conf;
$h = 0;
$head = array();
@ -77,7 +77,7 @@ function payment_supplier_prepare_head(Paiement $object) {
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'payment_supplier');
$head[$h][0] = DOL_URL_ROOT.'/fourn/paiement/info.php?id='.$object->id;
$head[$h][1] = $langs->trans('Info');
$head[$h][2] = 'info';
@ -95,9 +95,10 @@ function payment_supplier_prepare_head(Paiement $object) {
*
* @param Societe $fromcompany Third party
* @param Translate $langs Output language
* @param int $addformmessage Add the payment form message
* @return void
*/
function htmlPrintOnlinePaymentFooter($fromcompany,$langs)
function htmlPrintOnlinePaymentFooter($fromcompany,$langs,$addformmessage=0)
{
global $conf;
@ -149,8 +150,16 @@ function htmlPrintOnlinePaymentFooter($fromcompany,$langs)
$line2.=($line2?" - ":"").$langs->transnoentities("VATIntraShort").": ".$fromcompany->tva_intra;
}
print '<br><br><hr>'."\n";
print '<br>';
print '<div class="center"><font style="font-size: 10px;">'."\n";
if ($addformmessage)
{
$key='ONLINE_PAYMENT_MESSAGE_FORM';
if (! empty($conf->global->$key)) print '<br>'.$conf->global->$key;
}
print '<br><hr>'."\n";
print $fromcompany->name.'<br>';
print $line1.'<br>';
print $line2;

View File

@ -802,7 +802,7 @@ print '</div>'."\n";
print '<br>';
htmlPrintOnlinePaymentFooter($mysoc,$langs);
htmlPrintOnlinePaymentFooter($mysoc,$langs,1);
llxFooter('', 'public');

View File

@ -156,7 +156,8 @@ print '<div id="dolpaymentdiv" align="center">'."\n";
print $langs->trans("YourPaymentHasNotBeenRecorded")."<br><br>\n";
if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_KO)) print $conf->global->ONLINE_PAYMENT_MESSAGE_KO;
$key='ONLINE_PAYMENT_MESSAGE_KO';
if (! empty($conf->global->$key)) print $conf->global->$key;
print "\n</div>\n";

View File

@ -115,7 +115,8 @@ dol_syslog("Call newpaymentok with token=".$onlinetoken." paymentType=".$payment
print $langs->trans("YourPaymentHasBeenRecorded")."<br><br>\n";
if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_OK)) print $conf->global->ONLINE_PAYMENT_MESSAGE_OK;
$key='ONLINE_PAYMENT_MESSAGE_OK';
if (! empty($conf->global->$key)) print $conf->global->$key;
// Appel des triggers

View File

@ -1264,6 +1264,7 @@ else
print '</td></tr>'."\n";
print '</table>'."\n";
print '</form>'."\n";
print '</div>'."\n";
print '<br>';
@ -1446,7 +1447,7 @@ if (preg_match('/^dopayment/',$action))
htmlPrintOnlinePaymentFooter($mysoc,$langs);
htmlPrintOnlinePaymentFooter($mysoc,$langs,1);
llxFooter('', 'public');

View File

@ -238,7 +238,9 @@ if ($urllogo)
print $langs->trans("YourPaymentHasNotBeenRecorded")."<br><br>";
if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_KO)) print $conf->global->ONLINE_PAYMENT_MESSAGE_KO;
$key='ONLINE_PAYMENT_MESSAGE_KO';
if (! empty($conf->global->$key)) print $conf->global->$key;
print "\n</div>\n";

View File

@ -285,7 +285,9 @@ if ($ispaymentok)
print $langs->trans("YourPaymentHasBeenRecorded")."<br>\n";
print $langs->trans("ThisIsTransactionId",$TRANSACTIONID)."<br><br>\n";
if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_OK)) print $conf->global->ONLINE_PAYMENT_MESSAGE_OK;
$key='ONLINE_PAYMENT_MESSAGE_OK';
if (! empty($conf->global->$key)) print $conf->global->$key;
$sendemail = '';
if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) $sendemail=$conf->global->ONLINE_PAYMENT_SENDEMAIL;

View File

@ -1015,7 +1015,7 @@ print '<br>';
htmlPrintOnlinePaymentFooter($mysoc,$langs);
htmlPrintOnlinePaymentFooter($mysoc,$langs,1);
llxFooter('', 'public');

View File

@ -166,7 +166,9 @@ print '<span id="dolpaymentspan"></span>'."\n";
print '<div id="dolpaymentdiv" align="center">'."\n";
print $langs->trans("YourPaymentHasNotBeenRecorded")."<br><br>";
if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_KO)) print $conf->global->ONLINE_PAYMENT_MESSAGE_KO;
$key='ONLINE_PAYMENT_MESSAGE_KO';
if (! empty($conf->global->$key)) print $conf->global->$key;
print "\n</div>\n";

View File

@ -170,7 +170,9 @@ if ($PAYPALTOKEN)
print $langs->trans("YourPaymentHasBeenRecorded")."<br>\n";
print $langs->trans("ThisIsTransactionId",$TRANSACTIONID)."<br><br>\n";
if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_OK)) print $conf->global->ONLINE_PAYMENT_MESSAGE_OK;
$key='ONLINE_PAYMENT_MESSAGE_OK';
if (! empty($conf->global->$key)) print $conf->global->$key;
// Appel des triggers
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';

View File

@ -1229,7 +1229,7 @@ if (preg_match('/^dopayment/',$action))
htmlPrintOnlinePaymentFooter($mysoc,$langs);
htmlPrintOnlinePaymentFooter($mysoc,$langs,1);
llxFooter('', 'public');

View File

@ -153,7 +153,9 @@ print '<span id="dolpaymentspan"></span>'."\n";
print '<div id="dolpaymentdiv" align="center">'."\n";
print $langs->trans("YourPaymentHasNotBeenRecorded")."<br><br>";
if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_KO)) print $conf->global->ONLINE_PAYMENT_MESSAGE_KO;
$key='ONLINE_PAYMENT_MESSAGE_KO';
if (! empty($conf->global->$key)) print $conf->global->$key;
print "\n</div>\n";

View File

@ -120,7 +120,9 @@ if ($ispaymentok)
print $langs->trans("YourPaymentHasBeenRecorded")."<br>\n";
print $langs->trans("ThisIsTransactionId",$TRANSACTIONID)."<br><br>\n";
if (! empty($conf->global->ONLINE_PAYMENT_MESSAGE_OK)) print $conf->global->ONLINE_PAYMENT_MESSAGE_OK;
$key='ONLINE_PAYMENT_MESSAGE_OK';
if (! empty($conf->global->$key)) print $conf->global->$key;
$sendemail = '';
if (! empty($conf->global->ONLINE_PAYMENT_SENDEMAIL)) $sendemail=$conf->global->ONLINE_PAYMENT_SENDEMAIL;