28require
'../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/societe/class/companybankaccount.class.php';
36$langs->loadLangs(array(
"admin",
"companies",
"bills",
"other",
"banks"));
42$action =
GETPOST(
'action',
'aZ09');
43$actionsave =
GETPOST(
'save',
'alpha');
44$value =
GETPOST(
'value',
'alpha');
45$label =
GETPOST(
'label',
'alpha');
46$scandir =
GETPOST(
'scan_dir',
'alpha');
55if ($action ==
'setbankorder') {
63if ($action ==
'setreportlastnumreleve') {
64 if (
dolibarr_set_const($db,
"BANK_REPORT_LAST_NUM_RELEVE", 1,
'chaine', 0,
'', $conf->entity) > 0) {
68} elseif ($action ==
'unsetreportlastnumreleve') {
69 if (
dolibarr_set_const($db,
"BANK_REPORT_LAST_NUM_RELEVE", 0,
'chaine', 0,
'', $conf->entity) > 0) {
76if ($action ==
'setbankcolorizemovement') {
77 if (
dolibarr_set_const($db,
"BANK_COLORIZE_MOVEMENT", 1,
'chaine', 0,
'', $conf->entity) > 0) {
81} elseif ($action ==
'unsetbankcolorizemovement') {
82 if (
dolibarr_set_const($db,
"BANK_COLORIZE_MOVEMENT", 0,
'chaine', 0,
'', $conf->entity) > 0) {
97 $color =
GETPOST(
'BANK_COLORIZE_MOVEMENT_COLOR'.$i,
'alpha');
102 $res =
dolibarr_set_const($db,
'BANK_COLORIZE_MOVEMENT_COLOR'.$i, $color,
'chaine', 0,
'', $conf->entity);
114 if (empty($errorsaved)) {
121if ($action ==
'specimen') {
122 $modele =
GETPOST(
'module',
'alpha');
124 if ($modele ==
'sepamandate') {
129 $object->initAsSpecimen();
135 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
136 foreach ($dirmodels as $reldir) {
137 $file =
dol_buildpath($reldir.
"core/modules/bank/doc/pdf_".$modele.
".modules.php", 0);
138 if (file_exists($file)) {
140 $classname =
"pdf_".$modele;
148 $module =
new $classname($db);
150 if ($module->write_file($object, $langs) > 0) {
151 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=bank&file=SPECIMEN.pdf");
159 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
164if ($action ==
'set') {
166} elseif ($action ==
'del') {
169 if ($conf->global->BANKADDON_PDF ==
"$value") {
173} elseif ($action ==
'setdoc') {
175 if (
dolibarr_set_const($db,
"BANKADDON_PDF", $value,
'chaine', 0,
'', $conf->entity)) {
178 $conf->global->BANKADDON_PDF = $value;
194$form =
new Form($db);
197$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
199llxHeader(
"", $langs->trans(
"BankSetupModule"));
201$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
202print
load_fiche_titre($langs->trans(
"BankSetupModule"), $linkback,
'title_setup');
204print
'<form name="bankmovementcolorconfig" action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
205print
'<input type="hidden" name="token" value="'.newToken().
'">';
206print
'<input type="hidden" name="action" value="save">';
209print
dol_get_fiche_head($head,
'general', $langs->trans(
"BankSetupModule"), -1,
'account');
214print
'<div class="div-table-responsive-no-min">';
215print
'<table class="noborder centpercent">';
216print
'<tr class="liste_titre">';
217print
'<td>'.$langs->trans(
"Name").
'</td>';
218print
'<td class="minwidth100">'.$langs->trans(
"Description").
'</td>';
219print
'<td>'.$langs->trans(
"Example").
'</td>';
220print
'<td class="center">'.$langs->trans(
"Status").
'</td>';
223$bankorder[0][0] = $langs->trans(
"BankOrderGlobal");
224$bankorder[0][1] = $langs->trans(
"BankOrderGlobalDesc");
225$bankorder[0][2] =
'BankCode DeskCode BankAccountNumber BankAccountNumberKey';
226$bankorder[1][0] = $langs->trans(
"BankOrderES");
227$bankorder[1][1] = $langs->trans(
"BankOrderESDesc");
228$bankorder[1][2] =
'BankCode DeskCode BankAccountNumberKey BankAccountNumber';
232$nbofbank = count($bankorder);
233while ($i < $nbofbank) {
234 print
'<tr class="oddeven">';
235 print
'<td>'.$bankorder[$i][0].
"</td><td>\n";
236 print $bankorder[$i][1];
238 print
'<td class="nowrap">';
239 $tmparray = explode(
' ', $bankorder[$i][2]);
240 foreach ($tmparray as $key => $val) {
244 print $langs->trans($val);
249 print
'<td class="center">';
250 print
img_picto($langs->trans(
"Activated"),
'on');
253 print
'<td class="center"><a href="'.$_SERVER[
'PHP_SELF'].
'?action=setbankorder&token='.newToken().
'&value='.((int) $i).
'">';
254 print
img_picto($langs->trans(
"Disabled"),
'off');
261print
'</table>'.
"\n";
276$sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
277$sql .=
" WHERE type = '".$db->escape($type).
"'";
278$sql .=
" AND entity = ".$conf->entity;
279$resql = $db->query($sql);
282 $num_rows = $db->num_rows($resql);
283 while ($i < $num_rows) {
284 $array = $db->fetch_array($resql);
285 array_push($def, $array[0]);
292print
'<div class="div-table-responsive-no-min">';
293print
'<table class="noborder centpercent">'.
"\n";
294print
'<tr class="liste_titre">'.
"\n";
295print
'<td>'.$langs->trans(
"Name").
'</td>';
296print
'<td class="minwidth100">'.$langs->trans(
"Description").
'</td>';
297print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
298print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
299print
'<td class="center" width="38">'.$langs->trans(
"ShortInfo").
'</td>';
300print
'<td class="center" width="38">'.$langs->trans(
"Preview").
'</td>';
305foreach ($dirmodels as $reldir) {
306 foreach (array(
'',
'/doc') as $valdir) {
310 $handle = opendir($dir);
311 if (is_resource($handle)) {
312 while (($file = readdir($handle)) !==
false) {
318 foreach ($filelist as $file) {
319 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
320 if (file_exists($dir.
'/'.$file)) {
321 $name = substr($file, 4,
dol_strlen($file) - 16);
322 $classname = substr($file, 0,
dol_strlen($file) - 12);
324 require_once $dir.
'/'.$file;
325 $module =
new $classname($db);
327 $modulequalified = 1;
328 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
329 $modulequalified = 0;
331 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
332 $modulequalified = 0;
335 if ($modulequalified) {
336 print
'<tr class="oddeven"><td width="100">';
337 print(empty($module->name) ? $name : $module->
name);
339 if (method_exists($module,
'info')) {
340 print $module->info($langs);
342 print $module->description;
347 if (in_array($name, $def)) {
348 print
'<td class="center">'.
"\n";
349 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.newToken().
'&value='.$name.
'">';
350 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
354 print
'<td class="center">'.
"\n";
355 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=set&value='.$name.
'&token='.newToken().
'&can_dir='.$module->scandir.
'&label='.urlencode($module->name).
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
360 print
'<td class="center">';
361 if ($conf->global->BANKADDON_PDF == $name) {
362 print
img_picto($langs->trans(
"Default"),
'on');
364 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>';
369 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
370 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
371 if ($module->type ==
'pdf') {
372 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
374 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
375 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
378 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
383 print
'<td class="center">';
384 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
388 print
'<td class="center">';
389 if ($module->type ==
'pdf') {
390 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
392 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
412print
'<div class="div-table-responsive-no-min">';
413print
'<table class="noborder centpercent">'.
"\n";
414print
'<tr class="liste_titre">'.
"\n";
415print
'<td colspan="4">'.$langs->trans(
"Name").
'</td>';
416print
'<td align="center" width="75">'.$langs->trans(
"Value").
'</td>'.
"\n";
419print
'<tr class="oddeven"><td colspan="4">';
420print $langs->trans(
'BankColorizeMovementDesc');
424 print
'<td class="center">'.
"\n";
425 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=unsetbankcolorizemovement&token='.newToken().
'">';
426 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
430 print
'<td class="center">'.
"\n";
431 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setbankcolorizemovement&token='.newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
441 $color =
'BANK_COLORIZE_MOVEMENT_COLOR'.$key;
443 print
'<tr class="oddeven">';
446 print
'<td colspan="4" width="180" class="nowrap">'.$langs->trans(
"BankColorizeMovementName".$key).
"</td>";
448 print
'<td class="nowrap right">';
449 print $formother->selectColor((
GETPOST(
"BANK_COLORIZE_MOVEMENT_COLOR".$key) ?
GETPOST(
"BANK_COLORIZE_MOVEMENT_COLOR".$key) : $conf->global->$color),
"BANK_COLORIZE_MOVEMENT_COLOR".$key,
'bankmovementcolorconfig', 1,
'',
'right hideifnotset');
467print
'<div class="div-table-responsive-no-min">';
468print
'<table class="noborder centpercent">'.
"\n";
469print
'<tr class="liste_titre">'.
"\n";
470print
'<td>'.$langs->trans(
"Name").
'</td>';
471print
'<td>'.$langs->trans(
"Description").
'</td>';
472print
'<td class="center width75">'.$langs->trans(
"Status").
"</td>\n";
475print
'<tr class="oddeven"><td>';
476print $langs->trans(
'AccountStatement');
478print $langs->trans(
'AutoReportLastAccountStatement');
482 print
'<td class="center">'.
"\n";
483 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=unsetreportlastnumreleve&token='.newToken().
'">';
484 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
488 print
'<td class="center">'.
"\n";
489 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setreportlastnumreleve&token='.newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
496 print
'<tr class="oddeven">';
497 print
'<td>'.$langs->trans(
"AllowOnLineSign").
'</td>';
498 print
'<td>'.$langs->trans(
"BankAccountModelModule").
'</td>';
499 print
'<td class="center">';
500 print ajax_constantonoff(
'SOCIETE_RIB_ALLOW_ONLINESIGN', array(),
null, 0, 0, 0, 2, 0, 1);
509print $form->buttonsSaveCancel(
"Save",
'');
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.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
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.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
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_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return 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.