function showGroupsAssociated($type, $canedit, array $options = array())
{
global $CFG_GLPI;
$groupicon = self::getActorIcon('group', $type);
$group = new Group();
$linkclass = new $this->grouplinkclass();
$itemtype = $this->getType();
$typename = self::getActorFieldNameType($type);
$candelete = true;
$mandatory = '';
// For ticket templates : mandatories
if ($itemtype == 'Ticket' && isset($options['_tickettemplate'])) {
$mandatory = $options['_tickettemplate']->getMandatoryMark("_groups_id_" . $typename);
if ($options['_tickettemplate']->isMandatoryField("_groups_id_" . $typename) && isset($this->groups[$type]) && count($this->groups[$type]) == 1) {
$candelete = false;
}
}
if (isset($this->groups[$type]) && count($this->groups[$type])) {
foreach ($this->groups[$type] as $d) {
echo "<div class='actor_row'>";
$k = $d['groups_id'];
echo "{$mandatory}{$groupicon} ";
if ($group->getFromDB($k)) {
echo $group->getLink(array('comments' => true));
}
if ($canedit && $candelete) {
echo " ";
Html::showSimpleForm($linkclass->getFormURL(), 'delete', _x('button', 'Delete permanently'), array('id' => $d['id']), $CFG_GLPI["root_doc"] . "/pics/delete.png");
}
echo "</div>";
}
}
}