def __init__(self, context, request, fieldvalue, allow_edit):
        BikaListingView.__init__(self, context, request)
        self.context_actions = {}
        self.contentFilter = {"review_state": "impossible_state"}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_column_toggles = False
        self.show_select_column = False
        self.pagesize = 1000
        self.allow_edit = allow_edit
        self.form_id = "partitions"

        self.columns = {
            "part_id": {"title": _("Partition"), "sortable": False},
            "container_uid": {"title": _("Container"), "sortable": False},
            "preservation_uid": {"title": _("Preservation"), "sortable": False},
        }
        self.review_states = [
            {
                "id": "default",
                "title": _("All"),
                "contentFilter": {},
                "transitions": [{"id": "empty"}],  # none
                "columns": ["part_id", "container_uid", "preservation_uid"],
            }
        ]

        self.fieldvalue = fieldvalue
예제 #2
0
    def __init__(self, context, request, field=None, category=None):
        BikaListingView.__init__(self, context, request)
        if field:
            self.selected = [o.UID() for o in getattr(field, field.accessor)()]
        else:
            self.selected = []
        self.category = category if category else None
        self.context_actions = {}
        self.catalog = "bika_setup_catalog"
        self.contentFilter = {'review_state': 'impossible_state'}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = True
        self.pagesize = 999999
        self.form_id = 'serviceswidget'

        self.show_categories = False
        self.categories = []
        # TODO Check if filtering by multiple UIDs should be enabled
        self.do_cats = self.context.bika_setup.getCategoriseAnalysisServices()
        if self.do_cats:
            self.show_categories = True
            self.expand_all_categories = False
            self.ajax_categories = True
            self.category_index = 'getCategoryTitle'
            self.ajax_categories_url = context.absolute_url() + \
                                       "/ajax_services_expand_category"

        self.columns = {
            'Service': {
                'title': _('Service')
            },
            'Keyword': {
                'title': _('Keyword'),
                'index': 'getKeyword'
            },
            'Method': {
                'title': _('Method')
            },
            'Calculation': {
                'title': _('Calculation')
            },
        }
        self.review_states = [
            {
                'id': 'default',
                'title': _('All'),
                'contentFilter': {},
                'transitions': [],
                'columns': [
                    'Service',
                    'Keyword',
                    'Method',
                    'Calculation',
                ]
            },
        ]
예제 #3
0
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)
        self.context_actions = {}
        self.catalog = 'bika_setup_catalog'
        self.contentFilter = {'review_state':'impossible_state'}
        self.base_url = self.context.absolute_url()
        self.view_url = self.context.absolute_url()
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = True
        self.pagesize = 999999
        self.show_workflow_action_buttons = False
        self.show_categories=context.bika_setup.getCategoriseAnalysisServices()
        self.expand_all_categories = False
        self.ajax_categories = True
        self.ajax_categories_url = self.base_url + '/service_view'
        self.category_index = 'getCategoryTitle'

        self.columns = {
            'Service': {'title': _('Service'),
                        'sortable': False},
        }
        self.review_states = [
            {'id':'default',
             'title': _('All'),
             'contentFilter': {},
             'transitions': [],
             'columns':['Service'],
            },
        ]
예제 #4
0
파일: log.py 프로젝트: socheathly/Bika-LIMS
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)

        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_column = False
        self.show_workflow_action_buttons = False
        self.pagesize = 1000

        self.icon = "++resource++bika.lims.images/%s_big.png" % \
            context.portal_type.lower()
        self.title = "%s %s" % (self.context.Title(),
                                self.context.translate(_("Log")))
        self.description = ""

        self.columns = {
            'Version': {'title': _('Version'),'sortable':False},
            'Date': {'title': _('Date'),'sortable':False},
            'User': {'title': _('User'),'sortable':False},
            'Action': {'title': _('Action'),'sortable':False},
            'Description': {'title': _('Description'),'sortable':False},
        }
        self.review_states = [
            {'id':'default',
             'title': 'All',
             'contentFilter':{},
             'columns': ['Version',
                         'Date',
                         'User',
                         'Action',
                         'Description']},
        ]
    def __init__(self, context, request, fieldvalue, allow_edit):
        BikaListingView.__init__(self, context, request)
        self.context_actions = {}
        self.contentFilter = {'review_state': 'impossible_state'}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_column_toggles = False
        self.show_select_column = False
        self.pagesize = 1000
        self.allow_edit = allow_edit
        self.form_id = "partitions"

        self.columns = {
            'part_id': {'title': _('Partition'),
                        'sortable': False,},
            'container_uid': {'title': _('Container'),
                              'sortable': False,},
            'preservation_uid': {'title': _('Preservation'),
                                 'sortable': False,},
        }
        self.review_states = [
            {'id':'default',
             'title': _('All'),
             'contentFilter':{},
             'transitions': [{'id':'empty'}], # none
             'columns':['part_id', 'container_uid', 'preservation_uid'],
            },
        ]

        self.fieldvalue = fieldvalue
    def __init__(self, context, request, fieldvalue, allow_edit):
        BikaListingView.__init__(self, context, request)
        self.context_actions = {}
        self.contentFilter = {'review_state': 'impossible_state'}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_column_toggles = False
        self.show_select_column = False
        self.setoddeven = False
        self.pagesize = 1000
        self.allow_edit = allow_edit
        self.form_id = "partitions"

        self.columns = {
            'part_id': {'title': _('Partition'),
                        'sortable': False,},
            'container_uid': {'title': _('Container'),
                              'sortable': False,},
            'preservation_uid': {'title': _('Preservation'),
                                 'sortable': False,},
        }
        self.review_states = [
            {'id':'default',
             'title': _('All'),
             'contentFilter':{},
             'transitions': [{'id':'empty'}], # none
             'columns':['part_id', 'container_uid', 'preservation_uid'],
            },
        ]

        self.fieldvalue = fieldvalue
예제 #7
0
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)
        self.context_actions = {}
        self.catalog = 'bika_setup_catalog'
        self.contentFilter = {'review_state': 'impossible_state'}
        self.base_url = self.context.absolute_url()
        self.view_url = self.context.absolute_url()
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = True
        self.pagesize = 999999
        self.show_workflow_action_buttons = False
        self.show_categories = context.bika_setup.getCategoriseAnalysisServices(
        )
        self.expand_all_categories = True

        self.columns = {
            'Service': {
                'title': _('Service'),
                'sortable': False
            },
        }
        self.review_states = [
            {
                'id': 'default',
                'title': _('All'),
                'contentFilter': {},
                'transitions': [],
                'columns': ['Service'],
            },
        ]
예제 #8
0
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)
        self.context_actions = {}
        self.catalog = 'bika_analysis_catalog'
        self.contentFilter = {'portal_type': 'Analysis',
                              'review_state':'impossible_state'}
        self.base_url = self.context.absolute_url()
        self.view_url = self.context.absolute_url() + "/add_duplicate"
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = False

        self.columns = {
            'Position': {'title': _('Position')},
            'RequestID': {'title': _('Request ID')},
            'Client': {'title': _('Client')},
            'created': {'title': _('Date Requested')},
        }
        self.review_states = [
            {'id':'default',
             'title': _('All'),
             'contentFilter':{},
             'transitions': [],
             'columns':['Position', 'RequestID', 'Client', 'created'],
            },
        ]
예제 #9
0
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)

        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_column = False
        self.show_workflow_action_buttons = False
        self.pagesize = 999999

        self.icon = self.portal_url + "/++resource++bika.lims.images/%s_big.png" % \
            context.portal_type.lower()
        self.title = to_utf8(self.context.Title()) + " " + t(_("Log"))
        self.description = ""

        self.columns = {
            'Version': {'title': _('Version'), 'sortable': False},
            'Date': {'title': _('Date'), 'sortable': False},
            'User': {'title': _('User'), 'sortable': False},
            'Action': {'title': _('Action'), 'sortable': False},
            'Description': {'title': _('Description'), 'sortable': False},
        }
        self.review_states = [
            {'id': 'default',
             'title': 'All',
             'contentFilter': {},
             'columns': ['Version',
                         'Date',
                         'User',
                         'Action',
                         'Description']},
        ]
예제 #10
0
    def __init__(self, context, request, field):
        BikaListingView.__init__(self, context, request)
        self.selected = [o.UID() for o in getattr(field, field.accessor)()]
        self.context_actions = {}
        self.contentFilter = {'review_state': 'impossible_state'}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = True
        self.pagesize = 1000
        self.form_id = 'serviceswidget'

        self.columns = {
            'Service': {'title': _('Service')},
            'Keyword': {'title': _('Keyword'),
                        'index': 'getKeyword'},
            'Method': {'title': _('Method')},
            'Calculation': {'title': _('Calculation')},
        }
        self.review_states = [
            {'id':'all',
             'title': _('All'),
             'transitions': [],
             'columns':['Service',
                        'Keyword',
                        'Method',
                        'Calculation', ]
            },
        ]
    def __init__(self, context, request, fieldvalue, allow_edit):
        BikaListingView.__init__(self, context, request)
        self.context_actions = {}
        self.contentFilter = {'review_state' : 'impossible_state'}
        self.context_actions = {}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = False
        self.pagesize = 1000
        self.allow_edit = allow_edit

        self.specsresults = {}
        for specresults in fieldvalue:
            self.specsresults[specresults['keyword']] = specresults

        self.columns = {
            'service': {'title': _('Service'), 'index': 'sortable_title', 'sortable': False},
            'min': {'title': _('Min'), 'sortable': False,},
            'max': {'title': _('Max'), 'sortable': False,},
            'error': {'title': _('Permitted Error %'), 'sortable': False},
        }

        self.review_states = [
            {'id':'default',
             'title': _('All'),
             'contentFilter':{},
             'transitions': [],
             'columns': ['service', 'min', 'max', 'error'],
             },
        ]
