Skip to content

Commit 33744f7

Browse files
committed
Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into 17.0
2 parents f796877 + 641a085 commit 33744f7

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

htdocs/core/class/html.form.class.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8862,8 +8862,7 @@ public function showLinkToObjectBlock($object, $restrictlinksto = array(), $excl
88628862
'perms'=>1,
88638863
'label'=>'LinkToContract',
88648864
'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht
8865-
FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."contrat as t, ".$this->db->prefix()."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier'
8866-
),
8865+
FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix()."contrat as t, ".$this->db->prefix()."contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('contract').') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier'),
88678866
'fichinter'=>array(
88688867
'enabled'=>isModEnabled('ficheinter'),
88698868
'perms'=>1,
@@ -8896,6 +8895,12 @@ public function showLinkToObjectBlock($object, $restrictlinksto = array(), $excl
88968895
);
88978896
}
88988897

8898+
if ($object->table_element == 'commande_fournisseur') {
8899+
$possiblelinks['mo']['sql'] = "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM ".$this->db->prefix()."societe as s INNER JOIN ".$this->db->prefix().'mrp_mo as t ON t.fk_soc = s.rowid WHERE t.entity IN ('.getEntity('mo').')';
8900+
} elseif ($object->table_element == 'mrp_mo') {
8901+
$possiblelinks['order_supplier']['sql'] = "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".$this->db->prefix()."societe as s, ".$this->db->prefix().'commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.entity IN ('.getEntity('commande_fournisseur').')';
8902+
}
8903+
88998904
if (!empty($listofidcompanytoscan)) { // If empty, we don't have criteria to scan the object we can link to
89008905
// Can complete the possiblelink array
89018906
$hookmanager->initHooks(array('commonobject'));

htdocs/user/card.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
// Define value to know what current user can do on properties of edited user
126126
if ($id > 0) {
127127
// $user is the current logged user, $id is the user we want to edit
128-
$canedituser = (($user->id == $id) && $user->hasRight("user", "self", "write")); // can edit myself
128+
$canedituser = (($user->id == $id) && $user->hasRight("user", "self", "write")) || (($user->id != $id) && $user->hasRight("user", "user", "write"));
129129
$caneditfield = ((($user->id == $id) && $user->hasRight("user", "self", "write")) || (($user->id != $id) && $user->hasRight("user", "user", "write")));
130130
$caneditpassword = ((($user->id == $id) && $user->hasRight("user", "self", "password")) || (($user->id != $id) && $user->hasRight("user", "user", "password")));
131131
}

0 commit comments

Comments
 (0)