28require 
'../../main.inc.php';
 
   29require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
 
   30require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
 
   32$servicename = 
'PayBox';
 
   45$langs->loadLangs(array(
'admin', 
'other', 
'paybox', 
'paypal', 
'stripe'));
 
   51$action = 
GETPOST(
'action', 
'aZ09');
 
   54if ($action == 
'setvalue' && $user->admin) {
 
   89  $result = 
dolibarr_set_const($db, 
"ONLINE_PAYMENT_MESSAGE_FORM", 
GETPOST(
'ONLINE_PAYMENT_MESSAGE_FORM', 
'restricthtml'), 
'chaine', 0, 
'', 
$conf->entity);
 
   93  $result = 
dolibarr_set_const($db, 
"ONLINE_PAYMENT_MESSAGE_OK", 
GETPOST(
'ONLINE_PAYMENT_MESSAGE_OK', 
'restricthtml'), 
'chaine', 0, 
'', 
$conf->entity);
 
   97  $result = 
dolibarr_set_const($db, 
"ONLINE_PAYMENT_MESSAGE_KO", 
GETPOST(
'ONLINE_PAYMENT_MESSAGE_KO', 
'restricthtml'), 
'chaine', 0, 
'', 
$conf->entity);
 
  102  if (!($result > 0)) {
 
  107  if (!($result > 0)) {
 
  110  $result = 
dolibarr_set_const($db, 
"PAYMENT_SECURITY_TOKEN_UNIQUE", 
GETPOST(
'PAYMENT_SECURITY_TOKEN_UNIQUE', 
'alpha'), 
'chaine', 0, 
'', 
$conf->entity);
 
  111  if (!($result > 0)) {
 
  115  if (!($result > 0)) {
 
  134$IBS_SITE = 
"1999888"; 
 
  136  $conf->global->PAYBOX_IBS_SITE = $IBS_SITE;
 
  140  $conf->global->PAYBOX_IBS_RANG = $IBS_RANG;
 
  144  $conf->global->PAYBOX_IBS_DEVISE = $IBS_DEVISE;
 
  149$linkback = 
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
 
  150print 
load_fiche_titre($langs->trans(
"PayBoxSetup"), $linkback, 
'title_setup');
 
  155$head[$h][0] = DOL_URL_ROOT.
"/paybox/admin/paybox.php";
 
  156$head[$h][1] = $langs->trans(
"PayBox");
 
  157$head[$h][2] = 
'payboxaccount';
 
  160print 
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
 
  161print 
'<input type="hidden" name="token" value="'.newToken().
'">';
 
  162print 
'<input type="hidden" name="action" value="setvalue">';
 
  166print $langs->trans(
"PayBoxDesc").
"<br>\n";
 
  169print 
'<table class="noborder centpercent">';
 
  170print 
'<tr class="liste_titre">';
 
  171print 
'<td>'.$langs->trans(
"AccountParameter").
'</td>';
 
  172print 
'<td>'.$langs->trans(
"Value").
'</td>';
 
  176print 
'<tr class="oddeven"><td>';
 
  177print 
'<span class="fieldrequired">'.$langs->trans(
"PAYBOX_PBX_SITE").
'</span></td><td>';
 
  178print 
'<input size="32" type="text" name="PAYBOX_IBS_SITE" value="' . 
getDolGlobalString(
'PAYBOX_IBS_SITE').
'">';
 
  179print 
'<span class="opacitymedium"><br>'.$langs->trans(
"Example").
': 1999888 ('.$langs->trans(
"Test").
')</span>';
 
  183print 
'<tr class="oddeven"><td>';
 
  184print 
'<span class="fieldrequired">'.$langs->trans(
"PAYBOX_PBX_RANG").
'</span></td><td>';
 
  185print 
'<input size="32" type="text" name="PAYBOX_IBS_RANG" value="' . 
getDolGlobalString(
'PAYBOX_IBS_RANG').
'">';
 
  186print 
'<span class="opacitymedium"><br>'.$langs->trans(
"Example").
': 99 ('.$langs->trans(
"Test").
')</span>';
 
  190print 
'<tr class="oddeven"><td>';
 
  191print 
'<span class="fieldrequired">'.$langs->trans(
"PAYBOX_PBX_IDENTIFIANT").
'</span></td><td>';
 
  192print 
'<input size="32" type="text" name="PAYBOX_PBX_IDENTIFIANT" value="' . 
getDolGlobalString(
'PAYBOX_PBX_IDENTIFIANT').
'">';
 
  193print 
'<span class="opacitymedium"><br>'.$langs->trans(
"Example").
': 2 ('.$langs->trans(
"Test").
')</span>';
 
  196print 
'<tr class="oddeven"><td>';
 
  197print 
'<span class="fieldrequired">'.$langs->trans(
"PAYBOX_HMAC_KEY").
'</span></td><td>';
 
  198print 
'<input size="100" type="text" name="PAYBOX_HMAC_KEY" value="'.dol_decode(
$conf->global->PAYBOX_HMAC_KEY).
'">';
 
  199print 
'<span class="opacitymedium"><br>'.$langs->trans(
"Example").
': 1A2B3C4D5E6F</span>';
 
  202print 
'<tr class="liste_titre">';
 
  203print 
'<td>'.$langs->trans(
"UsageParameter").
'</td>';
 
  204print 
'<td>'.$langs->trans(
"Value").
'</td>';
 
  226print 
'<tr class="oddeven"><td>';
 
  227print 
'<span class="fieldrequired">'.$langs->trans(
"PAYBOX_CGI_URL_V2").
'</span></td><td>';
 
  228print 
'<input size="64" type="text" name="PAYBOX_CGI_URL_V2" value="' . 
getDolGlobalString(
'PAYBOX_CGI_URL_V2').
'">';
 
  229print 
'<span class="opacitymedium"><br>'.$langs->trans(
"Example").
' (preprod): https://preprod-tpeweb.paybox.com/php/';
 
  230print 
'<br>'.$langs->trans(
"Example").
' (prod): https://tpeweb.paybox.com/php/</span>';
 
  234print 
'<tr class="oddeven"><td>';
 
  235print $langs->trans(
"PublicVendorName").
'</td><td>';
 
  236print 
'<input type="text" class="minwidth300" name="ONLINE_PAYMENT_CREDITOR" value="' . 
getDolGlobalString(
'ONLINE_PAYMENT_CREDITOR').
'">';
 
  237print 
'<br><span class="opacitymedium">'.$langs->trans(
"Example").
': '.$mysoc->name.
'</span>';
 
  241if (isModEnabled(
"bank")) {
 
  242  print 
'<tr class="oddeven"><td>';
 
  243  print $langs->trans(
"BankAccount").
'</td><td>';
 
  244  $form->select_comptes(
$conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS, 
'PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS', 0, 
'', 1);
 
  249print 
'<tr class="oddeven"><td>';
 
  250print $langs->trans(
"CSSUrlForPaymentForm").
'</td><td>';
 
  251print 
'<input size="64" type="text" name="ONLINE_PAYMENT_CSS_URL" value="' . 
getDolGlobalString(
'ONLINE_PAYMENT_CSS_URL').
'">';
 
  252print 
'<span class="opacitymedium"><br>'.$langs->trans(
"Example").
': http://mysite/mycss.css</span>';
 
  256print 
'<tr class="oddeven"><td>';
 
  257print $langs->trans(
"MessageForm").
'</td><td>';
 
  258$doleditor = 
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_FORM', 
$conf->global->ONLINE_PAYMENT_MESSAGE_FORM, 
'', 100, 
'dolibarr_details', 
'In', 
false, 
true, 
true, ROWS_2, 
'90%');
 
  262print 
'<tr class="oddeven"><td>';
 
  263print $langs->trans(
"MessageOK").
'</td><td>';
 
  264$doleditor = 
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_OK', 
$conf->global->ONLINE_PAYMENT_MESSAGE_OK, 
'', 100, 
'dolibarr_details', 
'In', 
false, 
true, 
true, ROWS_2, 
'90%');
 
  269print 
'<tr class="oddeven"><td>';
 
  270print $langs->trans(
"MessageKO").
'</td><td>';
 
  271$doleditor = 
new DolEditor(
'ONLINE_PAYMENT_MESSAGE_KO', 
$conf->global->ONLINE_PAYMENT_MESSAGE_KO, 
'', 100, 
'dolibarr_details', 
'In', 
false, 
true, 
true, ROWS_2, 
'90%');
 
  276print 
'<tr class="oddeven"><td class="fieldrequired">';
 
  277print $langs->trans(
"ONLINE_PAYMENT_SENDEMAIL").
'</td><td>';
 
  278print 
'<input size="32" type="text" name="ONLINE_PAYMENT_SENDEMAIL" value="' . 
getDolGlobalString(
'ONLINE_PAYMENT_SENDEMAIL').
'">';
 
  279print 
'   <span class="opacitymedium">'.$langs->trans(
"Example").
': myemail@myserver.com, Payment service <myemail2@myserver2.com></span>';
 
  283print 
'<tr class="oddeven"><td>';
 
  284print $langs->trans(
"SecurityToken").
'</td><td>';
 
  285print 
'<input size="48" type="text" id="PAYMENT_SECURITY_TOKEN" name="PAYMENT_SECURITY_TOKEN" value="' . 
getDolGlobalString(
'PAYMENT_SECURITY_TOKEN').
'">';
 
  286if (!empty(
$conf->use_javascript_ajax)) {
 
  287  print 
' '.img_picto($langs->trans(
'Generate'), 
'refresh', 
'id="generate_token" class="linkobject"');
 
  291print 
'<tr class="oddeven"><td>';
 
  292print $langs->trans(
"SecurityTokenIsUnique").
'</td><td>';
 
  293print $form->selectyesno(
"PAYMENT_SECURITY_TOKEN_UNIQUE", (!
getDolGlobalString(
'PAYMENT_SECURITY_TOKEN') ? 0 : 
$conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE), 1);
 
  300print $form->buttonsSaveCancel(
"Modify", 
'');
 
  306include DOL_DOCUMENT_ROOT.
'/core/tpl/onlinepaymentlinks.tpl.php';
 
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).
 
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
 
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
 
Class to manage a WYSIWYG editor.
 
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
 
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
 
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
 
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
 
dol_get_fiche_end($notab=0)
Return tab footer of a card.
 
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
 
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
 
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
 
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
 
dol_encode($chain, $key='1')
Encode a string with base 64 algorithm + specific delta change.
 
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.