예제 #12
0
    def __init__(self, context, request, field):
        BikaListingView.__init__(self, context, request)
        self.selected = [o.UID() for o in getattr(field, field.accessor)()]
        self.context_actions = {}
        self.catalog = "bika_setup_catalog"
        self.contentFilter = {'review_state': 'impossible_state'}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url
        self.show_categories = True
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = True
        self.pagesize = 1000
        self.form_id = 'serviceswidget'

        self.columns = {
            'Service': {'title': _('Service')},
            'Keyword': {'title': _('Keyword'),
                        'index': 'getKeyword'},
            'Method': {'title': _('Method')},
            'Calculation': {'title': _('Calculation')},
        }
        self.review_states = [
            {'id':'default',
             'title': _('All'),
             'contentFilter':{},
             'transitions': [],
             'columns':['Service',
                        'Keyword',
                        'Method',
                        'Calculation', ]
            },
        ]
예제 #13
0
 def __init__(self, context, request, **kwargs):
     BikaListingView.__init__(self, context, request, **kwargs)
     self.form_id = "instrumentcertifications"
     self.columns = {
         'Title': {'title': _('Cert. Num'),
                   'index': 'sortable_title'},
         'getAgency': {'title': _('Agency')},
         'getDate': {'title': _('Date')},
         'getValidFrom': {'title': _('Valid from')},
         'getValidTo': {'title': _('Valid to')},
         'getDocument': {'title': _('Document')},
     }
     self.review_states = [
         {'id':'default',
          'title':_('All'),
          'contentFilter':{},
          'columns': [ 'Title',
                      'getAgency',
                      'getDate',
                      'getValidFrom',
                      'getValidTo',
                      'getDocument'],
          'transitions': [{}]},
     ]
     self.allow_edit = False
     self.show_select_column = False
     self.show_workflow_action_buttons = True
     uids = [c.UID() for c in self.context.getCertifications()]
     self.catalog = 'portal_catalog'
     self.contentFilter = {'UID': uids, 'sort_on': 'sortable_title'}
예제 #14
0
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)
        self.context_actions = {}
        self.catalog = 'bika_analysis_catalog'
        self.contentFilter = {'portal_type': 'Analysis',
                              'review_state':'impossible_state'}
        self.base_url = self.context.absolute_url()
        self.view_url = self.context.absolute_url() + "/add_duplicate"
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = False

        self.columns = {
            'Position': {'title': _('Position')},
            'RequestID': {'title': _('Request ID')},
            'Client': {'title': _('Client')},
            'created': {'title': _('Date Requested')},
        }
        self.review_states = [
            {'id':'default',
             'title': _('All'),
             'contentFilter':{},
             'transitions': [],
             'columns':['Position', 'RequestID', 'Client', 'created'],
            },
        ]
예제 #15
0
 def __init__(self, context, request, **kwargs):
     BikaListingView.__init__(self, context, request, **kwargs)
     self.form_id = "instrumentcertifications"
     self.columns = {
         'Title': {'title': _('Cert. Num'),
                   'index': 'sortable_title'},
         'getAgency': {'title': _('Agency')},
         'getDate': {'title': _('Date')},
         'getValidFrom': {'title': _('Valid from')},
         'getValidTo': {'title': _('Valid to')},
         'getDocument': {'title': _('Document')},
     }
     self.review_states = [
         {'id':'default',
          'title':_('All'),
          'contentFilter':{},
          'columns': [ 'Title',
                      'getAgency',
                      'getDate',
                      'getValidFrom',
                      'getValidTo',
                      'getDocument'],
          'transitions': [{}]},
     ]
     self.allow_edit = False
     self.show_select_column = False
     self.show_workflow_action_buttons = False
     uids = [c.UID() for c in self.context.getCertifications()]
     self.catalog = 'portal_catalog'
     self.contentFilter = {'UID': uids, 'sort_on': 'sortable_title'}
예제 #16
0
    def __init__(self, context, request, fieldvalue, allow_edit):
        BikaListingView.__init__(self, context, request)
        self.context_actions = {}
        self.contentFilter = {'review_state': 'impossible_state'}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = False
        self.setoddeven = False
        self.pagesize = 1000
        self.allow_edit = allow_edit

        self.referenceresults = {}
        # we want current field value as a dict
        # key:uid, value:{dictionary from field list of dict}
        for refres in fieldvalue:
            self.referenceresults[refres['uid']] = refres

        self.columns = {
            'service': {'title': _('Service')},
            'result': {'title': _('Expected Result')},
            'error': {'title': _('Permitted Error %')},
            'min': {'title': _('Min')},
            'max': {'title': _('Max')}
        }
        self.review_states = [
            {'id':'all',
             'title': _('All'),
             'transitions': [],
             'columns':['service', 'result', 'error', 'min', 'max'],
            },
        ]
예제 #17
0
    def __init__(self, context, request, fieldvalue, allow_edit):
        BikaListingView.__init__(self, context, request)
        self.context_actions = {}
        self.contentFilter = {'review_state': 'impossible_state'}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = False
        self.setoddeven = False
        self.pagesize = 1000
        self.allow_edit = allow_edit

        self.referenceresults = {}
        # we want current field value as a dict
        # key:uid, value:{dictionary from field list of dict}
        for refres in fieldvalue:
            self.referenceresults[refres['uid']] = refres

        self.columns = {
            'service': {'title': _('Service')},
            'result': {'title': _('Expected Result')},
            'error': {'title': _('Permitted Error %')},
            'min': {'title': _('Min')},
            'max': {'title': _('Max')}
        }
        self.review_states = [
            {'id':'default',
             'title': _('All'),
             'contentFilter':{},
             'transitions': [],
             'columns':['service', 'result', 'error', 'min', 'max'],
            },
        ]
예제 #18
0
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)
        self.content_add_actions = {}
        self.contentFilter = {'portal_type': 'Analysis',
                              'review_state':'impossible_state'}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url + "/add_analyses"
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_column = True
        self.pagesize = 100

        self.columns = {
            'ClientName': {'title': _('Client')},
            'getClientOrderNumber': {'title': _('Order')},
            'getRequestID': {'title': _('Request ID')},
            'CategoryName': {'title': _('Category')},
            'Title': {'title': _('Analysis')},
            'getDateReceived': {'title': _('Date Received')},
            'getDueDate': {'title': _('Due Date')},
        }
        self.review_states = [
            {'title': _('All'), 'id':'all',
             'transitions': ['assign'],
             'columns':['ClientName',
                        'getClientOrderNumber',
                        'getRequestID',
                        'CategoryName',
                        'Title',
                        'getDateReceived',
                        'getDueDate'],
            },
        ]
예제 #19
0
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)
        self.context_actions = {}
        self.catalog = 'bika_setup_catalog'
        self.contentFilter = {'review_state':'impossible_state'}
        self.base_url = self.context.absolute_url()
        self.view_url = self.context.absolute_url()
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = True
        self.pagesize = 1000
        self.show_workflow_action_buttons = False

        self.columns = {
            'Service': {'title': _('Service'),
                        'sortable': False},
        }
        self.review_states = [
            {'id':'default',
             'title': _('All'),
             'contentFilter': {},
             'transitions': [],
             'columns':['Service'],
            },
        ]
예제 #20
0
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)
        self.context = context
        self.request = request
        self.catalog = "portal_catalog"
        self.contentFilter = {
            'portal_type': 'SupplierContact',
            'path': {
                "query": "/".join(context.getPhysicalPath()),
                "level": 0
            }
        }
        self.context_actions = {
            _('Add'): {
                'url': 'createObject?type_name=SupplierContact',
                'icon': '++resource++bika.lims.images/add.png'
            }
        }
        self.show_table_only = False
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_column = True
        self.pagesize = 50
        self.icon = self.portal_url + \
                    "/++resource++bika.lims.images/contact_big.png"
        self.title = self.context.translate(_("Contacts"))

        self.columns = {
            'getFullname': {
                'title': _('Full Name'),
                'replace_url': 'absolute_url'
            },
            'getEmailAddress': {
                'title': _('Email Address')
            },
            'getBusinessPhone': {
                'title': _('Business Phone')
            },
            'getMobilePhone': {
                'title': _('Mobile Phone')
            },
            'getFax': {
                'title': _('Fax')
            },
        }

        self.review_states = [
            {
                'id':
                'default',
                'title':
                _('All'),
                'contentFilter': {},
                'columns': [
                    'getFullname', 'getEmailAddress', 'getBusinessPhone',
                    'getMobilePhone', 'getFax'
                ]
            },
        ]
예제 #21
0
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)
        self.context = context
        self.request = request

        self.catalog = "portal_catalog"
        self.contentFilter = {
            'portal_type': 'ARReport',
            'path': {
                'query': api.get_path(self.context),
                'depth': 1,
            },
            'sort_order': 'reverse'
        }
        self.context_actions = {}
        self.show_select_column = True
        self.show_workflow_action_buttons = False
        self.form_id = 'published_results'
        self.icon = "{}//++resource++bika.lims.images/report_big.png".format(
            self.portal_url)
        self.title = self.context.translate(_("Published results"))
        self.columns = {
            'COANumber': {
                'title': _('COA')
            },
            'Date': {
                'title': _('Published Date')
            },
            'PublishedBy': {
                'title': _('Published By')
            },
            'DownloadPDF': {
                'title': _('Download PDF')
            },
            'DownloadCSV': {
                'title': _('Download CSV')
            },
            'Recipients': {
                'title': _('Recipients')
            },
        }
        self.review_states = [
            {
                'id':
                'default',
                'title':
                'All',
                'contentFilter': {},
                'columns': [
                    'COANumber',
                    'Date',
                    'PublishedBy',
                    'Recipients',
                    'DownloadPDF',
                    'DownloadCSV',
                ]
            },
        ]
