Merge pull request #22128 from dolibit-ut/patch-530

Update card.php
This commit is contained in:
Laurent Destailleur 2022-09-09 17:18:58 +02:00 committed by GitHub
commit 53e92e1392
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,8 +39,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
require_once DOL_DOCUMENT_ROOT.'/intracommreport/class/intracommreport.class.php';
// Load translation files required by the page
$langs->loadLangs(array("intracommreport"));
// Get Parameters
$id = GETPOST('id', 'int');
$action = GETPOST('action');
$exporttype = GETPOSTISSET('exporttype') ? GETPOST('exporttype', 'alphanohtml') : 'deb'; // DEB or DES
@ -49,6 +51,7 @@ $month = GETPOSTINT('month');
$label = (string) GETPOST('label', 'alphanohtml');
$type_declaration = (string) GETPOST('type_declaration', 'alphanohtml');
$backtopage = GETPOST('backtopage', 'alpha');
$declaration = array(
"deb" => $langs->trans("DEB"),
"des" => $langs->trans("DES"),
@ -57,6 +60,8 @@ $typeOfDeclaration = array(
"introduction" => $langs->trans("Introduction"),
"expedition" => $langs->trans("Expedition"),
);
// Initialize technical objects
$object = new IntracommReport($db);
if ($id > 0) {
$object->fetch($id);
@ -69,6 +74,7 @@ $hookmanager->initHooks(array('intracommcard', 'globalcard'));
$error = 0;
// Permissions
$permissiontoread = $user->rights->intracommreport->read;
$permissiontoadd = $user->rights->intracommreport->write;
$permissiontodelete = $user->rights->intracommreport->delete;