Mercurial > hg > MPIWGWeb
comparison MPIWGStaff.py @ 2:ddf6c1a27a4b
new version with main_template and css in product.
author | casties |
---|---|
date | Thu, 07 Feb 2013 19:50:39 +0100 |
parents | bca61e893fcc |
children | ee3eb9a6665a |
comparison
equal
deleted
inserted
replaced
1:1f2760ed3efe | 2:ddf6c1a27a4b |
---|---|
2 # TODO: pruefe ob die id der einzelnen tabellen, wie id in publications noch benutzt werden | 2 # TODO: pruefe ob die id der einzelnen tabellen, wie id in publications noch benutzt werden |
3 # TODO: pruefe ob die bibliographischen felder in publications noch benutzt werden | 3 # TODO: pruefe ob die bibliographischen felder in publications noch benutzt werden |
4 # TODO: wird username gebraucht? | 4 # TODO: wird username gebraucht? |
5 | 5 |
6 from OFS.Folder import Folder | 6 from OFS.Folder import Folder |
7 from Products.ZSQLExtend.ZSQLExtend import ZSQLExtendFolder | |
8 from Products.PageTemplates.PageTemplateFile import PageTemplateFile | 7 from Products.PageTemplates.PageTemplateFile import PageTemplateFile |
9 from Products.PageTemplates.PageTemplate import PageTemplate | 8 from Products.PageTemplates.PageTemplate import PageTemplate |
10 from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate | 9 from Products.PageTemplates.ZopePageTemplate import ZopePageTemplate |
11 from Products.ZCatalog.CatalogPathAwareness import CatalogAware | 10 from Products.ZCatalog.CatalogPathAwareness import CatalogAware |
12 from Products.versionedFile.extVersionedFile import extVersionedFileFolder | 11 from Products.versionedFile.extVersionedFile import extVersionedFileFolder |
13 from AccessControl import getSecurityManager | 12 from AccessControl import getSecurityManager |
14 | 13 |
14 from Products.ZSQLExtend.ZSQLExtend import ZSQLExtendFolder | |
15 from Products.ZDBInterface.ZDBInterfaceFolder import ZDBInterfaceFolder | |
16 | |
15 import os | 17 import os |
16 import logging | 18 import logging |
17 import bibliography | |
18 import email | 19 import email |
19 from Globals import package_home | 20 from Globals import package_home |
20 from Products.PythonScripts.standard import sql_quote | 21 from Products.PythonScripts.standard import sql_quote |
21 from types import * | 22 from types import * |
22 from AccessControl import ClassSecurityInfo | 23 from AccessControl import ClassSecurityInfo |
23 import time | 24 import time |
24 import logging | 25 import logging |
25 import email | |
26 import re | 26 import re |
27 from OFS.Cache import Cacheable | 27 from OFS.Cache import Cacheable |
28 import urllib2 | 28 import urllib2 |
29 import transaction | 29 import transaction |
30 | |
30 import SrvTxtUtils | 31 import SrvTxtUtils |
32 import bibliography | |
31 | 33 |
32 from MPIWGHelper import * | 34 from MPIWGHelper import * |
33 #ersetzt logging | 35 #ersetzt logging |
34 def logger(txt,method,txt2): | 36 def logger(txt,method,txt2): |
35 """logging""" | 37 """logging""" |
631 self.redirect(RESPONSE,"editCV") | 633 self.redirect(RESPONSE,"editCV") |
632 | 634 |
633 | 635 |
634 def getProfile(self): | 636 def getProfile(self): |
635 """get the profile""" | 637 """get the profile""" |
636 self.REQUEST.RESPONSE.setHeader('Last-Modified',email.Utils.formatdate().split("-")[0]+'GMT') | 638 self.REQUEST.RESPONSE.setHeader('Last-Modified',email.Utils.formatdate().split("-")[0]+'GMT') |
637 | 639 |
638 founds=self.ZSQLInlineSearchU(_table='personal_www',key=self.getKeyUTF8()) | 640 founds=self.ZSQLInlineSearchU(_table='personal_www',key=self.getKeyUTF8()) |
639 html="""<html><body>%s</body></html>""" | 641 html="""<html><body>%s</body></html>""" |
640 if founds.profile and founds.profile != "": | 642 if founds.profile and founds.profile != "": |
641 | 643 |
995 """add it""" | 997 """add it""" |
996 newObj=MPIWGStaff(id,lastName,firstName) | 998 newObj=MPIWGStaff(id,lastName,firstName) |
997 | 999 |
998 self._setObject(id,newObj) | 1000 self._setObject(id,newObj) |
999 | 1001 |
1000 | |
1001 if RESPONSE is not None: | 1002 if RESPONSE is not None: |
1002 self.redirect(RESPONSE,'manage_main') | 1003 self.redirect(RESPONSE,'manage_main') |
1003 | 1004 |
1004 | 1005 |
1006 class MPIWGStaffFolder(ZDBInterfaceFolder): | |
1007 """Folder of staff objects""" | |
1008 | |
1009 meta_type="MPIWGStaffFolder" | |
1010 security=ClassSecurityInfo() | |
1011 | |
1012 def index_html(self,REQUEST,RESPONSE): | |
1013 """show homepage""" | |
1014 logging.debug("MPIWGStaffFolder: index_html!") | |
1015 return REQUEST | |
1016 | |
1017 def manage_addMPIWGStaffFolderForm(self): | |
1018 """form for adding the project""" | |
1019 pt=PageTemplateFile('zpt/addMPIWGStaffFolderForm', globals()).__of__(self) | |
1020 return pt() | |
1021 | |
1022 def manage_addMPIWGStaffFolder(self,id,title,RESPONSE=None): | |
1023 """add it""" | |
1024 newObj=MPIWGStaffFolder(id,title) | |
1025 | |
1026 self._setObject(id,newObj) | |
1027 | |
1028 if RESPONSE is not None: | |
1029 RESPONSE.redirect('manage_main') | |
1030 |