예제 #22
0
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)
        self.icon = "++resource++bika.lims.images/worksheet_big.png"
        self.title = _("Add Analyses")
        self.description = ""
        self.catalog = "bika_analysis_catalog"
        self.context_actions = {}
        # initial review state for first form display of the worksheet
        # add_analyses search view - first batch of analyses, latest first.
        self.contentFilter = {'portal_type': 'Analysis',
                              'review_state':'sample_received',
                              'worksheetanalysis_review_state':'unassigned',
                              'cancellation_state':'active'}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url + "/add_analyses"
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_column = True
        self.pagesize = 50

        self.columns = {
            'Client': {
                'title': _('Client'),
                'index':'getClientTitle'},
            'getClientOrderNumber': {
                'title': _('Order'),
                'index': 'getClientOrderNumber'},
            'getRequestID': {
                'title': _('Request ID'),
                'index': 'getRequestID'},
            'CategoryTitle': {
                'title': _('Category'),
                'index':'getCategoryTitle'},
            'Title': {
                'title': _('Analysis'),
                'index':'sortable_title'},
            'getDateReceived': {
                'title': _('Date Received'),
                'index': 'getDateReceived'},
            'getDueDate': {
                'title': _('Due Date'),
                'index': 'getDueDate'},
        }
        self.filter_indexes = ['Title',]
        self.review_states = [
            {'id':'default',
             'title': _('All'),
             'contentFilter': {},
             'transitions': [{'id':'assign'}, ],
             'columns':['Client',
                        'getClientOrderNumber',
                        'getRequestID',
                        'CategoryTitle',
                        'Title',
                        'getDateReceived',
                        'getDueDate'],
            },
        ]
예제 #23
0
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)

        self.context = context
        self.catalog = 'bika_catalog'
        request.set('disable_plone.rightcolumn', 1)
        self.contentFilter = {
            'portal_type': 'DiseaseOntology',
        }
        self.context_actions = {
            _('Add'): {
                'url': 'createObject?type_name=DiseaseOntology',
                'icon': '++resource++bika.lims.images/add.png'
            }
        }
        self.title = self.context.translate(_("Disease Ontology"))
        self.icon = self.portal_url + \
                    "/++resource++baobab.lims.images/patient_big.png"
        self.description = ''
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_column = False
        self.pagesize = 25
        self.allow_edit = True

        if self.context.portal_type == 'DiseaseOntologies':
            self.request.set('disable_border', 1)

        self.columns = {
            'Title': {
                'title': _('Disease Ontology'),
                'index': 'sortable_title'
            },
            'Version': {
                'title': _('Version'),
                'index': 'sortable_title'
            },
            'Code': {
                'title': _('Code'),
                'index': 'sortable_title'
            },
        }

        self.review_states = [{
            'id': 'default',
            'title': _('Active'),
            'contentFilter': {
                'inactive_state': 'active',
                'sort_on': 'sortable_title',
                'sort_order': 'ascending'
            },
            'transitions': [
                {
                    'id': 'deactivate'
                },
            ],
            'columns': ['Title', 'Version', 'Code']
        }]
예제 #24
0
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)
        self.context = context
        self.catalog = 'bika_catalog'
        request.set('disable_plone.rightcolumn', 1)
        self.contentFilter = {
            'portal_type': 'SampleBatch',
            'sort_on': 'sortable_title',
            'sort_order': 'ascending'
        }
        self.context_actions = {}
        self.title = self.context.translate(_("Biospecimen Batches"))
        self.icon = self.portal_url + \
                    "/++resource++baobab.lims.images/biospectype_big.png"
        self.description = ''
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_column = False
        self.pagesize = 25
        self.allow_edit = True

        self.columns = {
            'Title': {
                'title': _('Title'),
                'index': 'sortable_title'
            },
            'BatchId': {
                'title': _('Batch ID'),
                'toggle': True,
            }
        }

        self.review_states = [
            {
                'id': 'default',
                'title': _('Active'),
                'contentFilter': {'inactive_state': 'active'},
                'transitions': [],
                'columns': [
                    'Title',
                    'BatchId'
                ]
             },

            {
                'id': 'all',
                'title': _('All'),
                'contentFilter': {
                    'sort_on': 'created',
                    'sort_order': 'ascending'
                },
                'columns': [
                    'Title',
                    'BatchId'
                ]
            },
        ]
예제 #25
0
    def __init__(self, context, request, fieldvalue=[], allow_edit=True):
        BikaListingView.__init__(self, context, request)
        self.context_actions = {}
        self.contentFilter = {
            'inactive_state': 'active',
            'sort_on': 'sortable_title'
        }
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = False
        self.pagesize = 999999
        self.allow_edit = allow_edit
        self.show_categories = True
        self.ajax_categories = True
        self.ajax_categories_url = self.context.absolute_url(
        ) + "/reference_results_widget_view"
        self.category_index = 'getCategoryTitle'
        # self.expand_all_categories = False

        self.referenceresults = {}
        # we want current field value as a dict
        # key:uid, value:{dictionary from field list of dict}
        for refres in fieldvalue:
            self.referenceresults[refres['uid']] = refres

        self.columns = {
            'service': {
                'title': _('Service')
            },
            'result': {
                'title': _('Expected Result')
            },
            'error': {
                'title': _('Permitted Error %')
            },
            'min': {
                'title': _('Min')
            },
            'max': {
                'title': _('Max')
            }
        }
        self.review_states = [
            {
                'id': 'default',
                'title': _('All'),
                'contentFilter': {},
                'transitions': [],
                'columns': ['service', 'result', 'error', 'min', 'max'],
            },
        ]
예제 #26
0
    def __init__(self, context, request, field=None, category=None):
        BikaListingView.__init__(self, context, request)
        if field:
            self.selected = [o.UID() for o in getattr(field, field.accessor)()]
        else:
            self.selected = []
        self.category = category if category else None
        self.context_actions = {}
        self.catalog = "bika_setup_catalog"
        self.contentFilter = {'review_state': 'impossible_state'}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = True
        self.pagesize = 999999
        self.form_id = 'serviceswidget'

        self.show_categories = False
        self.categories = []
        # TODO Check if filtering by multiple UIDs should be enabled
        self.do_cats = self.context.bika_setup.getCategoriseAnalysisServices()
        if self.do_cats:
            self.show_categories = True
            self.expand_all_categories = False
            self.ajax_categories = True
            self.category_index = 'getCategoryTitle'
            self.ajax_categories_url = context.absolute_url() + \
                                       "/ajax_services_expand_category"

        self.columns = {
            'Service': {'title': _('Service')},
            'Keyword': {'title': _('Keyword'),
                        'index': 'getKeyword'},
            'Method': {'title': _('Method')},
            'Calculation': {'title': _('Calculation')},
        }
        self.review_states = [
            {'id':'default',
             'title': _('All'),
             'contentFilter':{},
             'transitions': [],
             'columns':['Service',
                        'Keyword',
                        'Method',
                        'Calculation', ]
            },
        ]
    def __init__(self, context, request, fieldvalue, allow_edit):
        BikaListingView.__init__(self, context, request)
        self.context_actions = {}
        self.contentFilter = {'review_state': 'impossible_state'}
        self.context_actions = {}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = False
        self.pagesize = 1000
        self.allow_edit = allow_edit
        self.show_categories = True
        # self.expand_all_categories = False

        self.specsresults = {}
        for specresults in fieldvalue:
            self.specsresults[specresults['keyword']] = specresults

        self.columns = {
            'service': {
                'title': _('Service'),
                'index': 'sortable_title',
                'sortable': False
            },
            'min': {
                'title': _('Min'),
                'sortable': False,
            },
            'max': {
                'title': _('Max'),
                'sortable': False,
            },
            'error': {
                'title': _('Permitted Error %'),
                'sortable': False
            },
        }

        self.review_states = [
            {
                'id': 'default',
                'title': _('All'),
                'contentFilter': {},
                'transitions': [],
                'columns': ['service', 'min', 'max', 'error'],
            },
        ]
