Merge branch '10.0' of git@github.com:Dolibarr/dolibarr.git into 11.0

Conflicts:
	htdocs/categories/class/categorie.class.php
	htdocs/core/class/html.formfile.class.php
	htdocs/core/lib/functions.lib.php
This commit is contained in:
Laurent Destailleur 2020-08-17 19:54:23 +02:00
commit 487d26c7db
4 changed files with 22 additions and 6 deletions

View File

@ -781,8 +781,8 @@ class Categorie extends CommonObject
$objs = array();
$tmpclass = $this->MAP_OBJ_CLASS[$type];
$obj = new $tmpclass($this->db);
$classnameforobj = $this->MAP_OBJ_CLASS[$type];
$obj = new $classnameforobj($this->db);
$sql = "SELECT c.fk_".$this->MAP_CAT_FK[$type];
$sql .= " FROM ".MAIN_DB_PREFIX."categorie_".$this->MAP_CAT_TABLE[$type]." as c";
@ -810,8 +810,11 @@ class Categorie extends CommonObject
}
else
{
$obj = new $this->MAP_OBJ_CLASS[$type]($this->db);
$obj->fetch($rec['fk_'.$this->MAP_CAT_FK[$type]]);
$classnameforobj = $this->MAP_OBJ_CLASS[$type];
$obj = new $classnameforobj($this->db);
$obj->fetch($rec['fk_' . $this->MAP_CAT_FK[$type]]);
$objs[] = $obj;
}
}

View File

@ -354,7 +354,7 @@ class FormFile
// Add entity in $param if not already exists
if (!preg_match('/entity\=[0-9]+/', $param)) {
$param .= 'entity='.(!empty($object->entity) ? $object->entity : $conf->entity);
$param .= ($param ? '&' : '').'entity='.(!empty($object->entity) ? $object->entity : $conf->entity);
}
$printer = 0;

View File

@ -8507,7 +8507,7 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u
$attr['class'] .= ' classfortooltip';
}
if (empty($id)) {
if (!empty($id)) {
$attr['id'] = $id;
}

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008-2017 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2020 Ferran Marcet <fmarcet@2byte.es>
*
* 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
@ -575,6 +576,18 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
$sql .= " WHERE dbt.".$dbt_select." IN (".$objectid.")";
$sql .= " AND dbt.entity IN (".getEntity($sharedelement, 1).")";
}
if ($feature == 'agenda')// Also check myactions rights
{
if ($objectid > 0 && empty($user->rights->agenda->allactions->read)) {
require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
$action = new ActionComm($db);
$action->fetch($objectid);
if ($action->authorid != $user->id && $action->userownerid != $user->id && !(array_key_exists($user->id, $action->userassigned))) {
return false;
}
}
}
}
elseif (in_array($feature, $checkproject))
{