28require
'../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/invoice.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
43$langs->loadLangs(array(
"admin",
"other",
"errors",
"bills"));
49$action =
GETPOST(
'action',
'aZ09');
50$value =
GETPOST(
'value',
'alpha');
51$label =
GETPOST(
'label',
'alpha');
52$scandir =
GETPOST(
'scan_dir',
'alpha');
56 $conf->global->PAYMENT_ADDON =
'mod_payment_cicada.php';
65if ($action ==
'updateMask') {
66 $maskconstpayment =
GETPOST(
'maskconstpayment',
'aZ09');
67 $maskpayment =
GETPOST(
'maskpayment',
'alpha');
71 if ($maskconstpayment && preg_match(
'/_MASK$/', $maskconstpayment)) {
80 setEventMessages($langs->trans(
"SetupSaved"),
null,
'mesgs');
82 setEventMessages($langs->trans(
"Error"),
null,
'errors');
86if ($action ==
'setmod') {
90if ($action ==
'setparams') {
91 $freetext =
GETPOST(
'FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS',
'restricthtml');
92 $res =
dolibarr_set_const($db,
"FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS", $freetext,
'chaine', 0,
'',
$conf->entity);
103 setEventMessages($langs->trans(
"Error"),
null,
'errors');
106 setEventMessages($langs->trans(
"SetupSaved"),
null,
'mesgs');
115$dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
117llxHeader(
'', $langs->trans(
"BillsSetup"),
'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura',
'', 0, 0,
'',
'',
'',
'mod-admin page-payment');
119$form =
new Form($db);
122$linkback =
'<a href="'.dolBuildUrl(DOL_URL_ROOT.
'/admin/modules.php', [
'restore_lastsearch_values' => 1]).
'">'.img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
124print
load_fiche_titre($langs->trans(
"BillsSetup"), $linkback,
'title_setup');
133print
'<div class="div-table-responsive-no-min">';
134print
'<table class="noborder centpercent">';
135print
'<tr class="liste_titre">';
136print
'<td>'.$langs->trans(
"Name").
'</td>';
137print
'<td>'.$langs->trans(
"Description").
'</td>';
138print
'<td class="nowrap">'.$langs->trans(
"Example").
'</td>';
139print
'<td class="center" width="60">'.$langs->trans(
"Status").
'</td>';
140print
'<td class="center" width="16">'.$langs->trans(
"ShortInfo").
'</td>';
145$arrayofmodules = array();
147foreach ($dirmodels as $reldir) {
150 $handle = opendir($dir);
151 if (is_resource($handle)) {
152 while (($file = readdir($handle)) !==
false) {
153 if (!is_dir($dir.$file) || (
dol_substr($file, 0, 1) !=
'.' &&
dol_substr($file, 0, 3) !=
'CVS')) {
155 $classname = preg_replace(
'/\.php$/',
'', $file);
157 if (!is_file($dir.$filebis)) {
158 $filebis = $file.
"/".$file.
".modules.php";
159 $classname =
"mod_payment_".$file;
163 preg_match(
'/\-(.*)_(.*)$/', $classname, $reg);
164 if (!empty($reg[2]) && $reg[2] != strtoupper(
$mysoc->country_code)) {
168 $classname = preg_replace(
'/\-.*$/',
'', $classname);
169 if (!class_exists($classname) && is_readable($dir.$filebis) && (preg_match(
'/mod_/', $filebis) || preg_match(
'/mod_/', $classname)) &&
dol_substr($filebis,
dol_strlen($filebis) - 3, 3) ==
'php') {
171 require_once $dir.$filebis;
175 '@phan-var-force ModeleNumRefPayments $module';
188foreach ($arrayofmodules as
$module) {
198 $file =
'mod_payment_'.strtolower(
$module->getName($langs)).
'.php';
200 print
'<tr class="oddeven"><td width="100">';
201 print preg_replace(
'/\-.*$/',
'', preg_replace(
'/mod_payment_/',
'',
$module->getName($langs)));
209 print
'<td class="nowrap">';
211 if (preg_match(
'/^Error/', $tmp)) {
212 $langs->load(
"errors");
213 print
'<div class="error">'.$langs->trans($tmp).
'</div>';
214 } elseif ($tmp ==
'NotConfigured') {
215 print
'<span class="opacitymedium">'.$langs->trans($tmp).
'</span>';
221 print
'<td class="center">';
223 print img_picto($langs->trans(
"Activated"),
'switch_on');
225 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setmod&token='.
newToken().
'&value='.preg_replace(
'/\.php$/',
'', $file).
'" alt="'.$langs->trans(
"Default").
'">'.img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
230 $payment->initAsSpecimen();
234 $htmltooltip .=
''.$langs->trans(
"Version").
': <b>'.
$module->getVersion().
'</b><br>';
236 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
237 $htmltooltip .= $langs->trans(
"NextValue").
': ';
239 if (preg_match(
'/^Error/', $nextval)) {
240 $nextval = $langs->trans($nextval);
242 $htmltooltip .= $nextval.
'<br>';
244 $htmltooltip .= $langs->trans(
$module->error).
'<br>';
248 print
'<td class="center">';
249 print $form->textwithpicto(
'', $htmltooltip, 1,
'info');
270print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST" spellcheck="false">';
271print
'<input type="hidden" name="token" value="'.newToken().
'" />';
272print
'<input type="hidden" name="action" value="setparams" />';
274print
'<div class="div-table-responsive-no-min">';
275print
'<table class="noborder centpercent">';
276print
'<tr class="liste_titre">';
277print
'<td>'.$langs->trans(
"Parameter").
'</td>';
278print
'<td align="center" width="60"></td>';
279print
'<td width="80"> </td>';
293print
'<tr class="oddeven"><td>';
294print $langs->trans(
"GroupPaymentsByModOnReports");
295print
'</td><td width="60" align="center">';
296print $form->selectyesno(
"PAYMENTS_REPORT_GROUP_BY_MOD",
getDolGlobalInt(
'PAYMENTS_REPORT_GROUP_BY_MOD'), 1);
297print
'</td><td class="right">';
305print $form->buttonsSaveCancel(
"Modify",
'');
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 payments of customer invoices.
if(! $sortfield) if(! $sortorder) $module
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
dol_substr($string, $start, $length=null, $stringencoding='', $trunconbytes=0)
Make a substring.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_htmloutput_mesg($mesgstring='', $mesgarray=array(), $style='ok', $keepembedded=0)
Print formatted messages to output (Used to show messages on html output).
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
invoice_admin_prepare_head()
Return array head with list of tabs to view object information.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.