Changeset f6f550 in indico


Ignore:
Timestamp:
01/28/10 17:46:06 (3 years ago)
Author:
Pedro Ferreira <jose.pedro.ferreira@…>
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:
ca129b
Parents:
eb09202
git-author:
Pedro Ferreira <jose.pedro.ferreira@…> (01/26/10 16:07:42)
git-committer:
Pedro Ferreira <jose.pedro.ferreira@…> (01/28/10 17:46:06)
Message:

[FIXED] Code review - Cesar's fixes

  • Some issues with locations and rooms;
  • None vs ;
Location:
indico
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/conference.py

    reb09202 rf6f550  
    56645664        return color 
    56655665 
    5666     def setValues( self, sessionData,check=2,moveEntries=0, isEdit = False ): 
     5666    def setValues( self, sessionData,check=2,moveEntries=0 ): 
    56675667        """Sets all the values of the current session object from a dictionary 
    56685668            containing the following key-value pairs: 
     
    57125712                self.setTextColor(self._getCorrectTextColor(textcolor)) 
    57135713        self.setTextColorToLinks(sessionData.has_key("textcolortolinks")) 
    5714         #if the location is not defined we set the location of the session 
    5715         #   to None so it will be considered to be the same as for the 
    5716         #   conference 
    5717         #if we are creating the session we need to set the location as none, but if it's an edit 
    5718         #it is neccesary to leave the location as "", because otherwise it will inherit it from the 
    5719         #parent even if the checkbox is not checked 
    5720         if sessionData.get( "locationName", "" ).strip() == "" and not isEdit: 
    5721             self.setLocation( None ) 
    5722         else: 
    5723             #if the location name is defined we must set a new location (or 
    5724             #   modify the existing one) for the session 
     5714 
     5715        if "locationName" in sessionData: 
    57255716            loc = self.getOwnLocation() 
    57265717            if not loc: 
     
    57295720            loc.setName( sessionData["locationName"] ) 
    57305721            loc.setAddress( sessionData.get("locationAddress", "") ) 
     5722 
    57315723        #same as for the location 
    5732         if sessionData.get( "roomName", "" ).strip() == "" and not isEdit: 
    5733                 self.setRoom( None ) 
    5734         else: 
     5724        if "roomName" in sessionData: 
    57355725            room = self.getOwnRoom() 
    57365726            if not room: 
     
    57385728            self.setRoom( room ) 
    57395729            room.setName( sessionData["roomName"] ) 
     5730 
    57405731        if sessionData.get("sDate",None) is not None: 
    57415732            self.setStartDate(sessionData["sDate"],check,moveEntries=moveEntries) 
     
    80388029                if data.has_key("f_%s"%id): 
    80398030                    self.setField(id, data["f_%s"%id]) 
    8040         #if the location is not defined we set the location of the contribution 
    8041         #   to None so it will be considered to be the same as for the 
    8042         #   conference 
    8043         if data.has_key("locationName"): 
    8044            # if data["locationName"].strip()=="": 
    8045             #    self.setLocation(None) 
    8046             #else: 
    8047                 #if the location name is defined we must set a new location (or 
    8048                 #   modify the existing one) for the contribution 
    8049                 loc=self.getOwnLocation() 
    8050                 if not loc: 
    8051                     loc=CustomLocation() 
    8052                 self.setLocation(loc) 
    8053                 loc.setName(data["locationName"]) 
    8054                 loc.setAddress(data.get("locationAddress", "")) 
     8031 
     8032        if "locationName" in data: 
     8033            loc=self.getOwnLocation() 
     8034            if not loc: 
     8035                loc=CustomLocation() 
     8036            self.setLocation(loc) 
     8037            loc.setName(data["locationName"]) 
     8038            loc.setAddress(data.get("locationAddress", "")) 
     8039 
    80558040        #same as for the location 
    8056         if data.has_key("roomName"): 
    8057            # if data["roomName"].strip()=="": 
    8058             #    self.setRoom(None) 
    8059             #else: 
    8060                 room=self.getOwnRoom() 
    8061                 if not room: 
    8062                     room=CustomRoom() 
    8063                 self.setRoom(room) 
    8064                 room.setName(data["roomName"]) 
     8041        if "roomName" in data: 
     8042            room=self.getOwnRoom() 
     8043            if not room: 
     8044                room=CustomRoom() 
     8045            self.setRoom(room) 
     8046            room.setName(data["roomName"]) 
    80658047        tz = 'UTC' 
    80668048        if self.getConference(): 
  • indico/MaKaC/services/implementation/schedule.py

    reb09202 rf6f550  
    5656 
    5757        if location != None: 
    58             #if location.strip()=="": 
    59             #    target.setLocation(None) 
    60             #else: 
    61                 loc = target.getOwnLocation() 
    62                 if not loc: 
    63                     loc = conference.CustomLocation() 
    64                 target.setLocation(loc) 
    65                 loc.setName(location) 
    66                 loc.setAddress(address) 
     58            loc = target.getOwnLocation() 
     59            if not loc: 
     60                loc = conference.CustomLocation() 
     61            target.setLocation(loc) 
     62            loc.setName(location) 
     63            loc.setAddress(address) 
     64 
    6765        #same as for the location 
    6866        if room != None: 
    69             #if room.strip()=="": 
    70             #    target.setRoom(None) 
    71             #else: 
    72                 r = target.getOwnRoom() 
    73                 if not r: 
    74                     r = conference.CustomRoom() 
    75                 target.setRoom(r) 
    76                 r.setName(room) 
     67            r = target.getOwnRoom() 
     68            if not r: 
     69                r = conference.CustomRoom() 
     70            target.setRoom(r) 
     71            r.setName(room) 
    7772 
    7873class ScheduleOperation: 
  • indico/MaKaC/webinterface/rh/contribMod.py

    reb09202 rf6f550  
    748748                params["sHour"] = "" 
    749749                params["sMinute"] = "" 
    750              
     750 
    751751            if params.has_key("duration"): 
    752752                params["durMins"] = params["duration"]; 
    753753            else: 
    754                 params["durMins"] = ""         
     754                params["durMins"] = "" 
    755755            self._target.setValues(params) 
    756756            self._target.setType(self._type) 
  • indico/htdocs/js/indico/Management/RoomBooking.js

    reb09202 rf6f550  
    161161 
    162162                     self._startBind(); 
    163                      self.info.set('location', ''); 
    164                      self.info.set('room', ''); 
    165                      self.info.set('address', ''); 
    166163                 } 
    167164             }); 
  • indico/htdocs/js/indico/Management/Timetable.js

    reb09202 rf6f550  
    33 
    44    return (!info) || 
    5         (!info.get('location')) || 
    6         (!info.get('room')); 
     5        (!exists(info.get('location'))) || 
     6        (!exists(info.get('room'))); 
    77} 
    88 
     
    798798                            this.timeField, 
    799799                            this.isEdit); 
    800               
     800 
    801801             invertableBind(this.info.accessor('inheritLoc'), 
    802802                            this.roomEditor.inheritCheckbox.get(), 
    803803                            false); 
    804               
     804 
    805805             invertableBind(this.info.accessor('inheritRoom'), 
    806806                            this.roomEditor.inheritCheckbox.get(), 
    807                             false);              
     807                            false); 
    808808 
    809809             self.parameterManager.add(self.startTimeField, 'time', false); 
Note: See TracChangeset for help on using the changeset viewer.