From af8f1a0e4920b2283a1c95f47d7ff8b3f1748fa7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 13 Jul 2011 11:14:43 +0000 Subject: [PATCH] Fix: Message for payment forms --- htdocs/public/members/new.php | 31 +++++++++++++++++++---------- htdocs/public/paybox/newpayment.php | 12 +++-------- htdocs/public/paypal/newpayment.php | 11 +++------- 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 035e8848da4..d461137eaf6 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -22,7 +22,7 @@ * \file htdocs/public/members/new.php * \ingroup member * \brief Example of form to add a new member - * \version $Id: new.php,v 1.40 2011/07/13 10:22:54 eldy Exp $ + * \version $Id: new.php,v 1.41 2011/07/13 11:14:43 eldy Exp $ * * Note that you can add following constant to change behaviour of page * MEMBER_NEWFORM_AMOUNT Default amount for autosubscribe form @@ -182,13 +182,18 @@ if ($action == 'add') $langs->load("errors"); $errmsg .= $langs->trans("ErrorBadDateFormat")."
\n"; } - if (isset($public)) + if (! empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { - $public=1; - }else{ - $public=0; + if (GETPOST('budget') <= 0) + { + $error+=1; + $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("TurnoverOrBudget"))."
\n"; + } } + if (isset($public)) $public=1; + else $public=0; + if (! $error) { // email a peu pres correct et le login n'existe pas @@ -232,20 +237,24 @@ if ($action == 'add') } if ($backtopage) $urlback=$backtopage; - else if ($conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION) $urlback=$conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION; + else if ($conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION) + { + $urlback=$conf->global->MEMBER_URL_REDIRECT_SUBSCRIPTION; + // TODO Make replacement of __AMOUNT__, etc... + } else $urlback=$_SERVER["PHP_SELF"]."?action=added"; if (! empty($conf->global->MEMBER_NEWFORM_PAYONLINE)) { if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paybox') { - $urlback=DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?source=membersubscription&ref='.$adh->ref; + $urlback=DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?from=membernewform&source=membersubscription&ref='.$adh->ref; if (price2num(GETPOST('amount'))) $urlback.='&amount='.price2num(GETPOST('amount')); if (GETPOST('email')) $urlback.='&email='.urlencode(GETPOST('email')); } else if ($conf->global->MEMBER_NEWFORM_PAYONLINE == 'paypal') { - $urlback=DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?source=membersubscription&ref='.$adh->ref; + $urlback=DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?from=membernewform&source=membersubscription&ref='.$adh->ref; if (price2num(GETPOST('amount'))) $urlback.='&amount='.price2num(GETPOST('amount')); if (GETPOST('email')) $urlback.='&email='.urlencode(GETPOST('email')); } @@ -280,7 +289,7 @@ if ($action == 'added') print $langs->trans("NewMemberbyWeb"); print ''; - llxFooterVierge('$Date: 2011/07/13 10:22:54 $ - $Revision: 1.40 $'); + llxFooterVierge('$Date: 2011/07/13 11:14:43 $ - $Revision: 1.41 $'); exit; } @@ -450,7 +459,7 @@ print ''."\n"; if (! empty($conf->global->MEMBER_NEWFORM_DOLIBARRTURNOVER)) { $arraybudget=array('50'=>'<= 100 000','100'=>'<= 200 000','200'=>'<= 500 000','400'=>'<= 1 500 000','750'=>'<= 3 000 000','1500'=>'<= 5 000 000','2000'=>'5 000 000+'); - print ''.$langs->trans("TurnoverOrBudget").''; + print ''.$langs->trans("TurnoverOrBudget").' *'; print $html->select_array('budget', $arraybudget, GETPOST('budget'), 1); print ' € or $'; @@ -528,5 +537,5 @@ print "
\n"; $db->close(); -llxFooterVierge('$Date: 2011/07/13 10:22:54 $ - $Revision: 1.40 $'); +llxFooterVierge('$Date: 2011/07/13 11:14:43 $ - $Revision: 1.41 $'); ?> diff --git a/htdocs/public/paybox/newpayment.php b/htdocs/public/paybox/newpayment.php index 9d405438673..fdec201c31d 100644 --- a/htdocs/public/paybox/newpayment.php +++ b/htdocs/public/paybox/newpayment.php @@ -23,7 +23,7 @@ * \ingroup paybox * \brief File to offer a way to make a payment for a particular Dolibarr entity * \author Laurent Destailleur - * \version $Id: newpayment.php,v 1.60 2011/07/13 12:03:30 eldy Exp $ + * \version $Id: newpayment.php,v 1.57 2011/07/13 11:14:43 eldy Exp $ */ define("NOLOGIN",1); // This means this output page does not require to be logged. @@ -188,13 +188,7 @@ if ($urllogo) // Output introduction text $text=''; -if (! empty($conf->global->PAYBOX_NEWFORM_TEXT)) -{ - $langs->load("members"); - if (preg_match('/^\((.*)\)$/',$conf->global->PAYBOX_NEWFORM_TEXT,$reg)) $text.=$langs->trans($reg[1])."
\n"; - else $text.=$conf->global->PAYBOX_NEWFORM_TEXT."
\n"; - $text='
'.$text.'
'."\n"; -} +if (! empty($conf->global->PAYBOX_NEWMEMBER_TEXT)) $text.=$langs->trans($conf->global->PAYBOX_NEWMEMBER_TEXT)."
\n"; if (empty($text)) { $text.='
'.$langs->trans("WelcomeOnPaymentPage").'
'."\n"; @@ -729,5 +723,5 @@ html_print_paybox_footer($mysoc,$langs); $db->close(); -llxFooterPayBox('$Date: 2011/07/13 12:03:30 $ - $Revision: 1.60 $'); +llxFooterPayBox('$Date: 2011/07/13 11:14:43 $ - $Revision: 1.57 $'); ?> diff --git a/htdocs/public/paypal/newpayment.php b/htdocs/public/paypal/newpayment.php index 5215b3f9924..82fd23583a6 100755 --- a/htdocs/public/paypal/newpayment.php +++ b/htdocs/public/paypal/newpayment.php @@ -23,7 +23,7 @@ * \ingroup paypal * \brief File to offer a way to make a payment for a particular Dolibarr entity * \author Laurent Destailleur - * \version $Id: newpayment.php,v 1.24 2011/07/13 12:00:18 eldy Exp $ + * \version $Id: newpayment.php,v 1.22 2011/07/13 11:14:43 eldy Exp $ */ define("NOLOGIN",1); // This means this output page does not require to be logged. @@ -282,12 +282,7 @@ if ($urllogo) // Output introduction text $text=''; -if (! empty($conf->global->PAYPAL_NEWFORM_TEXT)) -{ - $langs->load("members"); - if (preg_match('/^\((.*)\)$/',$conf->global->PAYPAL_NEWFORM_TEXT,$reg)) $text.=$langs->trans($reg[1])."
\n"; - else $text.=$conf->global->PAYPAL_NEWFORM_TEXT."
\n"; -} +if (! empty($conf->global->PAYPAL_NEWMEMBER_TEXT)) $text.=$langs->trans($conf->global->PAYPAL_NEWMEMBER_TEXT)."
\n"; if (empty($text)) { $text.='
'.$langs->trans("WelcomeOnPaymentPage").'
'."\n"; @@ -946,5 +941,5 @@ html_print_paypal_footer($mysoc,$langs); $db->close(); -llxFooterPaypal('$Date: 2011/07/13 12:00:18 $ - $Revision: 1.24 $'); +llxFooterPaypal('$Date: 2011/07/13 11:14:43 $ - $Revision: 1.22 $'); ?>