Diff for /MPIWGWeb/MPIWGStaff.py between versions 1.3 and 1.10.2.1

version 1.3, 2004/07/06 16:49:36 version 1.10.2.1, 2005/07/14 15:12:11
Line 1 Line 1
 """This file contains the classes for the organization of the staff"""  """This file contains the classes for the organization of the staff"""
   
 from OFS.Folder import Folder  from OFS.Folder import Folder
 from Products.ZSQLExtend.ZSQLExtend import ZSQLExtendFolder  from Products.ZSQLExtend.ZSQLExtend import ZSQLExtendFolder
 from Products.PageTemplates.PageTemplateFile import PageTemplateFile  from Products.PageTemplates.PageTemplateFile import PageTemplateFile
 from Products.PageTemplates.PageTemplate import PageTemplate  from Products.PageTemplates.PageTemplate import PageTemplate
   from Products.ZCatalog.CatalogPathAwareness import CatalogAware
   import os
   from Globals import package_home
   
   
   def getTemplate(self, tpName):
       """get a template file either form the instance or from the product"""
       ext=self.ZopeFind(self.aq_parent,obj_ids=[tpName])
       if ext:
           pt = getattr(self,ext[0][1].getId())
       else:
           pt=PageTemplateFile(os.path.join(package_home(globals()), 'zpt/'+tpName)).__of__(self)
       assert(pt)
       return pt
   
 class MPIWGStaff(ZSQLExtendFolder):  class MPIWGStaff(CatalogAware,ZSQLExtendFolder):
     """Staff"""      """Staff"""
   
     meta_type="MPIWGStaff"      meta_type="MPIWGStaff"
       default_catalog='MembersCatalog'
       
       def PrincipiaSearchSource(self):
           """Return cataloguable key for ourselves."""
           return str(self)
   
       manage_options = Folder.manage_options+(
           {'label':'Edit','action':'changeMPIWGStaffForm'},
           {'label':'Change Publications Special','action':'changePublications_specialForm'},
           )
   
     def __init__(self,id, lastName,firstName):      def __init__(self,id, lastName,firstName):
         """init"""          """init"""
Line 17  class MPIWGStaff(ZSQLExtendFolder): Line 40  class MPIWGStaff(ZSQLExtendFolder):
         self.lastName=lastName          self.lastName=lastName
         self.firstName=firstName          self.firstName=firstName
   
     manage_options = Folder.manage_options+(  
         {'label':'Edit','action':'changeMPIWGStaffForm'},  
         )  
     def index_html(self):      def index_html(self):
         """show homepage"""          """show homepage"""
         pt=PageTemplateFile('Products/MPIWGWeb/zpt/members_main').__of__(self)          pt = getTemplate(self, "members_main")
         return pt()          return pt()
   
       def changePublications_specialForm(self):
       """Priority publications manual field"""
       pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','changePublications_special.zpt')).__of__(self)
           return pt()
       
       def changePublications_special(self,usePublicationsSpecial=None,specialPublicationsField=None,RESPONSE=None):
       """change publications special params"""
       if usePublicationsSpecial:
             self.usePublicationsSpecial=True
        
       else:
         self.usePublicationsSpecial=False
   
       self.specialPublicationsField=specialPublicationsField[0:]
   
           if RESPONSE is not None:
               RESPONSE.redirect('manage_main')
   
       
     def publications_full(self):      def publications_full(self):
         """show publication"""          """show publication"""
         pt=PageTemplateFile('Products/MPIWGWeb/zpt/publications_full').__of__(self)          pt=getTemplate(self, "publications_full_main")
         return pt()          return pt()
   
     def talks_full(self):      def talks_full(self):
         """show talks"""          """show talks"""
         pt=PageTemplateFile('Products/MPIWGWeb/zpt/talks_full').__of__(self)          pt=getTemplate(self, 'talks_full_main')
         return pt()          return pt()
   
     def teaching_full(self):      def teaching_full(self):
         """show talks"""          """show talks"""
         pt=PageTemplateFile('Products/MPIWGWeb/zpt/teaching_full').__of__(self)          pt=getTemplate(self, 'teaching_full_main')
         return pt()          return pt()
           
     def changeMPIWGStaffForm(self):      def changeMPIWGStaffForm(self):
         """change form"""          """change form"""
         pt=PageTemplateFile('Products/MPIWGWeb/zpt/edit_MPIWGStaff.zpt').__of__(self)          pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','edit_MPIWGStaff.zpt')).__of__(self)
         return pt()          return pt()
   
     def changeMPIWGStaff(self,lastName,firstName,RESPONSE=None):      def changeMPIWGStaff(self,lastName,firstName,RESPONSE=None):
Line 58  class MPIWGStaff(ZSQLExtendFolder): Line 98  class MPIWGStaff(ZSQLExtendFolder):
   
 def manage_addMPIWGStaffForm(self):  def manage_addMPIWGStaffForm(self):
     """form for adding the project"""      """form for adding the project"""
     pt=PageTemplateFile('Products/MPIWGWeb/zpt/addMPIWGStaffForm.zpt').__of__(self)      pt=PageTemplateFile(os.path.join(package_home(globals()),'zpt','addMPIWGStaffForm.zpt')).__of__(self)
     return pt()      return pt()
   
 def manage_addMPIWGStaff(self,id,lastName,firstName,RESPONSE=None):  def manage_addMPIWGStaff(self,id,lastName,firstName,RESPONSE=None):

Removed from v.1.3  
changed lines
  Added in v.1.10.2.1


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>