Go to the documentation of this file.
25 require
'../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/invoice.lib.php';
28 require_once DOL_DOCUMENT_ROOT.
'/compta/paiement/class/paiement.class.php';
31 $langs->loadLangs(array(
"admin",
"other",
"errors",
"bills"));
37 $action =
GETPOST(
'action',
'aZ09');
38 $value =
GETPOST(
'value',
'alpha');
39 $label =
GETPOST(
'label',
'alpha');
40 $scandir =
GETPOST(
'scan_dir',
'alpha');
43 if (empty($conf->global->PAYMENT_ADDON)) {
44 $conf->global->PAYMENT_ADDON =
'mod_payment_cicada.php';
52 if ($action ==
'updateMask') {
53 $maskconstpayment =
GETPOST(
'maskconstpayment',
'alpha');
54 $maskpayment =
GETPOST(
'maskpayment',
'alpha');
55 if ($maskconstpayment) {
56 $res =
dolibarr_set_const($db, $maskconstpayment, $maskpayment,
'chaine', 0,
'', $conf->entity);
70 if ($action ==
'setmod') {
74 if ($action ==
'setparams') {
75 $freetext =
GETPOST(
'FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS',
'restricthtml');
76 $res =
dolibarr_set_const($db,
"FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS", $freetext,
'chaine', 0,
'', $conf->entity);
81 $res =
dolibarr_set_const($db,
"PAYMENTS_REPORT_GROUP_BY_MOD",
GETPOST(
'PAYMENTS_REPORT_GROUP_BY_MOD',
'int'),
'chaine', 0,
'', $conf->entity);
99 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
101 llxHeader(
"", $langs->trans(
"BillsSetup"),
'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura');
106 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
107 print
load_fiche_titre($langs->trans(
"BillsSetup"), $linkback,
'title_setup');
118 print
'<div class="div-table-responsive-no-min">';
119 print
'<table class="noborder centpercent">';
120 print
'<tr class="liste_titre">';
121 print
'<td>'.$langs->trans(
"Name").
'</td>';
122 print
'<td>'.$langs->trans(
"Description").
'</td>';
123 print
'<td class="nowrap">'.$langs->trans(
"Example").
'</td>';
124 print
'<td align="center" width="60">'.$langs->trans(
"Status").
'</td>';
125 print
'<td align="center" width="16">'.$langs->trans(
"ShortInfo").
'</td>';
130 foreach ($dirmodels as $reldir) {
133 $handle = opendir($dir);
134 if (is_resource($handle)) {
135 while (($file = readdir($handle)) !==
false) {
136 if (!is_dir($dir.$file) || (substr($file, 0, 1) <>
'.' && substr($file, 0, 3) <>
'CVS')) {
138 $classname = preg_replace(
'/\.php$/',
'', $file);
140 if (!is_file($dir.$filebis)) {
141 $filebis = $file.
"/".$file.
".modules.php";
142 $classname =
"mod_payment_".$file;
145 preg_match(
'/\-(.*)_(.*)$/', $classname, $reg);
146 if (!empty($reg[2]) && $reg[2] != strtoupper($mysoc->country_code)) {
150 $classname = preg_replace(
'/\-.*$/',
'', $classname);
151 if (!class_exists($classname) && is_readable($dir.$filebis) && (preg_match(
'/mod_/', $filebis) || preg_match(
'/mod_/', $classname)) && substr($filebis,
dol_strlen($filebis) - 3, 3) ==
'php') {
153 require_once $dir.$filebis;
155 $module =
new $classname($db);
158 if ($module->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
161 if ($module->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
165 if ($module->isEnabled()) {
166 print
'<tr class="oddeven"><td width="100">';
167 echo preg_replace(
'/\-.*$/',
'', preg_replace(
'/mod_payment_/',
'', preg_replace(
'/\.php$/',
'', $file)));
170 print $module->info();
175 print
'<td class="nowrap">';
176 $tmp = $module->getExample();
177 if (preg_match(
'/^Error/', $tmp)) {
178 $langs->load(
"errors");
179 print
'<div class="error">'.$langs->trans($tmp).
'</div>';
180 } elseif ($tmp ==
'NotConfigured') {
181 print
'<span class="opacitymedium">'.$langs->trans($tmp).
'</span>';
187 print
'<td class="center">';
189 if ($conf->global->PAYMENT_ADDON == $file || $conf->global->PAYMENT_ADDON.
'.php' == $file) {
190 print
img_picto($langs->trans(
"Activated"),
'switch_on');
192 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setmod&token='.
newToken().
'&value='.preg_replace(
'/\.php$/',
'', $file).
'&scan_dir='.$module->scandir.
'&label='.urlencode($module->name).
'" alt="'.$langs->trans(
"Default").
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
197 $payment->initAsSpecimen();
201 $htmltooltip .=
''.$langs->trans(
"Version").
': <b>'.$module->getVersion().
'</b><br>';
202 $nextval = $module->getNextValue($mysoc, $payment);
203 if (
"$nextval" != $langs->trans(
"NotAvailable")) {
204 $htmltooltip .= $langs->trans(
"NextValue").
': ';
206 if (preg_match(
'/^Error/', $nextval) || $nextval ==
'NotConfigured') {
207 $nextval = $langs->trans($nextval);
209 $htmltooltip .= $nextval.
'<br>';
211 $htmltooltip .= $langs->trans($module->error).
'<br>';
215 print
'<td class="center">';
216 print
$form->textwithpicto(
'', $htmltooltip, 1, 0);
218 if ($conf->global->PAYMENT_ADDON.
'.php' == $file) {
219 if (!empty($module->error)) {
243 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
244 print
'<input type="hidden" name="token" value="'.newToken().
'" />';
245 print
'<input type="hidden" name="action" value="setparams" />';
247 print
'<div class="div-table-responsive-no-min">';
248 print
'<table class="noborder centpercent">';
249 print
'<tr class="liste_titre">';
250 print
'<td>'.$langs->trans(
"Parameter").
'</td>';
251 print
'<td align="center" width="60">'.$langs->trans(
"Value").
'</td>';
252 print
'<td width="80"> </td>';
256 print
'<tr class="oddeven"><td>';
257 print $langs->trans(
"PaymentOnDifferentThirdBills");
258 print
'</td><td width="60" align="center">';
259 print
$form->selectyesno(
"FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS", $conf->global->FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS, 1);
260 print
'</td><td class="right">';
261 print
"</td></tr>\n";
264 print
'<tr class="oddeven"><td>';
265 print $langs->trans(
"GroupPaymentsByModOnReports");
266 print
'</td><td width="60" align="center">';
267 print
$form->selectyesno(
"PAYMENTS_REPORT_GROUP_BY_MOD", $conf->global->PAYMENTS_REPORT_GROUP_BY_MOD, 1);
268 print
'</td><td class="right">';
269 print
"</td></tr>\n";
276 print
$form->buttonsSaveCancel(
"Modify",
'');
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
invoice_admin_prepare_head()
Return array head with list of tabs to view object informations.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_htmloutput_mesg($mesgstring='', $mesgarray=array(), $style='ok', $keepembedded=0)
Print formated messages to output (Used to show messages on html output).
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).
Class to manage payments of customer invoices.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.