Skip to content
Snippets Groups Projects
Commit 6d5578a8 authored by Alexandre SPANGARO's avatar Alexandre SPANGARO
Browse files

Reactivated constant BANK_DISABLE_DIRECT_INPUT

parent b09398a6
No related branches found
No related tags found
No related merge requests found
...@@ -141,6 +141,18 @@ if ($action == 'setmanagezero') { ...@@ -141,6 +141,18 @@ if ($action == 'setmanagezero') {
} }
} }
if ($action == 'setdisabledirectinput') {
$setdisabledirectinput = GETPOST('value', 'int');
$res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity);
if (! $res > 0)
$error ++;
if (! $error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
setEventMessages($langs->trans("Error"), null, 'mesgs');
}
}
/* /*
* View * View
*/ */
...@@ -230,6 +242,20 @@ if (! empty($user->admin)) ...@@ -230,6 +242,20 @@ if (! empty($user->admin))
} }
print '</tr>'; print '</tr>';
$var = ! $var;
print "<tr " . $bc[$var] . ">";
print '<td>' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . '</td>';
if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
print '</tr>';
$var = ! $var; $var = ! $var;
print "<tr " . $bc[$var] . ">"; print "<tr " . $bc[$var] . ">";
print '<td>' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . '</td>'; print '<td>' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . '</td>';
......
...@@ -394,16 +394,15 @@ if ($id > 0 || ! empty($ref)) ...@@ -394,16 +394,15 @@ if ($id > 0 || ! empty($ref))
foreach ($bankcateg->fetchAll() as $bankcategory) { foreach ($bankcateg->fetchAll() as $bankcategory) {
$options[$bankcategory->id] = $bankcategory->label; $options[$bankcategory->id] = $bankcategory->label;
} }
// Bank card // Bank card
$head=bank_prepare_head($object); $head=bank_prepare_head($object);
dol_fiche_head($head,'journal',$langs->trans("FinancialAccount"),0,'account'); dol_fiche_head($head,'journal',$langs->trans("FinancialAccount"),0,'account');
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("BackToList").'</a>'; $linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/index.php">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
dol_fiche_end(); dol_fiche_end();
/* /*
...@@ -413,10 +412,17 @@ if ($id > 0 || ! empty($ref)) ...@@ -413,10 +412,17 @@ if ($id > 0 || ! empty($ref))
{ {
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if ($user->rights->banque->modifier) { if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT))
print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.$account.'">'.$langs->trans("AddBankRecord").'</a>'; {
} else { if ($user->rights->banque->modifier) {
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("AddBankRecord").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.$account.'">'.$langs->trans("AddBankRecord").'</a>';
} else {
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
}
}
else
{
print '<a class="butActionRefused" title="'.$langs->trans("FeatureDisabled").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
} }
if ($object->canBeConciliated() > 0) { if ($object->canBeConciliated() > 0) {
......
...@@ -124,8 +124,6 @@ INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('USER_A ...@@ -124,8 +124,6 @@ INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('USER_A
ALTER TABLE llx_chargesociales ADD COLUMN fk_projet integer DEFAULT NULL; ALTER TABLE llx_chargesociales ADD COLUMN fk_projet integer DEFAULT NULL;
DELETE FROM llx_const WHERE name = __ENCRYPT('BANK_DISABLE_DIRECT_INPUT')__;
create table llx_payment_various create table llx_payment_various
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment