| @@ 83-92 (lines=10) @@ | ||
| 80 | from bika.lims.idserver import renameAfterCreation |
|
| 81 | renameAfterCreation(self) |
|
| 82 | ||
| 83 | @security.private |
|
| 84 | def _getAvailableMethodsDisplayList(self): |
|
| 85 | """ Returns a DisplayList with the available Methods |
|
| 86 | registered in Bika-Setup. Only active Methods are fetched. |
|
| 87 | """ |
|
| 88 | bsc = getToolByName(self, 'bika_setup_catalog') |
|
| 89 | items = [(i.UID, i.Title) |
|
| 90 | for i in bsc(portal_type='Method', is_active=True)] |
|
| 91 | items.sort(lambda x, y: cmp(x[1], y[1])) |
|
| 92 | return DisplayList(list(items)) |
|
| 93 | ||
| 94 | @security.private |
|
| 95 | def _areConditionsMet(self, action_set, analysis, forceuid=False): |
|
| @@ 586-597 (lines=12) @@ | ||
| 583 | items.insert(0, ('', _("None"))) |
|
| 584 | return DisplayList(list(items)) |
|
| 585 | ||
| 586 | @security.private |
|
| 587 | def _getAvailableInstrumentsDisplayList(self): |
|
| 588 | """ Returns a DisplayList with the available Instruments |
|
| 589 | registered in Bika-Setup. Only active Instruments are |
|
| 590 | fetched. Used to fill the Instruments MultiSelectionWidget |
|
| 591 | """ |
|
| 592 | bsc = getToolByName(self, 'bika_setup_catalog') |
|
| 593 | items = [(i.UID, i.Title) |
|
| 594 | for i in bsc(portal_type='Instrument', |
|
| 595 | is_active=True)] |
|
| 596 | items.sort(lambda x, y: cmp(x[1], y[1])) |
|
| 597 | return DisplayList(list(items)) |
|
| 598 | ||
| 599 | @security.public |
|
| 600 | def getServiceDependencies(self): |
|
| @@ 237-246 (lines=10) @@ | ||
| 234 | items = [(i.UID(), i.Title()) for i in self.getInstruments()] |
|
| 235 | return DisplayList(list(items)) |
|
| 236 | ||
| 237 | def _getAvailableInstrumentsDisplayList(self): |
|
| 238 | """Available instruments registered in the system |
|
| 239 | ||
| 240 | Only instruments with state=active will be fetched |
|
| 241 | """ |
|
| 242 | bsc = getToolByName(self, "bika_setup_catalog") |
|
| 243 | items = [(i.UID, i.Title) |
|
| 244 | for i in bsc(portal_type="Instrument", |
|
| 245 | is_active=True)] |
|
| 246 | items.sort(lambda x, y: cmp(x[1], y[1])) |
|
| 247 | return DisplayList(list(items)) |
|
| 248 | ||
| 249 | ||