예제 #28
0
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)
        self.contentFilter = {
            'portal_type': 'Project',
            'sort_on': 'sortable_title'
        }
        self.context_actions = {}
        self.title = self.context.translate(_("Projects"))
        self.icon = self.portal_url + \
                    "/++resource++baobab.lims.images/project_big.png"
        self.description = ""
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_column = False
        self.pagesize = 50

        if self.context.portal_type == 'Projects':
            self.request.set('disable_border', 1)

        self.columns = {
            'Title': {
                'title': _('Project'),
                'index': 'sortable_title'
            },
            'getClient': {
                'title': _('Client'),
                'toggle': True
            },
            'getStudyType': {
                'title': _('Study Type'),
                'toggle': True
            },
        }

        self.review_states = [
            {
                'id': 'default',
                'title': _('Active'),
                'contentFilter': {
                    'inactive_state': 'active'
                },
                'transitions': [],
                'columns': ['Title', 'getClient', 'getStudyType']
            },
        ]
    def __init__(self, context, request, fieldvalue=[], allow_edit=True):
        BikaListingView.__init__(self, context, request)
        self.context_actions = {}
        self.contentFilter = {'inactive_state': 'active',
                              'sort_on': 'sortable_title'}
        self.context_actions = {}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = False
        self.pagesize = 999999
        self.allow_edit = allow_edit
        self.show_categories = True
        # self.expand_all_categories = False
        self.ajax_categories = True
        self.ajax_categories_url = self.context.absolute_url() + "/analysis_spec_widget_view"
        self.category_index = 'getCategoryTitle'

        self.specsresults = {}
        for specresults in fieldvalue:
            self.specsresults[specresults['keyword']] = specresults

        self.columns = {
            'service': {'title': _('Service'), 'index': 'sortable_title', 'sortable': False},
            'min': {'title': _('Min'), 'sortable': False,},
            'max': {'title': _('Max'), 'sortable': False,},
            'error': {'title': _('Permitted Error %'), 'sortable': False},
            'hidemin': {'title': _('< Min'), 'sortable': False},
            'hidemax': {'title': _('> Max'), 'sortable': False},
            'rangecomment': {'title': _('Range comment'), 'sortable': False, 'toggle': False}
        }

        self.review_states = [
            {'id':'default',
             'title': _('All'),
             'contentFilter':{},
             'transitions': [],
             'columns': ['service', 'min', 'max', 'error',
                         'hidemin', 'hidemax', 'rangecomment'],
             },
        ]
    def __init__(self, context, request, fieldvalue=[], allow_edit=True):
        BikaListingView.__init__(self, context, request)
        self.context_actions = {}
        self.contentFilter = {'inactive_state': 'active',
                              'sort_on': 'sortable_title'}
        self.context_actions = {}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = False
        self.pagesize = 999999
        self.allow_edit = allow_edit
        self.show_categories = True
        # self.expand_all_categories = False
        self.ajax_categories = True
        self.ajax_categories_url = self.context.absolute_url() + "/analysis_spec_widget_view"
        self.category_index = 'getCategoryTitle'

        self.specsresults = {}
        for specresults in fieldvalue:
            self.specsresults[specresults['keyword']] = specresults

        self.columns = {
            'service': {'title': _('Service'), 'index': 'sortable_title', 'sortable': False},
            'min': {'title': _('Min'), 'sortable': False,},
            'max': {'title': _('Max'), 'sortable': False,},
            'error': {'title': _('Permitted Error %'), 'sortable': False},
            'hidemin': {'title': _('< Min'), 'sortable': False},
            'hidemax': {'title': _('> Max'), 'sortable': False},
            'rangecomment': {'title': _('Range comment'), 'sortable': False, 'toggle': False}
        }

        self.review_states = [
            {'id':'default',
             'title': _('All'),
             'contentFilter':{},
             'transitions': [],
             'columns': ['service', 'min', 'max', 'error',
                         'hidemin', 'hidemax', 'rangecomment'],
             },
        ]
    def __init__(self, context, request, fieldvalue=[], allow_edit=True):
        BikaListingView.__init__(self, context, request)
        self.context_actions = {}
        self.contentFilter = {"inactive_state": "active", "sort_on": "sortable_title"}
        self.context_actions = {}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = False
        self.pagesize = 999999
        self.allow_edit = allow_edit
        self.show_categories = True
        # self.expand_all_categories = False
        self.ajax_categories = True
        self.ajax_categories_url = self.context.absolute_url() + "/analysis_spec_widget_view"
        self.category_index = "getCategoryTitle"

        self.specsresults = {}
        for specresults in fieldvalue:
            self.specsresults[specresults["keyword"]] = specresults

        self.columns = {
            "service": {"title": _("Service"), "index": "sortable_title", "sortable": False},
            "min": {"title": _("Min"), "sortable": False},
            "max": {"title": _("Max"), "sortable": False},
            "error": {"title": _("Permitted Error %"), "sortable": False},
            "hidemin": {"title": _("< Min"), "sortable": False},
            "hidemax": {"title": _("> Max"), "sortable": False},
            "rangecomment": {"title": _("Range comment"), "sortable": False, "toggle": False},
        }

        self.review_states = [
            {
                "id": "default",
                "title": _("All"),
                "contentFilter": {},
                "transitions": [],
                "columns": ["service", "min", "max", "error", "hidemin", "hidemax", "rangecomment"],
            }
        ]
예제 #32
0
파일: log.py 프로젝트: udithap/Bika-LIMS
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)

        translate = context.translation_service.translate

        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_column = False
        self.show_workflow_action_buttons = False
        self.pagesize = 1000

        self.icon = "++resource++bika.lims.images/%s_big.png" % \
            context.portal_type.lower()
        self.title = "%s %s" % (self.context.Title(), translate(_("Log")))
        self.description = ""

        self.columns = {
            'Version': {
                'title': _('Version')
            },
            'Date': {
                'title': _('Date')
            },
            'User': {
                'title': _('User')
            },
            'Action': {
                'title': _('Action')
            },
            'Description': {
                'title': _('Description')
            },
        }
        self.review_states = [
            {
                'id': 'all',
                'title': 'All',
                'columns':
                ['Version', 'Date', 'User', 'Action', 'Description']
            },
        ]
예제 #33
0
    def __init__(self, context, request, **kwargs):
        BikaListingView.__init__(self, context, request, **kwargs)
        self.form_id = "instrumentcertifications"

        self.icon = self.portal_url + "/++resource++bika.lims.images/instrumentcertification_big.png"
        self.title = self.context.translate(_("Calibration Certificates"))
        self.context_actions = {_('Add'):
                                {'url': 'createObject?type_name=InstrumentCertification',
                                 'icon': '++resource++bika.lims.images/add.png'}}

        self.columns = {
            'Title': {'title': _('Cert. Num'), 'index': 'sortable_title'},
            'getAgency': {'title': _('Agency'), 'sortable': False},
            'getDate': {'title': _('Date'), 'sortable': False},
            'getValidFrom': {'title': _('Valid from'), 'sortable': False},
            'getValidTo': {'title': _('Valid to'), 'sortable': False},
            'getDocument': {'title': _('Document'), 'sortable': False},
        }

        self.review_states = [
            {
                'id': 'default',
                'title': _('All'),
                'contentFilter': {},
                'columns': [
                    'Title',
                    'getAgency',
                    'getDate',
                    'getValidFrom',
                    'getValidTo',
                    'getDocument',
                ],
                'transitions': []
            }
        ]
        self.allow_edit = False
        self.show_select_column = False
        self.show_workflow_action_buttons = True
        uids = [c.UID() for c in self.context.getCertifications()]
        self.catalog = 'portal_catalog'
        self.contentFilter = {'UID': uids, 'sort_on': 'sortable_title'}
    def __init__(self, context, request, fieldvalue=[], allow_edit=True):
        BikaListingView.__init__(self, context, request)
        self.context_actions = {}
        self.contentFilter = {"inactive_state": "active", "sort_on": "sortable_title"}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = False
        self.pagesize = 999999
        self.allow_edit = allow_edit
        self.show_categories = True
        self.ajax_categories = True
        self.ajax_categories_url = self.context.absolute_url() + "/reference_results_widget_view"
        self.category_index = "getCategoryTitle"
        # self.expand_all_categories = False

        self.referenceresults = {}
        # we want current field value as a dict
        # key:uid, value:{dictionary from field list of dict}
        for refres in fieldvalue:
            self.referenceresults[refres["uid"]] = refres

        self.columns = {
            "service": {"title": _("Service")},
            "result": {"title": _("Expected Result")},
            "error": {"title": _("Permitted Error %")},
            "min": {"title": _("Min")},
            "max": {"title": _("Max")},
        }
        self.review_states = [
            {
                "id": "default",
                "title": _("All"),
                "contentFilter": {},
                "transitions": [],
                "columns": ["service", "result", "error", "min", "max"],
            }
        ]
    def __init__(self, context, request, fieldvalue=[], allow_edit=True):
        BikaListingView.__init__(self, context, request)
        self.context_actions = {}
        self.contentFilter = {'inactive_state': 'active',
                              'sort_on': 'sortable_title'}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = False
        self.pagesize = 999999
        self.allow_edit = allow_edit
        self.show_categories = True
        self.ajax_categories = True
        self.ajax_categories_url = self.context.absolute_url() + "/reference_results_widget_view"
        self.category_index = 'getCategoryTitle'
        # self.expand_all_categories = False

        self.referenceresults = {}
        # we want current field value as a dict
        # key:uid, value:{dictionary from field list of dict}
        for refres in fieldvalue:
            self.referenceresults[refres['uid']] = refres

        self.columns = {
            'service': {'title': _('Service')},
            'result': {'title': _('Expected Result')},
            'error': {'title': _('Permitted Error %')},
            'min': {'title': _('Min')},
            'max': {'title': _('Max')}
        }
        self.review_states = [
            {'id': 'default',
             'title': _('All'),
             'contentFilter': {},
             'transitions': [],
             'columns': ['service', 'result', 'error', 'min', 'max'],
             },
        ]
예제 #36
0
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)
        self.content_add_actions = {}
        self.contentFilter = {'review_state':'impossible_state'}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url + "/add_blank"
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = True
        self.pagesize = 1000

        self.columns = {
            'Service': {'title': _('Service')},
        }
        self.review_states = [
            {'id':'all',
             'title': _('All'),
             'transitions': [],
             'columns':['Service'],
            },
        ]
예제 #37
0
    def __init__(self, context, request, field):
        BikaListingView.__init__(self, context, request)
        self.selected = [o.UID() for o in getattr(field, field.accessor)()]
        self.context_actions = {}
        self.contentFilter = {'review_state': 'impossible_state'}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = True
        self.pagesize = 1000

        self.columns = {
            'Service': {'title': _('Service')},
        }
        self.review_states = [
            {'id':'all',
             'title': _('All'),
             'transitions': [],
             'columns':['Service'],
            },
        ]
