27require
'../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/bank.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/societe/class/companybankaccount.class.php';
35$langs->loadLangs(array(
"admin",
"companies",
"bills",
"other",
"banks"));
41$action =
GETPOST(
'action',
'aZ09');
42$actionsave =
GETPOST(
'save',
'alpha');
43$value =
GETPOST(
'value',
'alpha');
44$label =
GETPOST(
'label',
'alpha');
45$scandir =
GETPOST(
'scan_dir',
'alpha');
54if ($action ==
'setbankorder') {
62if ($action ==
'setreportlastnumreleve') {
63 if (
dolibarr_set_const($db,
"BANK_REPORT_LAST_NUM_RELEVE", 1,
'chaine', 0,
'', $conf->entity) > 0) {
67} elseif ($action ==
'unsetreportlastnumreleve') {
68 if (
dolibarr_set_const($db,
"BANK_REPORT_LAST_NUM_RELEVE", 0,
'chaine', 0,
'', $conf->entity) > 0) {
75if ($action ==
'setbankcolorizemovement') {
76 if (
dolibarr_set_const($db,
"BANK_COLORIZE_MOVEMENT", 1,
'chaine', 0,
'', $conf->entity) > 0) {
80} elseif ($action ==
'unsetbankcolorizemovement') {
81 if (
dolibarr_set_const($db,
"BANK_COLORIZE_MOVEMENT", 0,
'chaine', 0,
'', $conf->entity) > 0) {
90 $i = 1; $errorsaved = 0;
95 $color =
GETPOST(
'BANK_COLORIZE_MOVEMENT_COLOR'.$i,
'alpha');
100 $res =
dolibarr_set_const($db,
'BANK_COLORIZE_MOVEMENT_COLOR'.$i, $color,
'chaine', 0,
'', $conf->entity);
112 if (empty($errorsaved)) {
119if ($action ==
'specimen') {
120 $modele =
GETPOST(
'module',
'alpha');
122 if ($modele ==
'sepamandate') {
127 $object->initAsSpecimen();
133 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
134 foreach ($dirmodels as $reldir) {
135 $file =
dol_buildpath($reldir.
"core/modules/bank/doc/pdf_".$modele.
".modules.php", 0);
136 if (file_exists($file)) {
138 $classname =
"pdf_".$modele;
146 $module =
new $classname($db);
148 if ($module->write_file($object, $langs) > 0) {
149 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=bank&file=SPECIMEN.pdf");
157 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
162if ($action ==
'set') {
164} elseif ($action ==
'del') {
167 if ($conf->global->BANKADDON_PDF ==
"$value") {
171} elseif ($action ==
'setdoc') {
173 if (
dolibarr_set_const($db,
"BANKADDON_PDF", $value,
'chaine', 0,
'', $conf->entity)) {
176 $conf->global->BANKADDON_PDF = $value;
192$form =
new Form($db);
195$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
197llxHeader(
"", $langs->trans(
"BankSetupModule"));
199$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
200print
load_fiche_titre($langs->trans(
"BankSetupModule"), $linkback,
'title_setup');
202print
'<form name="bankmovementcolorconfig" action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
203print
'<input type="hidden" name="token" value="'.newToken().
'">';
204print
'<input type="hidden" name="action" value="save">';
207print
dol_get_fiche_head($head,
'general', $langs->trans(
"BankSetupModule"), -1,
'account');
212print
'<table class="noborder centpercent">';
213print
'<tr class="liste_titre">';
214print
'<td width="140">'.$langs->trans(
"Name").
'</td>';
215print
'<td>'.$langs->trans(
"Description").
'</td>';
216print
'<td>'.$langs->trans(
"Example").
'</td>';
217print
'<td class="center">'.$langs->trans(
"Status").
'</td>';
218print
'<td class="center" width="60"> </td>';
221$bankorder[0][0] = $langs->trans(
"BankOrderGlobal");
222$bankorder[0][1] = $langs->trans(
"BankOrderGlobalDesc");
223$bankorder[0][2] =
'BankCode DeskCode BankAccountNumber BankAccountNumberKey';
224$bankorder[1][0] = $langs->trans(
"BankOrderES");
225$bankorder[1][1] = $langs->trans(
"BankOrderESDesc");
226$bankorder[1][2] =
'BankCode DeskCode BankAccountNumberKey BankAccountNumber';
230$nbofbank = count($bankorder);
231while ($i < $nbofbank) {
232 print
'<tr class="oddeven">';
233 print
'<td>'.$bankorder[$i][0].
"</td><td>\n";
234 print $bankorder[$i][1];
236 print
'<td class="nowrap">';
237 $tmparray = explode(
' ', $bankorder[$i][2]);
238 foreach ($tmparray as $key => $val) {
242 print $langs->trans($val);
246 if ($conf->global->BANK_SHOW_ORDER_OPTION == $i) {
247 print
'<td class="center">';
248 print
img_picto($langs->trans(
"Activated"),
'on');
251 print
'<td class="center"><a href="'.$_SERVER[
'PHP_SELF'].
'?action=setbankorder&token='.newToken().
'&value='.$i.
'">';
252 print
img_picto($langs->trans(
"Disabled"),
'off');
255 print
'<td> </td>';
260print
'</table>'.
"\n";
274$sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
275$sql .=
" WHERE type = '".$db->escape($type).
"'";
276$sql .=
" AND entity = ".$conf->entity;
277$resql = $db->query($sql);
280 $num_rows = $db->num_rows($resql);
281 while ($i < $num_rows) {
282 $array = $db->fetch_array($resql);
283 array_push($def, $array[0]);
290print
"<table class=\"noborder\" width=\"100%\">\n";
291print
"<tr class=\"liste_titre\">\n";
292print
'<td>'.$langs->trans(
"Name").
'</td>';
293print
'<td>'.$langs->trans(
"Description").
'</td>';
294print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
295print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
296print
'<td class="center" width="38">'.$langs->trans(
"ShortInfo").
'</td>';
297print
'<td class="center" width="38">'.$langs->trans(
"Preview").
'</td>';
302foreach ($dirmodels as $reldir) {
303 foreach (array(
'',
'/doc') as $valdir) {
307 $handle = opendir($dir);
308 if (is_resource($handle)) {
309 while (($file = readdir($handle)) !==
false) {
315 foreach ($filelist as $file) {
316 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
317 if (file_exists($dir.
'/'.$file)) {
318 $name = substr($file, 4,
dol_strlen($file) - 16);
319 $classname = substr($file, 0,
dol_strlen($file) - 12);
321 require_once $dir.
'/'.$file;
322 $module =
new $classname($db);
324 $modulequalified = 1;
325 if ($module->version ==
'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
326 $modulequalified = 0;
328 if ($module->version ==
'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
329 $modulequalified = 0;
332 if ($modulequalified) {
333 print
'<tr class="oddeven"><td width="100">';
334 print(empty($module->name) ? $name : $module->
name);
336 if (method_exists($module,
'info')) {
337 print $module->info($langs);
339 print $module->description;
344 if (in_array($name, $def)) {
345 print
'<td class="center">'.
"\n";
346 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.newToken().
'&value='.$name.
'">';
347 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
351 print
'<td class="center">'.
"\n";
352 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>';
357 print
'<td class="center">';
358 if ($conf->global->BANKADDON_PDF == $name) {
359 print
img_picto($langs->trans(
"Default"),
'on');
361 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>';
366 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
367 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
368 if ($module->type ==
'pdf') {
369 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
371 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
372 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
375 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
380 print
'<td class="center">';
381 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
385 print
'<td class="center">';
386 if ($module->type ==
'pdf') {
387 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
389 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
408print
'<table class="noborder centpercent">';
409print
"<tr class=\"liste_titre\">\n";
410print
'<td colspan="4">'.$langs->trans(
"Name").
'</td>';
411print
'<td align="center" width="100">'.$langs->trans(
"Value").
'</td>'.
"\n";
414print
'<tr class="oddeven"><td colspan="4" width="100">';
415print $langs->trans(
'BankColorizeMovementDesc');
418if ($conf->global->BANK_COLORIZE_MOVEMENT) {
419 print
'<td class="center">'.
"\n";
420 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=unsetbankcolorizemovement&token='.newToken().
'">';
421 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
425 print
'<td class="center">'.
"\n";
426 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setbankcolorizemovement&token='.newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
432if (!empty($conf->global->BANK_COLORIZE_MOVEMENT)) {
436 $color =
'BANK_COLORIZE_MOVEMENT_COLOR'.$key;
438 print
'<tr class="oddeven">';
441 print
'<td colspan="4" width="180" class="nowrap">'.$langs->trans(
"BankColorizeMovementName".$key).
"</td>";
443 print
'<td class="nowrap right">';
444 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');
461print
"<table class=\"noborder\" width=\"100%\">\n";
462print
"<tr class=\"liste_titre\">\n";
463print
'<td>'.$langs->trans(
"Name").
'</td>';
464print
'<td>'.$langs->trans(
"Description").
'</td>';
465print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
468print
'<tr class="oddeven"><td width="100">';
469print $langs->trans(
'AccountStatement');
471print $langs->trans(
'AutoReportLastAccountStatement');
474if ($conf->global->BANK_REPORT_LAST_NUM_RELEVE) {
475 print
'<td class="center">'.
"\n";
476 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=unsetreportlastnumreleve&token='.newToken().
'">';
477 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
481 print
'<td class="center">'.
"\n";
482 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setreportlastnumreleve&token='.newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
490print $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.
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.
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.