diff MPIWGStaff_old.py @ 86:ab836d3f96dc

styles for staff list.
author casties
date Tue, 14 May 2013 17:24:30 +0200
parents ddf6c1a27a4b
children
line wrap: on
line diff
--- a/MPIWGStaff_old.py	Tue May 14 10:36:48 2013 +0200
+++ b/MPIWGStaff_old.py	Tue May 14 17:24:30 2013 +0200
@@ -27,7 +27,9 @@
 from OFS.Cache import Cacheable
 import urllib2
 import transaction
-import SrvTxtUtils
+
+from SrvTxtUtils import getHttpData, getAt, getInt, unicodify, utf8ify
+import bibliography
 
 from MPIWGHelper import *
 #ersetzt logging
@@ -76,6 +78,8 @@
         #  self.ZSQLQuery(queryStr)
         
         return True,msg
+    
+    
 class MPIWGStaff(CatalogAware,ZSQLExtendFolder,Cacheable):
     """Staff"""
 
@@ -85,6 +89,30 @@
     #_v_cone=None;
     security=ClassSecurityInfo()
     
+    manage_options = Folder.manage_options+(
+        {'label':'Edit','action':'changeMPIWGStaffForm'},
+        {'label':'Change Publications Special','action':'changePublications_specialForm'},
+        ) + Cacheable.manage_options
+    
+    __manager_id = "ramCache"
+    def __init__(self,id, lastName,firstName,key):
+        """init"""
+        self.id=id
+        self.title=key
+        self.lastName=lastName
+        self.firstName=firstName
+        self.key=key
+    
+    # compat TODO: remove this
+    def getat(self, array, idx, default=None):
+        """returns always an int (0 in case of problems)"""
+        return getAt(array, idx, default)
+    
+    # compat TODO: remove this
+    def decode(self, s):
+        """TODO: remove this"""
+        return unicodify(s)
+    
     def redirect(self,RESPONSE,url):
         """mache ein redirect mit einem angehaengten time stamp um ein reload zu erzwingen"""
         
@@ -312,20 +340,6 @@
         """Return cataloguable key for ourselves."""
         return str(self)
 
-    manage_options = Folder.manage_options+(
-        {'label':'Edit','action':'changeMPIWGStaffForm'},
-        {'label':'Change Publications Special','action':'changePublications_specialForm'},
-        ) + Cacheable.manage_options
-    
-    __manager_id = "ramCache"
-    def __init__(self,id, lastName,firstName,key):
-        """init"""
-        self.id=id
-        self.title=key
-        self.lastName=lastName
-        self.firstName=firstName
-        self.key=key
-    
     def getPersonID(self):
         """gibt den ID fuer die Person zurueck"
         im Moment ist personID = id, i.e. e-mail
@@ -633,7 +647,7 @@
     
     def getProfile(self):
         """get the profile"""
-	self.REQUEST.RESPONSE.setHeader('Last-Modified',email.Utils.formatdate().split("-")[0]+'GMT')
+        self.REQUEST.RESPONSE.setHeader('Last-Modified',email.Utils.formatdate().split("-")[0]+'GMT')
       
         founds=self.ZSQLInlineSearchU(_table='personal_www',key=self.getKeyUTF8())
         html="""<html><body>%s</body></html>"""
@@ -909,18 +923,6 @@
         # TODO: remove all occurences of getDBId and replaces it by getKey
         return self.getKey()
         
-#        search=self.ZSQLInlineSearch(_table='personal_www',key=self.getKey(),publish_the_data='yes')
-#        if search:#name existiert und published, dann nimm diesen falls es mehrereeventuell nich publizierte datensaetze gibt.
-#            return search[0].id
-#        else:#nicht publiziert dann nimm einen davon
-#            search2=self.ZSQLInlineSearch(_table='personal_www',username=self.getId())
-#            if search2:
-#                return search2[0].id
-#            else:
-#                return None
-        
-    
-    
     formatBiblHelp=bibliography.formatBiblHelp
     
     def sortBibliography(self,list,sortingMode=None,max=None):
@@ -997,8 +999,9 @@
 
     self._setObject(id,newObj)
 
-
     if RESPONSE is not None:
         self.redirect(RESPONSE,'manage_main')
 
+
+