예제 #38
0
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)
        self.context = context
        self.request = request
        self.catalog = 'bika_catalog'
        request.set('disable_plone.rightcolumn', 1)
        self.contentFilter = {
            'portal_type': 'Kit',
            'sort_on': 'sortable_title',
            'sort_order': 'reverse'
        }
        # Todo: I add these two line to set the sort and the order of kit listing because
        # Todo: the values in self.contentFilter seems have no effect!
        self.sort_on = 'sortable_title'
        self.request.set('list_sort_order', 'reverse')

        self.context_actions = {}
        self.title = self.context.translate(_("Kits"))
        self.icon = self.portal_url + \
                    "/++resource++bika.sanbi.images/kit_big.png"
        self.description = ''

        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_column = False
        self.pagesize = 25

        if self.context.portal_type == 'Kits':
            self.request.set('disable_border', 1)

        self.columns = {
            'Title': {'title': _('Kit Name')},
            'Project': {'title': _('Project'),
                            'toggle': True},
            'kitTemplate': {'title': _('Kit template'),
                            'toggle': True},
            'state_title': {'title': _('State'),
                            'index': 'review_state'},
            'sortable_title':{}
        }

        self.review_states = [
            {
                'id': 'default',
                'title': _('Active'),
                'contentFilter': {
                    'inactive_state': 'active',
                },
                'transitions': [
                    {'id': 'deactivate'},
                    {'id': 'receive_kit'},
                    {'id': 'process'},
                    # {'id': 'ship'}
                ],
                'columns': [
                    'Title',
                    'Project',
                    'kitTemplate',
                    'state_title'
                ]
            },
            {
                'id': 'shipped',
                'title': _('Shipped'),
                'contentFilter': {
                    'review_state': 'shipped',
                    'sort_on': 'sortable_title',
                    'sort_order': 'reverse'
                },
                'transitions': [
                    {'id': 'deactivate'},
                    {'id': 'receive_kit'}
                ],
                'columns': [
                    'Title',
                    'Project',
                    'kitTemplate',
                    'state_title'
                ]
            },
            {
                'id': 'received',
                'title': _('Received'),
                'contentFilter': {
                    'review_state': 'received',
                    'sort_on': 'sortable_title',
                    'sort_order': 'reverse'
                },
                'transitions': [
                    {'id': 'deactivate'},
                    {'id': 'process'}
                ],
                'columns': [
                    'Title',
                    'Project',
                    'kitTemplate',
                    'state_title'
                ]
            },
            {
                'id': 'processed',
                'title': _('Processed'),
                'contentFilter': {
                    'review_state': 'processed',
                    'sort_on': 'sortable_title',
                    'sort_order': 'reverse'
                },
                'transitions': [{'id': 'deactivate'}],
                'columns': [
                    'Title',
                    'Project',
                    'kitTemplate',
                    'state_title'
                ]
            },
            {
                'id': 'all',
                'title': _('All'),
                'contentFilter': {
                    'sort_on': 'sortable_title',
                    'sort_order': 'reverse'
                },
                'columns': [
                    'Title',
                    'Project',
                    'kitTemplate',
                    'state_title'
                ]
            },
        ]
예제 #39
0
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)
        self.context = context
        self.catalog = 'bika_catalog'
        request.set('disable_plone.rightcolumn', 1)
        self.contentFilter = {
            'portal_type': 'SampleShipment',
        }
        self.context_actions = {
            _('Add'): {
                'url': 'createObject?type_name=SampleShipment',
                'icon': '++resource++bika.lims.images/add.png'
            }
        }
        self.title = self.context.translate(_("Sample Shipments"))
        self.icon = self.portal_url + \
                    "/++resource++baobab.lims.images/biospecimen_big.png"
        self.description = ''
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_column = False
        self.pagesize = 25
        self.allow_edit = True

        if self.context.portal_type == 'SampleShipments':
            self.request.set('disable_border', 1)

        self.columns = {
            # 'SampleShipmentID': {
            #     'title': _('Sample Shipment'),
            #     'input_width': '10'
            # },
            'Title': {
                'title': _('Sample Shipment'),
                'index': 'sortable_title'
            },
            'Description': {
                'title': _('Description'),
                'index': 'sortable_title'
            },
            'SamplesList': {
                'title': _('Samples'),
                'type': 'choices'
            },
            'Client': {
                'title': _('Client'),
                'type': 'choices'
            },
        }

        self.review_states = [
            {
                'id':
                'default',
                'title':
                _('Active'),
                'contentFilter': {
                    'inactive_state': 'active',
                    'sort_on': 'sortable_title',
                    'sort_order': 'ascending'
                },
                'transitions': [{
                    'id': 'deactivate'
                }, {
                    'id': 'ship'
                }, {
                    'id': 'ready_shipment'
                }],
                'columns': [
                    # 'SampleShipmentID',
                    'Title',
                    'Description',
                    'SamplesList',
                    'Client',
                ]
            },
            {
                'id':
                'pending',
                'title':
                _('Pending'),
                'contentFilter': {
                    'review_state': 'pending',
                    'sort_on': 'sortable_title',
                    'sort_order': 'ascending'
                },
                'transitions': [{
                    'id': 'deactivate'
                }, {
                    'id': 'ready_to_ship'
                }],
                'columns': [
                    # 'SampleShipmentID',
                    'Title',
                    'Description',
                    'SamplesList',
                    'Client',
                ]
            },
            {
                'id':
                'ready_to_ship',
                'title':
                _('Ready to Ship'),
                'contentFilter': {
                    'review_state': 'ready_to_ship',
                    'sort_on': 'sortable_title',
                    'sort_order': 'ascending'
                },
                'transitions': [{
                    'id': 'deactivate'
                }, {
                    'id': 'ship'
                }],
                'columns': [
                    # 'SampleShipmentID',
                    'Title',
                    'Description',
                    'SamplesList',
                    'Client',
                ]
            },
            {
                'id':
                'shipped',
                'title':
                _('Shipped'),
                'contentFilter': {
                    'review_state': 'shipped',
                    'sort_on': 'sortable_title',
                    'sort_order': 'ascending'
                },
                'transitions': [{
                    'id': 'deactivate'
                }],
                'columns': [
                    # 'SampleShipmentID',
                    'Title',
                    'Description',
                    'SamplesList',
                    'Client',
                ]
            }
        ]
예제 #40
0
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)
        self.contentFilter = {
            'portal_type': 'Worksheet',
            'review_state': ['open', 'to_be_verified', 'verified', 'rejected'],
            'sort_on': 'id',
            'sort_order': 'reverse'
        }
        self.context_actions = {
            _('Add'): {
                'url': 'worksheet_add',
                'icon': '++resource++bika.lims.images/add.png',
                'class': 'worksheet_add'
            }
        }
        self.show_table_only = False
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = True
        self.show_select_column = True

        request.set('disable_border', 1)

        self.icon = "++resource++bika.lims.images/worksheet_big.png"
        self.title = _("Worksheets")
        self.description = ""
        self.TimeOrDate = TimeOrDate

        pm = getToolByName(context, "portal_membership")
        # this is a property of self, because self.getAnalysts returns it
        self.analysts = getUsers(self, ['Manager', 'LabManager', 'Analyst'])

        bsc = getToolByName(context, 'bika_setup_catalog')

        templates = [
            t for t in bsc(portal_type='WorksheetTemplate',
                           inactive_state='active')
        ]

        self.templates = [(t.UID, t.Title) for t in templates]
        self.templates.sort(lambda x, y: cmp(x[1], y[1]))

        self.instruments = [
            (i.UID, i.Title)
            for i in bsc(portal_type='Instrument', inactive_state='active')
        ]
        self.instruments.sort(lambda x, y: cmp(x[1], y[1]))

        self.templateinstruments = {}
        for t in templates:
            i = t.getObject().getInstrument()
            if i:
                self.templateinstruments[t.UID] = i.UID()
            else:
                self.templateinstruments[t.UID] = ''

        self.columns = {
            'Title': {
                'title': _('Worksheet'),
                'index': 'sortable_title'
            },
            'Analyst': {
                'title': _('Analyst'),
                'index': 'getAnalyst',
                'toggle': True
            },
            'Template': {
                'title': _('Template'),
                'toggle': True
            },
            'Services': {
                'title': _('Services'),
                'sortable': False,
                'toggle': False
            },
            'SampleTypes': {
                'title': _('Sample Types'),
                'sortable': False,
                'toggle': False
            },
            'QC': {
                'title': _('QC'),
                'sortable': False,
                'toggle': False
            },
            'CreationDate': {
                'title': _('Creation Date'),
                'toggle': True
            },
            #'index': 'created'},
            'state_title': {
                'title': _('State'),
                'index': 'review_state'
            },
        }
        self.review_states = [
            {
                'id':
                'all',
                'title':
                _('All'),
                'contentFilter': {
                    'portal_type':
                    'Worksheet',
                    'review_state':
                    ['open', 'to_be_verified', 'verified', 'rejected'],
                    'sort_on':
                    'id',
                    'sort_order':
                    'reverse'
                },
                'transitions': [{
                    'id': 'retract'
                }, {
                    'id': 'verify'
                }, {
                    'id': 'reject'
                }],
                'columns': [
                    'Title', 'Analyst', 'Template', 'Services', 'SampleTypes',
                    'QC', 'CreationDate', 'state_title'
                ]
            },
            # getAuthenticatedMember does not work in __init__
            # so 'mine' is configured further in 'folderitems' below.
            {
                'id':
                'mine',
                'title':
                _('Mine'),
                'contentFilter': {
                    'portal_type':
                    'Worksheet',
                    'review_state':
                    ['open', 'to_be_verified', 'verified', 'rejected'],
                    'sort_on':
                    'id',
                    'sort_order':
                    'reverse'
                },
                'transitions': [{
                    'id': 'retract'
                }, {
                    'id': 'verify'
                }, {
                    'id': 'reject'
                }],
                'columns': [
                    'Title', 'Analyst', 'Template', 'Services', 'SampleTypes',
                    'QC', 'CreationDate', 'state_title'
                ]
            },
            {
                'id':
                'open',
                'title':
                _('Open'),
                'contentFilter': {
                    'portal_type': 'Worksheet',
                    'review_state': 'open',
                    'sort_on': 'id',
                    'sort_order': 'reverse'
                },
                'transitions': [],
                'columns': [
                    'Title', 'Analyst', 'Template', 'Services', 'SampleTypes',
                    'QC', 'CreationDate', 'state_title'
                ]
            },
            {
                'id':
                'to_be_verified',
                'title':
                _('To be verified'),
                'contentFilter': {
                    'portal_type': 'Worksheet',
                    'review_state': 'to_be_verified',
                    'sort_on': 'id',
                    'sort_order': 'reverse'
                },
                'transitions': [{
                    'id': 'retract'
                }, {
                    'id': 'verify'
                }, {
                    'id': 'reject'
                }],
                'columns': [
                    'Title', 'Analyst', 'Template', 'Services', 'SampleTypes',
                    'QC', 'CreationDate', 'state_title'
                ]
            },
            {
                'id':
                'verified',
                'title':
                _('Verified'),
                'contentFilter': {
                    'portal_type': 'Worksheet',
                    'review_state': 'verified',
                    'sort_on': 'id',
                    'sort_order': 'reverse'
                },
                'transitions': [],
                'columns': [
                    'Title', 'Analyst', 'Template', 'Services', 'SampleTypes',
                    'QC', 'CreationDate', 'state_title'
                ]
            },
        ]
