* Copyright (C) 2005-2009 Laurent Destailleur * * 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 2 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, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** \file htdocs/admin/paybox.php * \ingroup paybox * \brief Page to setup paybox module * \version $Id$ */ require("../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); $servicename='PayBox'; $langs->load("admin"); $langs->load("paybox"); if (!$user->admin) accessforbidden(); if ($_POST["action"] == 'setvalue' && $user->admin) { //$result=dolibarr_set_const($db, "PAYBOX_IBS_DEVISE",$_POST["PAYBOX_IBS_DEVISE"],'chaine',0,'',$conf->entity); $result=dolibarr_set_const($db, "PAYBOX_CSS_URL",$_POST["PAYBOX_CSS_URL"],'chaine',0,'',$conf->entity); $result=dolibarr_set_const($db, "PAYBOX_CREDITOR",$_POST["PAYBOX_CREDITOR"],'chaine',0,'',$conf->entity); $result=dolibarr_set_const($db, "PAYBOX_CGI_URL_V1",$_POST["PAYBOX_CGI_URL_V1"],'chaine',0,'',$conf->entity); $result=dolibarr_set_const($db, "PAYBOX_CGI_URL_V2",$_POST["PAYBOX_CGI_URL_V2"],'chaine',0,'',$conf->entity); $result=dolibarr_set_const($db, "PAYBOX_IBS_SITE",$_POST["PAYBOX_IBS_SITE"],'chaine',0,'',$conf->entity); $result=dolibarr_set_const($db, "PAYBOX_IBS_RANG",$_POST["PAYBOX_IBS_RANG"],'chaine',0,'',$conf->entity); $result=dolibarr_set_const($db, "PAYBOX_PBX_IDENTIFIANT",$_POST["PAYBOX_PBX_IDENTIFIANT"],'chaine',0,'',$conf->entity); if ($result >= 0) { $mesg='
'.$langs->trans("SetupSaved").'
'; } else { dol_print_error($db); } } /* * View */ $IBS_SITE="1999888"; # Site test if (empty($conf->global->PAYBOX_IBS_SITE)) $conf->global->PAYBOX_IBS_SITE=$IBS_SITE; $IBS_RANG="99"; # Rang test if (empty($conf->global->PAYBOX_IBS_RANG)) $conf->global->PAYBOX_IBS_RANG=$IBS_RANG; $IBS_DEVISE="978"; # Euro if (empty($conf->global->PAYBOX_IBS_DEVISE)) $conf->global->PAYBOX_IBS_DEVISE=$IBS_DEVISE; llxHeader(); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("PayBoxSetup"),$linkback,'setup'); print $langs->trans("PayBoxDesc")."
\n"; if ($mesg) print '
'.$mesg; print '
'; print '
'; print ''; print ''; $var=true; print ''; print ''; print ''; print ''; print "\n"; /* $var=!$var; print ''; */ $var=!$var; print ''; $var=!$var; print ''; /* $var=!$var; print ''; */ $var=!$var; print ''; $var=!$var; print ''; $var=!$var; print ''; $var=!$var; print ''; print ''; print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'; print $langs->trans("PAYBOX_IBS_DEVISE").''; print ''; print '
'.$langs->trans("Example").': 978 (EUR)'; print '
'; print $langs->trans("PAYBOX_CSS_URL").''; print ''; print '
'.$langs->trans("Example").': http://mysite/mycss.css'; print '
'; print $langs->trans("PAYBOX_CREDITOR").''; print ''; print '
'.$langs->trans("Example").': '.$mysoc->nom; print '
'; print $langs->trans("PAYBOX_CGI_URL_V1").''; print ''; print '
'.$langs->trans("Example").': http://mysite/cgi-bin/module_linux.cgi'; print '
'; print ''.$langs->trans("PAYBOX_CGI_URL_V2").''; print ''; print '
'.$langs->trans("Example").': http://mysite/cgi-bin/modulev2_redhat72.cgi'; print '
'; print ''.$langs->trans("PAYBOX_PBX_SITE").''; print ''; print '
'.$langs->trans("Example").': 1999888 ('.$langs->trans("Test").')'; print '
'; print ''.$langs->trans("PAYBOX_PBX_RANG").''; print ''; print '
'.$langs->trans("Example").': 99 ('.$langs->trans("Test").')'; print '
'; print ''.$langs->trans("PAYBOX_PBX_IDENTIFIANT").''; print ''; print '
'.$langs->trans("Example").': 2 ('.$langs->trans("Test").')'; print '
'; print '

'; print ''.$langs->trans("FollowingUrlAreAvailableToMakePayments").':
'; // 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 '
'; print img_picto('','puce.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount",$servicename).':
'; print ''.$urlwithouturlroot.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=9.99&tag=your_free_tag'."
\n"; print '
'; if ($conf->commande->enabled) { print img_picto('','puce.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnOrder",$servicename).':
'; print ''.$urlwithouturlroot.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=order&ref=order_ref'."
\n"; print '
'; } if ($conf->facture->enabled) { print img_picto('','puce.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnInvoice",$servicename).':
'; print ''.$urlwithouturlroot.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=invoice&ref=invoice_ref'."
\n"; // print $langs->trans("SetupPayBoxToHavePaymentCreatedAutomatically",$langs->transnoentitiesnoconv("FeatureNotYetAvailable"))."
\n"; print '
'; } if ($conf->contrat->enabled) { print img_picto('','puce.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnContractLine",$servicename).':
'; print ''.$urlwithouturlroot.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=contractline&ref=contractline_ref'."
\n"; print '
'; } if ($conf->adherent->enabled) { print img_picto('','puce.png').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnMemberSubscription",$servicename).':
'; print ''.$urlwithouturlroot.DOL_URL_ROOT.'/public/paybox/newpayment.php?amount=membersubscription&ref=member_ref'."
\n"; print '
'; } print $langs->trans("YouCanAddTagOnUrl"); $db->close(); llxFooter('$Date$ - $Revision$'); ?>