Beispiel #1
0
function plugin_relation_getAddSearchOptions($itemtype)
{
    $sopt = array();
    if (Session::haveRight("plugin_relation", CREATE)) {
        $sopt['relation'] = 'Relaciones';
        if (in_array($itemtype, PluginRelationRelation::getTypes(true))) {
            $sopt[2250]['table'] = 'glpi_plugin_relation_relations';
            $sopt[2250]['field'] = '';
            $sopt[2250]['linkfield'] = 'parent';
            $sopt[2250]['name'] = PluginRelationRelation::getTypeName(2) . " - " . __('Inversa');
            $sopt[2250]['datatype'] = 'itemlink';
            //$sopt[2250]['datatype']	= 'dropdown';
            $sopt[2250]['itemlink_type'] = $itemtype;
            $sopt[2250]['forcegroupby'] = true;
            $sopt[2250]['massiveaction'] = false;
            $sopt[2251]['table'] = 'glpi_plugin_relation_relations';
            $sopt[2251]['field'] = '';
            $sopt[2251]['linkfield'] = 'children';
            $sopt[2251]['name'] = PluginRelationRelation::getTypeName(2) . " - " . __('Directa');
            $sopt[2251]['forcegroupby'] = true;
            //$sopt[2251]['datatype'] = 'dropdown';
            $sopt[2251]['datatype'] = 'itemlink';
            $sopt[2251]['itemlink_type'] = $itemtype;
            $sopt[2251]['massiveaction'] = false;
            //$sopt[2251]['link2'] = 'children2';
            //$sopt[2251]["splititems"] = true;
        }
    }
    return $sopt;
}