Now dolibarr_main_url_root is detected automatically. Value in conf file is used only to forge links to show for external access.
This commit is contained in:
parent
6b42ec4a37
commit
d31dbaf85a
@ -47,11 +47,9 @@ print '<br>';
|
|||||||
|
|
||||||
print '<table class="border" cellspacing="0" cellpadding="3">';
|
print '<table class="border" cellspacing="0" cellpadding="3">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Description").'</td><td>'.$langs->trans("URL").'</td></tr>';
|
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'
|
print '<tr><td>'.$langs->trans("BlankSubscriptionForm").'</td><td>'.img_picto('','object_globe.png').' '.'<a target="_blank" href="'.DOL_URL_ROOT.'/public/members/new.php'.'">'.DOL_MAIN_URL_ROOT.'/public/members/new.php'.'</a></td></tr>';
|
||||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',$dolibarr_main_url_root);
|
print '<tr><td>'.$langs->trans("PublicMemberList").'</td><td>'.img_picto('','object_globe.png').' '.'<a target="_blank" href="'.DOL_URL_ROOT.'/public/members/public_list.php'.'">'.DOL_MAIN_URL_ROOT.'/public/members/public_list.php'.'</a></td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("BlankSubscriptionForm").'</td><td>'.img_picto('','object_globe.png').' '.'<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("PublicMemberCard").'</td><td>'.img_picto('','object_globe.png').' '.DOL_MAIN_URL_ROOT.'/public/members/public_card.php?id=xxx'.'</td></tr>';
|
||||||
print '<tr><td>'.$langs->trans("PublicMemberList").'</td><td>'.img_picto('','object_globe.png').' '.'<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>'.img_picto('','object_globe.png').' '.$urlwithouturlroot.DOL_URL_ROOT.'/public/members/public_card.php?id=xxx'.'</td></tr>';
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -129,14 +129,13 @@ print "<br>";
|
|||||||
|
|
||||||
// Show message
|
// Show message
|
||||||
$message='';
|
$message='';
|
||||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',$dolibarr_main_url_root);
|
$urlvcal='<a href="'.DOL_MAIN_URL_ROOT.'/public/agenda/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'...').'" target="_blank">'.DOL_MAIN_URL_ROOT.'/public/agenda/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'</a>';
|
||||||
$urlvcal='<a href="'.$urlwithouturlroot.DOL_URL_ROOT.'/public/agenda/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'...').'" target="_blank">'.$urlwithouturlroot.DOL_URL_ROOT.'/public/agenda/agendaexport.php?format=vcal&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'</a>';
|
|
||||||
$message.=img_picto('','object_globe.png').' '.$langs->trans("WebCalUrlForVCalExport",'vcal',$urlvcal);
|
$message.=img_picto('','object_globe.png').' '.$langs->trans("WebCalUrlForVCalExport",'vcal',$urlvcal);
|
||||||
$message.='<br>';
|
$message.='<br>';
|
||||||
$urlical='<a href="'.$urlwithouturlroot.DOL_URL_ROOT.'/public/agenda/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'...').'" target="_blank">'.$urlwithouturlroot.DOL_URL_ROOT.'/public/agenda/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'</a>';
|
$urlical='<a href="'.DOL_MAIN_URL_ROOT.'/public/agenda/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'...').'" target="_blank">'.DOL_MAIN_URL_ROOT.'/public/agenda/agendaexport.php?format=ical&type=event&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'</a>';
|
||||||
$message.=img_picto('','object_globe.png').' '.$langs->trans("WebCalUrlForVCalExport",'ical/ics',$urlical);
|
$message.=img_picto('','object_globe.png').' '.$langs->trans("WebCalUrlForVCalExport",'ical/ics',$urlical);
|
||||||
$message.='<br>';
|
$message.='<br>';
|
||||||
$urlrss='<a href="'.$urlwithouturlroot.DOL_URL_ROOT.'/public/agenda/agendaexport.php?format=rss&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'...').'" target="_blank">'.$urlwithouturlroot.DOL_URL_ROOT.'/public/agenda/agendaexport.php?format=rss&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'</a>';
|
$urlrss='<a href="'.DOL_MAIN_URL_ROOT.'/public/agenda/agendaexport.php?format=rss&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'...').'" target="_blank">'.DOL_MAIN_URL_ROOT.'/public/agenda/agendaexport.php?format=rss&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY):'KEYNOTDEFINED').'</a>';
|
||||||
$message.=img_picto('','object_globe.png').' '.$langs->trans("WebCalUrlForVCalExport",'rss',$urlrss);
|
$message.=img_picto('','object_globe.png').' '.$langs->trans("WebCalUrlForVCalExport",'rss',$urlrss);
|
||||||
$message.='<br>';
|
$message.='<br>';
|
||||||
$message.='<br>';
|
$message.='<br>';
|
||||||
|
|||||||
@ -133,6 +133,8 @@ foreach($configfileparameters as $key)
|
|||||||
// Value
|
// Value
|
||||||
print "<td>";
|
print "<td>";
|
||||||
if ($key == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$key});
|
if ($key == 'dolibarr_main_db_pass') print preg_replace('/./i','*',${$key});
|
||||||
|
else if ($key == 'dolibarr_main_url_root' && preg_match('/__auto__/',${$key})) print ${$key}.' => '.constant('DOL_MAIN_URL_ROOT');
|
||||||
|
else if ($key == 'dolibarr_main_url_root_alt' && preg_match('/__auto__/',${$key})) print ${$key}.' => '.constant('DOL_MAIN_URL_ROOT_ALT');
|
||||||
else print ${$key};
|
else print ${$key};
|
||||||
print "</td>";
|
print "</td>";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -754,9 +754,8 @@ class ActionComm extends CommonObject
|
|||||||
$event['location']=$langs->convToOutputCharset($obj->location);
|
$event['location']=$langs->convToOutputCharset($obj->location);
|
||||||
$event['transparency']='TRANSPARENT'; // OPAQUE (busy) or TRANSPARENT (not busy)
|
$event['transparency']='TRANSPARENT'; // OPAQUE (busy) or TRANSPARENT (not busy)
|
||||||
$event['category']=$langs->convToOutputCharset($obj->libelle); // libelle type action
|
$event['category']=$langs->convToOutputCharset($obj->libelle); // libelle type action
|
||||||
$url=$dolibarr_main_url_root;
|
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',$dolibarr_main_url_root);
|
||||||
if (! preg_match('/\/$/',$url)) $url.='/';
|
$url=$urlwithouturlroot.DOL_URL_ROOT.'/comm/action/fiche.php?id='.$obj->id;
|
||||||
$url.='comm/action/fiche.php?id='.$obj->id;
|
|
||||||
$event['url']=$url;
|
$event['url']=$url;
|
||||||
$event['created']=$this->db->jdate($obj->datec);
|
$event['created']=$this->db->jdate($obj->datec);
|
||||||
$event['modified']=$this->db->jdate($obj->datem);
|
$event['modified']=$this->db->jdate($obj->datem);
|
||||||
|
|||||||
@ -118,24 +118,44 @@ if (! empty($dolibarr_main_document_root_alt))
|
|||||||
{
|
{
|
||||||
define('DOL_DOCUMENT_ROOT_ALT', $dolibarr_main_document_root_alt); // Filesystem paths to alternate core php (alternate htdocs)
|
define('DOL_DOCUMENT_ROOT_ALT', $dolibarr_main_document_root_alt); // Filesystem paths to alternate core php (alternate htdocs)
|
||||||
}
|
}
|
||||||
// If dolibarr_main_url_root = auto (Hidden feature for developers only), we try to forge it.
|
// Define DOL_MAIN_URL_ROOT and DOL_URL_ROOT
|
||||||
if ($dolibarr_main_url_root == 'auto' && ! empty($_SERVER["SCRIPT_URL"]) && ! empty($_SERVER["SCRIPT_URI"]))
|
$tmp=$dolibarr_main_url_root;
|
||||||
|
if (1 == 1) // Use auto forge url.
|
||||||
{
|
{
|
||||||
$dolibarr_main_url_root=str_replace($_SERVER["SCRIPT_URL"],'',$_SERVER["SCRIPT_URI"]);
|
if (! empty($_SERVER["SCRIPT_URL"]) && ! empty($_SERVER["SCRIPT_URI"]))
|
||||||
|
{
|
||||||
|
$tmp=str_replace($_SERVER["SCRIPT_URL"],'',$_SERVER["SCRIPT_URI"]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//print realpath($dolibarr_main_document_root).'-'.realpath($_SERVER["DOCUMENT_ROOT"]).'<br>';
|
||||||
|
//print $dolibarr_main_document_root.'-'.$_SERVER["DOCUMENT_ROOT"].'<br>';
|
||||||
|
$tmp1=realpath($dolibarr_main_document_root);
|
||||||
|
$tmp2=realpath($_SERVER["DOCUMENT_ROOT"]);
|
||||||
|
$pos=strpos($tmp1,$tmp2);
|
||||||
|
if ($pos !== false && $pos == 0) $tmp3=str_replace($tmp2,'',$tmp1);
|
||||||
|
else $tmp3=str_replace($_SERVER["DOCUMENT_ROOT"],'',$dolibarr_main_document_root);
|
||||||
|
$tmp='http'.((empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != 'on')?'':'s').'://'.$_SERVER["SERVER_NAME"].((empty($_SERVER["SERVER_PORT"])||$_SERVER["SERVER_PORT"]==80)?'':':'.$_SERVER["SERVER_PORT"]).($tmp3?(preg_match('/^\//',$tmp3)?'':'/').$tmp3:'');
|
||||||
|
//print "tmp1=".$tmp1." tmp2=".$tmp2." tmp3=".$tmp3." tmp=".$tmp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
define('DOL_MAIN_URL_ROOT', $dolibarr_main_url_root); // URL absolute root
|
if (! empty($dolibarr_main_force_https)) $tmp=preg_replace('/^http:/i','https:',$tmp);
|
||||||
|
define('DOL_MAIN_URL_ROOT', $tmp); // URL absolute root (https://sss/dolibarr, ...)
|
||||||
$uri=preg_replace('/^http(s?):\/\//i','',constant('DOL_MAIN_URL_ROOT')); // $uri contains url without http*
|
$uri=preg_replace('/^http(s?):\/\//i','',constant('DOL_MAIN_URL_ROOT')); // $uri contains url without http*
|
||||||
$suburi = strstr($uri, '/'); // $suburi contains url without domain
|
$suburi = strstr($uri, '/'); // $suburi contains url without domain
|
||||||
if ($suburi == '/') $suburi = ''; // If $suburi is /, it is now ''
|
if ($suburi == '/') $suburi = ''; // If $suburi is /, it is now ''
|
||||||
define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...)
|
define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...)
|
||||||
|
// Define DOL_MAIN_URL_ROOT_ALT and DOL_URL_ROOT_ALT
|
||||||
if (! empty($dolibarr_main_url_root_alt))
|
if (! empty($dolibarr_main_url_root_alt))
|
||||||
{
|
{
|
||||||
define('DOL_MAIN_URL_ROOT_ALT', $dolibarr_main_url_root_alt); // URL absolute root
|
$tmp_alt=$tmp.str_replace($dolibarr_main_url_root,'',$dolibarr_main_url_root_alt);
|
||||||
|
define('DOL_MAIN_URL_ROOT_ALT', $tmp_alt); // URL absolute root (https://sss/dolibarr/custom, ...)
|
||||||
$uri=preg_replace('/^http(s?):\/\//i','',constant('DOL_MAIN_URL_ROOT_ALT')); // $uri contains url without http*
|
$uri=preg_replace('/^http(s?):\/\//i','',constant('DOL_MAIN_URL_ROOT_ALT')); // $uri contains url without http*
|
||||||
$suburi = strstr($uri, '/'); // $suburi contains url without domain
|
$suburi = strstr($uri, '/'); // $suburi contains url without domain
|
||||||
if ($suburi == '/') $suburi = ''; // If $suburi is /, it is now ''
|
if ($suburi == '/') $suburi = ''; // If $suburi is /, it is now ''
|
||||||
define('DOL_URL_ROOT_ALT', $suburi); // URL relative root ('', '/dolibarr', ...)
|
define('DOL_URL_ROOT_ALT', $suburi); // URL relative root ('', '/dolibarr/custom', ...)
|
||||||
}
|
}
|
||||||
|
// Define DOL_URL_ROOT_FULL_STATIC
|
||||||
if (! empty($dolibarr_main_url_root_static)) define('DOL_URL_ROOT_FULL_STATIC', $dolibarr_main_url_root_static); // Used to put static images on another domain
|
if (! empty($dolibarr_main_url_root_static)) define('DOL_URL_ROOT_FULL_STATIC', $dolibarr_main_url_root_static); // Used to put static images on another domain
|
||||||
// Define prefix
|
// Define prefix
|
||||||
if (isset($_SERVER["LLX_DBNAME"])) $dolibarr_main_db_prefix=$_SERVER["LLX_DBNAME"];
|
if (isset($_SERVER["LLX_DBNAME"])) $dolibarr_main_db_prefix=$_SERVER["LLX_DBNAME"];
|
||||||
|
|||||||
@ -317,9 +317,8 @@ function build_rssfile($format='rss',$title,$desc,$events_array,$outputfile,$fil
|
|||||||
'<lastBuildDate>'.$date.'</lastBuildDate>'."\n".
|
'<lastBuildDate>'.$date.'</lastBuildDate>'."\n".
|
||||||
'<generator>Dolibarr</generator>'."\n";
|
'<generator>Dolibarr</generator>'."\n";
|
||||||
|
|
||||||
$url=$dolibarr_main_url_root;
|
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',$dolibarr_main_url_root);
|
||||||
if (! preg_match('/\/$/',$url)) $url.='/';
|
$url=$urlwithouturlroot.DOL_URL_ROOT.'/public/agenda/agendaexport.php?format=rss&exportkey='.urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY);
|
||||||
$url.='public/agenda/agendaexport.php?format=rss&exportkey='.urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY);
|
|
||||||
$html.='<link><![CDATA['.$url.']]></link>'."\n";
|
$html.='<link><![CDATA['.$url.']]></link>'."\n";
|
||||||
// '<managingEditor>editor@example.com</managingEditor>'."\n"
|
// '<managingEditor>editor@example.com</managingEditor>'."\n"
|
||||||
// '<webMaster>webmaster@example.com</webMaster>'."\n"
|
// '<webMaster>webmaster@example.com</webMaster>'."\n"
|
||||||
|
|||||||
@ -184,9 +184,7 @@ if (! empty($conf->file->main_force_https))
|
|||||||
// $_SERVER["HTTPS"] is 'on' when link is https, otherwise $_SERVER["HTTPS"] is empty or 'off'
|
// $_SERVER["HTTPS"] is 'on' when link is https, otherwise $_SERVER["HTTPS"] is empty or 'off'
|
||||||
if (empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != 'on') // If link is http
|
if (empty($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != 'on') // If link is http
|
||||||
{
|
{
|
||||||
$uri=preg_replace('/^http(s?):\/\//i','',$dolibarr_main_url_root);
|
$newurl=preg_replace('/^http:/i','https:',DOL_MAIN_URL_ROOT).$_SERVER["REQUEST_URI"];
|
||||||
$val=explode('/',$uri); // $val[0] contains domain name and port
|
|
||||||
$newurl='https://'.$val[0].$_SERVER["REQUEST_URI"];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -183,30 +183,28 @@ print '</table></form>';
|
|||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
|
|
||||||
print '<u>'.$langs->trans("FollowingUrlAreAvailableToMakePayments").':</u><br>';
|
print '<u>'.$langs->trans("FollowingUrlAreAvailableToMakePayments").':</u><br>';
|
||||||
// Should work with DOL_URL_ROOT='' or DOL_URL_ROOT='/dolibarr'
|
|
||||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',$dolibarr_main_url_root);
|
|
||||||
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount",$servicename).':<br>';
|
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount",$servicename).':<br>';
|
||||||
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 '<b>'.DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?amount=<i>9.99</i>&tag=<i>your_free_tag</i></b>'."<br>\n";
|
||||||
if ($conf->commande->enabled)
|
if ($conf->commande->enabled)
|
||||||
{
|
{
|
||||||
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnOrder",$servicename).':<br>';
|
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnOrder",$servicename).':<br>';
|
||||||
print '<b>'.$urlwithouturlroot.DOL_URL_ROOT.'/public/paybox/newpayment.php?source=order&ref=<i>order_ref</i></b>'."<br>\n";
|
print '<b>'.DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?source=order&ref=<i>order_ref</i></b>'."<br>\n";
|
||||||
}
|
}
|
||||||
if ($conf->facture->enabled)
|
if ($conf->facture->enabled)
|
||||||
{
|
{
|
||||||
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnInvoice",$servicename).':<br>';
|
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnInvoice",$servicename).':<br>';
|
||||||
print '<b>'.$urlwithouturlroot.DOL_URL_ROOT.'/public/paybox/newpayment.php?source=invoice&ref=<i>invoice_ref</i></b>'."<br>\n";
|
print '<b>'.DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?source=invoice&ref=<i>invoice_ref</i></b>'."<br>\n";
|
||||||
// print $langs->trans("SetupPayBoxToHavePaymentCreatedAutomatically",$langs->transnoentitiesnoconv("FeatureNotYetAvailable"))."<br>\n";
|
// print $langs->trans("SetupPayBoxToHavePaymentCreatedAutomatically",$langs->transnoentitiesnoconv("FeatureNotYetAvailable"))."<br>\n";
|
||||||
}
|
}
|
||||||
if ($conf->contrat->enabled)
|
if ($conf->contrat->enabled)
|
||||||
{
|
{
|
||||||
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnContractLine",$servicename).':<br>';
|
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnContractLine",$servicename).':<br>';
|
||||||
print '<b>'.$urlwithouturlroot.DOL_URL_ROOT.'/public/paybox/newpayment.php?source=contractline&ref=<i>contractline_ref</i></b>'."<br>\n";
|
print '<b>'.DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?source=contractline&ref=<i>contractline_ref</i></b>'."<br>\n";
|
||||||
}
|
}
|
||||||
if ($conf->adherent->enabled)
|
if ($conf->adherent->enabled)
|
||||||
{
|
{
|
||||||
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnMemberSubscription",$servicename).':<br>';
|
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnMemberSubscription",$servicename).':<br>';
|
||||||
print '<b>'.$urlwithouturlroot.DOL_URL_ROOT.'/public/paybox/newpayment.php?source=membersubscription&ref=<i>member_ref</i></b>'."<br>\n";
|
print '<b>'.DOL_MAIN_URL_ROOT.'/public/paybox/newpayment.php?source=membersubscription&ref=<i>member_ref</i></b>'."<br>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<br>";
|
print "<br>";
|
||||||
|
|||||||
@ -208,30 +208,28 @@ print '<br><br>';
|
|||||||
|
|
||||||
// Url list
|
// Url list
|
||||||
print '<u>'.$langs->trans("FollowingUrlAreAvailableToMakePayments").':</u><br>';
|
print '<u>'.$langs->trans("FollowingUrlAreAvailableToMakePayments").':</u><br>';
|
||||||
// Should work with DOL_URL_ROOT='' or DOL_URL_ROOT='/dolibarr'
|
|
||||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',$dolibarr_main_url_root);
|
|
||||||
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount",$servicename).':<br>';
|
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount",$servicename).':<br>';
|
||||||
print '<b>'.$urlwithouturlroot.DOL_URL_ROOT.'/public/paypal/newpayment.php?amount=<i>9.99</i>&tag=<i>your_free_tag</i></b>'."<br>\n";
|
print '<b>'.DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?amount=<i>9.99</i>&tag=<i>your_free_tag</i></b>'."<br>\n";
|
||||||
if ($conf->commande->enabled)
|
if ($conf->commande->enabled)
|
||||||
{
|
{
|
||||||
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnOrder",$servicename).':<br>';
|
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnOrder",$servicename).':<br>';
|
||||||
print '<b>'.$urlwithouturlroot.DOL_URL_ROOT.'/public/paypal/newpayment.php?source=order&ref=<i>order_ref</i></b>'."<br>\n";
|
print '<b>'.DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?source=order&ref=<i>order_ref</i></b>'."<br>\n";
|
||||||
}
|
}
|
||||||
if ($conf->facture->enabled)
|
if ($conf->facture->enabled)
|
||||||
{
|
{
|
||||||
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnInvoice",$servicename).':<br>';
|
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnInvoice",$servicename).':<br>';
|
||||||
print '<b>'.$urlwithouturlroot.DOL_URL_ROOT.'/public/paypal/newpayment.php?source=invoice&ref=<i>invoice_ref</i></b>'."<br>\n";
|
print '<b>'.DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?source=invoice&ref=<i>invoice_ref</i></b>'."<br>\n";
|
||||||
// print $langs->trans("SetupPaypalToHavePaymentCreatedAutomatically",$langs->transnoentitiesnoconv("FeatureNotYetAvailable"))."<br>\n";
|
// print $langs->trans("SetupPaypalToHavePaymentCreatedAutomatically",$langs->transnoentitiesnoconv("FeatureNotYetAvailable"))."<br>\n";
|
||||||
}
|
}
|
||||||
if ($conf->contrat->enabled)
|
if ($conf->contrat->enabled)
|
||||||
{
|
{
|
||||||
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnContractLine",$servicename).':<br>';
|
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnContractLine",$servicename).':<br>';
|
||||||
print '<b>'.$urlwithouturlroot.DOL_URL_ROOT.'/public/paypal/newpayment.php?source=contractline&ref=<i>contractline_ref</i></b>'."<br>\n";
|
print '<b>'.DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?source=contractline&ref=<i>contractline_ref</i></b>'."<br>\n";
|
||||||
}
|
}
|
||||||
if ($conf->adherent->enabled)
|
if ($conf->adherent->enabled)
|
||||||
{
|
{
|
||||||
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnMemberSubscription",$servicename).':<br>';
|
print img_picto('','object_globe.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnMemberSubscription",$servicename).':<br>';
|
||||||
print '<b>'.$urlwithouturlroot.DOL_URL_ROOT.'/public/paypal/newpayment.php?source=membersubscription&ref=<i>member_ref</i></b>'."<br>\n";
|
print '<b>'.DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?source=membersubscription&ref=<i>member_ref</i></b>'."<br>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<br>";
|
print "<br>";
|
||||||
|
|||||||
@ -1339,7 +1339,7 @@ class User extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Define urlwithouturlroot
|
// Define urlwithouturlroot
|
||||||
if (1 == 1 && ! empty($_SERVER["HTTP_HOST"])) // Autodetect main url root
|
if (! empty($_SERVER["HTTP_HOST"])) // Autodetect main url root
|
||||||
{
|
{
|
||||||
$urlwithouturlroot='http://'.preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',$_SERVER["HTTP_HOST"]);
|
$urlwithouturlroot='http://'.preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',$_SERVER["HTTP_HOST"]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,21 +99,19 @@ if ($mesg) print '<br>'.$mesg;
|
|||||||
|
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
|
|
||||||
// Should work with DOL_URL_ROOT='' or DOL_URL_ROOT='/dolibarr'
|
|
||||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',$dolibarr_main_url_root);
|
|
||||||
|
|
||||||
// WSDL
|
// WSDL
|
||||||
print '<u>'.$langs->trans("WSDLCanBeDownloadedHere").':</u><br>';
|
print '<u>'.$langs->trans("WSDLCanBeDownloadedHere").':</u><br>';
|
||||||
$url=$urlwithouturlroot.DOL_URL_ROOT.'/webservices/server_other.php?wsdl';
|
$url=DOL_MAIN_URL_ROOT.'/webservices/server_other.php?wsdl';
|
||||||
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||||
if ($conf->societe->enabled)
|
if ($conf->societe->enabled)
|
||||||
{
|
{
|
||||||
$url=$urlwithouturlroot.DOL_URL_ROOT.'/webservices/server_thirdparty.php?wsdl';
|
$url=DOL_MAIN_URL_ROOT.'/webservices/server_thirdparty.php?wsdl';
|
||||||
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||||
}
|
}
|
||||||
if ($conf->facture->enabled)
|
if ($conf->facture->enabled)
|
||||||
{
|
{
|
||||||
$url=$urlwithouturlroot.DOL_URL_ROOT.'/webservices/server_invoice.php?wsdl';
|
$url=DOL_MAIN_URL_ROOT.'/webservices/server_invoice.php?wsdl';
|
||||||
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||||
}
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -121,16 +119,16 @@ print '<br>';
|
|||||||
|
|
||||||
// Endpoint
|
// Endpoint
|
||||||
print '<u>'.$langs->trans("EndPointIs").':</u><br>';
|
print '<u>'.$langs->trans("EndPointIs").':</u><br>';
|
||||||
$url=$urlwithouturlroot.DOL_URL_ROOT.'/webservices/server_other.php';
|
$url=DOL_MAIN_URL_ROOT.'/webservices/server_other.php';
|
||||||
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||||
if ($conf->societe->enabled)
|
if ($conf->societe->enabled)
|
||||||
{
|
{
|
||||||
$url=$urlwithouturlroot.DOL_URL_ROOT.'/webservices/server_thirdparty.php';
|
$url=DOL_MAIN_URL_ROOT.'/webservices/server_thirdparty.php';
|
||||||
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||||
}
|
}
|
||||||
if ($conf->facture->enabled)
|
if ($conf->facture->enabled)
|
||||||
{
|
{
|
||||||
$url=$urlwithouturlroot.DOL_URL_ROOT.'/webservices/server_invoice.php';
|
$url=DOL_MAIN_URL_ROOT.'/webservices/server_invoice.php';
|
||||||
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||||
}
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
@ -28,7 +28,7 @@ set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs');
|
|||||||
require_once("../master.inc.php");
|
require_once("../master.inc.php");
|
||||||
require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP
|
require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP
|
||||||
|
|
||||||
$WS_DOL_URL = $dolibarr_main_url_root.'/webservices/server_invoice.php';
|
$WS_DOL_URL = DOL_MAIN_URL_ROOT.'/webservices/server_invoice.php';
|
||||||
$WS_METHOD1 = 'getInvoice';
|
$WS_METHOD1 = 'getInvoice';
|
||||||
$WS_METHOD2 = 'getInvoicesForThirdParty';
|
$WS_METHOD2 = 'getInvoicesForThirdParty';
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@ set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs');
|
|||||||
require_once("../master.inc.php");
|
require_once("../master.inc.php");
|
||||||
require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP
|
require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP
|
||||||
|
|
||||||
$WS_DOL_URL = $dolibarr_main_url_root.'/webservices/server_other.php';
|
$WS_DOL_URL = DOL_MAIN_URL_ROOT.'/webservices/server_other.php';
|
||||||
$WS_METHOD = 'getVersions';
|
$WS_METHOD = 'getVersions';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@ set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs');
|
|||||||
require_once("../master.inc.php");
|
require_once("../master.inc.php");
|
||||||
require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP
|
require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP
|
||||||
|
|
||||||
$WS_DOL_URL = $dolibarr_main_url_root.'/webservices/server_thirdparty.php';
|
$WS_DOL_URL = DOL_MAIN_URL_ROOT.'/webservices/server_thirdparty.php';
|
||||||
$WS_METHOD = 'getThirdParty';
|
$WS_METHOD = 'getThirdParty';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -50,21 +50,18 @@ if (empty($conf->global->MAIN_MODULE_WEBSERVICES))
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Should work with DOL_URL_ROOT='' or DOL_URL_ROOT='/dolibarr'
|
|
||||||
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',$dolibarr_main_url_root);
|
|
||||||
|
|
||||||
// WSDL
|
// WSDL
|
||||||
print '<u>'.$langs->trans("WSDLCanBeDownloadedHere").':</u><br>';
|
print '<u>'.$langs->trans("WSDLCanBeDownloadedHere").':</u><br>';
|
||||||
$url=$urlwithouturlroot.DOL_URL_ROOT.'/webservices/server_other.php?wsdl';
|
$url=DOL_MAIN_URL_ROOT.'/webservices/server_other.php?wsdl';
|
||||||
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||||
if ($conf->societe->enabled)
|
if ($conf->societe->enabled)
|
||||||
{
|
{
|
||||||
$url=$urlwithouturlroot.DOL_URL_ROOT.'/webservices/server_thirdparty.php?wsdl';
|
$url=DOL_MAIN_URL_ROOT.'/webservices/server_thirdparty.php?wsdl';
|
||||||
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||||
}
|
}
|
||||||
if ($conf->facture->enabled)
|
if ($conf->facture->enabled)
|
||||||
{
|
{
|
||||||
$url=$urlwithouturlroot.DOL_URL_ROOT.'/webservices/server_invoice.php?wsdl';
|
$url=DOL_MAIN_URL_ROOT.'/webservices/server_invoice.php?wsdl';
|
||||||
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||||
}
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
@ -72,16 +69,16 @@ print '<br>';
|
|||||||
|
|
||||||
// Endpoint
|
// Endpoint
|
||||||
print '<u>'.$langs->trans("EndPointIs").':</u><br>';
|
print '<u>'.$langs->trans("EndPointIs").':</u><br>';
|
||||||
$url=$urlwithouturlroot.DOL_URL_ROOT.'/webservices/server_other.php';
|
$url=DOL_MAIN_URL_ROOT.'/webservices/server_other.php';
|
||||||
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||||
if ($conf->societe->enabled)
|
if ($conf->societe->enabled)
|
||||||
{
|
{
|
||||||
$url=$urlwithouturlroot.DOL_URL_ROOT.'/webservices/server_thirdparty.php';
|
$url=DOL_MAIN_URL_ROOT.'/webservices/server_thirdparty.php';
|
||||||
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||||
}
|
}
|
||||||
if ($conf->facture->enabled)
|
if ($conf->facture->enabled)
|
||||||
{
|
{
|
||||||
$url=$urlwithouturlroot.DOL_URL_ROOT.'/webservices/server_invoice.php';
|
$url=DOL_MAIN_URL_ROOT.'/webservices/server_invoice.php';
|
||||||
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
print img_picto('','object_globe.png').' '.'<a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||||
}
|
}
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user