FIX: add contact permission on contact box
In contact box is only checked the "societe" permission. Contact permission should be checked too.
This commit is contained in:
parent
5b0197a541
commit
bd81487f71
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||||
|
* Copyright (C) 2018 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||||
*
|
*
|
||||||
* 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
|
||||||
@ -20,7 +21,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \file htdocs/core/boxes/box_contacts.php
|
* \file htdocs/core/boxes/box_contacts.php
|
||||||
* \ingroup societes
|
* \ingroup contacts
|
||||||
* \brief Module to show box of contacts
|
* \brief Module to show box of contacts
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -36,7 +37,7 @@ class box_contacts extends ModeleBoxes
|
|||||||
var $boxcode="lastcontacts";
|
var $boxcode="lastcontacts";
|
||||||
var $boximg="object_contact";
|
var $boximg="object_contact";
|
||||||
var $boxlabel="BoxLastContacts";
|
var $boxlabel="BoxLastContacts";
|
||||||
var $depends = array("societe");
|
var $depends = array("societe","contact");
|
||||||
|
|
||||||
var $db;
|
var $db;
|
||||||
var $param;
|
var $param;
|
||||||
@ -57,7 +58,7 @@ class box_contacts extends ModeleBoxes
|
|||||||
|
|
||||||
$this->db=$db;
|
$this->db=$db;
|
||||||
|
|
||||||
$this->hidden=! ($user->rights->societe->lire);
|
$this->hidden=! ($user->rights->societe->lire && $user->rights->contact->lire);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -75,7 +76,7 @@ class box_contacts extends ModeleBoxes
|
|||||||
|
|
||||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedContacts",$max));
|
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastModifiedContacts",$max));
|
||||||
|
|
||||||
if ($user->rights->societe->lire)
|
if ($user->rights->societe->lire && $user->rights->contact->lire)
|
||||||
{
|
{
|
||||||
$sql = "SELECT sp.rowid as id, sp.lastname, sp.firstname, sp.civility as civility_id, sp.datec, sp.tms, sp.fk_soc, sp.statut as status";
|
$sql = "SELECT sp.rowid as id, sp.lastname, sp.firstname, sp.civility as civility_id, sp.datec, sp.tms, sp.fk_soc, sp.statut as status";
|
||||||
$sql.= ", sp.address, sp.zip, sp.town, sp.phone, sp.phone_perso, sp.phone_mobile";
|
$sql.= ", sp.address, sp.zip, sp.town, sp.phone, sp.phone_perso, sp.phone_mobile";
|
||||||
@ -170,7 +171,6 @@ class box_contacts extends ModeleBoxes
|
|||||||
'text' => $langs->trans("ReadPermissionNotAllowed")
|
'text' => $langs->trans("ReadPermissionNotAllowed")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user