30require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/societe/class/companybankaccount.class.php';
46$langs->loadLangs(array(
"admin",
"companies",
"bills",
"other",
"banks"));
48$action =
GETPOST(
'action',
'aZ09');
49$actionsave =
GETPOST(
'save',
'alpha');
50$value =
GETPOST(
'value',
'alpha');
51$label =
GETPOST(
'label',
'alpha');
52$scandir =
GETPOST(
'scan_dir',
'alpha');
66if (in_array($action, array(
'setBANK_DISABLE_DIRECT_INPUT'))) {
67 $constname = preg_replace(
'/^set/',
'', $action);
82if ($action ==
'setbankorder') {
90if ($action ==
'setreportlastnumreleve') {
95} elseif ($action ==
'unsetreportlastnumreleve') {
103if ($action ==
'setbankcolorizemovement') {
108} elseif ($action ==
'unsetbankcolorizemovement') {
124 $color =
GETPOST(
'BANK_COLORIZE_MOVEMENT_COLOR'.$i,
'alpha');
125 if ($color ==
'-1') {
141 if (empty($errorsaved)) {
148if ($action ==
'specimen') {
149 $modele =
GETPOST(
'module',
'alpha');
151 if ($modele ==
'sepamandate') {
161 $dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
162 foreach ($dirmodels as $reldir) {
163 $file =
dol_buildpath($reldir.
"core/modules/bank/doc/pdf_".$modele.
".modules.php", 0);
164 if (file_exists($file)) {
165 $classname =
"pdf_".$modele;
170 if ($classname !==
'') {
173 $module =
new $classname(
$db);
174 '@phan-var-force ModeleBankAccountDoc $module';
176 if ($module->write_file(
$object, $langs) > 0) {
177 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=bank&file=SPECIMEN.pdf");
185 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
190if ($action ==
'set') {
192} elseif ($action ==
'del') {
199} elseif ($action ==
'setdoc') {
204 $conf->global->BANKADDON_PDF = $value;
223$dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
225llxHeader(
"", $langs->trans(
"BankSetupModule"),
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-bank');
227$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>';
229print
load_fiche_titre($langs->trans(
"BankSetupModule"), $linkback,
'title_setup');
231print
'<form name="bankmovementcolorconfig" action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
232print
'<input type="hidden" name="token" value="'.newToken().
'">';
233print
'<input type="hidden" name="action" value="save">';
236print
dol_get_fiche_head($head,
'general', $langs->trans(
"BankSetupModule"), -1,
'account');
241print
'<div class="div-table-responsive-no-min">';
242print
'<table class="noborder centpercent">';
243print
'<tr class="liste_titre">';
244print
'<td>'.$langs->trans(
"Name").
'</td>';
245print
'<td class="minwidth100">'.$langs->trans(
"Description").
'</td>';
246print
'<td>'.$langs->trans(
"Example").
'</td>';
247print
'<td class="center">'.$langs->trans(
"Status").
'</td>';
251$bankorder[0][0] = $langs->trans(
"BankOrderGlobal");
252$bankorder[0][1] = $langs->trans(
"BankOrderGlobalDesc");
253$bankorder[0][2] =
'BankCode DeskCode BankAccountNumber BankAccountNumberKey';
254$bankorder[1][0] = $langs->trans(
"BankOrderES");
255$bankorder[1][1] = $langs->trans(
"BankOrderESDesc");
256$bankorder[1][2] =
'BankCode DeskCode BankAccountNumberKey BankAccountNumber';
260$nbofbank = count($bankorder);
261while ($i < $nbofbank) {
262 print
'<tr class="oddeven">';
263 print
'<td>'.$bankorder[$i][0].
"</td><td>\n";
264 print $bankorder[$i][1];
266 print
'<td class="nowrap">';
267 $tmparray = explode(
' ', $bankorder[$i][2]);
268 foreach ($tmparray as $key => $val) {
272 print $langs->trans($val);
277 print
'<td class="center">';
278 print
img_picto($langs->trans(
"Activated"),
'on');
281 print
'<td class="center"><a href="'.$_SERVER[
'PHP_SELF'].
'?action=setbankorder&token='.newToken().
'&value='.((int) $i).
'">';
282 print
img_picto($langs->trans(
"Disabled"),
'off');
289print
'</table>'.
"\n";
304$sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
305$sql .=
" WHERE type = '".$db->escape($type).
"'";
306$sql .=
" AND entity = ".((int)
$conf->entity);
307$resql =
$db->query($sql);
310 $num_rows =
$db->num_rows($resql);
311 while ($i < $num_rows) {
312 $array =
$db->fetch_array($resql);
313 if (is_array($array)) {
314 array_push($def, $array[0]);
322print
'<div class="div-table-responsive-no-min">';
323print
'<table class="noborder centpercent">'.
"\n";
324print
'<tr class="liste_titre">'.
"\n";
325print
'<td>'.$langs->trans(
"Name").
'</td>';
326print
'<td class="minwidth100">'.$langs->trans(
"Description").
'</td>';
327print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
328print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
329print
'<td class="center" width="38">'.$langs->trans(
"ShortInfo").
'</td>';
330print
'<td class="center" width="38">'.$langs->trans(
"Preview").
'</td>';
335foreach ($dirmodels as $reldir) {
336 foreach (array(
'',
'/doc') as $valdir) {
340 $handle = opendir($dir);
341 if (is_resource($handle)) {
343 while (($file = readdir($handle)) !==
false) {
349 foreach ($filelist as $file) {
350 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
351 if (file_exists($dir.
'/'.$file)) {
352 $name = substr($file, 4,
dol_strlen($file) - 16);
353 $classname = substr($file, 0,
dol_strlen($file) - 12);
355 require_once $dir.
'/'.$file;
356 $module =
new $classname(
$db);
358 '@phan-var-force ModeleBankAccountDoc $module';
360 $modulequalified = 1;
361 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
362 $modulequalified = 0;
364 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
365 $modulequalified = 0;
368 if ($modulequalified) {
369 print
'<tr class="oddeven"><td width="100">';
370 print(empty($module->name) ? $name : $module->
name);
372 if (method_exists($module,
'info')) {
373 print $module->info($langs);
375 print $module->description;
380 if (in_array($name, $def)) {
381 print
'<td class="center">'.
"\n";
382 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.newToken().
'&value='.$name.
'">';
383 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
387 print
'<td class="center">'.
"\n";
388 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=set&value='.$name.
'&token='.newToken().
'&scan_dir='.$module->scandir.
'&label='.urlencode($module->name).
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
393 print
'<td class="center">';
395 print
img_picto($langs->trans(
"Default"),
'on');
397 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setdoc&token='.newToken().
'&value='.$name.
'&scan_dir='.$module->scandir.
'&label='.urlencode($module->name).
'" alt="'.$langs->trans(
"Default").
'">'.
img_picto($langs->trans(
"Disabled"),
'off').
'</a>';
402 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
403 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
404 if ($module->type ==
'pdf') {
405 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
407 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
408 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
411 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
416 print
'<td class="center">';
417 print $form->textwithpicto(
'', $htmltooltip, 1,
'info');
421 print
'<td class="center">';
422 if ($module->type ==
'pdf') {
423 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
425 print
img_object($langs->transnoentitiesnoconv(
"PreviewNotAvailable"),
'generic');
445print
'<div class="div-table-responsive-no-min">';
446print
'<table class="noborder centpercent">'.
"\n";
447print
'<tr class="liste_titre">'.
"\n";
448print
'<td colspan="4">'.$langs->trans(
"Parameter").
'</td>';
449print
'<td align="center" width="75"></td>'.
"\n";
452print
'<tr class="oddeven"><td colspan="4">';
453print $langs->trans(
'BankColorizeMovementDesc');
457 print
'<td class="center">'.
"\n";
458 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=unsetbankcolorizemovement&token='.newToken().
'">';
459 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
463 print
'<td class="center">'.
"\n";
464 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setbankcolorizemovement&token='.newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
474 $color =
'BANK_COLORIZE_MOVEMENT_COLOR'.$key;
476 print
'<tr class="oddeven">';
479 print
'<td colspan="4" width="180" class="nowrap">'.$langs->trans(
"BankColorizeMovementName".$key).
"</td>";
481 print
'<td class="nowrap right">';
482 print $formother->selectColor((
GETPOST(
"BANK_COLORIZE_MOVEMENT_COLOR".$key) ?
GETPOST(
"BANK_COLORIZE_MOVEMENT_COLOR".$key) :
getDolGlobalString($color)),
"BANK_COLORIZE_MOVEMENT_COLOR".$key,
'', 1, array(),
'right hideifnotset');
500print
'<div class="div-table-responsive-no-min">';
501print
'<table class="noborder centpercent">'.
"\n";
502print
'<tr class="liste_titre">'.
"\n";
503print
'<td>'.$langs->trans(
"Parameter").
'</td>';
508print
'<tr class="oddeven">';
509print
'<td>'.$langs->trans(
"BANK_DISABLE_DIRECT_INPUT").
'</td>';
511 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setBANK_DISABLE_DIRECT_INPUT&value=0">';
512 print
img_picto($langs->trans(
"Activated"),
'switch_on');
515 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.newToken().
'&action=setBANK_DISABLE_DIRECT_INPUT&value=1">';
516 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
522print
'<tr class="oddeven"><td>'.
"\n";
523print $langs->trans(
'AutoReportLastAccountStatement');
527 print
'<td class="center">'.
"\n";
528 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=unsetreportlastnumreleve&token='.newToken().
'">';
529 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
533 print
'<td class="center">'.
"\n";
534 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setreportlastnumreleve&token='.newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
541 print
'<tr class="oddeven">';
542 print
'<td>'.$form->textwithpicto($langs->trans(
"AllowOnLineSign"), $langs->trans(
"AllowOnLineSignDesc")).
'</td>';
543 print
'<td class="center">';
544 print ajax_constantonoff(
'SOCIETE_RIB_ALLOW_ONLINESIGN', array(),
null, 0, 0, 0, 2, 0, 1,
'',
'',
'inline-block', 0, $langs->transnoentitiesnoconv(
"WarningOnlineSignature",
"https://www.dolistore.com"));
553print $form->buttonsSaveCancel(
"Save",
'');
if(! $sortfield) if(! $sortorder) $object
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
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).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
delDocumentModel($name, $type)
Delete document model used by doc generator.
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.
bank_admin_prepare_head($object)
Prepare array with list of tabs.
Class to manage bank accounts.
Class to manage bank accounts description of third parties.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
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, $morecssdiv='')
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $allowothertags=array())
Show a picto called object_picto (generic function)
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$conf db name
Only used if Module[ID]Name translation string is not found.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.