* Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * \file htdocs/webservices/admin/webservices.php * \ingroup webservices * \brief Page to setup webservices module */ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; $langs->load("admin"); if (! $user->admin) accessforbidden(); $actionsave=GETPOST("save"); // Sauvegardes parametres if ($actionsave) { $i=0; $db->begin(); $i+=dolibarr_set_const($db,'WEBSERVICES_KEY',trim(GETPOST("WEBSERVICES_KEY")),'chaine',0,'',$conf->entity); if ($i >= 1) { $db->commit(); setEventMessage($langs->trans("SetupSaved")); } else { $db->rollback(); setEventMessage($langs->trans("Error"), 'errors'); } } /* * View */ llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("WebServicesSetup"),$linkback,'title_setup'); print $langs->trans("WebServicesDesc")."
\n"; print "
\n"; print '
'; print ''; print ''; print ''; print ""; print ""; //print ""; print ""; print ""; print ''; print ''; print ''; print ''; print ''; print '
".$langs->trans("Parameter")."".$langs->trans("Value")."".$langs->trans("Examples")." 
'.$langs->trans("KeyForWebServicesAccess").''; if (! empty($conf->use_javascript_ajax)) print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"'); print ' 
'; print '
'; print ''; print '
'; print '
'; print '

'; // Webservices list $webservices = array( 'user' => '', 'thirdparty' => '!empty($conf->societe->enabled)', 'contact' => '!empty($conf->societe->enabled)', 'productorservice' => '(!empty($conf->product->enabled) || !empty($conf->service->enabled))', 'order' => '!empty($conf->commande->enabled)', 'invoice' => '!empty($conf->facture->enabled)', 'supplier_invoice' => '!empty($conf->fournisseur->enabled)', 'actioncomm' => '!empty($conf->agenda->enabled)', 'category' => '!empty($conf->categorie->enabled)', 'other' => '' ); // WSDL print ''.$langs->trans("WSDLCanBeDownloadedHere").':
'; foreach($webservices as $name => $right) { if (!empty($right) && !verifCond($right)) continue; $url=DOL_MAIN_URL_ROOT.'/webservices/server_'.$name.'.php?wsdl'; print img_picto('','object_globe.png').' '.$url."
\n"; } print '
'; // Endpoint print ''.$langs->trans("EndPointIs").':
'; foreach($webservices as $name => $right) { if (!empty($right) && !verifCond($right)) continue; $url=DOL_MAIN_URL_ROOT.'/webservices/server_'.$name.'.php'; print img_picto('','object_globe.png').' '.$url."
\n"; } print '
'; print '
'; print $langs->trans("OnlyActiveElementsAreShown", DOL_URL_ROOT.'/admin/modules.php'); if (! empty($conf->use_javascript_ajax)) { print "\n".''; } llxFooter(); $db->close();