Skip to content

Commit

Permalink
fix(report): fix bad url on generic object on report after injection
Browse files Browse the repository at this point in the history
  • Loading branch information
stonebuzz authored and cedric-anne committed Sep 4, 2018
1 parent 3f22b16 commit 4ae53e5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions inc/model.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1403,6 +1403,15 @@ static function prepareLogResults($models_id) {
$tmp['item'] = $result[$model->fields['itemtype']];
$url = Toolbox::getItemTypeFormURL($model->fields['itemtype'])."?id=".
$result[$model->fields['itemtype']];
//redefine genericobject url of needed
$plugin = new Plugin();
if ($plugin->isActivated('genericobject')
&& array_key_exists($model->fields['itemtype'], PluginGenericobjectType::getTypes())) {
global $CFG_GLPI;
$url = $CFG_GLPI['root_doc']."/plugins/genericobject/front/object.form.php".
"?itemtype=".$model->fields['itemtype']."&id=".$result[$model->fields['itemtype']];
}

$tmp['url'] = "<a href='".$url."'>".$result[$model->fields['itemtype']]."</a>";
}

Expand Down

0 comments on commit 4ae53e5

Please sign in to comment.