Fix: cheques sending to bank

This commit is contained in:
Laurent Destailleur 2008-03-11 23:32:53 +00:00
parent 84fddd5ca5
commit e2306ccf7a
5 changed files with 22 additions and 20 deletions

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2007 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2007-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -145,7 +145,7 @@ if ($_GET['action'] == 'new')
{ {
$h=0; $h=0;
$head[$h][0] = DOL_URL_ROOT.'/compta/paiement/cheque/fiche.php?action=new'; $head[$h][0] = DOL_URL_ROOT.'/compta/paiement/cheque/fiche.php?action=new';
$head[$h][1] = $langs->trans("NewCheckDeposit"); $head[$h][1] = $langs->trans("MenuChequeDeposits");
$hselected = $h; $hselected = $h;
$h++; $h++;
@ -198,11 +198,7 @@ else
if ($mesg) print $mesg.'<br>'; if ($mesg) print $mesg.'<br>';
/*
*
*
*
*/
if ($_GET['action'] == 'new') if ($_GET['action'] == 'new')
{ {
$accounts = array(); $accounts = array();
@ -272,9 +268,14 @@ if ($_GET['action'] == 'new')
print "</table>"; print "</table>";
print '<div class="tabsAction">'; print '<div class="tabsAction">';
print '<a class="butAction" href="fiche.php?action=create&amp;accountid='.$bid.'">'; if ($user->rights->banque->modifier)
print $langs->trans('NewCheckDepositOn',$account_label); {
print '</a>'; print '<a class="butAction" href="fiche.php?action=create&amp;accountid='.$bid.'">'.$langs->trans('NewCheckDepositOn',$account_label).'</a>';
}
else
{
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotEnoughPermissions").'">'.$langs->trans('NewCheckDepositOn',$account_label).'</a>';
}
print '</div><br />'; print '</div><br />';
} }

View File

@ -524,9 +524,8 @@ class MenuLeft {
if ($conf->facture->enabled && $conf->banque->enabled) if ($conf->facture->enabled && $conf->banque->enabled)
{ {
$newmenu->add_submenu(DOL_URL_ROOT."/compta/paiement/cheque/index.php?leftmenu=checks",$langs->trans("MenuChequeDeposits"),0,$user->rights->banque->lire); $newmenu->add_submenu(DOL_URL_ROOT."/compta/paiement/cheque/index.php?leftmenu=checks",$langs->trans("MenuChequeDeposits"),0,$user->rights->banque->lire);
if (eregi("checks",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/paiement/cheque/fiche.php?leftmenu=checks&amp;action=new",$langs->trans("NewChequeDeposit"),1,$user->rights->banque->creer); if (eregi("checks",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/paiement/cheque/fiche.php?leftmenu=checks&amp;action=new",$langs->trans("NewChequeDeposit"),1,$user->rights->banque->modifier);
if (eregi("checks",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/paiement/cheque/liste.php?leftmenu=checks",$langs->trans("MenuChequesReceipts"),1,$user->rights->banque->lire); if (eregi("checks",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/paiement/cheque/liste.php?leftmenu=checks",$langs->trans("MenuChequesReceipts"),1,$user->rights->banque->lire);
} }
// Bank-Caisse // Bank-Caisse

View File

@ -510,10 +510,9 @@ class MenuLeft {
/* /*
if ($conf->facture->enabled && $conf->banque->enabled) if ($conf->facture->enabled && $conf->banque->enabled)
{ {
$newmenu->add_submenu(DOL_URL_ROOT."/compta/paiement/cheque/index.php?leftmenu=checks",$langs->trans("MenuChequeDeposits"),0,$user->rights->facture->lire); $newmenu->add_submenu(DOL_URL_ROOT."/compta/paiement/cheque/index.php?leftmenu=checks",$langs->trans("MenuChequeDeposits"),0,$user->rights->banque->lire);
if (eregi("checks",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/paiement/cheque/fiche.php?leftmenu=checks&amp;action=new",$langs->trans("NewChequeDeposit"),1,$user->rights->facture->creer); if (eregi("checks",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/paiement/cheque/fiche.php?leftmenu=checks&amp;action=new",$langs->trans("NewChequeDeposit"),1,$user->rights->banque->modifier);
if (eregi("checks",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/paiement/cheque/liste.php?leftmenu=checks",$langs->trans("MenuChequesReceipts"),1,$user->rights->facture->lire); if (eregi("checks",$leftmenu)) $newmenu->add_submenu(DOL_URL_ROOT."/compta/paiement/cheque/liste.php?leftmenu=checks",$langs->trans("MenuChequesReceipts"),1,$user->rights->banque->lire);
} }
*/ */

View File

@ -17,12 +17,11 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Id$
*/ */
/** \defgroup banque Module banque /** \defgroup banque Module banque
\brief Module pour gérer la tenue d'un compte bancaire et rapprochements \brief Module pour gérer la tenue d'un compte bancaire et rapprochements
\version $Id$
*/ */
/** /**

View File

@ -1248,7 +1248,7 @@ function restrictedArea($user, $feature='societe', $objectid=0, $dbtablename='')
{ {
if (! $user->rights->fournisseur->commande->lire) $readok=0; if (! $user->rights->fournisseur->commande->lire) $readok=0;
} }
else if (! empty($features)) else if (! empty($feature))
{ {
if (! $user->rights->$feature->lire) $readok=0; if (! $user->rights->$feature->lire) $readok=0;
} }
@ -1276,6 +1276,10 @@ function restrictedArea($user, $feature='societe', $objectid=0, $dbtablename='')
{ {
if (! $user->rights->fournisseur->commande->creer) $createok=0; if (! $user->rights->fournisseur->commande->creer) $createok=0;
} }
else if ($feature == 'banque')
{
if (! $user->rights->banque->modifier) $createok=0;
}
else else
{ {
if (! $user->rights->$feature->creer) $createok=0; if (! $user->rights->$feature->creer) $createok=0;