commit
f5aebbf6b8
@ -1330,7 +1330,7 @@ class ActionComm extends CommonObject
|
|||||||
if (empty($user->rights->societe->client->voir) && !$user->socid) {
|
if (empty($user->rights->societe->client->voir) && !$user->socid) {
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
||||||
}
|
}
|
||||||
if (!$user->rights->agenda->allactions->read) {
|
if (empty($user->rights->agenda->allactions->read)) {
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_resources AS ar ON a.id = ar.fk_actioncomm AND ar.element_type ='user' AND ar.fk_element = ".((int) $user->id);
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_resources AS ar ON a.id = ar.fk_actioncomm AND ar.element_type ='user' AND ar.fk_element = ".((int) $user->id);
|
||||||
}
|
}
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
|
||||||
@ -1345,7 +1345,7 @@ class ActionComm extends CommonObject
|
|||||||
if ($user->socid) {
|
if ($user->socid) {
|
||||||
$sql .= " AND a.fk_soc = ".((int) $user->socid);
|
$sql .= " AND a.fk_soc = ".((int) $user->socid);
|
||||||
}
|
}
|
||||||
if (!$user->rights->agenda->allactions->read) {
|
if (empty($user->rights->agenda->allactions->read)) {
|
||||||
$sql .= " AND (a.fk_user_author = ".((int) $user->id)." OR a.fk_user_action = ".((int) $user->id)." OR a.fk_user_done = ".((int) $user->id);
|
$sql .= " AND (a.fk_user_author = ".((int) $user->id)." OR a.fk_user_action = ".((int) $user->id)." OR a.fk_user_done = ".((int) $user->id);
|
||||||
$sql .= " OR ar.fk_element = ".((int) $user->id);
|
$sql .= " OR ar.fk_element = ".((int) $user->id);
|
||||||
$sql .= ")";
|
$sql .= ")";
|
||||||
|
|||||||
@ -86,13 +86,13 @@ if ($socid < 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$canedit = 1;
|
$canedit = 1;
|
||||||
if (!$user->rights->agenda->myactions->read) {
|
if (empty($user->rights->agenda->myactions->read)) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
if (!$user->rights->agenda->allactions->read) {
|
if (empty($user->rights->agenda->allactions->read)) {
|
||||||
$canedit = 0;
|
$canedit = 0;
|
||||||
}
|
}
|
||||||
if (!$user->rights->agenda->allactions->read || $filter == 'mine') { // If no permission to see all, we show only affected to me
|
if (empty($user->rights->agenda->allactions->read) || $filter == 'mine') { // If no permission to see all, we show only affected to me
|
||||||
$filtert = $user->id;
|
$filtert = $user->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -136,13 +136,13 @@ if ($socid < 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$canedit = 1;
|
$canedit = 1;
|
||||||
if (!$user->rights->agenda->myactions->read) {
|
if (empty($user->rights->agenda->myactions->read)) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
if (!$user->rights->agenda->allactions->read) {
|
if (empty($user->rights->agenda->allactions->read)) {
|
||||||
$canedit = 0;
|
$canedit = 0;
|
||||||
}
|
}
|
||||||
if (!$user->rights->agenda->allactions->read || $filter == 'mine') { // If no permission to see all, we show only affected to me
|
if (empty($user->rights->agenda->allactions->read) || $filter == 'mine') { // If no permission to see all, we show only affected to me
|
||||||
$filtert = $user->id;
|
$filtert = $user->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -80,13 +80,13 @@ if ($socid < 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$canedit = 1;
|
$canedit = 1;
|
||||||
if (!$user->rights->agenda->myactions->read) {
|
if (empty($user->rights->agenda->myactions->read)) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
if (!$user->rights->agenda->allactions->read) {
|
if (empty($user->rights->agenda->allactions->read)) {
|
||||||
$canedit = 0;
|
$canedit = 0;
|
||||||
}
|
}
|
||||||
if (!$user->rights->agenda->allactions->read || $filter == 'mine') { // If no permission to see all, we show only affected to me
|
if (empty($user->rights->agenda->allactions->read) || $filter == 'mine') { // If no permission to see all, we show only affected to me
|
||||||
$filtert = $user->id;
|
$filtert = $user->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -80,13 +80,13 @@ if ($socid < 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$canedit = 1;
|
$canedit = 1;
|
||||||
if (!$user->rights->agenda->myactions->read) {
|
if (empty($user->rights->agenda->myactions->read)) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
}
|
}
|
||||||
if (!$user->rights->agenda->allactions->read) {
|
if (empty($user->rights->agenda->allactions->read)) {
|
||||||
$canedit = 0;
|
$canedit = 0;
|
||||||
}
|
}
|
||||||
if (!$user->rights->agenda->allactions->read || $filter == 'mine') { // If no permission to see all, we show only affected to me
|
if (empty($user->rights->agenda->allactions->read) || $filter == 'mine') { // If no permission to see all, we show only affected to me
|
||||||
$filtert = $user->id;
|
$filtert = $user->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -105,7 +105,7 @@ class box_actions extends ModeleBoxes
|
|||||||
if ($user->socid) {
|
if ($user->socid) {
|
||||||
$sql .= " AND s.rowid = ".((int) $user->socid);
|
$sql .= " AND s.rowid = ".((int) $user->socid);
|
||||||
}
|
}
|
||||||
if (!$user->rights->agenda->allactions->read) {
|
if (empty($user->rights->agenda->allactions->read)) {
|
||||||
$sql .= " AND (a.fk_user_author = ".((int) $user->id)." OR a.fk_user_action = ".((int) $user->id)." OR a.fk_user_done = ".((int) $user->id).")";
|
$sql .= " AND (a.fk_user_author = ".((int) $user->id)." OR a.fk_user_action = ".((int) $user->id)." OR a.fk_user_done = ".((int) $user->id).")";
|
||||||
}
|
}
|
||||||
$sql .= " ORDER BY a.datec DESC";
|
$sql .= " ORDER BY a.datec DESC";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user