From 591834a80769382a579ecdae734913045a1ab245 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 9 Sep 2017 09:54:42 +0200 Subject: [PATCH] Add a message on payment forms --- htdocs/langs/en_US/other.lang | 3 +++ htdocs/langs/en_US/paybox.lang | 2 -- htdocs/langs/en_US/stripe.lang | 2 -- htdocs/paybox/admin/paybox.php | 12 ++++++++++-- htdocs/paypal/admin/paypal.php | 9 +++++++++ htdocs/stripe/admin/stripe.php | 10 +++++++++- 6 files changed, 31 insertions(+), 7 deletions(-) diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 9179b8eddb7..0bf7eff8ed1 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -19,6 +19,9 @@ TextNextMonthOfInvoice=Following month (text) of invoice date ZipFileGeneratedInto=Zip file generated into %s. DocFileGeneratedInto=Doc file generated into %s. JumpToLogin=Disconnected. Go to login page... +MessageForm=Message on online payment form +MessageOK=Message on validated payment return page +MessageKO=Message on canceled payment return page YearOfInvoice=Year of invoice date PreviousYearOfInvoice=Previous year of invoice date diff --git a/htdocs/langs/en_US/paybox.lang b/htdocs/langs/en_US/paybox.lang index 52d368a19a6..e1c9f15030c 100644 --- a/htdocs/langs/en_US/paybox.lang +++ b/htdocs/langs/en_US/paybox.lang @@ -30,8 +30,6 @@ InformationToFindParameters=Help to find your %s account information PAYBOX_CGI_URL_V2=Url of Paybox CGI module for payment VendorName=Name of vendor CSSUrlForPaymentForm=CSS style sheet url for payment form -MessageOK=Message on validated payment return page -MessageKO=Message on canceled payment return page NewPayboxPaymentReceived=New Paybox payment received NewPayboxPaymentFailed=New Paybox payment tried but failed PAYBOX_PAYONLINE_SENDEMAIL=EMail to warn after a payment (success or failed) diff --git a/htdocs/langs/en_US/stripe.lang b/htdocs/langs/en_US/stripe.lang index c2acaae37f7..5efd2a45400 100644 --- a/htdocs/langs/en_US/stripe.lang +++ b/htdocs/langs/en_US/stripe.lang @@ -31,8 +31,6 @@ InformationToFindParameters=Help to find your %s account information STRIPE_CGI_URL_V2=Url of Stripe CGI module for payment VendorName=Name of vendor CSSUrlForPaymentForm=CSS style sheet url for payment form -MessageOK=Message on validated payment return page -MessageKO=Message on canceled payment return page NewStripePaymentReceived=New Stripe payment received NewStripePaymentFailed=New Stripe payment tried but failed STRIPE_TEST_SECRET_KEY=Secret test key diff --git a/htdocs/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php index d1bd0812366..991c1511694 100644 --- a/htdocs/paybox/admin/paybox.php +++ b/htdocs/paybox/admin/paybox.php @@ -57,9 +57,11 @@ if ($action == 'setvalue' && $user->admin) if (! $result > 0) $error++; $result=dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL",GETPOST('ONLINE_PAYMENT_CSS_URL','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK",GETPOST('ONLINE_PAYMENT_OK','alpha'),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM",GETPOST('ONLINE_PAYMENT_MESSAGE_FORM','alpha'),'chaine',0,'',$conf->entity); + if (! $result > 0) $error++; + $result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK",GETPOST('ONLINE_PAYMENT_MESSAGE_OK','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; - $result=dolibarr_set_const($db, "ONLINE_PAYMENT_KO",GETPOST('ONLINE_PAYMENT_KO','alpha'),'chaine',0,'',$conf->entity); + $result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO",GETPOST('ONLINE_PAYMENT_MESSAGE_KO','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; $result=dolibarr_set_const($db, "ONLINE_PAYMENT_SENDEMAIL",GETPOST('ONLINE_PAYMENT_SENDEMAIL'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; @@ -182,6 +184,12 @@ print '
'.$langs->trans("Example").': http://mysite/mycss.css'; print ''; +print ''; +print $langs->trans("MessageForm").''; +$doleditor=new DolEditor('ONLINE_PAYMENT_MESSAGE_FORM',$conf->global->ONLINE_PAYMENT_MESSAGE_FORM,'',100,'dolibarr_details','In',false,true,true,ROWS_2,'90%'); +$doleditor->Create(); +print ''; + print ''; print $langs->trans("MessageOK").''; $doleditor=new DolEditor('ONLINE_PAYMENT_MESSAGE_OK',$conf->global->ONLINE_PAYMENT_MESSAGE_OK,'',100,'dolibarr_details','In',false,true,true,ROWS_2,'90%'); diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index 9dadd4ff970..0b11b34c872 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -64,6 +64,8 @@ if ($action == 'setvalue' && $user->admin) if (! $result > 0) $error++; $result=dolibarr_set_const($db, "PAYPAL_ADD_PAYMENT_URL",GETPOST('PAYPAL_ADD_PAYMENT_URL','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; + $result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM",GETPOST('ONLINE_PAYMENT_MESSAGE_FORM'),'chaine',0,'',$conf->entity); + if (! $result > 0) $error++; $result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK",GETPOST('ONLINE_PAYMENT_MESSAGE_OK'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; $result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO",GETPOST('ONLINE_PAYMENT_MESSAGE_KO'),'chaine',0,'',$conf->entity); @@ -220,6 +222,13 @@ print $form->selectyesno("PAYPAL_ADD_PAYMENT_URL",$conf->global->PAYPAL_ADD_PAYM print ''; +print ''; +print $langs->trans("MessageForm").''; +$doleditor=new DolEditor('ONLINE_PAYMENT_MESSAGE_FORM',$conf->global->ONLINE_PAYMENT_MESSAGE_FORM,'',100,'dolibarr_details','In',false,true,true,ROWS_4,'90%'); +$doleditor->Create(); +print ''; + + print ''; print $langs->trans("MessageOK").''; $doleditor=new DolEditor('ONLINE_PAYMENT_MESSAGE_OK',$conf->global->ONLINE_PAYMENT_MESSAGE_OK,'',100,'dolibarr_details','In',false,true,true,ROWS_4,'90%'); diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 0055bc0a8ab..4abf52fe0e0 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -59,8 +59,10 @@ if ($action == 'setvalue' && $user->admin) if (! $result > 0) $error++; $result=dolibarr_set_const($db, "ONLINE_PAYMENT_CSS_URL",GETPOST('ONLINE_PAYMENT_CSS_URL','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; + $result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_FORM",GETPOST('ONLINE_PAYMENT_MESSAGE_FORM','alpha'),'chaine',0,'',$conf->entity); + if (! $result > 0) $error++; $result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_OK",GETPOST('ONLINE_PAYMENT_MESSAGE_OK','alpha'),'chaine',0,'',$conf->entity); - if (! $result > 0) $error++; + if (! $result > 0) $error++; $result=dolibarr_set_const($db, "ONLINE_PAYMENT_MESSAGE_KO",GETPOST('ONLINE_PAYMENT_MESSAGE_KO','alpha'),'chaine',0,'',$conf->entity); if (! $result > 0) $error++; $result=dolibarr_set_const($db, "ONLINE_PAYMENT_SENDEMAIL",GETPOST('ONLINE_PAYMENT_SENDEMAIL'),'chaine',0,'',$conf->entity); @@ -194,6 +196,12 @@ print ''; +print ''; +print $langs->trans("MessageForm").''; +$doleditor=new DolEditor('ONLINE_PAYMENT_MESSAGE_FORM',$conf->global->ONLINE_PAYMENT_MESSAGE_FORM,'',100,'dolibarr_details','In',false,true,true,ROWS_2,'90%'); +$doleditor->Create(); +print ''; + print ''; print $langs->trans("MessageOK").''; $doleditor=new DolEditor('ONLINE_PAYMENT_MESSAGE_OK',$conf->global->ONLINE_PAYMENT_MESSAGE_OK,'',100,'dolibarr_details','In',false,true,true,ROWS_2,'90%');