예제 #41
0
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)
        self.contentFilter = {
            "portal_type": "Worksheet",
            "review_state": ["open", "to_be_verified", "verified", "rejected"],
            "sort_on": "id",
            "sort_order": "reverse",
        }
        self.content_add_actions = {_("Add"): "worksheet_add"}
        self.show_table_only = False
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = True
        self.show_select_column = True
        self.pagesize = 50

        request.set("disable_border", 1)

        self.icon = "++resource++bika.lims.images/worksheet_big.png"
        self.title = "%s: %s" % (self.context.Title(), _("Worksheets"))
        self.description = ""
        self.TimeOrDate = TimeOrDate

        pm = getToolByName(context, "portal_membership")
        analyst = pm.getAuthenticatedMember().getId()

        self.columns = {
            "Title": {"title": _("Worksheet Number")},
            "Owner": {"title": _("Owner")},
            "Analyst": {"title": _("Analyst")},
            "Template": {"title": _("Template")},
            "Analyses": {"title": _("Analyses")},
            "Services": {"title": _("Services")},
            "SampleTypes": {"title": _("Sample Types")},
            "QC": {"title": _("QC")},
            "CreationDate": {"title": _("Creation Date")},
            "state_title": {"title": _("State")},
        }
        self.review_states = [
            {
                "title": _("All"),
                "id": "all",
                "contentFilter": {
                    "portal_type": "Worksheet",
                    "review_state": ["open", "to_be_verified", "verified", "rejected"],
                    "sort_on": "id",
                    "sort_order": "reverse",
                },
                "transitions": [],
                "columns": [
                    "Title",
                    "Owner",
                    "Analyst",
                    "Template",
                    "Analyses",
                    "Services",
                    "SampleTypes",
                    "QC",
                    "CreationDate",
                    "state_title",
                ],
            },
            {
                "title": _("Mine"),
                "id": "mine",
                "contentFilter": {
                    "portal_type": "Worksheet",
                    "review_state": ["open", "to_be_verified", "verified", "rejected"],
                    "getAnalyst": analyst,
                    "sort_on": "id",
                    "sort_order": "reverse",
                },
                "transitions": [],
                "columns": [
                    "Title",
                    "Owner",
                    "Analyst",
                    "Template",
                    "Analyses",
                    "Services",
                    "SampleTypes",
                    "QC",
                    "CreationDate",
                    "state_title",
                ],
            },
            {
                "title": _("Open"),
                "id": "open",
                "contentFilter": {
                    "portal_type": "Worksheet",
                    "review_state": "open",
                    "sort_on": "id",
                    "sort_order": "reverse",
                },
                "transitions": [],
                "columns": [
                    "Title",
                    "Owner",
                    "Analyst",
                    "Template",
                    "Analyses",
                    "Services",
                    "SampleTypes",
                    "QC",
                    "CreationDate",
                    "state_title",
                ],
            },
            {
                "title": _("To Be Verified"),
                "id": "to_be_verified",
                "contentFilter": {
                    "portal_type": "Worksheet",
                    "review_state": "to_be_verified",
                    "sort_on": "id",
                    "sort_order": "reverse",
                },
                "transitions": [],
                "columns": [
                    "Title",
                    "Owner",
                    "Analyst",
                    "Template",
                    "Analyses",
                    "Services",
                    "SampleTypes",
                    "QC",
                    "CreationDate",
                    "state_title",
                ],
            },
            {
                "title": _("Verified"),
                "id": "verified",
                "contentFilter": {
                    "portal_type": "Worksheet",
                    "review_state": "verified",
                    "sort_on": "id",
                    "sort_order": "reverse",
                },
                "transitions": [],
                "columns": [
                    "Title",
                    "Owner",
                    "Analyst",
                    "Template",
                    "Analyses",
                    "Services",
                    "SampleTypes",
                    "QC",
                    "CreationDate",
                    "state_title",
                ],
            },
            ##                {'title': _('Cancelled'), 'id':'cancelled',
            ##                 'contentFilter': {'portal_type': 'Worksheet',
            ##                                   'cancellation_state':'cancelled',
            ##                                   'sort_on':'id',
            ##                                   'sort_order': 'reverse'},
            ##                 'transitions':[],
            ##                 'columns':['Title',
            ##                            'Owner',
            ##                            'Analyst',
            ##                            'Template',
            ##                            'Analyses',
            ##                            'CreationDate',
            ##                            'state_title']},
            # XXX reject workflow - one transition, to set a flag
            # "has been rejected in the past" on this worksheet.
            ##                {'title': _('Rejected'), 'id':'rejected',
            ##                 'contentFilter': {'review_state':'open'},
            ##                 'columns':['Title',
            ##                            'Owner',
            ##                            'Analyst',
            ##                            'Template',
            ##                            'Analyses',
            ##                            'SampleTypes',
            ##                            'CreationDate',
            ##                            'state_title']}
        ]
예제 #42
0
 def __init__(self, context, request):
     BikaListingView.__init__(self, context, request)
     self.context = context
     self.request = request
예제 #43
0
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)
        self.context = context
        self.request = request
        self.contentFilter = {
            'portal_type': 'Shipment',
            'sort_on': 'sortable_title'
        }
        request.set('disable_plone.rightcolumn', 1)
        self.context_actions = {}
        self.catalog = 'bika_catalog'
        self.title = self.context.translate(_("Shipments"))
        self.icon = self.portal_url + \
                    "/++resource++baobab.lims.images/shipments_big.png"
        self.description = ""
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_column = True
        self.pagesize = 50

        if self.context.portal_type == 'Shipments':
            self.request.set('disable_border', 1)

        self.columns = {
            'ShipmentID': {
                'title': _('Shipment ID'),
                'index': 'sortable_title',
                'toggle': True
            },
            'Project': {
                'title': _('Project'),
                'toggle': True
            },
            'Courier': {
                'title': _('Courier'),
                'toggle': True
            },
            'TrackingURL': {
                'title': _('Tracking URL'),
                'toggle': True
            },
            'ShippingDate': {
                'title': _('Shipping Date'),
                'toggle': True
            },
            'state_title': {
                'title': _('State'),
                'index': 'review_state'
            },
        }

        self.review_states = [
            {
                'id':
                'default',
                'title':
                _('All'),
                'contentFilter': {},
                'transitions': [{
                    'id': 'deactivate'
                }, {
                    'id': 'dispatch_shipment'
                }, {
                    'id': 'receive_shipment'
                }, {
                    'id': 'collect'
                }, {
                    'id': 'receive_back'
                }],
                'columns': [
                    'ShipmentID', 'Project', 'Courier', 'TrackingURL',
                    'ShippingDate', 'state_title'
                ]
            },
            {
                'id':
                'pending',
                'title':
                _('Pending'),
                'contentFilter': {
                    'review_state': 'pending'
                },
                'transitions': [{
                    'id': 'deactivate'
                }, {
                    'id': 'dispatch_shipment'
                }],
                'columns': [
                    'ShipmentID', 'Project', 'Courier', 'TrackingURL',
                    'ShippingDate', 'state_title'
                ]
            },
            {
                'id':
                'dispatched',
                'title':
                _('Dispatched'),
                'contentFilter': {
                    'review_state': 'dispatched'
                },
                'transitions': [{
                    'id': 'deactivate'
                }, {
                    'id': 'receive_shipment'
                }],
                'columns': [
                    'ShipmentID', 'Project', 'Courier', 'TrackingURL',
                    'ShippingDate', 'state_title'
                ]
            },
            {
                'id':
                'received',
                'title':
                _('Received'),
                'contentFilter': {
                    'review_state': 'received'
                },
                'transitions': [{
                    'id': 'deactivate'
                }, {
                    'id': 'collect'
                }],
                'columns': [
                    'ShipmentID', 'Project', 'Courier', 'TrackingURL',
                    'ShippingDate', 'state_title'
                ]
            },
            {
                'id':
                'to_collect',
                'title':
                _('To collect'),
                'contentFilter': {
                    'review_state': 'to_collect'
                },
                'transitions': [{
                    'id': 'deactivate'
                }, {
                    'id': 'receive_back'
                }],
                'columns': [
                    'ShipmentID', 'Project', 'Courier', 'TrackingURL',
                    'ShippingDate', 'state_title'
                ]
            },
            {
                'id':
                'received_back',
                'title':
                _('Received Back'),
                'contentFilter': {
                    'review_state': 'received_back'
                },
                'transitions': [{
                    'id': 'deactivate'
                }],
                'columns': [
                    'ShipmentID', 'Project', 'Courier', 'TrackingURL',
                    'ShippingDate', 'state_title'
                ]
            },
        ]
