Esempio n. 1
0
    def _add_options(my):
        ''' add the options to the select '''
        search_type = my._get_search_type()
        if not search_type:
            return
        # get all processes if no search type is given
        proj_code = Project.extract_project_code(search_type)
        is_group_restricted = False

        if my.has_empty:
            my.add_first_option()
        else:
            from asset_filter_wdg import ProcessFilterWdg
            if ProcessFilterWdg.has_restriction():
                is_group_restricted = True

        process_names, process_values = Pipeline.get_process_select_data(\
            search_type, is_filter=my.is_filter, project_code=proj_code,\
            is_group_restricted=is_group_restricted, sobject = my._sobject)


        my.set_option("values", process_values)
        my.set_option("labels", process_names)
        if not my.is_filter:
            behavior = {
            'type': 'onchange',
            'cbjs_action': "if (bvr.src_el.value=='')\
                {alert('Please choose a valid process.');}" }
Esempio n. 2
0
    def _add_options(self):
        ''' add the options to the select '''
        search_type = self._get_search_type()
        if not search_type:
            return
        # get all processes if no search type is given
        proj_code = Project.extract_project_code(search_type)
        is_group_restricted = False

        if self.has_empty:
            self.add_first_option()
        else:
            from asset_filter_wdg import ProcessFilterWdg
            if ProcessFilterWdg.has_restriction():
                is_group_restricted = True

        process_names, process_values = Pipeline.get_process_select_data(\
            search_type, is_filter=self.is_filter, project_code=proj_code,\
            is_group_restricted=is_group_restricted, sobject = self._sobject)

        self.set_option("values", process_values)
        self.set_option("labels", process_names)
        if not self.is_filter:
            behavior = {
                'type':
                'onchange',
                'cbjs_action':
                "if (bvr.src_el.value=='')\
                {alert('Please choose a valid process.');}"
            }
Esempio n. 3
0
    def get_context_data(self, search_type=None):
        '''get the list of contexts that can be checked in with this widget'''
        # usually there is no pipeline for prod/shot_instance
        #search_type = self.search_type
        labels, values = Pipeline.get_process_select_data(search_type, \
            project_code=Project.get_project_code())

        return labels, values
Esempio n. 4
0
    def get_context_data(my, search_type=None):
        '''get the list of contexts that can be checked in with this widget'''
        # usually there is no pipeline for prod/shot_instance
        #search_type = my.search_type
        labels, values = Pipeline.get_process_select_data(search_type, \
            project_code=Project.get_project_code())
        

        return labels, values