Changeset af4162 in indico
- Timestamp:
- 02/23/10 08:47:26 (3 years ago)
- Branches:
- master, burotel, hello-world-walkthrough, ipv6, new-webex, prov-dual-interface, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
- Children:
- 019031, f3d0f4
- Parents:
- 9278fc
- File:
-
- 1 edited
-
indico/MaKaC/webinterface/rh/categoryDisplay.py (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indico/MaKaC/webinterface/rh/categoryDisplay.py
r0c8aad raf4162 67 67 class RHCategoryDisplay( RHCategDisplayBase ): 68 68 _uh = urlHandlers.UHCategoryDisplay 69 69 70 70 def _process( self ): 71 71 72 72 wfReg = webFactoryRegistry.WebFactoryRegistry() 73 73 p = category.WPCategoryDisplay( self, self._target, wfReg ) … … 77 77 class RHCategoryMap( RHCategDisplayBase ): 78 78 _uh = urlHandlers.UHCategoryMap 79 79 80 80 def _process( self ): 81 81 p = category.WPCategoryMap( self, self._target ) … … 84 84 class RHCategoryStatistics( RHCategDisplayBase ): 85 85 _uh = urlHandlers.UHCategoryStatistics 86 86 87 87 def _process( self ): 88 88 wfReg = webFactoryRegistry.WebFactoryRegistry() … … 92 92 93 93 class RHCategOverviewDisplay( RHCategDisplayBase ): 94 94 95 95 def _checkParams( self, params ): 96 96 id = params.get("selCateg", "") … … 115 115 self._cal = wcalendar.Overview( self._aw, sd, [self._target] ) 116 116 self._cal.setDetailLevel( params.get("detail", "conference") ) 117 117 118 118 def _process( self ): 119 119 p = category.WPCategOverview( self, self._target, self._cal ) … … 121 121 122 122 class RHConferenceCreationBase( RHCategoryDisplay ): 123 124 def _checkProtection( self ): 123 124 def _checkProtection( self ): 125 125 self._checkSessionUser() 126 126 RHCategoryDisplay._checkProtection( self ) … … 129 129 if not self._target.canCreateConference( self._getUser() ): 130 130 raise MaKaCError( _("You are not allowed to create conferences inside this category")) 131 131 132 132 def _checkParams( self, params, mustExist=1 ): 133 133 RHCategoryDisplay._checkParams( self, params, mustExist ) … … 139 139 if et != "" and et !="default": 140 140 self._wf = self._wfReg.getFactoryById( et ) 141 141 142 142 143 143 #------------------------------------------------------------------------------------- … … 192 192 return 193 193 194 def _process( self ): 194 def _process( self ): 195 195 params = self._getRequestParams() 196 196 if params["title"]=="": … … 231 231 c = lectures[0] 232 232 self._redirect(urlHandlers.UHConferenceModification.getURL( c ) ) 233 else : 233 else : 234 234 url = urlHandlers.UHCategoryDisplay.getURL(self._target) 235 235 self._redirect(url) … … 248 248 c.disableSessionSlots() 249 249 return c 250 250 251 251 def _getPersons(self): 252 252 avatars, newUsers = [], [] … … 309 309 %s """ % (i,c.getStartDate(), c.getEndDate(), i,urlHandlers.UHConferenceDisplay.getURL(c)) 310 310 i+=1 311 311 312 312 msg = ("Content-Type: text/plain; charset=\"utf-8\"\r\nFrom: %s\r\nReturn-Path: %s\r\nTo: %s\r\nCc: \r\nSubject: %s\r\n\r\n"%(fromAddr, fromAddr, addrs, subject)) 313 313 msg = msg + text 314 maildata = { "fromAddr": fromAddr, "toList": addrs, "subject": subject, "body": text } 314 maildata = { "fromAddr": fromAddr, "toList": addrs, "subject": subject, "body": text } 315 315 self._emailsToBeSent.append(maildata) 316 316 # Category notification … … 319 319 maildata2 = { "fromAddr": fromAddr, "toList": addrs2, "subject": subject, "body": text } 320 320 self._emailsToBeSent.append(maildata2) 321 322 321 322 323 323 class UtilPersons: 324 324 325 325 @staticmethod 326 def addToConf( avatars, newUsers, conf, grantManager): 327 326 def addToConf( avatars, newUsers, conf, grantManager): 327 328 328 if newUsers : 329 329 for newUser in newUsers: … … 343 343 #self._errorList.append("%s has been already defined as %s of this conference"%(person.getFullName(),self._typeName)) 344 344 pass 345 345 346 346 if avatars: 347 347 348 348 for selected in avatars : 349 if isinstance(selected, user.Avatar) : 349 if isinstance(selected, user.Avatar) : 350 350 person = ConferenceChair() 351 351 person.setDataFromAvatar(selected) … … 353 353 #TODO: add to conf 354 354 UtilPersons._add(conf, person, grantManager) 355 else : 355 else : 356 356 #self._errorList.append("%s has been already defined as %s of this conference"%(person.getFullName(),self._typeName)) 357 357 pass 358 359 #elif isinstance(selected, user.Group) : 358 359 #elif isinstance(selected, user.Group) : 360 360 # for member in selected.getMemberList() : 361 361 # person = ConferenceChair() 362 362 # person.setDataFromAvatar(member) 363 363 # if not self._alreadyDefined(person, definedList) : 364 # definedList.append([person,params.has_key("submissionControl")]) 364 # definedList.append([person,params.has_key("submissionControl")]) 365 365 # else : 366 366 # self._errorList.append("%s has been already defined as %s of this conference"%(presenter.getFullName(),self._typeName)) 367 367 368 368 @staticmethod 369 369 def _alreadyDefined(person):#, definedList): … … 442 442 c.setLocation( l ) 443 443 l.setName( confData["locationName"] ) 444 l.setAddress( confData ["locationAddress"])444 l.setAddress( confData.get("locationAddress","") ) 445 445 446 446 roomName = confData.get( "locationBookedRoom" ) or confData.get( "roomName" ) or "" … … 472 472 473 473 class RHCategoryGetIcon(RHCategDisplayBase): 474 474 475 475 def _process(self): 476 476 icon=self._target.getIcon() … … 501 501 502 502 class RHCategoryToiCal(RHCategoryOpenService): 503 503 504 504 def _processData( self ): 505 505 filename = "%s - Event.ics"%self._target.getName().replace("/","") … … 518 518 def _getRSS( self, tz ): 519 519 return CategoryToRSS(self._target,tz=tz).getBody() 520 520 521 521 def _processData( self ): 522 522 data = "" … … 529 529 530 530 class RHTodayCategoryToRSS(RHCategoryToRSS): 531 531 532 532 def _getRSS( self, tz ): 533 533 return CategoryToRSS(self._target, date=nowutc().astimezone(timezone(tz)), tz=tz).getBody() 534 534 535 535 536 536 def sortByStartDate(conf1,conf2): 537 return cmp(conf1.getStartDate(),conf2.getStartDate()) 538 537 return cmp(conf1.getStartDate(),conf2.getStartDate()) 538
Note: See TracChangeset
for help on using the changeset viewer.
