From 14b660f97d1c9e0178a2bfcee956518751f581ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 20 Feb 2010 12:31:11 +0000 Subject: [PATCH] Qual: Uniformise code --- htdocs/adherents/public.php | 10 ++++------ htdocs/admin/index.php | 3 --- htdocs/admin/paybox.php | 13 ++++++------- htdocs/admin/webservices.php | 7 +++---- 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/htdocs/adherents/public.php b/htdocs/adherents/public.php index 3fde848cbef..20088ad11ec 100644 --- a/htdocs/adherents/public.php +++ b/htdocs/adherents/public.php @@ -48,12 +48,10 @@ print '
'; print ''; print ''; // Should work with DOL_URL_ROOT='' or DOL_URL_ROOT='/dolibarr' -$firstpart=$dolibarr_main_url_root; -$regex='/'.DOL_URL_ROOT.'$/i'; -$firstpart=preg_replace($regex,'',$firstpart); -print ''; -print ''; -print ''; +$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',$dolibarr_main_url_root); +print ''; +print ''; +print ''; print '
'.$langs->trans("Description").''.$langs->trans("URL").'
'.$langs->trans("BlankSubscriptionForm").''.$firstpart.DOL_URL_ROOT.'/public/members/new.php'.'
'.$langs->trans("PublicMemberList").''.$firstpart.DOL_URL_ROOT.'/public/members/public_list.php'.'
'.$langs->trans("PublicMemberCard").''.$firstpart.DOL_URL_ROOT.'/public/members/public_card.php?id=xxx'.'
'.$langs->trans("BlankSubscriptionForm").''.$urlwithouturlroot.DOL_URL_ROOT.'/public/members/new.php'.'
'.$langs->trans("PublicMemberList").''.$urlwithouturlroot.DOL_URL_ROOT.'/public/members/public_list.php'.'
'.$langs->trans("PublicMemberCard").''.$urlwithouturlroot.DOL_URL_ROOT.'/public/members/public_card.php?id=xxx'.'
'; diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index 9d07c28d028..4b5a914998a 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -46,9 +46,6 @@ $form = new Form($db); print_fiche_titre($langs->trans("SetupArea"),'','setup'); -//print ''; -//print '
Dolibarr logo

'; - if ($mesg) print $mesg.'
'; print $langs->trans("SetupDescription1").' '; diff --git a/htdocs/admin/paybox.php b/htdocs/admin/paybox.php index 0ca81c631a6..012b7e02851 100644 --- a/htdocs/admin/paybox.php +++ b/htdocs/admin/paybox.php @@ -159,35 +159,34 @@ print '

'; print ''.$langs->trans("FollowingUrlAreAvailableToMakePayments").':
'; // Should work with DOL_URL_ROOT='' or DOL_URL_ROOT='/dolibarr' -$firstpart=$dolibarr_main_url_root; -$firstpart=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',$firstpart); +$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',$dolibarr_main_url_root); print '
'; print img_picto('','puce.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount",$servicename).':
'; -print ''.$firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=9.99&tag=your_free_tag'."
\n"; +print ''.$urlwithouturlroot.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=9.99&tag=your_free_tag'."
\n"; print '
'; if ($conf->commande->enabled) { print img_picto('','puce.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnOrder",$servicename).':
'; - print ''.$firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=order&ref=order_ref'."
\n"; + print ''.$urlwithouturlroot.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=order&ref=order_ref'."
\n"; print '
'; } if ($conf->facture->enabled) { print img_picto('','puce.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnInvoice",$servicename).':
'; - print ''.$firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=invoice&ref=invoice_ref'."
\n"; + print ''.$urlwithouturlroot.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=invoice&ref=invoice_ref'."
\n"; // print $langs->trans("SetupPayBoxToHavePaymentCreatedAutomatically",$langs->transnoentitiesnoconv("FeatureNotYetAvailable"))."
\n"; print '
'; } if ($conf->contrat->enabled) { print img_picto('','puce.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnContractLine",$servicename).':
'; - print ''.$firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=contractline&ref=contractline_ref'."
\n"; + print ''.$urlwithouturlroot.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=contractline&ref=contractline_ref'."
\n"; print '
'; } if ($conf->adherent->enabled) { print img_picto('','puce.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnMemberSubscription",$servicename).':
'; - print ''.$firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=membersubscription&ref=member_ref'."
\n"; + print ''.$urlwithouturlroot.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=membersubscription&ref=member_ref'."
\n"; print '
'; } print $langs->trans("YouCanAddTagOnUrl"); diff --git a/htdocs/admin/webservices.php b/htdocs/admin/webservices.php index c78271a344e..62053f821b3 100644 --- a/htdocs/admin/webservices.php +++ b/htdocs/admin/webservices.php @@ -64,16 +64,15 @@ if ($mesg) print '
'.$mesg; print '

'; // Should work with DOL_URL_ROOT='' or DOL_URL_ROOT='/dolibarr' -$firstpart=$dolibarr_main_url_root; -$firstpart=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',$firstpart); +$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',$dolibarr_main_url_root); print ''.$langs->trans("WSDLCanBeDownloadedHere").':
'; -$url=$firstpart.DOL_URL_ROOT.'/webservices/server.php?wsdl'; +$url=$urlwithouturlroot.DOL_URL_ROOT.'/webservices/server.php?wsdl'; print img_picto('','puce.png').' '.'
'.$url."
\n"; print '
'; print ''.$langs->trans("EndPointIs").':
'; -$url=$firstpart.DOL_URL_ROOT.'/webservices/server.php'; +$url=$urlwithouturlroot.DOL_URL_ROOT.'/webservices/server.php'; print img_picto('','puce.png').' '.''.$url."
\n"; print '
';