Index: api/src/java/org/sakaiproject/signup/hbm/SignupMeeting.hbm.xml =================================================================== --- api/src/java/org/sakaiproject/signup/hbm/SignupMeeting.hbm.xml (revision 76843) +++ api/src/java/org/sakaiproject/signup/hbm/SignupMeeting.hbm.xml (working copy) @@ -45,7 +45,9 @@ - + + + Index: api/src/java/org/sakaiproject/signup/model/SignupMeeting.java =================================================================== --- api/src/java/org/sakaiproject/signup/model/SignupMeeting.java (revision 76843) +++ api/src/java/org/sakaiproject/signup/model/SignupMeeting.java (working copy) @@ -94,8 +94,27 @@ private boolean emailAttendeesOnly; private boolean allowAttendance; + + private Integer maxNumOfSlots; /** + * get how many slots allowed for one user to sign in in this meeting + * + * @return String, the slot number (It is a number, for compatible with the existing data, we use a string to + avoid the existing null data. + */ + public Integer getMaxNumOfSlots() { + if(maxNumOfSlots == null){ + maxNumOfSlots= new Integer(1);//default + } + return maxNumOfSlots; + } + + public void setMaxNumOfSlots(Integer maxNumOfSlots) { + this.maxNumOfSlots = maxNumOfSlots; + } + + /** * check if the meeting/event is cancelled * * @return true if the meeting/event is cancelled Index: api/src/java/org/sakaiproject/signup/restful/SignupEvent.java =================================================================== --- api/src/java/org/sakaiproject/signup/restful/SignupEvent.java (revision 76843) +++ api/src/java/org/sakaiproject/signup/restful/SignupEvent.java (working copy) @@ -123,6 +123,9 @@ private String userActionType; private boolean allowAttendance; + + /*max # of slots, which user is allowed to sign-up*/ + private Integer maxNumOfSlots; public String getId() { if (entityID == null) { @@ -768,4 +771,12 @@ this.userActionWarningMsg = userActionWarningMsg; } + public Integer getMaxNumOfSlots() { + return maxNumOfSlots; + } + + public void setMaxNumOfSlots(Integer maxNumOfSlots) { + this.maxNumOfSlots = maxNumOfSlots; + } + } Index: resources/updateSqlScripts/Signup82MySqlScript.sql =================================================================== --- resources/updateSqlScripts/Signup82MySqlScript.sql (revision 0) +++ resources/updateSqlScripts/Signup82MySqlScript.sql (revision 0) @@ -0,0 +1,2 @@ +ALTER TABLE 'signup_meetings' ADD 'maxnumof_slot' integer default 1; + Index: resources/updateSqlScripts/Signup82OracleScript.sql =================================================================== --- resources/updateSqlScripts/Signup82OracleScript.sql (revision 0) +++ resources/updateSqlScripts/Signup82OracleScript.sql (revision 0) @@ -0,0 +1 @@ +ALTER TABLE signup_meetings ADD maxnumof_slot number(10,0) default 1; Index: tool/src/bundle/messages.properties =================================================================== --- tool/src/bundle/messages.properties (revision 76843) +++ tool/src/bundle/messages.properties (working copy) @@ -369,6 +369,8 @@ event_close_other_default_setting=Hide the other default settings event_publish_to_calendar=Publish to Calendar: event_yes_publish_to_calendar= Yes, publish the meeting to the Schedule tool. +event_allowed_slots=Max # of time slots per participant: +event_allowed_slots_comments= Yes, allow participants to sign up for more than one time slot. event_hide_custom_ts=Hide custom defined timeslots event_show_custom_ts=Show custom-defined timeslots title_tip_click_hide_schedule =Click to hide schedule details. Index: tool/src/bundle/messages_es.properties =================================================================== --- tool/src/bundle/messages_es.properties (revision 76843) +++ tool/src/bundle/messages_es.properties (working copy) @@ -30,6 +30,8 @@ label_announcement=Reunión abierta (no es necesario inscribirse) label_custom_timeslots=Intervalos de tiempo avanzados definidos por el usuario +event_allowed_slots=# máximo de segmentos de tiempo por participante: +event_allowed_slots_comments= Sí, permiten a los participantes a inscribirse en horario de más de un. event_step4_page_title=Disponibilidad de inscripción event_signup_begins=La inscripción empieza: before_event_start= antes de que empiece la reunión Index: tool/src/bundle/signupConfig.properties =================================================================== --- tool/src/bundle/signupConfig.properties (revision 76843) +++ tool/src/bundle/signupConfig.properties (working copy) @@ -29,3 +29,6 @@ #configure whether the event will be published in Calendar tool signup.default.export.to.calendar.setting=true + +signup.maxAttendeesPerSlot=500 +signup.maxSlots=500 Index: tool/src/java/org/sakaiproject/signup/tool/entityproviders/SignupObjectConverter.java =================================================================== --- tool/src/java/org/sakaiproject/signup/tool/entityproviders/SignupObjectConverter.java (revision 76843) +++ tool/src/java/org/sakaiproject/signup/tool/entityproviders/SignupObjectConverter.java (working copy) @@ -91,6 +91,7 @@ se.setAllowAttendance(sm.isAllowAttendance()); se.setAutoReminder(sm.isAutoReminder()); se.setEidInputMode(sm.isEidInputMode()); + se.setMaxNumOfSlots(sm.getMaxNumOfSlots()); if (isDeepCopy) { se.setSignupTimeSlotItems(getSignupTimeslotItems(sm.getSignupTimeSlots(), sm.getPermission().isUpdate(), sakaiFacade)); Index: tool/src/java/org/sakaiproject/signup/tool/jsf/NewSignupMeetingBean.java =================================================================== --- tool/src/java/org/sakaiproject/signup/tool/jsf/NewSignupMeetingBean.java (revision 76843) +++ tool/src/java/org/sakaiproject/signup/tool/jsf/NewSignupMeetingBean.java (working copy) @@ -205,6 +205,26 @@ /* used for jsf parameter passing */ private final static String PARAM_NAME_FOR_ATTENDEE_USERID = "attendeeUserId"; + /* to remember the number of the meeting slots */ + private int maxNumOfSlots; + /* Used for populate the drop down box for the allowed number of meeting slots */ + private List slots; + + public int getMaxNumOfSlots() { + return maxNumOfSlots; + } + + public void setMaxNumOfSlots(int preferredSlot) { + this.maxNumOfSlots = preferredSlot; + } + + public List getSlots(){ + + slots = new ArrayList(); + for (int i =1; i <= numberOfSlots;i++) slots.add(new SelectItem(i, i+"")); + return slots; + } + public String getCurrentUserDisplayName() { return sakaiFacade.getUserDisplayName(sakaiFacade.getCurrentUserId()); } @@ -768,6 +788,8 @@ signupMeeting.setAllowComment(this.allowComment); signupMeeting.setAutoReminder(this.autoReminder); signupMeeting.setEidInputMode(this.eidInputMode); + signupMeeting.setMaxNumOfSlots(new Integer(this.maxNumOfSlots)); + /* add attachments */ signupMeeting.setSignupAttachments(this.attachments); } Index: tool/src/java/org/sakaiproject/signup/tool/jsf/SignupUIBaseBean.java =================================================================== --- tool/src/java/org/sakaiproject/signup/tool/jsf/SignupUIBaseBean.java (revision 77355) +++ tool/src/java/org/sakaiproject/signup/tool/jsf/SignupUIBaseBean.java (working copy) @@ -125,16 +125,35 @@ setCurrentUserSignedup(false);// reset and make sure to capture new // changes int i = 0; + int totalSignedupSlots=0; for (Iterator iter = timeslots.iterator(); iter.hasNext();) { SignupTimeslot elm = (SignupTimeslot) iter.next(); TimeslotWrapper tsw = new TimeslotWrapper(elm, sakaiFacade.getCurrentUserId()); - tsw.setAttendeeWrappers(wrapAttendees(elm.getAttendees())); + + List attendeeWrp = new ArrayList(); + int posIndex = 0; + for (SignupAttendee attendee : elm.getAttendees()) { + AttendeeWrapper attWrp = new AttendeeWrapper(attendee, sakaiFacade.getUserDisplayName(attendee + .getAttendeeUserId())); + attWrp.setPositionIndex(posIndex++); + attendeeWrp.add(attWrp); + + /* current user is already signed up in one of the timeslot */ + if (attendee.getAttendeeUserId().equals(sakaiFacade.getCurrentUserId())) + //setCurrentUserSignedup(true); + totalSignedupSlots++; + } + tsw.setAttendeeWrappers(attendeeWrp); + tsw.setWaitingList(wrapWaiters(elm.getWaitingList())); tsw.setPositionInTSlist(i++); timeslotWrapperList.add(tsw); } - + int preferredSlot = meeting.getMaxNumOfSlots(); + if (totalSignedupSlots >= preferredSlot){ + setCurrentUserSignedup(true); + } setTimeslotWrappers(timeslotWrapperList); } @@ -195,7 +214,7 @@ } /** convert SignupAttendee to AttendeeWrapper object */ - private List wrapAttendees(List attendees) { + /*private List wrapAttendees(List attendees) { List attendeeWrp = new ArrayList(); int posIndex = 0; for (SignupAttendee attendee : attendees) { @@ -204,12 +223,12 @@ attWrp.setPositionIndex(posIndex++); attendeeWrp.add(attWrp); - /* current user is already signed up in one of the timeslot */ + // current user is already signed up in one of the timeslot if (attendee.getAttendeeUserId().equals(sakaiFacade.getCurrentUserId())) setCurrentUserSignedup(true); } return attendeeWrp; - } + }*/ /** convert SignupAttendee to AttendeeWrapper object */ private List wrapWaiters(List attendees) { Index: tool/src/java/org/sakaiproject/signup/tool/jsf/organizer/EditMeetingSignupMBean.java =================================================================== --- tool/src/java/org/sakaiproject/signup/tool/jsf/organizer/EditMeetingSignupMBean.java (revision 76843) +++ tool/src/java/org/sakaiproject/signup/tool/jsf/organizer/EditMeetingSignupMBean.java (working copy) @@ -116,7 +116,7 @@ private boolean userDefinedTS=false; - + List slots; /** * This method will reset everything to orignal value and also initialize @@ -184,7 +184,7 @@ } getUserDefineTimeslotBean().init(this.signupMeeting, MODIFY_MEETING_PAGE_URL, this.customTimeSlotWrpList, UserDefineTimeslotBean.MODIFY_MEETING); - + populateDropDown(); } /* get the relative time out */ @@ -228,6 +228,12 @@ } + + void populateDropDown(){ + slots = new ArrayList(); + for (int i =1; i <= numberOfSlots;i++) slots.add(new SelectItem(i, i+"")); + } + boolean hasUserChangedSignupBeginTime(){ if(this.copyDisplaySignupBegins == getSignupBegins() && getSignupBeginsType().equals(this.copyDisplaySignupBeginsType)) return false; @@ -951,4 +957,12 @@ } } + public List getSlots() { + return slots; + } + + public void setSlots(List slots) { + this.slots = slots; + } + } Index: tool/src/java/org/sakaiproject/signup/tool/jsf/organizer/action/AddAttendee.java =================================================================== --- tool/src/java/org/sakaiproject/signup/tool/jsf/organizer/action/AddAttendee.java (revision 76843) +++ tool/src/java/org/sakaiproject/signup/tool/jsf/organizer/action/AddAttendee.java (working copy) @@ -185,13 +185,19 @@ private void checkForPromotion(SignupMeeting meeting, SignupAttendee newAttendee) throws Exception { String attendeeUserId = newAttendee.getAttendeeUserId(); List signupTimeSlots = meeting.getSignupTimeSlots(); + int totalSignupSlots=0; for (SignupTimeslot timeslot : signupTimeSlots) { List attendees = timeslot.getAttendees(); for (SignupAttendee attendee : attendees) { - if (attendee.getAttendeeUserId().equals(attendeeUserId)) - throw new SignupUserActionException(Utilities.rb.getString("you.promoted.to.another.ts_meanwhile")); + if (attendee.getAttendeeUserId().equals(attendeeUserId)){ + totalSignupSlots++; + } } } + int preferredSlot = meeting.getMaxNumOfSlots().intValue(); + if (totalSignupSlots >=preferredSlot){ + throw new SignupUserActionException(Utilities.rb.getString("you.promoted.to.another.ts_meanwhile")); + } } private SignupMeeting reloadMeeting(Long meetingId) { Index: tool/src/java/org/sakaiproject/signup/tool/jsf/organizer/action/CreateMeetings.java =================================================================== --- tool/src/java/org/sakaiproject/signup/tool/jsf/organizer/action/CreateMeetings.java (revision 76843) +++ tool/src/java/org/sakaiproject/signup/tool/jsf/organizer/action/CreateMeetings.java (working copy) @@ -514,6 +514,7 @@ copy.setAutoReminder(s.isAutoReminder()); copy.setEidInputMode(s.isEidInputMode()); copy.setAllowAttendance(s.isAllowAttendance()); + copy.setMaxNumOfSlots(s.getMaxNumOfSlots()); return copy; Index: tool/src/java/org/sakaiproject/signup/tool/jsf/organizer/action/EditMeeting.java =================================================================== --- tool/src/java/org/sakaiproject/signup/tool/jsf/organizer/action/EditMeeting.java (revision 76843) +++ tool/src/java/org/sakaiproject/signup/tool/jsf/organizer/action/EditMeeting.java (working copy) @@ -110,7 +110,6 @@ private UserDefineTimeslotBean userDefineTimeslotBean; private List toBedeletedTSList = null; - public EditMeeting(String userId, String siteId, SignupMeetingService signupMeetingService, AttachmentHandler attachmentHandler, boolean isOrganizer) { super(userId, siteId, signupMeetingService, isOrganizer); this.attachmentHandler = attachmentHandler; @@ -246,7 +245,7 @@ newlyModifyMeeting.setAutoReminder(modifiedMeeting.isAutoReminder()); newlyModifyMeeting.setEidInputMode(modifiedMeeting.isEidInputMode()); newlyModifyMeeting.setAllowAttendance(modifiedMeeting.isAllowAttendance()); - + newlyModifyMeeting.setMaxNumOfSlots(modifiedMeeting.getMaxNumOfSlots()); /*new attachments changes*/ if(this.currentAttachList !=null){ updateWithOrigalAttachments(newlyModifyMeeting, this.currentAttachList, recurNum);//what to do with recurrence @@ -403,6 +402,7 @@ .getRecurrenceId() != null && originalMeetingCopy.getRecurrenceId().equals( upTodateMeeting.getRecurrenceId()))) || originalMeetingCopy.getNoOfTimeSlots() != upTodateMeeting.getNoOfTimeSlots() + || originalMeetingCopy.getMaxNumOfSlots().intValue() != upTodateMeeting.getMaxNumOfSlots().intValue() || !((originalMeetingCopy.getDescription() == null && upTodateMeeting.getDescription() == null) || (originalMeetingCopy .getDescription() != null && upTodateMeeting.getDescription() != null) && (originalMeetingCopy.getDescription().length() == upTodateMeeting.getDescription().length())) Index: tool/src/webapp/signup/newMeeting/step2.jsp =================================================================== --- tool/src/webapp/signup/newMeeting/step2.jsp (revision 76843) +++ tool/src/webapp/signup/newMeeting/step2.jsp (working copy) @@ -298,6 +298,14 @@ +