Merge pull request #19127 from frederic34/usermyactions

fix warnings
This commit is contained in:
Laurent Destailleur 2021-10-23 11:38:18 +02:00 committed by GitHub
commit f5aebbf6b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 15 deletions

View File

@ -1330,7 +1330,7 @@ class ActionComm extends CommonObject
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";
}
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."societe as s ON a.fk_soc = s.rowid";
@ -1345,7 +1345,7 @@ class ActionComm extends CommonObject
if ($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 .= " OR ar.fk_element = ".((int) $user->id);
$sql .= ")";

View File

@ -86,13 +86,13 @@ if ($socid < 0) {
}
$canedit = 1;
if (!$user->rights->agenda->myactions->read) {
if (empty($user->rights->agenda->myactions->read)) {
accessforbidden();
}
if (!$user->rights->agenda->allactions->read) {
if (empty($user->rights->agenda->allactions->read)) {
$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;
}

View File

@ -136,13 +136,13 @@ if ($socid < 0) {
}
$canedit = 1;
if (!$user->rights->agenda->myactions->read) {
if (empty($user->rights->agenda->myactions->read)) {
accessforbidden();
}
if (!$user->rights->agenda->allactions->read) {
if (empty($user->rights->agenda->allactions->read)) {
$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;
}

View File

@ -80,13 +80,13 @@ if ($socid < 0) {
}
$canedit = 1;
if (!$user->rights->agenda->myactions->read) {
if (empty($user->rights->agenda->myactions->read)) {
accessforbidden();
}
if (!$user->rights->agenda->allactions->read) {
if (empty($user->rights->agenda->allactions->read)) {
$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;
}

View File

@ -80,13 +80,13 @@ if ($socid < 0) {
}
$canedit = 1;
if (!$user->rights->agenda->myactions->read) {
if (empty($user->rights->agenda->myactions->read)) {
accessforbidden();
}
if (!$user->rights->agenda->allactions->read) {
if (empty($user->rights->agenda->allactions->read)) {
$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;
}

View File

@ -105,7 +105,7 @@ class box_actions extends ModeleBoxes
if ($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 .= " ORDER BY a.datec DESC";