some minor improvements for form manager application
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@3778 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
		
							parent
							
								
									0ae96854a7
								
							
						
					
					
						commit
						eac872cb2c
					
				
					 3 changed files with 11 additions and 2 deletions
				
			
		|  | @ -28,6 +28,7 @@ from zope import component | |||
| from zope.app.pagetemplate import ViewPageTemplateFile | ||||
| from zope.app.session.interfaces import ISession | ||||
| from zope.cachedescriptors.property import Lazy | ||||
| from zope.traversing.browser.absoluteurl import absoluteURL | ||||
| 
 | ||||
| from cybertools.composer.interfaces import IInstance | ||||
| from cybertools.composer.schema.interfaces import IClientFactory, ISchema | ||||
|  | @ -153,6 +154,10 @@ class BaseView(object): | |||
|         from zope.traversing.browser import absoluteURL | ||||
|         return absoluteURL(self.context, self.request) | ||||
| 
 | ||||
|     def firstFormUrl(self): | ||||
|         for tpl in self.context.getClientSchemas(): | ||||
|             return absoluteURL(tpl, self.request) | ||||
| 
 | ||||
|     def setSessionInfo(self, key, value, packageId=packageId): | ||||
|         session = ISession(self.request)[packageId] | ||||
|         if session.get(key) != value: | ||||
|  |  | |||
|  | @ -59,7 +59,8 @@ class RegistrationsExportCsv(FormManagerView): | |||
|         context = self.context | ||||
|         schemas = [s for s in context.getClientSchemas() if ISchema.providedBy(s)] | ||||
|         headline = (['Client ID', 'Time Stamp'] | ||||
|              + list(itertools.chain(*[[self.encode(f.title) | ||||
|              #+ list(itertools.chain(*[[self.encode(f.title) | ||||
|              + list(itertools.chain(*[[self.encode(f.name) | ||||
|                                             for f in s.fields | ||||
|                                             if f.storeData] | ||||
|                                                     for s in schemas]))) | ||||
|  |  | |||
|  | @ -141,7 +141,10 @@ class FormManagerView(BaseView): | |||
| 
 | ||||
|     def firstFormUrl(self): | ||||
|         for tpl in self.context.getClientSchemas(): | ||||
|             return absoluteURL(tpl, self.request) | ||||
|             url = absoluteURL(tpl, self.request) | ||||
|             if self.isManageMode and 'client' in self.request.form: | ||||
|                 url = '%s?id=%s' % (url, self.request.form['client']) | ||||
|             return url | ||||
| 
 | ||||
| 
 | ||||
| class CheckoutView(BaseView): | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 helmutm
						helmutm