function getNameID($options = array())
{
global $CFG_GLPI;
$p['forceid'] = false;
$p['comments'] = false;
if (is_array($options)) {
foreach ($options as $key => $val) {
$p[$key] = $val;
}
}
if ($p['forceid'] || $_SESSION['glpiis_ids_visible']) {
$addcomment = $p['comments'];
// unset comment
$p['comments'] = false;
$name = $this->getName($p);
//TRANS: %1$s is a name, %2$s is ID
$name = sprintf(__('%1$s (%2$s)'), $name, $this->getField('id'));
if ($addcomment) {
$comment = $this->getComments();
if (!empty($comment)) {
$name = sprintf(__('%1$s - %2$s'), $name, $comment);
}
}
return $name;
}
return $this->getName($options);
}