From 14b660f97d1c9e0178a2bfcee956518751f581ae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@users.sourceforge.net> 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 '<br>'; print '<table class="border" cellspacing="0" cellpadding="3">'; print '<tr class="liste_titre"><td>'.$langs->trans("Description").'</td><td>'.$langs->trans("URL").'</td></tr>'; // 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 '<tr><td>'.$langs->trans("BlankSubscriptionForm").'</td><td><a target="_blank" href="'.DOL_URL_ROOT.'/public/members/new.php'.'">'.$firstpart.DOL_URL_ROOT.'/public/members/new.php'.'</a></td></tr>'; -print '<tr><td>'.$langs->trans("PublicMemberList").'</td><td><a target="_blank" href="'.DOL_URL_ROOT.'/public/members/public_list.php'.'">'.$firstpart.DOL_URL_ROOT.'/public/members/public_list.php'.'</a></td></tr>'; -print '<tr><td>'.$langs->trans("PublicMemberCard").'</td><td>'.$firstpart.DOL_URL_ROOT.'/public/members/public_card.php?id=xxx'.'</td></tr>'; +$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',$dolibarr_main_url_root); +print '<tr><td>'.$langs->trans("BlankSubscriptionForm").'</td><td><a target="_blank" href="'.DOL_URL_ROOT.'/public/members/new.php'.'">'.$urlwithouturlroot.DOL_URL_ROOT.'/public/members/new.php'.'</a></td></tr>'; +print '<tr><td>'.$langs->trans("PublicMemberList").'</td><td><a target="_blank" href="'.DOL_URL_ROOT.'/public/members/public_list.php'.'">'.$urlwithouturlroot.DOL_URL_ROOT.'/public/members/public_list.php'.'</a></td></tr>'; +print '<tr><td>'.$langs->trans("PublicMemberCard").'</td><td>'.$urlwithouturlroot.DOL_URL_ROOT.'/public/members/public_card.php?id=xxx'.'</td></tr>'; print '</table>'; 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 '<a href="'.$dolibarr_main_url_root .'/admin/index.php?mainmenu=home&leftmenu=setup'.(isset($_POST["login"])?'&username='.urlencode($_POST["login"]):'').'">'; -//print '<center><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.png" alt="Dolibarr logo"></center><br>'; - if ($mesg) print $mesg.'<br>'; 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 '<br><br>'; print '<u>'.$langs->trans("FollowingUrlAreAvailableToMakePayments").':</u><br>'; // 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 '<br>'; print img_picto('','puce.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount",$servicename).':<br>'; -print '<b>'.$firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=<i>9.99</i>&tag=<i>your_free_tag</i></b>'."<br>\n"; +print '<b>'.$urlwithouturlroot.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=<i>9.99</i>&tag=<i>your_free_tag</i></b>'."<br>\n"; print '<br>'; if ($conf->commande->enabled) { print img_picto('','puce.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnOrder",$servicename).':<br>'; - print '<b>'.$firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=order&ref=<i>order_ref</i></b>'."<br>\n"; + print '<b>'.$urlwithouturlroot.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=order&ref=<i>order_ref</i></b>'."<br>\n"; print '<br>'; } if ($conf->facture->enabled) { print img_picto('','puce.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnInvoice",$servicename).':<br>'; - print '<b>'.$firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=invoice&ref=<i>invoice_ref</i></b>'."<br>\n"; + print '<b>'.$urlwithouturlroot.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=invoice&ref=<i>invoice_ref</i></b>'."<br>\n"; // print $langs->trans("SetupPayBoxToHavePaymentCreatedAutomatically",$langs->transnoentitiesnoconv("FeatureNotYetAvailable"))."<br>\n"; print '<br>'; } if ($conf->contrat->enabled) { print img_picto('','puce.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnContractLine",$servicename).':<br>'; - print '<b>'.$firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=contractline&ref=<i>contractline_ref</i></b>'."<br>\n"; + print '<b>'.$urlwithouturlroot.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=contractline&ref=<i>contractline_ref</i></b>'."<br>\n"; print '<br>'; } if ($conf->adherent->enabled) { print img_picto('','puce.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnMemberSubscription",$servicename).':<br>'; - print '<b>'.$firstpart.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=membersubscription&ref=<i>member_ref</i></b>'."<br>\n"; + print '<b>'.$urlwithouturlroot.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=membersubscription&ref=<i>member_ref</i></b>'."<br>\n"; print '<br>'; } 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 '<br>'.$mesg; print '<br><br>'; // 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 '<u>'.$langs->trans("WSDLCanBeDownloadedHere").':</u><br>'; -$url=$firstpart.DOL_URL_ROOT.'/webservices/server.php?wsdl'; +$url=$urlwithouturlroot.DOL_URL_ROOT.'/webservices/server.php?wsdl'; print img_picto('','puce.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n"; print '<br>'; print '<u>'.$langs->trans("EndPointIs").':</u><br>'; -$url=$firstpart.DOL_URL_ROOT.'/webservices/server.php'; +$url=$urlwithouturlroot.DOL_URL_ROOT.'/webservices/server.php'; print img_picto('','puce.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n"; print '<br>'; -- GitLab