source: WAeUP_SRP/base/skins/waeup_default/import.py @ 2284

Last change on this file since 2284 was 2262, checked in by Henrik Bettermann, 17 years ago

show import data link to managers

  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1##parameters=REQUEST
2# $Id: import.py 2262 2007-09-20 14:02:45Z henrik $
3"""
4process the Application Form
5return html renderer + psm
6"""
7try:
8    from Products.zdb import set_trace
9except:
10    def set_trace():
11        pass
12import DateTime
13from urllib import urlencode
14current = DateTime.DateTime()
15pr = context.portal_registration
16
17validate = REQUEST.has_key("import")
18enable = REQUEST.has_key("enable_bypass")
19disable = REQUEST.has_key("disable_bypass")
20#set_trace()
21lt = context.portal_layouts
22#pr = context.portal_registration
23
24res,psm,ds = lt.renderLayout(layout_id= 'import',
25                      schema_id= 'import',
26                      context=context,
27                      mapping=validate and REQUEST,
28                      ob={},
29                      layout_mode='create',
30                      commit=False,
31                      )
32if enable:
33    context.portal_catalog.setBypassQueue(1)
34    psm = "QueueCatalog Bypass enabled!"
35    #return REQUEST.RESPONSE.redirect("%s" % context.absolute_url())
36elif disable:
37    context.portal_catalog.setBypassQueue(0)
38    psm = "QueueCatalog Bypass disabled!"
39elif psm == 'invalid':
40    return context.import_form(rendered = res,
41                               psm = "Please correct your input!",
42                               ds = ds,
43                              )
44elif psm == '':
45    return context.import_form(rendered = res,
46                               psm = None,
47                               ds = ds,
48                              )
49elif psm == 'valid':
50    psm = context.waeup_tool.importData(ds.get('filename'),
51                                    ds.get('name'),
52                                    ds.get('import_or_edit')
53                                   )
54return context.import_form(rendered = res,
55                                 psm = psm,
56                                 ds = ds,
57                                 )
Note: See TracBrowser for help on using the repository browser.