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';
38$langs->loadLangs(array(
"admin",
"companies",
"bills",
"other",
"banks"));
40$action =
GETPOST(
'action',
'aZ09');
41$actionsave =
GETPOST(
'save',
'alpha');
42$value =
GETPOST(
'value',
'alpha');
43$label =
GETPOST(
'label',
'alpha');
44$scandir =
GETPOST(
'scan_dir',
'alpha');
58if (in_array($action, array(
'setBANK_DISABLE_DIRECT_INPUT'))) {
59 $constname = preg_replace(
'/^set/',
'', $action);
61 $res =
dolibarr_set_const($db, $constname, $constvalue,
'yesno', 0,
'', $conf->entity);
74if ($action ==
'setbankorder') {
82if ($action ==
'setreportlastnumreleve') {
83 if (
dolibarr_set_const($db,
"BANK_REPORT_LAST_NUM_RELEVE", 1,
'chaine', 0,
'', $conf->entity) > 0) {
87} elseif ($action ==
'unsetreportlastnumreleve') {
88 if (
dolibarr_set_const($db,
"BANK_REPORT_LAST_NUM_RELEVE", 0,
'chaine', 0,
'', $conf->entity) > 0) {
95if ($action ==
'setbankcolorizemovement') {
96 if (
dolibarr_set_const($db,
"BANK_COLORIZE_MOVEMENT", 1,
'chaine', 0,
'', $conf->entity) > 0) {
100} elseif ($action ==
'unsetbankcolorizemovement') {
101 if (
dolibarr_set_const($db,
"BANK_COLORIZE_MOVEMENT", 0,
'chaine', 0,
'', $conf->entity) > 0) {
116 $color =
GETPOST(
'BANK_COLORIZE_MOVEMENT_COLOR'.$i,
'alpha');
117 if ($color ==
'-1') {
121 $res =
dolibarr_set_const($db,
'BANK_COLORIZE_MOVEMENT_COLOR'.$i, $color,
'chaine', 0,
'', $conf->entity);
133 if (empty($errorsaved)) {
140if ($action ==
'specimen') {
141 $modele =
GETPOST(
'module',
'alpha');
143 if ($modele ==
'sepamandate') {
153 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
154 foreach ($dirmodels as $reldir) {
155 $file =
dol_buildpath($reldir.
"core/modules/bank/doc/pdf_".$modele.
".modules.php", 0);
156 if (file_exists($file)) {
157 $classname =
"pdf_".$modele;
162 if ($classname !==
'') {
165 $module =
new $classname($db);
166 '@phan-var-force ModeleBankAccountDoc $module';
168 if ($module->write_file(
$object, $langs) > 0) {
169 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=bank&file=SPECIMEN.pdf");
177 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
182if ($action ==
'set') {
184} elseif ($action ==
'del') {
187 if ($conf->global->BANKADDON_PDF ==
"$value") {
191} elseif ($action ==
'setdoc') {
193 if (
dolibarr_set_const($db,
"BANKADDON_PDF", $value,
'chaine', 0,
'', $conf->entity)) {
196 $conf->global->BANKADDON_PDF = $value;
212$form =
new Form($db);
215$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
217llxHeader(
"", $langs->trans(
"BankSetupModule"),
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-bank');
219$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
220print
load_fiche_titre($langs->trans(
"BankSetupModule"), $linkback,
'title_setup');
222print
'<form name="bankmovementcolorconfig" action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
223print
'<input type="hidden" name="token" value="'.newToken().
'">';
224print
'<input type="hidden" name="action" value="save">';
227print
dol_get_fiche_head($head,
'general', $langs->trans(
"BankSetupModule"), -1,
'account');
232print
'<div class="div-table-responsive-no-min">';
233print
'<table class="noborder centpercent">';
234print
'<tr class="liste_titre">';
235print
'<td>'.$langs->trans(
"Name").
'</td>';
236print
'<td class="minwidth100">'.$langs->trans(
"Description").
'</td>';
237print
'<td>'.$langs->trans(
"Example").
'</td>';
238print
'<td class="center">'.$langs->trans(
"Status").
'</td>';
242$bankorder[0][0] = $langs->trans(
"BankOrderGlobal");
243$bankorder[0][1] = $langs->trans(
"BankOrderGlobalDesc");
244$bankorder[0][2] =
'BankCode DeskCode BankAccountNumber BankAccountNumberKey';
245$bankorder[1][0] = $langs->trans(
"BankOrderES");
246$bankorder[1][1] = $langs->trans(
"BankOrderESDesc");
247$bankorder[1][2] =
'BankCode DeskCode BankAccountNumberKey BankAccountNumber';
251$nbofbank = count($bankorder);
252while ($i < $nbofbank) {
253 print
'<tr class="oddeven">';
254 print
'<td>'.$bankorder[$i][0].
"</td><td>\n";
255 print $bankorder[$i][1];
257 print
'<td class="nowrap">';
258 $tmparray = explode(
' ', $bankorder[$i][2]);
259 foreach ($tmparray as $key => $val) {
263 print $langs->trans($val);
268 print
'<td class="center">';
269 print
img_picto($langs->trans(
"Activated"),
'on');
272 print
'<td class="center"><a href="'.$_SERVER[
'PHP_SELF'].
'?action=setbankorder&token='.
newToken().
'&value='.((int) $i).
'">';
273 print
img_picto($langs->trans(
"Disabled"),
'off');
280print
'</table>'.
"\n";
295$sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
296$sql .=
" WHERE type = '".$db->escape($type).
"'";
297$sql .=
" AND entity = ".$conf->entity;
298$resql = $db->query($sql);
301 $num_rows = $db->num_rows($resql);
302 while ($i < $num_rows) {
303 $array = $db->fetch_array($resql);
304 if (is_array($array)) {
305 array_push($def, $array[0]);
313print
'<div class="div-table-responsive-no-min">';
314print
'<table class="noborder centpercent">'.
"\n";
315print
'<tr class="liste_titre">'.
"\n";
316print
'<td>'.$langs->trans(
"Name").
'</td>';
317print
'<td class="minwidth100">'.$langs->trans(
"Description").
'</td>';
318print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
319print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
320print
'<td class="center" width="38">'.$langs->trans(
"ShortInfo").
'</td>';
321print
'<td class="center" width="38">'.$langs->trans(
"Preview").
'</td>';
326foreach ($dirmodels as $reldir) {
327 foreach (array(
'',
'/doc') as $valdir) {
331 $handle = opendir($dir);
332 if (is_resource($handle)) {
334 while (($file = readdir($handle)) !==
false) {
340 foreach ($filelist as $file) {
341 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
342 if (file_exists($dir.
'/'.$file)) {
343 $name = substr($file, 4,
dol_strlen($file) - 16);
344 $classname = substr($file, 0,
dol_strlen($file) - 12);
346 require_once $dir.
'/'.$file;
347 $module =
new $classname($db);
349 $modulequalified = 1;
350 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
351 $modulequalified = 0;
353 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
354 $modulequalified = 0;
357 if ($modulequalified) {
358 print
'<tr class="oddeven"><td width="100">';
359 print(empty($module->name) ? $name : $module->
name);
361 if (method_exists($module,
'info')) {
362 print $module->info($langs);
364 print $module->description;
369 if (in_array($name, $def)) {
370 print
'<td class="center">'.
"\n";
371 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.
newToken().
'&value='.$name.
'">';
372 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
376 print
'<td class="center">'.
"\n";
377 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>';
382 print
'<td class="center">';
383 if ($conf->global->BANKADDON_PDF == $name) {
384 print
img_picto($langs->trans(
"Default"),
'on');
386 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>';
391 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
392 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
393 if ($module->type ==
'pdf') {
394 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
396 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
397 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
400 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
405 print
'<td class="center">';
406 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
410 print
'<td class="center">';
411 if ($module->type ==
'pdf') {
412 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
414 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
434print
'<div class="div-table-responsive-no-min">';
435print
'<table class="noborder centpercent">'.
"\n";
436print
'<tr class="liste_titre">'.
"\n";
437print
'<td colspan="4">'.$langs->trans(
"Name").
'</td>';
438print
'<td align="center" width="75">'.$langs->trans(
"Value").
'</td>'.
"\n";
441print
'<tr class="oddeven"><td colspan="4">';
442print $langs->trans(
'BankColorizeMovementDesc');
446 print
'<td class="center">'.
"\n";
447 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=unsetbankcolorizemovement&token='.
newToken().
'">';
448 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
452 print
'<td class="center">'.
"\n";
453 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setbankcolorizemovement&token='.
newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
463 $color =
'BANK_COLORIZE_MOVEMENT_COLOR'.$key;
465 print
'<tr class="oddeven">';
468 print
'<td colspan="4" width="180" class="nowrap">'.$langs->trans(
"BankColorizeMovementName".$key).
"</td>";
470 print
'<td class="nowrap right">';
471 print $formother->selectColor((
GETPOST(
"BANK_COLORIZE_MOVEMENT_COLOR".$key) ?
GETPOST(
"BANK_COLORIZE_MOVEMENT_COLOR".$key) :
getDolGlobalString($color)),
"BANK_COLORIZE_MOVEMENT_COLOR".$key,
'bankmovementcolorconfig', 1,
'',
'right hideifnotset');
489print
'<div class="div-table-responsive-no-min">';
490print
'<table class="noborder centpercent">'.
"\n";
491print
'<tr class="liste_titre">'.
"\n";
492print
'<td>'.$langs->trans(
"Name").
'</td>';
493print
'<td>'.$langs->trans(
"Description").
'</td>';
494print
'<td class="center width75">'.$langs->trans(
"Status").
"</td>\n";
497print
'<tr class="oddeven">';
498print
'<td>'.$langs->trans(
"BANK_DISABLE_DIRECT_INPUT").
'</td><td></td>';
500 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setBANK_DISABLE_DIRECT_INPUT&value=0">';
501 print
img_picto($langs->trans(
"Activated"),
'switch_on');
504 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setBANK_DISABLE_DIRECT_INPUT&value=1">';
505 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
510print
'<tr class="oddeven"><td>';
511print $langs->trans(
'AccountStatement');
513print $langs->trans(
'AutoReportLastAccountStatement');
517 print
'<td class="center">'.
"\n";
518 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=unsetreportlastnumreleve&token='.
newToken().
'">';
519 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
523 print
'<td class="center">'.
"\n";
524 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setreportlastnumreleve&token='.
newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
531 print
'<tr class="oddeven">';
532 print
'<td>'.$langs->trans(
"AllowOnLineSign").
'</td>';
533 print
'<td>'.$langs->trans(
"AllowOnLineSignDesc").
'</td>';
534 print
'<td class="center">';
535 print ajax_constantonoff(
'SOCIETE_RIB_ALLOW_ONLINESIGN', array(),
null, 0, 0, 0, 2, 0, 1);
544print $form->buttonsSaveCancel(
"Save",
'');
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $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.
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($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
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.
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_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.
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)
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_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.