# Zones marquees MODIF dans : categories/class/api_categories.class (24.03.2026 14.47).php # Fichier actif correspondant : categories/class/api_categories.class.php ... 16 | */ 17 | 18 | use Luracast\Restler\RestException; 19 | 20 | require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; 21 | require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; 22 | // MODIF JOSE 23 | require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; 24 | 25 | 26 | require_once DOL_DOCUMENT_ROOT.'/adherents/class/api_members.class.php'; 27 | require_once DOL_DOCUMENT_ROOT.'/product/class/api_products.class.php'; 28 | require_once DOL_DOCUMENT_ROOT.'/societe/class/api_contacts.class.php'; 29 | require_once DOL_DOCUMENT_ROOT.'/societe/class/api_thirdparties.class.php'; 30 | require_once DOL_DOCUMENT_ROOT.'/projet/class/api_projects.class.php'; ... 305 | Categorie::TYPE_CONTACT, 306 | Categorie::TYPE_CUSTOMER, 307 | Categorie::TYPE_SUPPLIER, 308 | Categorie::TYPE_MEMBER, 309 | Categorie::TYPE_PROJECT, 310 | Categorie::TYPE_KNOWLEDGEMANAGEMENT, 311 | // MODIF JOSE 312 | Categorie::TYPE_ACTIONCOMM 313 | ])) { 314 | throw new RestException(401); 315 | } 316 | 317 | if ($type == Categorie::TYPE_PRODUCT && !(DolibarrApiAccess::$user->rights->produit->lire || DolibarrApiAccess::$user->rights->service->lire)) { 318 | throw new RestException(401); 319 | } elseif ($type == Categorie::TYPE_CONTACT && !DolibarrApiAccess::$user->rights->contact->lire) { ... 325 | } elseif ($type == Categorie::TYPE_MEMBER && !DolibarrApiAccess::$user->rights->adherent->lire) { 326 | throw new RestException(401); 327 | } elseif ($type == Categorie::TYPE_PROJECT && !DolibarrApiAccess::$user->rights->projet->lire) { 328 | throw new RestException(401); 329 | } elseif ($type == Categorie::TYPE_KNOWLEDGEMANAGEMENT && !DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) { 330 | throw new RestException(401); 331 | // MODIF JOSE 332 | } elseif ($type == Categorie::TYPE_ACTIONCOMM && !DolibarrApiAccess::$user->hasRight('agenda', 'allactions', 'read')) { 333 | throw new RestException(401); 334 | } 335 | 336 | 337 | $categories = $this->category->getListForItem($id, $type, $sortfield, $sortorder, $limit, $page); 338 | 339 | if (!is_array($categories)) { ... 394 | $object = new Contact($this->db); 395 | } elseif ($type === Categorie::TYPE_MEMBER) { 396 | if (!DolibarrApiAccess::$user->hasRight('adherent', 'creer')) { 397 | throw new RestException(401); 398 | } 399 | $object = new Adherent($this->db); 400 | // MODIF JOSE START 401 | } elseif ($type === Categorie::TYPE_ACTIONCOMM) { 402 | if (!DolibarrApiAccess::$user->hasRight('agenda', 'allactions', 'read')) { 403 | throw new RestException(401); 404 | } 405 | // error_log("linkObjectById Actioncomm = ".print_r($type,1),1,"jose.martinez@pichinov.com"); 406 | $object = new Actioncomm($this->db); 407 | // MODIF JOSE END */ 408 | } else { 409 | throw new RestException(401, "this type is not recognized yet."); 410 | } 411 | 412 | if (!empty($object)) { 413 | $result = $object->fetch($object_id); 414 | if ($result > 0) { 415 | $result = $this->category->add_type($object, $type);