Diff for /OSAS/OSA_system/OSAS_ids.py between versions 1.3 and 1.7

version 1.3, 2003/12/23 15:17:37 version 1.7, 2004/03/03 13:02:54
Line 1 Line 1
 """Generate and organize the institutes internal IDs  """Generate and organize the institutes internal IDs
 DW 2003, itgroup """  DW 2003, itgroup
   
   needs PgSQL
   needs manual configuration at the moment
   
   """
   
 from AccessControl import ClassSecurityInfo  from AccessControl import ClassSecurityInfo
 from Globals import InitializeClass  from Globals import InitializeClass
Line 39  class OSAS_idGenerator(SimpleItem): Line 44  class OSAS_idGenerator(SimpleItem):
         if self.idExists(id):          if self.idExists(id):
             return "ERROR: id - %s - already exists" %id              return "ERROR: id - %s - already exists" %id
                   
         conn=PgSQL.connect("127.0.0.1 dbname=osas_ids user=dwinter")          conn=PgSQL.connect("127.0.0.1:osas_ids:dwinter")
         curs=conn.cursor()          curs=conn.cursor()
   
         curs.execute("INSERT INTO institutesIds (id,date,name)  VALUES ('%s','%s','%s')" % (id,date,name))          curs.execute("INSERT INTO institutesIds (id,date,name)  VALUES ('%s','%s','%s')" % (id,date,name))
Line 63  class OSAS_idGenerator(SimpleItem): Line 68  class OSAS_idGenerator(SimpleItem):
                   
     def index_html(self):      def index_html(self):
         """ID generator"""          """ID generator"""
         pt=PageTemplateFile("Products/OSA_System/OSAS_ids.zpt").__of__(self)          pt=PageTemplateFile("Products/OSA_system/OSAS_ids.zpt").__of__(self)
         return pt()          return pt()
   
     def giveIdsOut(self,number,RESPONSE=None):      def giveIdsOut(self,number,RESPONSE=None):
Line 76  class OSAS_idGenerator(SimpleItem): Line 81  class OSAS_idGenerator(SimpleItem):
   
         if RESPONSE:          if RESPONSE:
             self.REQUEST.SESSION['ids']=ids              self.REQUEST.SESSION['ids']=ids
             pt=PageTemplateFile("Products/OSA_System/OSAS_printIds.zpt").__of__(self)              pt=PageTemplateFile("Products/OSA_system/OSAS_printIDs.zpt").__of__(self)
             return pt()              return pt()
         else:          else:
             return ids              return ids
Line 103  class OSAS_idGenerator(SimpleItem): Line 108  class OSAS_idGenerator(SimpleItem):
             self.REQUEST.SESSION['ids']=[ids]              self.REQUEST.SESSION['ids']=[ids]
   
         if RESPONSE:          if RESPONSE:
             pt=PageTemplateFile("Products/OSA_System/OSAS_registrationIdsDone.zpt").__of__(self)              pt=PageTemplateFile("Products/OSA_system/OSAS_registrationIdsDone.zpt").__of__(self)
             return pt()              return pt()
         else:          else:
             return self.REQUEST.SESSION['ids']              return self.REQUEST.SESSION['ids']

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


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