Code Duplication    Length = 12-14 lines in 4 locations

bika/lims/content/autoimportlog.py 1 location

@@ 74-86 (lines=13) @@
71
            return self.getInstrument().absolute_url_path()
72
        return None
73
74
    def getObjectWorkflowStates(self):
75
        """
76
        This method is used as a metacolumn.
77
        Returns a dictionary with the workflow id as key and workflow state as
78
        value.
79
        :returns: {'review_state':'active',...}
80
        """
81
        workflow = getToolByName(self, 'portal_workflow')
82
        states = {}
83
        for w in workflow.getWorkflowsFor(self):
84
            state = w._getWorkflowStateOf(self).id
85
            states[w.state_var] = state
86
        return states
87
88
89
# Activating the content type in Archetypes' internal types registry

bika/lims/content/analysisrequest.py 1 location

@@ 2170-2182 (lines=13) @@
2167
        """
2168
        return user_email(self, self.Creator())
2169
2170
    def getObjectWorkflowStates(self):
2171
        """
2172
        This method is used as a metacolumn.
2173
        Returns a dictionary with the workflow id as key and workflow state as
2174
        value.
2175
        :returns: {'review_state':'active',...}
2176
        """
2177
        workflow = getToolByName(self, 'portal_workflow')
2178
        states = {}
2179
        for w in workflow.getWorkflowsFor(self):
2180
            state = w._getWorkflowStateOf(self).id
2181
            states[w.state_var] = state
2182
        return states
2183
2184
    def getPriorityText(self):
2185
        """

bika/lims/content/worksheet.py 1 location

@@ 1306-1319 (lines=14) @@
1303
            return analyst_member.getProperty('fullname')
1304
        return analyst
1305
1306
    def getObjectWorkflowStates(self):
1307
        """
1308
        This method is used as a metacolumn.
1309
        Returns a dictionary with the workflow id as key and workflow state as
1310
        value.
1311
        :returns: {'review_state':'active',...}
1312
        :rtype: dict
1313
        """
1314
        workflow = getToolByName(self, 'portal_workflow')
1315
        states = {}
1316
        for w in workflow.getWorkflowsFor(self):
1317
            state = w._getWorkflowStateOf(self).id
1318
            states[w.state_var] = state
1319
        return states
1320
1321
    # TODO Workflow - Worksheet - Move to workflow.worksheet.events
1322
    def workflow_script_reject(self):

bika/lims/content/person.py 1 location

@@ 265-276 (lines=12) @@
262
        return self.portal_membership.getMemberById(
263
            self.getUsername()) is not None
264
265
    def getObjectWorkflowStates(self):
266
        """Returns a dictionary with the workflow id as key and workflow state
267
        as value.
268
269
        :returns: {'review_state':'active',...}
270
        """
271
        workflow = getToolByName(self, 'portal_workflow')
272
        states = {}
273
        for w in workflow.getWorkflowsFor(self):
274
            state = w._getWorkflowStateOf(self).id
275
            states[w.state_var] = state
276
        return states
277
278
279
registerType(Person, PROJECTNAME)