예제 #44
0
    def __init__(self, context, request, fieldvalue=[], allow_edit=True):
        BikaListingView.__init__(self, context, request)

        self.contentFilter = {
            "portal_type": "AnalysisService",
            "inactive_state": "active",
            "sort_on": "sortable_title",
            "sort_order": "ascending",
        }

        self.context_actions = {}
        self.base_url = self.context.absolute_url()
        self.view_url = self.base_url
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = False
        self.show_select_column = False
        self.pagesize = 999999
        self.allow_edit = allow_edit
        self.show_categories = True
        self.form_id = "analysisspec"
        # self.expand_all_categories = False
        self.ajax_categories = True
        self.ajax_categories_url = "{}/{}".format(
            self.context.absolute_url(), "/analysis_spec_widget_view")
        self.category_index = "getCategoryTitle"

        self.specsresults = {}
        for specresults in fieldvalue:
            self.specsresults[specresults["keyword"]] = specresults

        self.columns = collections.OrderedDict((
            ("service", {
                "title": _("Service"),
                "index": "sortable_title",
                "sortable": False
            }),
            ("keyword", {
                "title": _("Keyword"),
                "sortable": False
            }),
            ("methods", {
                "title": _("Methods"),
                "sortable": False
            }),
            ("unit", {
                "title": _("Unit"),
                "sortable": False
            }),
            ("service", {
                "title": _("Service"),
                "sortable": False
            }),
            ("warn_min", {
                "title": _("Min warn"),
                "sortable": False
            }),
            ("min_operator", {
                "title": _("Min operator"),
                "type": "choices",
                "sortable": False
            }),
            ("min", {
                "title": _("Min"),
                "sortable": False
            }),
            ("max_operator", {
                "title": _("Max operator"),
                "type": "choices",
                "sortable": False
            }),
            ("max", {
                "title": _("Max"),
                "sortable": False
            }),
            ("warn_max", {
                "title": _("Max warn"),
                "sortable": False
            }),
            ("hidemin", {
                "title": _("< Min"),
                "sortable": False
            }),
            ("hidemax", {
                "title": _("> Max"),
                "sortable": False
            }),
            ("rangecomment", {
                "title": _("Range comment"),
                "sortable": False,
                "toggle": False
            }),
        ))

        self.review_states = [
            {
                "id": "default",
                "title": _("All"),
                "contentFilter": {
                    "inactive_state": "active"
                },
                "transitions": [],
                "columns": self.columns.keys(),
            },
        ]
예제 #45
0
    def __init__(self, context, request):
        BikaListingView.__init__(self, context, request)
        self.catalog = 'bika_catalog'
        self.contentFilter = {
            'portal_type': 'Worksheet',
            'review_state':['open', 'to_be_verified', 'verified', 'rejected'],
            'sort_on':'id',
            'sort_order': 'reverse'}
        self.context_actions = {_('Add'):
                                {'url': 'worksheet_add',
                                 'icon': '++resource++bika.lims.images/add.png',
                                 'class': 'worksheet_add'}}
        self.show_table_only = False
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_all_checkbox = True
        self.show_select_column = True

        request.set('disable_border', 1)

        self.icon = "++resource++bika.lims.images/worksheet_big.png"
        self.title = _("Worksheets")
        self.description = ""
        self.TimeOrDate = TimeOrDate

        pm = getToolByName(context, "portal_membership")
        # this is a property of self, because self.getAnalysts returns it
        self.analysts = getUsers(self, ['Manager', 'LabManager', 'Analyst'])

        bsc = getToolByName(context, 'bika_setup_catalog')
        templates = [t for t in bsc(portal_type = 'WorksheetTemplate',
                                    inactive_state = 'active')]

        self.templates = [(t.UID, t.Title) for t in templates]
        self.templates.sort(lambda x, y: cmp(x[1], y[1]))

        self.instruments = [(i.UID, i.Title) for i in
                            bsc(portal_type = 'Instrument',
                                inactive_state = 'active')]
        self.instruments.sort(lambda x, y: cmp(x[1], y[1]))

        self.templateinstruments = {}
        for t in templates:
            i = t.getObject().getInstrument()
            if i:
                self.templateinstruments[t.UID] = i.UID()
            else:
                self.templateinstruments[t.UID] = ''

        self.columns = {
            'Title': {'title': _('Worksheet'),
                      'index': 'sortable_title'},
            'Analyst': {'title': _('Analyst'),
                        'index':'getAnalyst',
                        'toggle': True},
            'Template': {'title': _('Template'),
                         'toggle': True},
            'Services': {'title': _('Services'),
                         'sortable':False,
                         'toggle': False},
            'SampleTypes': {'title': _('Sample Types'),
                            'sortable':False,
                            'toggle': False},
            'Instrument': {'title': _('Instrument'),
                            'sortable':False,
                            'toggle': False},
            'QC': {'title': _('QC'),
                   'sortable':False,
                   'toggle': False},
            'CreationDate': {'title': PMF('Date Created'),
                             'toggle': True,
                             'index': 'created'},
            'state_title': {'title': _('State'),
                            'index': 'review_state'},
        }
        self.review_states = [
            {'id':'default',
             'title': _('All'),
             'contentFilter': {'portal_type': 'Worksheet',
                               'review_state':['open', 'to_be_verified', 'verified', 'rejected'],
                               'sort_on':'id',
                               'sort_order': 'reverse'},
             'transitions':[{'id':'retract'},
                            {'id':'verify'},
                            {'id':'reject'}],
             'columns':['Title',
                        'Analyst',
                        'Template',
                        'Services',
                        'SampleTypes',
                        'Instrument',
                        'QC',
                        'CreationDate',
                        'state_title']},
            # getAuthenticatedMember does not work in __init__
            # so 'mine' is configured further in 'folderitems' below.
            {'id':'mine',
             'title': _('Mine'),
             'contentFilter': {'portal_type': 'Worksheet',
                               'review_state':['open', 'to_be_verified', 'verified', 'rejected'],
                               'sort_on':'id',
                               'sort_order': 'reverse'},
             'transitions':[{'id':'retract'},
                            {'id':'verify'},
                            {'id':'reject'}],
             'columns':['Title',
                        'Analyst',
                        'Template',
                        'Services',
                        'SampleTypes',
                        'Instrument',
                        'QC',
                        'CreationDate',
                        'state_title']},
            {'id':'open',
             'title': _('Open'),
             'contentFilter': {'portal_type': 'Worksheet',
                               'review_state':'open',
                               'sort_on':'id',
                               'sort_order': 'reverse'},
             'transitions':[],
             'columns':['Title',
                        'Analyst',
                        'Template',
                        'Services',
                        'SampleTypes',
                        'Instrument',
                        'QC',
                        'CreationDate',
                        'state_title']},
            {'id':'to_be_verified',
             'title': _('To be verified'),
             'contentFilter': {'portal_type': 'Worksheet',
                               'review_state':'to_be_verified',
                               'sort_on':'id',
                               'sort_order': 'reverse'},
             'transitions':[{'id':'retract'},
                            {'id':'verify'},
                            {'id':'reject'}],
             'columns':['Title',
                        'Analyst',
                        'Template',
                        'Services',
                        'SampleTypes',
                        'Instrument',
                        'QC',
                        'CreationDate',
                        'state_title']},
            {'id':'verified',
             'title': _('Verified'),
             'contentFilter': {'portal_type': 'Worksheet',
                               'review_state':'verified',
                               'sort_on':'id',
                               'sort_order': 'reverse'},
             'transitions':[],
             'columns':['Title',
                        'Analyst',
                        'Template',
                        'Services',
                        'SampleTypes',
                        'Instrument',
                        'QC',
                        'CreationDate',
                        'state_title']},
        ]
예제 #46
0
 def __init__(self, context, request):
     BikaListingView.__init__(self, context, request)
     self.context = context
     self.request = request
     self.request.set('disable_plone.rightcolumn', 1)
예제 #47
0
    def __init__(self, context, request, content_type=None):
        BikaListingView.__init__(self, context, request)
        self.context = context
        # self.catalog = 'bika_catalog'
        self.catalog = 'portal_catalog'
        request.set('disable_plone.rightcolumn', 1)
        self.contentFilter = {
            'portal_type': 'Sample',
            'sort_on': 'sortable_title',
            'sort_order': 'ascending'
        }
        self.context_actions = {}
        self.title = self.context.translate(_("Biospecimens"))
        self.icon = self.portal_url + \
                    "/++resource++baobab.lims.images/biospecimen_big.png"
        self.description = 'ten'
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_column = False
        self.allow_edit = True
        self.content_type = content_type
        if self.content_type == 'batch':
            self.pagesize = 1000
        else:
            self.pagesize = 25

        if self.context.portal_type == 'Biospecimens':
            self.request.set('disable_border', 1)

        self.columns = {
            'Title': {
                'title': _('Title'),
                'index': 'sortable_title'
            },
            'Type': {
                'title': _('Type'),
                'toggle': True,
                'type': 'choices'
            },
            'Volume': {
                'title': _('Volume'),
                'toggle': True,
                'input_width': '7'
            },
            'Unit': {
                'title': _('Unit'),
                'allow_edit': True,
                'input_class': 'text',
                'input_width': '5',
                'toggle': True
            },
            'SubjectID': {
                'title': _('Subject ID'),
                'allow_edit': True,
                'input_class': 'text',
                'input_width': '10',
                'toggle': True
            },
            'Kit': {
                'title': _('Kit'),
                'index': 'sortable_title'
            },
            'Barcode': {
                'title': _('Barcode'),
                'allow_edit': True,
                'input_class': 'text',
                'input_width': '10',
                'toggle': True
            },
            'Project': {
                'title': _('Project'),
                'index': 'sortable_title'
            },
            'state_title': {
                'title': _('State'),
                'index': 'review_state'
            },
            # 'Location': {
            #     'title': _('Location'),
            #     'toggle': True
            # },
        }

        self.review_states = [
            {
                'id':
                'default',
                'title':
                _('Active'),
                'contentFilter': {
                    'cancellation_state': 'active',
                    'sort_on': 'sortable_title',
                    'sort_order': 'ascending'
                },
                'transitions': [{
                    'id': 'receive'
                }, {
                    'id': 'sample_due'
                }, {
                    'id': 'cancel'
                }],
                'columns': [
                    'Title',
                    'Project',
                    'Kit',
                    'Type',
                    'SubjectID',
                    'Barcode',
                    'Volume',
                    'Unit',
                    'state_title',
                    # 'Location'
                ]
            },
            {
                'id':
                'sample_registered',
                'title':
                _('Sample Registered'),
                'contentFilter': {
                    'review_state': 'sample_registered',
                    'cancellation_state': 'active',
                    'sort_on': 'created',
                    'sort_order': 'ascending'
                },
                'transitions': [{
                    'id': 'sample_due'
                }, {
                    'id': 'cancel'
                }],
                'columns': [
                    'Title',
                    'Project',
                    'Kit',
                    'Type',
                    'Barcode',
                    'state_title',
                    # 'Location'
                ]
            },
            {
                'id':
                'sample_due',
                'title':
                _('Sample Due'),
                'contentFilter': {
                    'review_state': 'sample_due',
                    'cancellation_state': 'active',
                    'sort_on': 'created',
                    'sort_order': 'ascending'
                },
                'transitions': [{
                    'id': 'receive'
                }, {
                    'id': 'cancel'
                }],
                'columns': [
                    'Title',
                    'Project',
                    'Kit',
                    'Type',
                    'SubjectID',
                    'Barcode',
                    'Volume',
                    'Unit',
                    'state_title',
                    # 'Location'
                ]
            },
            {
                'id':
                'sample_received',
                'title':
                _('Received'),
                'contentFilter': {
                    'review_state': 'sample_received',
                    'sort_on': 'created',
                    'sort_order': 'reverse'
                },
                'transitions': [{
                    'id': 'cancel'
                }],
                'columns': [
                    'Title',
                    'Project',
                    'Kit',
                    'Type',
                    'SubjectID',
                    'Barcode',
                    'Volume',
                    'Unit',
                    'state_title',
                    # 'Location'
                ]
            },
            {
                'id':
                'cancelled',
                'title':
                _('Cancelled'),
                'contentFilter': {
                    'cancellation_state': 'cancelled',
                    'sort_order': 'reverse',
                    'sort_on': 'created'
                },
                'transitions': [
                    {
                        'id': 'reinstate'
                    },
                ],
                'columns': [
                    'Title',
                    'Project',
                    'Kit',
                    'Type',
                    'SubjectID',
                    'Barcode',
                    'Volume',
                    'Unit',
                    'state_title',
                    # 'Location'
                ]
            },
            {
                'id':
                'all',
                'title':
                _('All'),
                'contentFilter': {
                    'sort_on': 'created',
                    'sort_order': 'ascending'
                },
                'columns': [
                    'Title',
                    'Project',
                    'Kit',
                    'Type',
                    'SubjectID',
                    'Barcode',
                    'Volume',
                    'Unit',
                    # 'Location'
                ]
            },
        ]
