def getAllSoftwaresAndVersions(ctx, softname = "", version = None): ret = [] if version == None: ret = unique([x.name for x in Glpi().getAllSoftwares(ctx, softname)]) else: if Glpi().glpi_chosen_version().find('0.8') == 0: # glpi in 0.8 ret = unique([x.name for x in Glpi().getAllVersion4Software(ctx, softname, version)]) else: if Glpi().glpi_version_new(): ret = unique([x.name for x in Glpi().getAllVersion4Software(ctx, softname, version)]) else: ret = unique([x.version for x in Glpi().getAllVersion4Software(ctx, softname, version)]) ret.sort() return ret
def merge(self, lists): retour = [] if len(lists) > 0: pos = map(lambda a:a[0], filter(lambda a:a[1], lists)) neg = map(lambda a:a[0], filter(lambda a:not a[1], lists)) retour = pos.pop() for list in pos: for x in list: retour.append(x) retour = unique(retour) for list in neg: # don't know what to do with neg values... pass return [retour, True]
def getAllContacts(ctx, value=""): return unique([x.contact for x in Glpi().getAllContacts(ctx, value)])
def getAllComments(ctx, value=""): if Glpi().glpi_version[:3] == "0.8": return unique([x.comment for x in Glpi().getAllComments(ctx, value)]) else: # glpi 7 return unique([x.comments for x in Glpi().getAllComments(ctx, value)])
def getAllComments(ctx, value = ''): if Glpi().glpi_chosen_version().find('0.8') == 0: return unique(map(lambda x:x.comment, Glpi().getAllComments(ctx, value))) else: return unique(map(lambda x:x.comments, Glpi().getAllComments(ctx, value)))
def getAllHostnames(ctx, value = ''): return unique(map(lambda x:x.name, Glpi().getAllHostnames(ctx, value)))
def getAllSoftwareVendors(ctx, value=""): res = Glpi().getAllSoftwareVendors(ctx, value) return unique([x.name for x in res])
def getAllSoftwares(ctx, value = ''): ret = unique([x.name for x in Glpi().getAllSoftwares(ctx, value)]) ret.sort() return ret
def getAllLocations(ctx, value=''): return unique([x.completename for x in Glpi().getAllLocations(ctx, value)])
def getAllGroups(ctx, value=""): return unique([x.name for x in Glpi().getAllGroups(ctx, value)])
def getAllContactNums(ctx, value=''): return unique( [x.contact_num for x in Glpi().getAllContactNums(ctx, value)])
def getAllComments(ctx, value=''): if Glpi().glpi_chosen_version().find('0.8') == 0: return unique([x.comment for x in Glpi().getAllComments(ctx, value)]) else: return unique([x.comments for x in Glpi().getAllComments(ctx, value)])
def getAllSoftwares(ctx, value=''): ret = unique([x.name for x in Glpi().getAllSoftwares(ctx, value)]) ret.sort() return ret
def getAllNetworks(ctx, value = ''): return unique(map(lambda x:x.name, Glpi().getAllNetworks(ctx, value)))
def getAllLocations(ctx, value = ''): return unique(map(lambda x:x.completename, Glpi().getAllLocations(ctx, value)))
def getAllInventoryNumbers(ctx, value=""): return unique([x.name for x in Glpi().getAllInventoryNumbers(ctx, value)])
def getAllGroups(ctx, value=''): return unique([x.name for x in Glpi().getAllGroups(ctx, value)])
def getAllManufacturers(ctx, value=""): return unique([x.name for x in Glpi().getAllManufacturers(ctx, value)])
def getAllNetworks(ctx, value=''): return unique([x.name for x in Glpi().getAllNetworks(ctx, value)])
def getAllNetworks(ctx, value=""): return unique([x.name for x in Glpi().getAllNetworks(ctx, value)])
def getAllContactNums(ctx, value = ''): return unique([x.contact_num for x in Glpi().getAllContactNums(ctx, value)])
def getAllSoftwareVersions(ctx, value="", software=None): res = Glpi().getAllSoftwareVersions(ctx, filt=value, software=software) return unique([x.name for x in res])
def getAllLocations(ctx, value = ''): return unique([x.completename for x in Glpi().getAllLocations(ctx, value)])
def getAllHostnames(ctx, value=''): return unique([x.name for x in Glpi().getAllHostnames(ctx, value)])
def getAllContactNums(ctx, value = ''): return unique(map(lambda x:x.contact_num, Glpi().getAllContactNums(ctx, value)))
def getAllComments(ctx, value = ''): if Glpi().glpi_chosen_version().find('0.8') == 0: return unique([x.comment for x in Glpi().getAllComments(ctx, value)]) else: return unique([x.comments for x in Glpi().getAllComments(ctx, value)])
def getAllHostnames(ctx, value=""): return unique([x.name for x in Glpi().getAllHostnames(ctx, value)])
def getAllOs(ctx, value = ''): return unique([x.name for x in Glpi().getAllOs(ctx, value)])
def getAllSoftwares(ctx, value = ''): ret = unique(map(lambda x:x.name, Glpi().getAllSoftwares(ctx, value))) ret.sort() return ret