Several fix on module accountancy expert

This commit is contained in:
Laurent Destailleur 2016-09-30 17:03:09 +02:00
parent d9ff53eb7f
commit 2f557fc09b
5 changed files with 41 additions and 25 deletions

View File

@ -17,11 +17,11 @@
/** /**
* \file htdocs/accountancy/admin/fiscalyear.php * \file htdocs/accountancy/admin/fiscalyear.php
* \ingroup fiscal year * \ingroup Advanced accountancy
* \brief Setup page to configure fiscal year * \brief Setup page to configure fiscal year
*/ */
require '../../main.inc.php';
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php';
@ -45,7 +45,7 @@ $langs->load("compta");
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
if (! $user->rights->accounting->fiscalyear) if (! $user->rights->mouvements->lire) // If we can read accounting records, we shoul be able to see fiscal year.
accessforbidden(); accessforbidden();
$error = 0; $error = 0;
@ -65,6 +65,7 @@ $errors = array ();
$object = new Fiscalyear($db); $object = new Fiscalyear($db);
/* /*
* Actions * Actions
*/ */
@ -146,7 +147,14 @@ dol_fiche_end();
// Buttons // Buttons
print '<div class="tabsAction">'; print '<div class="tabsAction">';
if (! empty($user->rights->accounting->fiscalyear))
{
print '<a class="butAction" href="fiscalyear_card.php?action=create">' . $langs->trans("NewFiscalYear") . '</a>'; print '<a class="butAction" href="fiscalyear_card.php?action=create">' . $langs->trans("NewFiscalYear") . '</a>';
}
else
{
print '<a class="butActionRefused" href="#">' . $langs->trans("NewFiscalYear") . '</a>';
}
print '</div>'; print '</div>';
llxFooter(); llxFooter();

View File

@ -17,6 +17,7 @@
/** /**
* \file htdocs/accountancy/admin/fiscalyear_card.php * \file htdocs/accountancy/admin/fiscalyear_card.php
* \ingroup Advanced accountancy
* \brief Page to show a fiscal year * \brief Page to show a fiscal year
*/ */
require '../../main.inc.php'; require '../../main.inc.php';
@ -30,7 +31,7 @@ $langs->load("compta");
// Security check // Security check
if ($user->societe_id > 0) if ($user->societe_id > 0)
accessforbidden(); accessforbidden();
if (! $user->rights->accounting->fiscalyear) if (empty($user->rights->accounting->fiscalyear))
accessforbidden(); accessforbidden();
$error = 0; $error = 0;
@ -138,9 +139,12 @@ else if ($action == 'update') {
} }
} }
/* /*
* View * View
*/ */
$title = $langs->trans("Fiscalyear") . " - " . $langs->trans("Card"); $title = $langs->trans("Fiscalyear") . " - " . $langs->trans("Card");
$helpurl = ""; $helpurl = "";
llxHeader("",$title,$helpurl); llxHeader("",$title,$helpurl);
@ -291,6 +295,8 @@ if ($action == 'create')
dol_fiche_end(); dol_fiche_end();
if (! empty($user->rights->accounting->fiscalyear))
{
/* /*
* Barre d'actions * Barre d'actions
*/ */
@ -302,6 +308,7 @@ if ($action == 'create')
print '</div>'; print '</div>';
} }
}
} else { } else {
dol_print_error($db); dol_print_error($db);
} }

View File

@ -16,11 +16,12 @@
*/ */
/** /**
* \file htdocs/accountancy/admin/fiscalyear_card.php * \file htdocs/accountancy/admin/fiscalyear_info.php
* \ingroup Advanced accountancy
* \brief Page to show info of a fiscal year * \brief Page to show info of a fiscal year
*/ */
require '../../main.inc.php';
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/fiscalyear.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/fiscalyear.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/fiscalyear.class.php';