예제 #48
0
 def __init__(self, context, request):
     BikaListingView.__init__(self, context, request)
     self.context = context
     self.request = request
     # self.catalog = 'bika_setup_catalog'
     path = '/'.join(context.getPhysicalPath())
     self.contentFilter = {
         'portal_type': 'StoragePosition',
         'sort_on': 'sortable_title',
         'path': {
             'query': path,
             'depth': 1,
             'level': 0
         }
     }
     self.context_actions = {}
     self.title = ''
     self.description = ''
     self.icon = ''
     self.show_sort_column = False
     self.show_select_row = False
     self.show_select_column = True
     self.pagesize = 25
     self.columns = {
         'id': {
             'title': _('ID'),
             'index': 'id'
         },
         'StorageTypes': {
             'title': _('Storage Types'),
             'toggle': True
         },
         'StoredItem': {
             'title': _('Stored Item'),
             'toggle': True
         },
         'review_state': {
             'title': _('State'),
             'index': 'review_state',
             'toggle': True
         },
     }
     self.review_states = [
         {
             'id':
             'default',
             'title':
             _('Active'),
             'contentFilter': {
                 'inactive_state': 'active'
             },
             'transitions': [{
                 'id': 'deactivate'
             }, {
                 'id': 'reserve'
             }, {
                 'id': 'liberate'
             }],
             'columns':
             ['id', 'StorageTypes', 'StoredItem', 'review_state']
         },
         {
             'id': 'reserved',
             'title': _('Reserved'),
             'contentFilter': {
                 'review_state': 'reserved'
             },
             'transitions': [
                 {
                     'id': 'liberate'
                 },
             ],
             'columns':
             ['id', 'StorageTypes', 'StoredItem', 'review_state']
         },
         {
             'id': 'all',
             'title': _('All'),
             'contentFilter': {},
             'columns':
             ['id', 'StorageTypes', 'StoredItem', 'review_state']
         },
     ]
예제 #49
0
    def __init__(self, context, request, **kwargs):
        BikaListingView.__init__(self, context, request, **kwargs)
        self.catalog = "portal_catalog"
        self.contentFilter = {
            "portal_type": "InstrumentCertification",
            "path": {
                "query": api.get_path(context),
                "depth": 1  # searching just inside the specified folder
            },
            "sort_on": "created",
            "sort_order": "descending",
        }

        self.form_id = "instrumentcertifications"
        self.title = self.context.translate(_("Calibration Certificates"))
        self.icon = "{}/{}".format(
            self.portal_url,
            "++resource++bika.lims.images/instrumentcertification_big.png")
        self.context_actions = {
            _("Add"): {
                "url": "createObject?type_name=InstrumentCertification",
                "icon": "++resource++bika.lims.images/add.png"
            }
        }

        self.allow_edit = False
        self.show_select_column = False
        self.show_workflow_action_buttons = True
        self.pagesize = 30

        # latest valid certificate UIDs
        self.valid_certificates = self.context.getValidCertifications()
        self.latest_certificate = self.context.getLatestValidCertification()

        self.columns = {
            "Title": {
                "title": _("Cert. Num"),
                "index": "sortable_title"
            },
            "getAgency": {
                "title": _("Agency"),
                "sortable": False
            },
            "getDate": {
                "title": _("Date"),
                "sortable": False
            },
            "getValidFrom": {
                "title": _("Valid from"),
                "sortable": False
            },
            "getValidTo": {
                "title": _("Valid to"),
                "sortable": False
            },
            "getDocument": {
                "title": _("Document"),
                "sortable": False
            },
        }

        self.review_states = [{
            "id":
            "default",
            "title":
            _("All"),
            "contentFilter": {},
            "columns": [
                "Title",
                "getAgency",
                "getDate",
                "getValidFrom",
                "getValidTo",
                "getDocument",
            ],
            "transitions": []
        }]
예제 #50
0
    def __init__(self, context, request, **kwargs):
        BikaListingView.__init__(
            self,
            context,
            request,
            show_categories=context.bika_setup.getCategoriseAnalysisServices(),
            expand_all_categories=True)

        # prepare the content filter of this listing
        self.contentFilter = dict(kwargs)
        self.contentFilter.update({
            "portal_type": "Analysis",
            "sort_on": "sortable_title",
            "sort_order": "ascending",
        })

        # set the listing view config
        self.catalog = CATALOG_ANALYSIS_LISTING
        self.sort_order = 'ascending'
        self.context_actions = {}
        self.show_sort_column = False
        self.show_select_row = False
        self.show_select_column = False
        self.show_column_toggles = False
        self.pagesize = 999999
        self.form_id = 'analyses_form'
        self.context_active = isActive(context)
        self.interim_fields = {}
        self.interim_columns = {}
        self.specs = {}
        self.bsc = getToolByName(context, 'bika_setup_catalog')
        self.portal = getToolByName(context, 'portal_url').getPortalObject()
        self.portal_url = self.portal.absolute_url()
        self.rc = getToolByName(context, REFERENCE_CATALOG)
        self.dmk = context.bika_setup.getResultsDecimalMark()
        self.scinot = context.bika_setup.getScientificNotationResults()
        self.categories = []
        request.set('disable_plone.rightcolumn', 1)

        # each editable item needs it's own allow_edit
        # which is a list of field names.
        self.allow_edit = False

        self.columns = {
            # Although 'created' column is not displayed in the list (see
            # review_states to check the columns that will be rendered), this
            # column is needed to sort the list by create date
            'created': {
                'title': _('Date Created'),
                'toggle': False},
            'Service': {
                'title': _('Analysis'),
                'attr': 'Title',
                'index': 'sortable_title',
                'sortable': False},
            'Partition': {
                'title': _("Partition"),
                'attr': 'getSamplePartitionID',
                'sortable': False},
            'Method': {
                'title': _('Method'),
                'sortable': False,
                'toggle': True},
            'Instrument': {
                'title': _('Instrument'),
                'sortable': False,
                'toggle': True},
            'Analyst': {
                'title': _('Analyst'),
                'sortable': False,
                'toggle': True},
            'state_title': {
                'title': _('Status'),
                'sortable': False},
            'DetectionLimit': {
                'title': _('DL'),
                'sortable': False,
                'toggle': False},
            'Result': {
                'title': _('Result'),
                'input_width': '6',
                'input_class': 'ajax_calculate numeric',
                'sortable': False},
            'Specification': {
                'title': _('Specification'),
                'sortable': False},
            'Uncertainty': {
                'title': _('+-'),
                'sortable': False},
            'retested': {
                'title': "<img title='%s' "
                         "src='%s/++resource++bika.lims.images/retested.png"
                         "'/>" % \
                         (t(_('Retested')), self.portal_url),
                'type': 'boolean',
                'sortable': False},
            'Attachments': {
                'title': _('Attachments'),
                'sortable': False},
            'CaptureDate': {
                'title': _('Captured'),
                'index': 'getResultCaptureDate',
                'sortable': False},
            'DueDate': {
                'title': _('Due Date'),
                'index': 'getDueDate',
                'sortable': False},
            'Hidden': {
                'title': _('Hidden'),
                'toggle': True,
                'sortable': False,
                'input_class': 'autosave',
                'type': 'boolean'},
        }

        self.review_states = [
            {
                'id':
                'default',
                'title':
                _('All'),
                'contentFilter': {},
                'columns': [
                    'Service', 'Partition', 'DetectionLimit', 'Result',
                    'Specification', 'Method', 'Instrument', 'Analyst',
                    'Uncertainty', 'CaptureDate', 'DueDate', 'state_title',
                    'Hidden'
                ]
            },
        ]
        if not context.bika_setup.getShowPartitions():
            self.review_states[0]['columns'].remove('Partition')

        # This is used to cache analysis keywords with Point of Capture to
        # reduce the number objects that need to be woken up
        # Is managed by `is_analysis_edition_allowed` function
        self._keywords_poc_map = dict()

        # This is used to display method and instrument columns if there is at
        # least one analysis to be rendered that allows the assignment of method
        # and/or instrument
        self.show_methodinstr_columns = False