* 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/index.php * \ingroup webservices * \brief Page to setup webservices module */ // Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; $langs->load("admin"); if (!$user->admin) { accessforbidden(); } $actionsave = GETPOST("save"); // Sauvegardes parameters if ($actionsave) { $i = 0; $db->begin(); $i += dolibarr_set_const($db, 'WEBSERVICES_KEY', GETPOST("WEBSERVICES_KEY"), 'chaine', 0, '', $conf->entity); if ($i >= 1) { $db->commit(); setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); } else { $db->rollback(); setEventMessages($langs->trans("Error"), null, 'errors'); } } /* * View */ llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-webservices page-admin_index'); $linkback = ''.$langs->trans("BackToModuleList").''; print load_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 ''; 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 $form->buttonsSaveCancel("Save", ''); print '
'; print '

'; // Webservices list $webservices = array( 'user' => '', 'thirdparty' => 'isModEnabled("societe")', 'contact' => 'isModEnabled("societe")', 'productorservice' => '(isModEnabled("product") || isModEnabled("service"))', 'order' => 'isModEnabled("order")', 'invoice' => 'isModEnabled("invoice")', 'supplier_invoice' => 'isModEnabled("fournisseur")', 'actioncomm' => 'isModEnabled("agenda")', 'category' => 'isModEnabled("category")', 'project' => 'isModEnabled("project")', '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('', 'globe').' '.$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('', 'globe').' '.$url."
\n"; } print '
'; print '
'; print $langs->trans("OnlyActiveElementsAreShown", DOL_URL_ROOT.'/admin/modules.php'); $constname = 'WEBSERVICES_KEY'; print dolJSToSetRandomPassword($constname); // End of page llxFooter(); $db->close();