Bug.py 2.79 KB
Newer Older
Yoshinori Okuji's avatar
Yoshinori Okuji committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
##############################################################################
#
# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.
#                    Yoshinori Okuji <yo@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
##############################################################################

from AccessControl import ClassSecurityInfo

from Products.ERP5Type import Permissions, PropertySheet, Constraint, Interface
Rafael Monnerat's avatar
 
Rafael Monnerat committed
32
from Products.ERP5.Document.Ticket import Ticket
Yoshinori Okuji's avatar
Yoshinori Okuji committed
33

Rafael Monnerat's avatar
 
Rafael Monnerat committed
34
class Bug(Ticket):
Yoshinori Okuji's avatar
Yoshinori Okuji committed
35
    """
Rafael Monnerat's avatar
 
Rafael Monnerat committed
36
    LEGACY
Yoshinori Okuji's avatar
Yoshinori Okuji committed
37

Rafael Monnerat's avatar
 
Rafael Monnerat committed
38 39 40
    This class is superceded by the Ticket class. Legacy
    Bug data should still be usable.
    """
Yoshinori Okuji's avatar
Yoshinori Okuji committed
41

Rafael Monnerat's avatar
 
Rafael Monnerat committed
42 43
    meta_type = 'ERP5 Bug'
    portal_type = 'Bug'
Yoshinori Okuji's avatar
Yoshinori Okuji committed
44 45 46
    add_permission = Permissions.AddPortalContent
    isPortalContent = 1
    isRADContent = 1
Rafael Monnerat's avatar
 
Rafael Monnerat committed
47
    isDelivery = 1
Yoshinori Okuji's avatar
Yoshinori Okuji committed
48 49 50

    # Declarative security
    security = ClassSecurityInfo()
51
    security.declareObjectProtected(Permissions.AccessContentsInformation)
52

Rafael Monnerat's avatar
 
Rafael Monnerat committed
53 54 55 56 57 58 59 60 61 62 63
    # Declarative properties
    property_sheets = ( PropertySheet.Base
                      , PropertySheet.XMLObject
                      , PropertySheet.CategoryCore
                      , PropertySheet.DublinCore
                      , PropertySheet.Amount
                      , PropertySheet.Arrow
                      , PropertySheet.Price
                      , PropertySheet.Movement
                      , PropertySheet.Bug
                      )
Rafael Monnerat's avatar
Rafael Monnerat committed
64 65 66 67 68 69 70 71 72 73
    def SearchableText(self):
      """ Used by the catalog for basic full text indexing """
      full_text = []
      for message in self.contentValues(portal_type='Bug Line'):
        full_text.append(message.getTextContent(""))

      return """ %s %s %s """ % ( self.getTitle(),
                                  self.getDescription(),
                                  ' '.join(full_text))