Beispiel #1
0
    def create_field(self, field_name, field_type, **field_options):
        config = AgiloConfig(self.env)
        ticket_custom = config.get_section('ticket-custom')
        ticket_custom.change_option(field_name, field_type)
        for (option_name, option_value) in field_options.items():
            key = '%s.%s' % (field_name, option_name)
            ticket_custom.change_option(key, option_value)
        config.save()

        ticket_system = AgiloTicketSystem(self.env)
        all_known_fields = ticket_system.fieldnames(ticket_system.get_ticket_fields())
        assert_contains(field_name, all_known_fields)
Beispiel #2
0
    def create_field(self, field_name, field_type, **field_options):
        config = AgiloConfig(self.env)
        ticket_custom = config.get_section('ticket-custom')
        ticket_custom.change_option(field_name, field_type)
        for (option_name, option_value) in field_options.items():
            key = '%s.%s' % (field_name, option_name)
            ticket_custom.change_option(key, option_value)
        config.save()

        ticket_system = AgiloTicketSystem(self.env)
        all_known_fields = ticket_system.fieldnames(
            ticket_system.get_ticket_fields())
        assert_contains(field_name, all_known_fields)
Beispiel #3
0
    def allow_link_from_to(self, from_type, to_type, save=None):
        # All tickets instantiated before this call will have a copy
        # of their allowed links, so for this call to have an effect,
        # the objects have to be dropped and recreated.
        config = AgiloConfig(self.env)
        assert from_type in config.get_available_types()
        assert to_type in config.get_available_types()
        section = config.get_section(AgiloConfig.AGILO_LINKS)
        allowed_links = section.get_list('allow')
        allowed_links.append('%s-%s' % (from_type, to_type))
        section.change_option('allow', ', '.join(allowed_links), save=save)

        # Recreate all the worst caches
        links_configuration = LinksConfiguration(self.env)
        links_configuration._initialized = False
        links_configuration.initialize()
        AgiloTicketSystem(self.env).clear_cached_information()
Beispiel #4
0
    def allow_link_from_to(self, from_type, to_type, save=None):
        # All tickets instantiated before this call will have a copy
        # of their allowed links, so for this call to have an effect,
        # the objects have to be dropped and recreated.
        config = AgiloConfig(self.env)
        assert from_type in config.get_available_types()
        assert to_type in config.get_available_types()
        section = config.get_section(AgiloConfig.AGILO_LINKS)
        allowed_links = section.get_list('allow')
        allowed_links.append('%s-%s' % (from_type, to_type))
        section.change_option('allow', ', '.join(allowed_links), save=save)

        # Recreate all the worst caches
        links_configuration = LinksConfiguration(self.env)
        links_configuration._initialized = False
        links_configuration.initialize()
        AgiloTicketSystem(self.env).clear_cached_information()