def folderitem(self, obj, item, index): # Call the folderitem method from the base class item = _ARV.folderitem(self, obj, item, index) # In sampling rounds, analysis request list will be listed per Sample # Partition/Container Obtaining analysis requests # TODO-performance: don't get the full object obj = obj.getObject() # Getting the sampling round template uid srTemplateUID = obj.getSamplingRound( ).sr_template if obj.getSamplingRound().sr_template else '' # Getting the sampling round object catalog = getToolByName(self.context, 'uid_catalog') srTemplateObj = catalog(UID=srTemplateUID)[0].getObject() if catalog( UID=srTemplateUID) else None # Getting the partitions and creating a row per partition partitions = obj.getPartitions() for part in partitions: item['partition'] = part.id if part.getContainer(): img_url = '<img src="' + self.portal_url + '/++resource++bika.lims.images/ok.png"/>' item['securitySealIntact'] = part.getContainer( ).getSecuritySealIntact() item['replace']['securitySealIntact'] = img_url \ if part.getContainer().getSecuritySealIntact() else ' ' else: item['securitySealIntact'] = ' ' item['replace']['partition'] = "<a href='%s'>%s</a>" % ( part.absolute_url(), item['partition']) item[ 'samplingRoundTemplate'] = srTemplateObj.title if srTemplateObj else '' if srTemplateObj: item['replace']['samplingRoundTemplate'] = \ "<a href='%s'>%s</a>" % (srTemplateObj.absolute_url, item['samplingRoundTemplate']) return item
def folderitem(self, obj, item, index): # Call the folderitem method from the base class item = _ARV.folderitem(self, obj, item, index) # In sampling rounds, analysis request list will be listed per Sample # Partition/Container Obtaining analysis requests # TODO-performance: don't get the full object obj = obj.getObject() # Getting the sampling round template uid srTemplateUID = obj.getSamplingRound().sr_template if obj.getSamplingRound().sr_template else '' # Getting the sampling round object catalog = getToolByName(self.context, 'uid_catalog') srTemplateObj = catalog(UID=srTemplateUID)[0].getObject() if catalog(UID=srTemplateUID) else None item['samplingRoundTemplate'] = '' if srTemplateObj: item['samplingRoundTemplate'] = srTemplateObj.title item['replace']['samplingRoundTemplate'] = \ "<a href='%s'>%s</a>" % ( srTemplateObj.absolute_url, item['samplingRoundTemplate']) item['securitySealIntact'] = '' return item
def folderitem(self, obj, item, index): item = BaseView.folderitem(self, obj, item, index) return folder_listing_item(self, obj, item, index)