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') {
195 if (
$conf->global->BANKADDON_PDF ==
"$value") {
199} elseif ($action ==
'setdoc') {
204 $conf->global->BANKADDON_PDF = $value;
220$form =
new Form($db);
223$dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
225llxHeader(
"", $langs->trans(
"BankSetupModule"),
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-bank');
227$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
228print
load_fiche_titre($langs->trans(
"BankSetupModule"), $linkback,
'title_setup');
230print
'<form name="bankmovementcolorconfig" action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
231print
'<input type="hidden" name="token" value="'.newToken().
'">';
232print
'<input type="hidden" name="action" value="save">';
235print
dol_get_fiche_head($head,
'general', $langs->trans(
"BankSetupModule"), -1,
'account');
240print
'<div class="div-table-responsive-no-min">';
241print
'<table class="noborder centpercent">';
242print
'<tr class="liste_titre">';
243print
'<td>'.$langs->trans(
"Name").
'</td>';
244print
'<td class="minwidth100">'.$langs->trans(
"Description").
'</td>';
245print
'<td>'.$langs->trans(
"Example").
'</td>';
246print
'<td class="center">'.$langs->trans(
"Status").
'</td>';
250$bankorder[0][0] = $langs->trans(
"BankOrderGlobal");
251$bankorder[0][1] = $langs->trans(
"BankOrderGlobalDesc");
252$bankorder[0][2] =
'BankCode DeskCode BankAccountNumber BankAccountNumberKey';
253$bankorder[1][0] = $langs->trans(
"BankOrderES");
254$bankorder[1][1] = $langs->trans(
"BankOrderESDesc");
255$bankorder[1][2] =
'BankCode DeskCode BankAccountNumberKey BankAccountNumber';
259$nbofbank = count($bankorder);
260while ($i < $nbofbank) {
261 print
'<tr class="oddeven">';
262 print
'<td>'.$bankorder[$i][0].
"</td><td>\n";
263 print $bankorder[$i][1];
265 print
'<td class="nowrap">';
266 $tmparray = explode(
' ', $bankorder[$i][2]);
267 foreach ($tmparray as $key => $val) {
271 print $langs->trans($val);
276 print
'<td class="center">';
277 print
img_picto($langs->trans(
"Activated"),
'on');
280 print
'<td class="center"><a href="'.$_SERVER[
'PHP_SELF'].
'?action=setbankorder&token='.
newToken().
'&value='.((int) $i).
'">';
281 print
img_picto($langs->trans(
"Disabled"),
'off');
288print
'</table>'.
"\n";
303$sql .=
" FROM ".MAIN_DB_PREFIX.
"document_model";
304$sql .=
" WHERE type = '".$db->escape($type).
"'";
305$sql .=
" AND entity = ".$conf->entity;
306$resql = $db->query($sql);
309 $num_rows = $db->num_rows($resql);
310 while ($i < $num_rows) {
311 $array = $db->fetch_array($resql);
312 if (is_array($array)) {
313 array_push($def, $array[0]);
321print
'<div class="div-table-responsive-no-min">';
322print
'<table class="noborder centpercent">'.
"\n";
323print
'<tr class="liste_titre">'.
"\n";
324print
'<td>'.$langs->trans(
"Name").
'</td>';
325print
'<td class="minwidth100">'.$langs->trans(
"Description").
'</td>';
326print
'<td class="center" width="60">'.$langs->trans(
"Status").
"</td>\n";
327print
'<td class="center" width="60">'.$langs->trans(
"Default").
"</td>\n";
328print
'<td class="center" width="38">'.$langs->trans(
"ShortInfo").
'</td>';
329print
'<td class="center" width="38">'.$langs->trans(
"Preview").
'</td>';
334foreach ($dirmodels as $reldir) {
335 foreach (array(
'',
'/doc') as $valdir) {
339 $handle = opendir($dir);
340 if (is_resource($handle)) {
342 while (($file = readdir($handle)) !==
false) {
348 foreach ($filelist as $file) {
349 if (preg_match(
'/\.modules\.php$/i', $file) && preg_match(
'/^(pdf_|doc_)/', $file)) {
350 if (file_exists($dir.
'/'.$file)) {
351 $name = substr($file, 4,
dol_strlen($file) - 16);
352 $classname = substr($file, 0,
dol_strlen($file) - 12);
354 require_once $dir.
'/'.$file;
355 $module =
new $classname($db);
357 '@phan-var-force ModeleBankAccountDoc $module';
359 $modulequalified = 1;
360 if ($module->version ==
'development' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 2) {
361 $modulequalified = 0;
363 if ($module->version ==
'experimental' &&
getDolGlobalInt(
'MAIN_FEATURES_LEVEL') < 1) {
364 $modulequalified = 0;
367 if ($modulequalified) {
368 print
'<tr class="oddeven"><td width="100">';
369 print(empty($module->name) ? $name : $module->
name);
371 if (method_exists($module,
'info')) {
372 print $module->info($langs);
374 print $module->description;
379 if (in_array($name, $def)) {
380 print
'<td class="center">'.
"\n";
381 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=del&token='.
newToken().
'&value='.$name.
'">';
382 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
386 print
'<td class="center">'.
"\n";
387 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>';
392 print
'<td class="center">';
394 print
img_picto($langs->trans(
"Default"),
'on');
396 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>';
401 $htmltooltip =
''.$langs->trans(
"Name").
': '.$module->name;
402 $htmltooltip .=
'<br>'.$langs->trans(
"Type").
': '.($module->type ? $module->type : $langs->trans(
"Unknown"));
403 if ($module->type ==
'pdf') {
404 $htmltooltip .=
'<br>'.$langs->trans(
"Width").
'/'.$langs->trans(
"Height").
': '.$module->page_largeur.
'/'.$module->page_hauteur;
406 $htmltooltip .=
'<br><br><u>'.$langs->trans(
"FeaturesSupported").
':</u>';
407 $htmltooltip .=
'<br>'.$langs->trans(
"Logo").
': '.
yn($module->option_logo, 1, 1);
410 $htmltooltip .=
'<br>'.$langs->trans(
"MultiLanguage").
': '.
yn($module->option_multilang, 1, 1);
415 print
'<td class="center">';
416 print $form->textwithpicto(
'', $htmltooltip, 1, 0);
420 print
'<td class="center">';
421 if ($module->type ==
'pdf') {
422 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=specimen&module='.$name.
'">'.
img_object($langs->trans(
"Preview"),
'pdf').
'</a>';
424 print
img_object($langs->trans(
"PreviewNotAvailable"),
'generic');
444print
'<div class="div-table-responsive-no-min">';
445print
'<table class="noborder centpercent">'.
"\n";
446print
'<tr class="liste_titre">'.
"\n";
447print
'<td colspan="4">'.$langs->trans(
"Name").
'</td>';
448print
'<td align="center" width="75">'.$langs->trans(
"Value").
'</td>'.
"\n";
451print
'<tr class="oddeven"><td colspan="4">';
452print $langs->trans(
'BankColorizeMovementDesc');
456 print
'<td class="center">'.
"\n";
457 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=unsetbankcolorizemovement&token='.
newToken().
'">';
458 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
462 print
'<td class="center">'.
"\n";
463 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setbankcolorizemovement&token='.
newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
473 $color =
'BANK_COLORIZE_MOVEMENT_COLOR'.$key;
475 print
'<tr class="oddeven">';
478 print
'<td colspan="4" width="180" class="nowrap">'.$langs->trans(
"BankColorizeMovementName".$key).
"</td>";
480 print
'<td class="nowrap right">';
481 print $formother->selectColor((
GETPOST(
"BANK_COLORIZE_MOVEMENT_COLOR".$key) ?
GETPOST(
"BANK_COLORIZE_MOVEMENT_COLOR".$key) :
getDolGlobalString($color)),
"BANK_COLORIZE_MOVEMENT_COLOR".$key,
'bankmovementcolorconfig', 1, array(),
'right hideifnotset');
499print
'<div class="div-table-responsive-no-min">';
500print
'<table class="noborder centpercent">'.
"\n";
501print
'<tr class="liste_titre">'.
"\n";
502print
'<td>'.$langs->trans(
"Parameter").
'</td>';
507print
'<tr class="oddeven">';
508print
'<td>'.$langs->trans(
"BANK_DISABLE_DIRECT_INPUT").
'</td>';
510 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setBANK_DISABLE_DIRECT_INPUT&value=0">';
511 print
img_picto($langs->trans(
"Activated"),
'switch_on');
514 print
'<td class="center"><a class="reposition" href="'.$_SERVER[
'PHP_SELF'].
'?token='.
newToken().
'&action=setBANK_DISABLE_DIRECT_INPUT&value=1">';
515 print
img_picto($langs->trans(
"Disabled"),
'switch_off');
521print
'<tr class="oddeven"><td>'.
"\n";
522print $langs->trans(
'AutoReportLastAccountStatement');
526 print
'<td class="center">'.
"\n";
527 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=unsetreportlastnumreleve&token='.
newToken().
'">';
528 print
img_picto($langs->trans(
"Enabled"),
'switch_on');
532 print
'<td class="center">'.
"\n";
533 print
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=setreportlastnumreleve&token='.
newToken().
'">'.
img_picto($langs->trans(
"Disabled"),
'switch_off').
'</a>';
540 print
'<tr class="oddeven">';
541 print
'<td>'.$form->textwithpicto($langs->trans(
"AllowOnLineSign"), $langs->trans(
"AllowOnLineSignDesc")).
'</td>';
542 print
'<td class="center">';
543 print ajax_constantonoff(
'SOCIETE_RIB_ALLOW_ONLINESIGN', array(),
null, 0, 0, 0, 2, 0, 1,
'',
'',
'inline-block', 0, $langs->trans(
"WarningOnlineSignature"));
552print $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($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.
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)
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)
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)
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'.
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...
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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
$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.