provide location url on feedback messages/pages
git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2204 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
		
							parent
							
								
									8d931d9786
								
							
						
					
					
						commit
						c9ec411a95
					
				
					 3 changed files with 21 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -62,7 +62,7 @@ class MessageInstance(Instance):
 | 
			
		|||
        if self.client is None:
 | 
			
		||||
            return ''
 | 
			
		||||
        if zope29:
 | 
			
		||||
            path = self.client.manager.getPhysicalPath()
 | 
			
		||||
            path = self.client.manager.getPhysicalPath()[:-3]
 | 
			
		||||
            url = request.physicalPathToURL(path)
 | 
			
		||||
        else:
 | 
			
		||||
            url = absoluteURL(self.client.manager, request)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -207,6 +207,7 @@ class CheckoutView(ServiceManagerView):
 | 
			
		|||
            result.append(dict(service=service.title,
 | 
			
		||||
                               fromTo=self.getFromTo(service),
 | 
			
		||||
                               location=service.location,
 | 
			
		||||
                               locationUrl=service.locationUrl,
 | 
			
		||||
                               number=reg.number,
 | 
			
		||||
                               serviceObject=service))
 | 
			
		||||
        return result
 | 
			
		||||
| 
						 | 
				
			
			@ -223,7 +224,12 @@ class CheckoutView(ServiceManagerView):
 | 
			
		|||
    def listRegistrationsText(self):
 | 
			
		||||
        result = []
 | 
			
		||||
        for info in self.getRegistrationsInfo():
 | 
			
		||||
            line = '\n'.join((info['service'], info['fromTo'], info['location']))
 | 
			
		||||
            location, locationUrl = info['location'], info['locationUrl']
 | 
			
		||||
            if locationUrl.startswith('/'):
 | 
			
		||||
                locationUrl = self.request.get('SERVER_URL') + locationUrl
 | 
			
		||||
            locationInfo = (locationUrl and '%s (%s)' % (location, locationUrl)
 | 
			
		||||
                                        or location)
 | 
			
		||||
            line = '\n'.join((info['service'], info['fromTo'], locationInfo))
 | 
			
		||||
            if info['serviceObject'].allowRegWithNumber:
 | 
			
		||||
                line += '\nTeilnehmer: %s\n' % info['number']
 | 
			
		||||
            result.append(line)
 | 
			
		||||
| 
						 | 
				
			
			@ -251,9 +257,13 @@ class CheckoutView(ServiceManagerView):
 | 
			
		|||
    def listRegistrationsHtml(self):
 | 
			
		||||
        result = []
 | 
			
		||||
        for info in self.getRegistrationsInfo():
 | 
			
		||||
            location, locationUrl = info['location'], info['locationUrl']
 | 
			
		||||
            locationInfo = (locationUrl
 | 
			
		||||
                        and ('<a href="%s">%s</a>'  % (locationUrl, location))
 | 
			
		||||
                        or location)
 | 
			
		||||
            line = self.row % (info['number'], info['service'],
 | 
			
		||||
                               info['fromTo'].replace(' ', '  '),
 | 
			
		||||
                        info['location'])
 | 
			
		||||
                               locationInfo)
 | 
			
		||||
            result.append(line)
 | 
			
		||||
        return self.html % '\n'.join(result)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -261,9 +261,14 @@ class IService(Interface):
 | 
			
		|||
                description=_(u'Web address (URL) for more information '
 | 
			
		||||
                        'about the service.'),
 | 
			
		||||
                required=False,)
 | 
			
		||||
    infoUrl = schema.TextLine(
 | 
			
		||||
    info = schema.TextLine(
 | 
			
		||||
                title=_(u'Additional information'),
 | 
			
		||||
                description=_(u'Web address (URL) of a document that '
 | 
			
		||||
                description=_(u'Name/title of a document or web page that '
 | 
			
		||||
                        'offers additional information.'),
 | 
			
		||||
                required=False,)
 | 
			
		||||
    infoUrl = schema.TextLine(
 | 
			
		||||
                title=_(u'URL for additional information'),
 | 
			
		||||
                description=_(u'Web address (URL) of a document or web page that '
 | 
			
		||||
                        'offers additional information.'),
 | 
			
		||||
                required=False,)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue