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

@@ 2162-2174 (lines=13) @@
2159
        """
2160
        return user_email(self, self.Creator())
2161
2162
    def getObjectWorkflowStates(self):
2163
        """
2164
        This method is used as a metacolumn.
2165
        Returns a dictionary with the workflow id as key and workflow state as
2166
        value.
2167
        :returns: {'review_state':'active',...}
2168
        """
2169
        workflow = getToolByName(self, 'portal_workflow')
2170
        states = {}
2171
        for w in workflow.getWorkflowsFor(self):
2172
            state = w._getWorkflowStateOf(self).id
2173
            states[w.state_var] = state
2174
        return states
2175
2176
    def getPriorityText(self):
2177
        """

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)