Changeset 71

Show
Ignore:
Timestamp:
11/01/06 00:15:25 (2 years ago)
Author:
lazaridis_com
Message:

closes #47, added 'time' and 'changetime'.
slightly changed signature of get_ticket_fields(self, all_fields=False) in a backwards compatible way.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • infra/trac-dev/trac/ticket/api.py

    r70 r71  
    8686                if action not in perms or perm_.has_permission(perms[action])] 
    8787 
    88     def get_ticket_fields(self): 
    89         """Returns the list of fields available for tickets.""" 
     88    def get_ticket_fields(self, all_fields=False): 
     89        """Returns the list of fields available for tickets. 
     90        optional Bool parameter 'all_fields': 
     91          True:  return all available fields 
     92          False: return only fields for display within Ticket GUI (default)""" 
    9093        from trac.ticket import model 
    9194 
     
    142145            field = {'name': name, 'type': 'text', 'label': name.title()} 
    143146            fields.append(field) 
     147 
     148        # DateTime fields 
     149        if (all_fields): 
     150            fields.append( {'name': 'time', 'type': 'datetime', 'label': 'Created'} ) 
     151            fields.append( {'name': 'changetime', 'type': 'datetime', 'label': 'Modified'} )                
    144152 
    145153        for field in self.get_custom_fields():