Skip to content

Commit

Permalink
Merge branch '16.0' of [email protected]:Dolibarr/dolibarr.git into 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Nov 19, 2024
2 parents c5ebc9b + 5a58b8e commit 9c4bb84
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions htdocs/core/actions_massactions.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -475,12 +475,12 @@
$substitutionarray['__REF__'] = ($oneemailperrecipient ? join(', ', $listofqualifiedref) : $objecttmp->ref);
$substitutionarray['__EMAIL__'] = $thirdparty->email;
$substitutionarray['__CHECK_READ__'] = '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.urlencode($thirdparty->tag).'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>';

if ($oneemailperrecipient) {
$substitutionarray['__ONLINE_PAYMENT_URL__'] = '';
$substitutionarray['__ONLINE_PAYMENT_TEXT_AND_URL__'] = '';
}

$parameters = array('mode'=>'formemail');

if (!empty($listofobjectthirdparties)) {
Expand Down
10 changes: 6 additions & 4 deletions htdocs/core/class/commonobject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2192,7 +2192,9 @@ public function load_previous_next_ref($filter, $fieldid, $nodbprefix = 0)
$sql = "SELECT MAX(te.".$fieldid.")";
$sql .= " FROM ".(empty($nodbprefix) ?$this->db->prefix():'').$this->table_element." as te";
if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
$sql .= ",".$this->db->prefix()."usergroup_user as ug";
if (empty($user->admin) || !empty($user->entity) || $conf->entity != 1) {
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON ug.fk_user = te.rowid";
}
}
if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) {
$tmparray = explode('@', $this->ismultientitymanaged);
Expand Down Expand Up @@ -2229,7 +2231,6 @@ public function load_previous_next_ref($filter, $fieldid, $nodbprefix = 0)
if (!empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
$sql .= " AND te.entity IS NOT NULL"; // Show all users
} else {
$sql .= " AND ug.fk_user = te.rowid";
$sql .= " AND ug.entity IN (".getEntity('usergroup').")";
}
} else {
Expand Down Expand Up @@ -2262,7 +2263,9 @@ public function load_previous_next_ref($filter, $fieldid, $nodbprefix = 0)
$sql = "SELECT MIN(te.".$fieldid.")";
$sql .= " FROM ".(empty($nodbprefix) ?$this->db->prefix():'').$this->table_element." as te";
if ($this->element == 'user' && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
$sql .= ",".$this->db->prefix()."usergroup_user as ug";
if (empty($user->admin) || !empty($user->entity) || $conf->entity != 1) {
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ug ON ug.fk_user = te.rowid";
}
}
if (isset($this->ismultientitymanaged) && !is_numeric($this->ismultientitymanaged)) {
$tmparray = explode('@', $this->ismultientitymanaged);
Expand Down Expand Up @@ -2299,7 +2302,6 @@ public function load_previous_next_ref($filter, $fieldid, $nodbprefix = 0)
if (!empty($user->admin) && empty($user->entity) && $conf->entity == 1) {
$sql .= " AND te.entity IS NOT NULL"; // Show all users
} else {
$sql .= " AND ug.fk_user = te.rowid";
$sql .= " AND ug.entity IN (".getEntity('usergroup').")";
}
} else {
Expand Down

0 comments on commit 9c4bb84

Please sign in to comment.