Changeset 8740 for main/waeup.kofa/trunk/src
- Timestamp:
- 17 Jun 2012, 17:51:12 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r8739 r8740 80 80 role_manager.assignRoleToPrincipal(localrole, user) 81 81 notify(LocalRoleSetEvent(view.context, localrole, user, granted=True)) 82 ob_class = view.__implemented__.__name__.replace('waeup.kofa.','') 83 grok.getSite().logger.info( 84 '%s - added: %s|%s' % (ob_class, user, localrole)) 82 85 view.redirect(view.url(view.context, u'@@manage')+'?tab%s' % tab) 83 86 return … … 1339 1342 self.url(self.context, 'export.csv') + '?exporter=%s' % exporter) 1340 1343 return 1344 1345 class ExportCSVView(grok.View): 1346 grok.context(IDataCenter) 1347 grok.name('export.csv') 1348 grok.require('waeup.manageDataCenter') 1349 1350 def render(self, exporter=None): 1351 if exporter is None: 1352 return 1341 1353 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 1342 1354 self.context.logger.info( … … 1349 1361 return csv_data 1350 1362 1351 class ExportCSVView(grok.View):1352 grok.context(IDataCenter)1353 grok.name('export.csv')1354 grok.require('waeup.manageDataCenter')1355 1356 def render(self, exporter=None):1357 if exporter is None:1358 return1359 exporter = getUtility(ICSVExporter, name=exporter)1360 csv_data = exporter.export_all(grok.getSite())1361 #csv_data.seek(0)1362 self.response.setHeader(1363 'Content-Type', 'text/csv; charset=UTF-8')1364 return csv_data1365 1366 1363 class ExportXMLPage(grok.View): 1367 1364 """Deliver an XML representation of the context. … … 1477 1474 self.flash(_('The faculty code chosen already exists.')) 1478 1475 return 1476 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 1477 self.context.__parent__.logger.info( 1478 '%s - added: %s' % (ob_class, faculty.code)) 1479 1479 self.redirect(self.url(self.context, u'@@manage')+'?tab1') 1480 return 1480 1481 1481 1482 @action(_('Cancel'), validator=NullValidator) … … 1591 1592 self.status = self.flash( 1592 1593 _("Department ${a} added.", mapping = {'a':data['code']})) 1594 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 1595 self.context.__parent__.__parent__.logger.info( 1596 '%s - added: %s' % (ob_class, data['code'])) 1593 1597 self.redirect(self.url(self.context, u'@@manage')+'?tab2') 1598 return 1594 1599 1595 1600 @action(_('Cancel'), validator=NullValidator) 1596 1601 def cancel(self, **data): 1597 1602 self.redirect(self.url(self.context)) 1603 return 1598 1604 1599 1605 # … … 1794 1800 message = _(u'Course ${a} successfully created.', mapping = {'a':course.code}) 1795 1801 self.flash(message) 1802 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 1803 self.context.__parent__.__parent__.__parent__.logger.info( 1804 '%s - added: %s' % (ob_class, data['code'])) 1796 1805 self.redirect(self.url(self.context, u'@@manage')+'?tab2') 1806 return 1797 1807 1798 1808 @action(_('Cancel'), validator=NullValidator) … … 1831 1841 message = _(u'Certificate ${a} successfully created.', mapping = {'a':certificate.code}) 1832 1842 self.flash(message) 1843 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 1844 self.context.__parent__.__parent__.__parent__.logger.info( 1845 '%s - added: %s' % (ob_class, data['code'])) 1833 1846 self.redirect(self.url(self.context, u'@@manage')+'?tab3') 1834 1847 return … … 1993 2006 _("Course referrer ${a}_${b} added.", 1994 2007 mapping = {'a': data['course'].code, 'b': data['level']})) 2008 code = "%s_%s" % (data['course'].code, data['level']) 2009 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 2010 grok.getSite().logger.info('%s - added: %s' % (ob_class, code)) 1995 2011 self.redirect(self.url(self.context, u'@@manage')+'?tab2') 2012 return 1996 2013 1997 2014 @action(_('Cancel'), validator=NullValidator) … … 2044 2061 parent.delCourseRef(data['course'].code, level=old_level) 2045 2062 self.flash(_('Form has been saved.')) 2063 old_code = "%s_%s" % (data['course'].code, old_level) 2064 new_code = "%s_%s" % (data['course'].code, data['level']) 2065 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 2066 grok.getSite().logger.info( 2067 '%s - renamed: %s to %s' % (ob_class, old_code, new_code)) 2046 2068 self.redirect(self.url(parent)) 2047 2069 return … … 2123 2145 else: 2124 2146 self.flash(_('An smtp server error occurred.')) 2125 return 2147 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 2148 self.context.logger.info( 2149 '%s - %s - %s' % (ob_class, data['identifier'], data['email'])) 2150 return
Note: See TracChangeset for help on using the changeset viewer.