27 require
'../../main.inc.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
30 $langs->load(
"admin");
64 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
68 print '<span class="opacitymedium">'.$langs->trans(
"WebServicesDesc").
"</span><br>\n";
71 print '<form name="agendasetupform" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
72 print '<input type="hidden" name="token" value="'.newToken().
'">';
73 print '<input type="hidden" name="action" value="save">';
75 print '<table class="noborder centpercent">';
77 print '<tr class="liste_titre">';
78 print "<td>".$langs->trans(
"Parameter").
"</td>";
79 print "<td>".$langs->trans(
"Value").
"</td>";
81 print "<td> </td>";
84 print '<tr class="oddeven">';
85 print '<td class="fieldrequired">'.$langs->trans(
"KeyForWebServicesAccess").
'</td>';
86 print '<td><input type="text" class="flat" id="WEBSERVICES_KEY" name="WEBSERVICES_KEY" value="'.(GETPOST(
'WEBSERVICES_KEY') ?
GETPOST(
'WEBSERVICES_KEY') : (!empty($conf->global->WEBSERVICES_KEY) ? $conf->global->WEBSERVICES_KEY :
'')).
'" size="40">';
87 if (!empty($conf->use_javascript_ajax))
88 print ' '.img_picto($langs->trans(
'Generate'),
'refresh',
'id="generate_token" class="linkobject"');
90 print '<td> </td>';
95 print '<br><div class="center">';
96 print '<input type="submit" name="save" class="button button-save" value="'.$langs->trans(
"Save").
'">';
104 $webservices = array(
106 'thirdparty' =>
'!empty($conf->societe->enabled)',
107 'contact' =>
'!empty($conf->societe->enabled)',
108 'productorservice' =>
'(!empty($conf->product->enabled) || !empty($conf->service->enabled))',
109 'order' =>
'!empty($conf->commande->enabled)',
110 'invoice' =>
'!empty($conf->facture->enabled)',
111 'supplier_invoice' =>
'!empty($conf->fournisseur->enabled)',
112 'actioncomm' =>
'!empty($conf->agenda->enabled)',
113 'category' =>
'!empty($conf->categorie->enabled)',
114 'project' =>
'!empty($conf->projet->enabled)',
120 print '<u>'.$langs->trans(
"WSDLCanBeDownloadedHere").
':</u><br>';
121 foreach ($webservices as $name => $right)
123 if (!empty($right) && !
verifCond($right))
continue;
124 $url = DOL_MAIN_URL_ROOT.
'/webservices/server_'.$name.
'.php?wsdl';
125 print img_picto(
'',
'globe').
' <a href="'.$url.
'" target="_blank">'.$url.
"</a><br>\n";
131 print '<u>'.$langs->trans(
"EndPointIs").
':</u><br>';
132 foreach ($webservices as $name => $right)
134 if (!empty($right) && !
verifCond($right))
continue;
135 $url = DOL_MAIN_URL_ROOT.
'/webservices/server_'.$name.
'.php';
136 print img_picto(
'',
'globe').
' <a href="'.$url.
'" target="_blank">'.$url.
"</a><br>\n";
142 print $langs->trans(
"OnlyActiveElementsAreShown", DOL_URL_ROOT.
'/admin/modules.php');
144 if (!empty($conf->use_javascript_ajax))
146 print "\n".
'<script type="text/javascript">';
147 print '$(document).ready(function () {
148 $("#generate_token").click(function() {
149 $.get( "'.DOL_URL_ROOT.
'/core/ajax/security.php", {
150 action: \'getrandompassword\',
154 $("#WEBSERVICES_KEY").val(token);
verifCond($strRights)
Verify if condition in string is ok or not.
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dolibarr_set_const($db, $name, $value, $type= 'chaine', $visible=0, $note= '', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
print
Draft customers invoices.