* Copyright (C) 2005-2016 Laurent Destailleur * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2012-2018 Regis Houssin * Copyright (C) 2015 Jean-François Ferry * * 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/ifttt/admin/index.php * \ingroup api * \brief Page to setup IFTTT module */ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; // Load translation files required by the page $langs->load("admin"); if (! $user->admin) accessforbidden(); $action=GETPOST('action', 'aZ09'); if ($action == 'setproductionmode') { $status = GETPOST('status', 'alpha'); if (dolibarr_set_const($db, 'IFTTT_PRODUCTION_MODE', $status, 'chaine', 0, '', 0) > 0) { header("Location: ".$_SERVER["PHP_SELF"]); exit; } else { dol_print_error($db); } } /* * View */ llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("IFTTTSetup"), $linkback, 'title_setup'); print $langs->trans("IFTTTDesc")."
\n"; print "
\n"; //print '
'; print ''; print ''; print ''; print ""; print '"; print ""; print ""; print ''; print ''; $production_mode=(empty($conf->global->IFTTT_PRODUCTION_MODE)?false:true); if ($production_mode) { print ''; } else { print ''; } print ''; print ''; print '
".$langs->trans("Parameter")."'.$langs->trans("Value")." 
'.$langs->trans("ProductionMode").''; print img_picto($langs->trans("Activated"), 'switch_on'); print ''; print img_picto($langs->trans("Disabled"), 'switch_off'); print ' 
'; print '

'; /* // Define $urlwithroot $urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root)); $urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file //$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current // Show message $message=''; $url=$urlwithroot.'/api/index.php/login?login=auserlogin&password=thepassword[&reset=1]'; $message.=$langs->trans("UrlToGetKeyToUseAPIs").':
'; $message.=img_picto('', 'object_globe.png').' '.$url; print $message; print '
'; print '
'; // Explorer print ''.$langs->trans("ApiExporerIs").':
'; if (dol_is_dir(DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/explorer')) { $url=DOL_MAIN_URL_ROOT.'/api/index.php/explorer'; print img_picto('', 'object_globe.png').' '.$url."
\n"; } else { print $langs->trans("NotAvailableWithThisDistribution"); } */ llxFooter(); $db->close();