| @@ 96-105 (lines=10) @@ | ||
| 93 | from bika.lims.idserver import renameAfterCreation |
|
| 94 | renameAfterCreation(self) |
|
| 95 | ||
| 96 | @security.private |
|
| 97 | def _getAvailableMethodsDisplayList(self): |
|
| 98 | """ Returns a DisplayList with the available Methods |
|
| 99 | registered in Bika-Setup. Only active Methods are fetched. |
|
| 100 | """ |
|
| 101 | bsc = getToolByName(self, 'bika_setup_catalog') |
|
| 102 | items = [(i.UID, i.Title) |
|
| 103 | for i in bsc(portal_type='Method', is_active=True)] |
|
| 104 | items.sort(lambda x, y: cmp(x[1], y[1])) |
|
| 105 | return DisplayList(list(items)) |
|
| 106 | ||
| 107 | @security.private |
|
| 108 | def _areConditionsMet(self, action_set, analysis, forceuid=False): |
|
| @@ 593-604 (lines=12) @@ | ||
| 590 | items.insert(0, ('', _("None"))) |
|
| 591 | return DisplayList(list(items)) |
|
| 592 | ||
| 593 | @security.private |
|
| 594 | def _getAvailableInstrumentsDisplayList(self): |
|
| 595 | """ Returns a DisplayList with the available Instruments |
|
| 596 | registered in Bika-Setup. Only active Instruments are |
|
| 597 | fetched. Used to fill the Instruments MultiSelectionWidget |
|
| 598 | """ |
|
| 599 | bsc = getToolByName(self, 'bika_setup_catalog') |
|
| 600 | items = [(i.UID, i.Title) |
|
| 601 | for i in bsc(portal_type='Instrument', |
|
| 602 | is_active=True)] |
|
| 603 | items.sort(lambda x, y: cmp(x[1], y[1])) |
|
| 604 | return DisplayList(list(items)) |
|
| 605 | ||
| 606 | @security.public |
|
| 607 | def getServiceDependencies(self): |
|
| @@ 257-266 (lines=10) @@ | ||
| 254 | items = [(i.UID(), i.Title()) for i in self.getInstruments()] |
|
| 255 | return DisplayList(list(items)) |
|
| 256 | ||
| 257 | def _getAvailableInstrumentsDisplayList(self): |
|
| 258 | """Available instruments registered in the system |
|
| 259 | ||
| 260 | Only instruments with state=active will be fetched |
|
| 261 | """ |
|
| 262 | bsc = getToolByName(self, "bika_setup_catalog") |
|
| 263 | items = [(i.UID, i.Title) |
|
| 264 | for i in bsc(portal_type="Instrument", |
|
| 265 | is_active=True)] |
|
| 266 | items.sort(lambda x, y: cmp(x[1], y[1])) |
|
| 267 | return DisplayList(list(items)) |
|
| 268 | ||
| 269 | ||