Changeset b7f4eee3751ed0742999d737e4cd81005f58a40b in indico
- Timestamp:
- 01/20/12 15:34:52 (4 months ago)
- Children:
- 791f15a31168da6bb2bac441f2cb1a6f370d15da
- Parents:
- 96c522bb4f6d67ab582d9bda459e76015d874d8b
- git-author:
- Alberto Resco Perez <alberto.resco.perez@…> (01/20/12 15:34:52)
- git-committer:
- Pedro Ferreira <jose.pedro.ferreira@…> (01/24/12 11:13:41)
- Location:
- indico
- Files:
-
- 8 edited
-
MaKaC/services/implementation/conference.py (modified) (7 diffs)
-
MaKaC/webinterface/pages/conferences.py (modified) (1 diff)
-
MaKaC/webinterface/rh/conferenceModif.py (modified) (2 diffs)
-
MaKaC/webinterface/tpls/ConferenceParticipants.tpl (modified) (6 diffs)
-
MaKaC/webinterface/tpls/ConferenceParticipantsPending.tpl (modified) (3 diffs)
-
MaKaC/webinterface/urlHandlers.py (modified) (1 diff)
-
htdocs/confModifParticipants.py (modified) (1 diff)
-
htdocs/js/indico/Display/Dialogs.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
indico/MaKaC/services/implementation/conference.py
r96c522 rb7f4ee 750 750 data["toList"] = [participant.getEmail()] 751 751 urlInvitation = urlHandlers.UHConfParticipantsInvitation.getURL( self._conf ) 752 urlInvitation.addParam("participantId","%s"% id)752 urlInvitation.addParam("participantId","%s"%participant.getId()) 753 753 urlRefusal = urlHandlers.UHConfParticipantsRefusal.getURL( self._conf ) 754 urlRefusal.addParam("participantId","%s"% id)754 urlRefusal.addParam("participantId","%s"%participant.getId()) 755 755 data["body"] = data["body"].format(name=participant.getEmail(), confTitle=self._conf.getTitle(), url=urlHandlers.UHConferenceDisplay.getURL( self._conf ), urlRefusal=urlRefusal, urlInvitation=urlInvitation) 756 756 GenericMailer.sendAndLog(GenericNotification(data),self._conf,"participants", self._getUser()) … … 776 776 pm = ParameterManager(self._params) 777 777 self._userList = pm.extract("userIds", pType=list, allowEmpty=False) 778 779 def _getWarningAlreadyAdded(self, list, typeList=""): 780 if len(list) == 1: 781 return _("""The participant identified by email %s 782 is already in the %s participants' list.""")%(typeList, list[0]) 783 else: 784 785 return _("""The participants identified by email %s 786 are already in the %s participants' list.""")%(typeList ,", ".join(list)) 778 787 779 788 class ConferenceParticipantsDisplay(ConferenceModifBase): … … 916 925 class ConferenceAddParticipants(ConferenceParticipantBase, ConferenceParticipantListBase): 917 926 927 def _addParticipant(self, participant, participation): 928 if not participation.addParticipant(participant, self._getUser()) : 929 if participation.alreadyParticipating(participant) != 0 : 930 self._usersParticipant.append(participant.getEmail()) 931 elif participation.alreadyPending(participant)!=0: 932 self._usersPending.append(participant.getEmail()) 933 else: 934 self._added.append(conferences.WConferenceParticipant(self._conf,participant).getHTML()) 935 918 936 def _getAnswer(self): 919 937 if self._userList == []: 920 938 raise NoReportError(_("No users were selected to be added as participants.")) 921 eventManager = self._getUser() 939 self._usersPending = [] 940 self._usersParticipant = [] 941 self._added =[] 922 942 participation = self._conf.getParticipation() 923 943 result = {} 924 944 infoWarning = [] 925 usersPending = [] 926 usersParticipant = [] 927 added =[] 945 928 946 for user in self._userList: 929 947 ph = PrincipalHolder() 930 948 selected = ph.getById(int(user['id'])) 931 949 if isinstance(selected, Avatar) : 932 participant =self._generateParticipant(selected) 933 if not participation.addParticipant(participant,eventManager) : 934 if participation.alreadyParticipating(participant) != 0 : 935 usersParticipant.append(participant.getEmail()) 936 elif participation.alreadyPending(participant)!=0: 937 usersPending.append(participant.getEmail()) 938 else: 939 added.append(conferences.WConferenceParticipant(self._conf,participant).getHTML()) 950 self._addParticipant(self._generateParticipant(selected), participation) 940 951 elif isinstance(selected, Group) : 941 952 for member in selected.getMemberList() : 942 participant =self._generateParticipant(member) 943 if not participation.addParticipant(participant,eventManager) : 944 if participation.alreadyParticipating(participant) != 0 : 945 usersParticipant.append(participant.getEmail()) 946 elif participation.alreadyPending(participant)!=0: 947 usersPending.append(participant.getEmail()) 948 else: 949 added.append(conferences.WConferenceParticipant(self._conf,participant).getHTML()) 953 self._addParticipant(self._generateParticipant(member), participation) 950 954 951 955 else : 952 participant = self._generateParticipant() 953 if not participation.addParticipant(participant,eventManager) : 954 if participation.alreadyParticipating(participant) != 0 : 955 usersParticipant.append(participant.getEmail()) 956 elif participation.alreadyPending(participant)!=0: 957 usersPending.append(participant.getEmail()) 958 else: 959 added.append(conferences.WConferenceParticipant(self._conf,participant).getHTML()) 960 961 result["added"] = ("".join(added)).replace("\n","") 962 if usersPending: 963 if len(usersPending) == 1: 964 infoWarning.append(_("""The participant identified by email %s 965 is already in the pending participants' list.""")%usersPending[0]) 966 else: 967 968 infoWarning.append(_("""The participants identified by email %s 969 are already in the pending participants' list.""")%(", ".join(usersPending))) 970 if usersParticipant: 971 if len(usersParticipant) == 1: 972 infoWarning.append(_("""The participant identified by email %s 973 is already in the participants' list.""")%usersParticipant[0]) 974 else: 975 976 infoWarning.append(_("""The participants identified by email %s 977 are already in the participants' list.""")%(", ".join(usersParticipant))) 956 self._addParticipant(self._generateParticipant(), participation) 957 958 result["added"] = ("".join(self._added)).replace("\n","") 959 if self._usersPending: 960 infoWarning.append(self._getWarningAlreadyAdded(self._usersPending, "pending")) 961 if self._usersParticipant: 962 infoWarning.append(self._getWarningAlreadyAdded(self._usersParticipant)) 978 963 if infoWarning: 979 964 result["infoWarning"] = infoWarning … … 982 967 class ConferenceInviteParticipants(ConferenceParticipantBase, ConferenceParticipantListBase): 983 968 969 def _checkParams(self): 970 ConferenceParticipantListBase._checkParams(self) 971 pm = ParameterManager(self._params) 972 self._emailSubject = pm.extract("subject", pType=str, allowEmpty=False) 973 self._emailBody = pm.extract("body", pType=str, allowEmpty=False) 974 975 def _inviteParticipant(self, participant, participation): 976 if not participation.inviteParticipant(participant, self._getUser()) : 977 if participation.alreadyParticipating(participant) != 0 : 978 self._usersParticipant.append(participant.getEmail()) 979 elif participation.alreadyPending(participant)!=0: 980 self._usersPending.append(participant.getEmail()) 981 return False 982 else: 983 self._added.append(conferences.WConferenceParticipant(self._conf,participant).getHTML()) 984 return True 985 984 986 def _getAnswer(self): 985 987 if self._userList == []: 986 988 raise NoReportError(_("No users were selected to be invited as participants.")) 987 pm = ParameterManager(self._params)988 emailSubject = pm.extract("subject", pType=str, allowEmpty=False)989 emailBody = pm.extract("body", pType=str, allowEmpty=False)989 self._usersPending = [] 990 self._usersParticipant = [] 991 self._added =[] 990 992 currentUser = self._getUser() 991 993 participation = self._conf.getParticipation() 992 994 infoWarning = [] 993 usersPending = [] 994 usersParticipant = [] 995 added =[] 995 996 996 result = {} 997 997 data = {} 998 998 if currentUser: 999 999 data["fromAddr"] = currentUser.getEmail() 1000 data["subject"] = emailSubject1001 data["body"] = emailBody1000 data["subject"] = self._emailSubject 1001 data["body"] = self._emailBody 1002 1002 for user in self._userList: 1003 1003 ph = PrincipalHolder() … … 1005 1005 if isinstance(selected, Avatar) : 1006 1006 participant =self._generateParticipant(selected) 1007 if not participation.inviteParticipant(participant,currentUser) : 1008 if participation.alreadyParticipating(participant) != 0 : 1009 usersParticipant.append(participant.getEmail()) 1010 elif participation.alreadyPending(participant)!=0: 1011 usersPending.append(participant.getEmail()) 1012 else: 1013 added.append(conferences.WConferenceParticipant(self._conf,participant).getHTML()) 1007 if self._inviteParticipant(participant, participation): 1014 1008 self._sendEmailWithFormat(participant, data) 1015 1009 elif isinstance(selected, Group) : 1016 1010 for member in selected.getMemberList() : 1017 1011 participant =self._generateParticipant(member) 1018 if not participation.inviteParticipant(participant,currentUser) : 1019 if participation.alreadyParticipating(participant) != 0 : 1020 usersParticipant.append(participant.getEmail()) 1021 elif participation.alreadyPending(participant)!=0: 1022 usersPending.append(participant.getEmail()) 1023 else: 1024 added.append(conferences.WConferenceParticipant(self._conf,participant).getHTML()) 1012 if self._inviteParticipant(participant, participation): 1025 1013 self._sendEmailWithFormat(participant, data) 1026 1014 else : 1027 1015 participant = self._generateParticipant() 1028 if not participation.inviteParticipant(participant,currentUser) : 1029 if participation.alreadyParticipating(participant) != 0 : 1030 usersParticipant.append(participant.getEmail()) 1031 elif participation.alreadyPending(participant)!=0: 1032 usersPending.append(participant.getEmail()) 1033 else: 1034 added.append(conferences.WConferenceParticipant(self._conf,participant).getHTML()) 1016 if self._inviteParticipant(participant, participation): 1035 1017 self._sendEmailWithFormat(participant, data) 1036 result["added"] = ("".join(added)).replace("\n","") 1037 if usersPending: 1038 if len(usersPending) == 1: 1039 infoWarning.append(_("""The participant identified by email %s 1040 is already in the pending participants' list.""")%usersPending[0]) 1041 else: 1042 1043 infoWarning.append(_("""The participants identified by email %s 1044 are already in the pending participants' list.""")%(", ".join(usersPending))) 1045 if usersParticipant: 1046 if len(usersParticipant) == 1: 1047 infoWarning.append(_("""The participant identified by email %s 1048 is already in the participants' list.""")%usersParticipant[0]) 1049 else: 1050 1051 infoWarning.append(_("""The participants identified by email %s 1052 are already in the participants' list.""")%(", ".join(usersParticipant))) 1018 result["added"] = ("".join(self._added)).replace("\n","") 1019 if self._usersPending: 1020 infoWarning.append(self._getWarningAlreadyAdded(self._usersPending, "pending")) 1021 if self._usersParticipant: 1022 infoWarning.append(self._getWarningAlreadyAdded(self._usersParticipant)) 1053 1023 if infoWarning: 1054 1024 result["infoWarning"] = infoWarning … … 1133 1103 return True 1134 1104 1135 class ConferenceRejectPendingParticipants(ConferenceParticipantBase, ConferenceParticipantListBase): 1105 class ConferenceRejectPendingParticipants(ConferenceParticipantListBase): 1106 1107 def _getAnswer(self): 1108 if self._userList == []: 1109 raise NoReportError(_("No pending participants were selected to be rejected.")) 1110 for id in self._userList: 1111 pending = self._conf.getParticipation().getPendingParticipantByKey(id) 1112 pending.setStatusDeclined() 1113 self._conf.getParticipation().declineParticipant(pending) 1114 return True 1115 1116 class ConferenceRejectWithEmailPendingParticipants(ConferenceParticipantBase, ConferenceParticipantListBase): 1136 1117 1137 1118 def _getAnswer(self): … … 1590 1571 "participation.acceptPending": ConferenceAcceptPendingParticipants, 1591 1572 "participation.rejectPending": ConferenceRejectPendingParticipants, 1573 "participation.rejectPendingWithEmail": ConferenceRejectWithEmailPendingParticipants, 1592 1574 "protection.getAllowedUsersList": ConferenceProtectionUserList, 1593 1575 "protection.addAllowedUsers": ConferenceProtectionAddUsers, -
indico/MaKaC/webinterface/pages/conferences.py
r1a8f22 rb7f4ee 3318 3318 self._tabCtrl = wcomponents.TabControl() 3319 3319 3320 self._tabParticipantsSetup = self._tabCtrl.newTab( "participantsetup", _("Setup"), urlHandlers.UHConfModifParticipants .getURL( self._conf ) )3321 self._tabParticipantsList = self._tabCtrl.newTab( "participantsList", _("Participants"), urlHandlers.UHConfModifParticipants List.getURL( self._conf ) )3320 self._tabParticipantsSetup = self._tabCtrl.newTab( "participantsetup", _("Setup"), urlHandlers.UHConfModifParticipantsSetup.getURL( self._conf ) ) 3321 self._tabParticipantsList = self._tabCtrl.newTab( "participantsList", _("Participants"), urlHandlers.UHConfModifParticipants.getURL( self._conf ) ) 3322 3322 self._tabStatistics = self._tabCtrl.newTab("statistics", _("Statistics"), urlHandlers.UHConfModifParticipantsStatistics.getURL(self._conf)) 3323 3323 if self._conf.getParticipation().getPendingParticipantList() and nowutc() < self._conf.getStartDate(): -
indico/MaKaC/webinterface/rh/conferenceModif.py
r1a8f22 rb7f4ee 1708 1708 return conferences.WPConferenceModificationClosed( self, self._target ).display() 1709 1709 else: 1710 return conferences.WPConfModifParticipants Setup( self, self._target ).display()1711 1712 class RHConfModifParticipants List(RHConferenceModifBase):1713 _uh = urlHandlers.UHConfModifParticipants List1710 return conferences.WPConfModifParticipants( self, self._target ).display() 1711 1712 class RHConfModifParticipantsSetup(RHConferenceModifBase): 1713 _uh = urlHandlers.UHConfModifParticipantsSetup 1714 1714 1715 1715 def _process( self ): … … 1717 1717 return conferences.WPConferenceModificationClosed( self, self._target ).display() 1718 1718 else: 1719 return conferences.WPConfModifParticipants ( self, self._target ).display()1719 return conferences.WPConfModifParticipantsSetup( self, self._target ).display() 1720 1720 1721 1721 class RHConfModifParticipantsPending(RHConferenceModifBase): -
indico/MaKaC/webinterface/tpls/ConferenceParticipants.tpl
r9dd174 rb7f4ee 22 22 <li><a href="#" id="add_existing_user">${_("Existing user")}</a></li> 23 23 <li><a href="#" id="add_new_user">${_("New user")}</a></li> 24 % if nowutc() < self_._conf.getStartDate() : 25 <li><a href="#" id="invite_users">${_("Invite")}</a></li> 26 % endif 24 27 </ul> 25 28 </li> 26 % if nowutc() < self_._conf.getStartDate() :27 <li class="middle">28 <a href="#" id="invite_users">${_("Invite")}</a>29 </li>30 % endif31 29 <li class="middle"> 32 30 <a href="#" id="remove_users">${_("Remove")}</a> … … 209 207 }; 210 208 211 var actionUsers = function(method){212 var arrayChecked=[];213 if (atLeastOneParticipantSelected()){214 $("input:checkbox:checked").each(function() {215 arrayChecked.push($(this).val());216 });217 var killProgress = IndicoUI.Dialogs.Util.progress("Processing...");218 var success = false;219 jsonRpc(Indico.Urls.JsonRpcService, method,220 { confId: "${self_._conf.getId()}",221 userIds: arrayChecked },222 function(result, error){223 killProgress();224 if (exists(error)) {225 IndicoUtil.errorReport(error);226 } else if(result.infoWarning){227 (new WarningPopup($T("Warning"),result.infoWarning)).open();228 } else if(result.emailed){229 success = true;230 (new WarningPopup($T("Done"),result.emailed)).open();231 }232 success = true;233 });234 return success;235 }};236 237 238 209 var searchUsers = function(title, handler) { 239 210 var chooseUsersPopup = new ChooseUsersPopup(title, true, ${self_._conf.getId()}, true, … … 258 229 IndicoUtil.errorReport(error); 259 230 } else { 260 $("input:checkbox:checked").parents("tr[id^=participant]").hide("highlight", {color:"#881122"}, 1500, function(){$(this).remove();checkNumberParticipants();}); 231 $("input:checkbox:checked").parents("tr[id^=participant]").remove(); 232 checkNumberParticipants(); 261 233 } 262 234 }); … … 271 243 participantsChecked[$(this).val()] = $(this).parent().siblings("[id^=nameParticipant]").children("[id^=participantEdit]").text(); 272 244 }); 273 var popup = new ParticipantsEmailPopup($T("Send mail to the participants"),"${conf.getTitle()}", ${conf.getId()}, 245 var popup = new ParticipantsEmailPopup($T("Send mail to the participants"),"${conf.getTitle()}", ${conf.getId()}, 274 246 method, participantsChecked, "${currentUser.getStraightFullName()}", 275 247 null, null, legends, function() { 276 alert($T('E-mail sent!'));248 (new AlertPopup($T("E-mail sent"), $T('An e-mail has been sent to ') +_.values(participantsChecked).join(", ") + ".")).open(); 277 249 deselectAll(); 278 250 }); … … 283 255 284 256 var manageAttendance = function(method, target, type){ 285 if(actionUsers(method) == true) { 286 $('input:checkbox:checked[id^=checkParticipant]').parent().siblings("td[id^="+target+"]").text(type); 287 $('input:checkbox:checked[id^=checkParticipant]').parents('tr[id^=participant]').effect("highlight", {}, 1500, deselectAll()); 257 var arrayChecked=[]; 258 if (atLeastOneParticipantSelected()){ 259 $("input:checkbox:checked").each(function() { 260 arrayChecked.push($(this).val()); 261 }); 262 var killProgress = IndicoUI.Dialogs.Util.progress("Processing..."); 263 jsonRpc(Indico.Urls.JsonRpcService, method, 264 { confId: "${self_._conf.getId()}", 265 userIds: arrayChecked }, 266 function(result, error){ 267 killProgress(); 268 if (exists(error)) { 269 IndicoUtil.errorReport(error); 270 } else { 271 $('input:checkbox:checked[id^=checkParticipant]').parent().siblings("td[id^="+target+"]").text(type); 272 $('input:checkbox:checked[id^=checkParticipant]').parents('tr[id^=participant]').effect("highlight", {}, 1500, deselectAll()); 273 } 274 }); 288 275 } 289 276 return false; … … 301 288 $('#add_new_user').bind('menu_select', function() { 302 289 var onSuccess = function(result){ 303 $(result).insertAfter($("#headParticipants")). effect("highlight", {}, 3000);290 $(result).insertAfter($("#headParticipants")).filter("tr[id^=participant]").effect("highlight",{},3000) 304 291 actionParticipantRows(); 305 292 checkNumberParticipants(); -
indico/MaKaC/webinterface/tpls/ConferenceParticipantsPending.tpl
r96c522 rb7f4ee 130 130 131 131 var pendingHandler = function(){ 132 $('input:checkbox:checked[id^=checkPending]').parents('tr[id^=pending]').hide("highlight", {color:"#881122"}, 1500, function(){ 133 $(this).remove(); 134 checkNumberPending(); 135 }); 132 $('input:checkbox:checked[id^=checkPending]').parents('tr[id^=pending]').remove(); 133 checkNumberPending(); 136 134 }; 137 135 … … 142 140 arrayChecked.push($(this).val()); 143 141 }); 142 144 143 var killProgress = IndicoUI.Dialogs.Util.progress("Processing..."); 145 144 jsonRpc(Indico.Urls.JsonRpcService, method, … … 168 167 var legends = {'confTitle':$T('field containing the conference title. (This field is mandatory)'), 169 168 'name':$T('field containing the full name of the participant.(This field is mandatory)')}; 170 var popup = new ParticipantsEmailPopup($T("Send mail to the participants"),"${conf.getTitle()}", ${conf.getId()}, 'event.participation.rejectPending ', participantsChecked, '${currentUser.getStraightFullName()}' ,subject, body, legends, pendingHandler);169 var popup = new ParticipantsEmailPopup($T("Send mail to the participants"),"${conf.getTitle()}", ${conf.getId()}, 'event.participation.rejectPendingWithEmail', participantsChecked, '${currentUser.getStraightFullName()}' ,subject, body, legends, pendingHandler); 171 170 popup.open(); 172 171 } -
indico/MaKaC/webinterface/urlHandlers.py
r1a8f22 rb7f4ee 1598 1598 _relativeURL = "confModifDisplay.py/savePic" 1599 1599 1600 class UHConfModifParticipants List( URLHandler ):1601 _relativeURL = "confModifParticipants.py/ list"1600 class UHConfModifParticipantsSetup( URLHandler ): 1601 _relativeURL = "confModifParticipants.py/setup" 1602 1602 1603 1603 class UHConfModifParticipantsPending( URLHandler ): -
indico/htdocs/confModifParticipants.py
r1a8f22 rb7f4ee 26 26 return conferenceModif.RHConfModifParticipants( req ).process( params ) 27 27 28 def list( req, **params ):29 return conferenceModif.RHConfModifParticipants List( req ).process( params )28 def setup ( req, **params ): 29 return conferenceModif.RHConfModifParticipantsSetup( req ).process( params ) 30 30 31 31 def pendingParticipants( req, **params ): -
indico/htdocs/js/indico/Display/Dialogs.js
r9f657d rb7f4ee 31 31 [$T('First Name'), $B(self.parameterManager.add(Html.edit({style: {width: '200px'}}), 'text', false), self.userData.accessor('name'))], 32 32 [$T('Affiliation'), $B(Html.edit({style: {width: '200px'}}), self.userData.accessor('affiliation'))], 33 [$T('Email'), $B(self.parameterManager.add(Html.edit({style: {width: '200px'}}), 'email', true), self.userData.accessor('email'))],33 [$T('Email'), $B(self.parameterManager.add(Html.edit({style: {width: '200px'}}), 'email', false), self.userData.accessor('email'))], 34 34 [$T('Address'), $B(Html.textarea({style: {width: '200px'}}), self.userData.accessor('address'))], 35 35 [$T('Telephone'), $B(Html.edit({style: {width: '150px'}}), self.userData.accessor('phone'))],
Note: See TracChangeset
for help on using the changeset viewer.
