diff --git a/addons/userrights/userrightsprofile.class.inc.php b/addons/userrights/userrightsprofile.class.inc.php index cf9cffb352..c46a3db96e 100644 --- a/addons/userrights/userrightsprofile.class.inc.php +++ b/addons/userrights/userrightsprofile.class.inc.php @@ -649,6 +649,14 @@ exit; { $sAttCode = 'id'; } + elseif (is_callable("$sClass::MapContextParam")) + { + $sAttCode = eval("return $sClass::MapContextParam('org_id');"); // Returns null when there is no mapping for this parameter + if ($sAttCode == null) + { + return true; + } + } elseif(MetaModel::IsValidAttCode($sClass, 'org_id')) { $sAttCode = 'org_id'; diff --git a/modules/itop-service-mgmt-1.0.0/model.itop-service-mgmt.php b/modules/itop-service-mgmt-1.0.0/model.itop-service-mgmt.php index 3361dee4a6..64d7fec4fe 100644 --- a/modules/itop-service-mgmt-1.0.0/model.itop-service-mgmt.php +++ b/modules/itop-service-mgmt-1.0.0/model.itop-service-mgmt.php @@ -92,6 +92,23 @@ class ProviderContract extends Contract MetaModel::Init_SetZListItems('standard_search', array('name', 'description', 'start_date', 'end_date', 'cost', 'cost_currency', 'cost_unit', 'billing_frequency', 'provider_id', 'sla', 'coverage')); MetaModel::Init_SetZListItems('list', array('start_date', 'end_date', 'provider_id', 'sla', 'coverage')); } + + /** + * Maps the given context parameter name to the appropriate filter/search code for this class + * @param string $sContextParam Name of the context parameter, e.g. 'org_id' + * @return string Filter code, e.g. 'customer_id' + */ + public static function MapContextParam($sContextParam) + { + if ($sContextParam == 'org_id') + { + return 'provider_id'; + } + else + { + return $sContextParam; + } + } } class CustomerContract extends Contract {