Code Duplication    Length = 12-14 lines in 4 locations

bika/lims/content/autoimportlog.py 1 location

@@ 61-73 (lines=13) @@
58
            return self.getInstrument().absolute_url_path()
59
        return None
60
61
    def getObjectWorkflowStates(self):
62
        """
63
        This method is used as a metacolumn.
64
        Returns a dictionary with the workflow id as key and workflow state as
65
        value.
66
        :returns: {'review_state':'active',...}
67
        """
68
        workflow = getToolByName(self, 'portal_workflow')
69
        states = {}
70
        for w in workflow.getWorkflowsFor(self):
71
            state = w._getWorkflowStateOf(self).id
72
            states[w.state_var] = state
73
        return states
74
75
76
# Activating the content type in Archetypes' internal types registry

bika/lims/content/person.py 1 location

@@ 232-243 (lines=12) @@
229
        return self.portal_membership.getMemberById(
230
            self.getUsername()) is not None
231
232
    def getObjectWorkflowStates(self):
233
        """
234
        Returns a dictionary with the workflow id as key and workflow state as
235
        value.
236
        :returns: {'review_state':'active',...}
237
        """
238
        workflow = getToolByName(self, 'portal_workflow')
239
        states = {}
240
        for w in workflow.getWorkflowsFor(self):
241
            state = w._getWorkflowStateOf(self).id
242
            states[w.state_var] = state
243
        return states
244
245
    ### Removed these accessors to prevent confusion when LDAP is used
246
    # def getEmailAddress(self, **kw):

bika/lims/content/analysisrequest.py 1 location

@@ 2808-2820 (lines=13) @@
2805
                    break
2806
            return canbeverified
2807
2808
    def getObjectWorkflowStates(self):
2809
        """
2810
        This method is used as a metacolumn.
2811
        Returns a dictionary with the workflow id as key and workflow state as
2812
        value.
2813
        :returns: {'review_state':'active',...}
2814
        """
2815
        workflow = getToolByName(self, 'portal_workflow')
2816
        states = {}
2817
        for w in workflow.getWorkflowsFor(self):
2818
            state = w._getWorkflowStateOf(self).id
2819
            states[w.state_var] = state
2820
        return states
2821
2822
    # TODO Workflow, AnalysisRequest Move to guards.verify?
2823
    def isUserAllowedToVerify(self, member):

bika/lims/content/worksheet.py 1 location

@@ 1316-1329 (lines=14) @@
1313
            return analyst_member.getProperty('fullname')
1314
        return analyst
1315
1316
    def getObjectWorkflowStates(self):
1317
        """
1318
        This method is used as a metacolumn.
1319
        Returns a dictionary with the workflow id as key and workflow state as
1320
        value.
1321
        :returns: {'review_state':'active',...}
1322
        :rtype: dict
1323
        """
1324
        workflow = getToolByName(self, 'portal_workflow')
1325
        states = {}
1326
        for w in workflow.getWorkflowsFor(self):
1327
            state = w._getWorkflowStateOf(self).id
1328
            states[w.state_var] = state
1329
        return states
1330
1331
    # TODO Workflow - Worksheet - Move to workflow.worksheet.events
1332
    def workflow_script_reject(self):