Changeset dbc739 in indico
- Timestamp:
- 01/25/10 14:50:18 (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:
- 3cd3b7
- Parents:
- 03e2c9
- git-author:
- Cesar Munoz Orena <cesar.munoz.orena@…> (01/15/10 11:16:52)
- git-committer:
- Pedro Ferreira <jose.pedro.ferreira@…> (01/25/10 14:50:18)
- Location:
- indico
- Files:
-
- 5 edited
-
MaKaC/services/implementation/schedule.py (modified) (3 diffs)
-
htdocs/js/indico/Legacy/Dialogs.js (modified) (12 diffs)
-
htdocs/js/indico/Management/Timetable.js (modified) (10 diffs)
-
htdocs/js/indico/Timetable/Base.js (modified) (1 diff)
-
htdocs/js/indico/Timetable/Management.js (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indico/MaKaC/services/implementation/schedule.py
r03e2c9 rdbc739 368 368 self._description = pManager.extract("description", pType=str, 369 369 allowEmpty=True) 370 self._dayChanged = pManager.extract("dayChanged", pType=bool, allowEmpty=True)371 370 372 371 def _performOperation(self): … … 443 442 sessionServices.SessionSlotModifCoordinationBase._checkParams(self) 444 443 ScheduleEditBreakBase._checkParams(self) 444 if self._schEntry.getStartDate().date() != self._dateTime.date(): 445 self._dayChanged = True 446 else: 447 self._dayChanged = False 445 448 self._brk = self._schEntry 446 449 … … 620 623 self._roomInfo = pManager.extract("roomInfo", pType=dict, allowEmpty=True) 621 624 self._isSessionTimetable = pManager.extract("sessionTimetable", pType=bool, allowEmpty=True) 622 self._dayChanged = pManager.extract("dayChanged", pType=bool, allowEmpty=True)623 625 624 626 def _performOperation(self): -
indico/htdocs/js/indico/Legacy/Dialogs.js
r03e2c9 rdbc739 42 42 info.set('startDateTime', Util.formatDateTime(startDate, IndicoDateTimeFormats.Server)); 43 43 info.set('endDateTime', Util.formatDateTime(endDate, IndicoDateTimeFormats.Server)); 44 dateArgs.startDate = startDate; 45 dateArgs.endDate = endDate; 44 46 hook.set(true); 45 47 } … … 124 126 days, 125 127 function(elem) { 126 var d = Util.formatDateTime(elem, IndicoDateTimeFormats. International, IndicoDateTimeFormats.Ordinal);128 var d = Util.formatDateTime(elem, IndicoDateTimeFormats.DefaultHourless, IndicoDateTimeFormats.Ordinal); 127 129 return Html.option({value: elem}, d); 128 130 } … … 134 136 conferenceDays.observe(function(value) { 135 137 //it is neccesary to update the date in dateArgs with the new date to make the request 136 dateArgs.selectedDay = Util.formatDateTime(value, IndicoDateTimeFormats.Server , IndicoDateTimeFormats.Ordinal);138 dateArgs.selectedDay = Util.formatDateTime(value, IndicoDateTimeFormats.ServerHourless, IndicoDateTimeFormats.Ordinal); 137 139 //we make a timeStartMethod request specifying the date for the request 138 140 //and we get the result of the request in result … … 146 148 var endDate = Util.parseJSDateTime(result, IndicoDateTimeFormats.Server); 147 149 148 var diffHours = dateArgs.endDate. time.substr(0,2) - dateArgs.startDate.time.substr(0,2);149 var diffMinutes = Math.abs(dateArgs.endDate. time.substr(3,2) - dateArgs.startDate.time.substr(3,2));150 var diffHours = dateArgs.endDate.getHours() - dateArgs.startDate.getHours(); 151 var diffMinutes = Math.abs(dateArgs.endDate.getMinutes() - dateArgs.startDate.getMinutes()); 150 152 if (startDate.getHours() >= 23) { 151 153 startDate.setHours(23); … … 177 179 toTarget: function (value) { 178 180 var aux = conferenceDays.get(); 179 return Util.formatDateTime(aux, IndicoDateTimeFormats.Server , IndicoDateTimeFormats.Ordinal) + ' ' + value;181 return Util.formatDateTime(aux, IndicoDateTimeFormats.ServerHourless, IndicoDateTimeFormats.Ordinal) + ' ' + value; 180 182 }, 181 183 toSource: function(value) { … … 254 256 255 257 IndicoUtil.waitLoad([ 256 isEdit?function(hook){hook.set(true);}:function(hook) { 258 isEdit?function(hook){ 259 dateArgs.startDate = new Date(dateArgs.startDate.date.substr(0,4), 260 dateArgs.startDate.date.substr(5,2), 261 dateArgs.startDate.date.substr(8,2), 262 dateArgs.startDate.time.substr(0,2), 263 dateArgs.startDate.time.substr(3,2), 264 dateArgs.startDate.time.substr(6,2)); 265 dateArgs.endDate = new Date(dateArgs.endDate.date.substr(0,4), 266 dateArgs.endDate.date.substr(5,2), 267 dateArgs.endDate.date.substr(8,2), 268 dateArgs.endDate.time.substr(0,2), 269 dateArgs.endDate.time.substr(3,2), 270 dateArgs.endDate.time.substr(6,2)); 271 hook.set(true);}:function(hook) { 257 272 // Get "end date" for container, so that the break be added after the rest 258 273 indicoRequest(timeStartMethod, dateArgs , function(result, error){ … … 276 291 endDate.setHours(startDate.getHours()+1); 277 292 } 278 info.set('startDateTime', Util.formatDateTime(startDate, IndicoDateTimeFormats.Server)); 279 info.set('endDateTime', Util.formatDateTime(endDate, IndicoDateTimeFormats.Server)); 293 294 dateArgs.startDate = startDate; 295 dateArgs.endDate = endDate; 296 info.set('startDateTime', Util.formatDateTime(startDate, IndicoDateTimeFormats.ServerHourless)); 297 info.set('endDateTime', Util.formatDateTime(endDate, IndicoDateTimeFormats.ServerHourless)); 280 298 hook.set(true); 281 299 } … … 294 312 }], function(retVal) { 295 313 var submitInfo = function(){ 296 //if the day changed297 if(previousDay != info.get("startDateTime").substr(0,10))298 info.set('dayChanged', true);299 else300 info.set('dayChanged', false);301 314 each(info, function(value, key) { 302 315 args[key] = value; … … 383 396 days, 384 397 function(elem) { 385 var d = Util.formatDateTime(elem, IndicoDateTimeFormats. International, IndicoDateTimeFormats.Ordinal);398 var d = Util.formatDateTime(elem, IndicoDateTimeFormats.DefaultHourless, IndicoDateTimeFormats.Ordinal); 386 399 return Html.option({value: elem}, d); 387 400 } 388 401 ); 389 //the hour added to dayStartDate is irrelevant and it won't be used, it is only passed to avoid the function crash390 402 conferenceDays.set(Util.formatDateTime(dayStartDate, IndicoDateTimeFormats.Ordinal, IndicoDateTimeFormats.ServerHourless)); 391 403 … … 394 406 conferenceDays.observe(function(value) { 395 407 //it is neccesary to update the date in dateArgs with the new date to make the request 396 dateArgs.selectedDay = Util.formatDateTime(value, IndicoDateTimeFormats.Server , IndicoDateTimeFormats.Ordinal);408 dateArgs.selectedDay = Util.formatDateTime(value, IndicoDateTimeFormats.ServerHourless, IndicoDateTimeFormats.Ordinal); 397 409 //we make a timeStartMethod request specifying the date for the request 398 410 //and we get the result of the request in result … … 406 418 var endDate = Util.parseJSDateTime(result, IndicoDateTimeFormats.Server); 407 419 408 var diffHours = dateArgs.endDate. time.substr(0,2) - dateArgs.startDate.time.substr(0,2);409 var diffMinutes = Math.abs(dateArgs.endDate. time.substr(3,2) - dateArgs.startDate.time.substr(3,2));420 var diffHours = dateArgs.endDate.getHours() - dateArgs.startDate.getHours(); 421 var diffMinutes = Math.abs(dateArgs.endDate.getMinutes() - dateArgs.startDate.getMinutes()); 410 422 if (startDate.getHours() >= 23) { 411 423 startDate.setHours(23); … … 436 448 toTarget: function (value) { 437 449 var aux = conferenceDays.get(); 438 return Util.formatDateTime(aux, IndicoDateTimeFormats.Server , IndicoDateTimeFormats.Ordinal) + ' ' + value;450 return Util.formatDateTime(aux, IndicoDateTimeFormats.ServerHourless, IndicoDateTimeFormats.Ordinal) + ' ' + value; 439 451 }, 440 452 toSource: function(value) { -
indico/htdocs/js/indico/Management/Timetable.js
r03e2c9 rdbc739 213 213 } 214 214 self.startTimeField.set(Util.formatDateTime(startDate, IndicoDateTimeFormats.Server).substr(11,5)); 215 216 215 self.info.set('startDate', Util.formatDateTime(startDate, IndicoDateTimeFormats.ServerHourless)); 217 216 hook.set(true); … … 291 290 info.set('privileges', presListWidget.getPrivileges()); 292 291 293 conferenceDays.set(Util.formatDateTime(self.datStartDate + ' ' + self.confStartDate.substr(11,5), IndicoDateTimeFormats.Ordinal, IndicoDateTimeFormats.ServerHourless));292 conferenceDays.set(Util.formatDateTime(self.datStartDate, IndicoDateTimeFormats.Ordinal, IndicoDateTimeFormats.ServerHourless)); 294 293 295 294 //We need to update the value of Time and endDateTime every time that is changed by the user … … 297 296 conferenceDays.observe(function(value) { 298 297 //it is neccesary to update the date in dateArgs with the new date 299 self.dateArgs.selectedDay = Util.formatDateTime(value, IndicoDateTimeFormats.Server , IndicoDateTimeFormats./*DefaultHourless*/Ordinal);298 self.dateArgs.selectedDay = Util.formatDateTime(value, IndicoDateTimeFormats.ServerHourless, IndicoDateTimeFormats./*DefaultHourless*/Ordinal); 300 299 //but we need to check if the contribution is inside a session and if the day changed, in order 301 300 //to make the request for the session timetable or the top level timetable 302 303 if(self.timetable.IntervalTimetableMixin){ 304 if(self.previousDate.substr(0,10) != self.dateArgsselectedDay) 305 self.timeStartMethod = "schedule.event.getDayEndDate"; 301 if(exists(self.timetable.parentTimetable)){ 302 if(self.previousDate.substr(0,10) != self.dateArgs.selectedDay) 303 self.timeStartMethod = self.timetable.managementActions.methods['Event'].getDayEndDate; 306 304 else 307 self.timeStartMethod = "schedule.slot.getDayEndDate";305 self.timeStartMethod = self.timetable.managementActions.methods['SessionSlot'].getDayEndDate; 308 306 } 309 307 … … 338 336 toTarget: function (value) { 339 337 var aux = conferenceDays.get(); 340 return Util.formatDateTime(aux, IndicoDateTimeFormats.Server , IndicoDateTimeFormats.Ordinal) + ' ' + value;338 return Util.formatDateTime(aux, IndicoDateTimeFormats.ServerHourless, IndicoDateTimeFormats.Ordinal) + ' ' + value; 341 339 }, 342 340 toSource: function(value) { … … 458 456 self.info.set(key, value); 459 457 }); 458 460 459 if (self.parameterManager.check()) { 461 460 var killProgress = IndicoUI.Dialogs.Util.progress(); … … 494 493 addButton.observeClick(function(){ 495 494 //check if the day changed 496 if(Util.formatDateTime(conferenceDays.get(), IndicoDateTimeFormats.Server , IndicoDateTimeFormats.Ordinal) !=495 if(Util.formatDateTime(conferenceDays.get(), IndicoDateTimeFormats.ServerHourless, IndicoDateTimeFormats.Ordinal) != 497 496 self.previousDate.substr(0,10)){ 498 497 self.dayChanged = true; 499 498 } 500 self.info.set("dayChanged", self.dayChanged);501 499 502 500 //if we are inside a session and the new contribution is set for a different day, we suppose that the contribution is not part of the session 503 if(self. method == "schedule.slot.addContribution" && self.dayChanged){504 self.method = "schedule.event.addContribution";501 if(self.dayChanged){ 502 self.method = self.timetable.managementActions.methods['Contribution'].add; 505 503 } 506 504 submitInfo(); … … 708 706 self.dayChanged = true; 709 707 } 710 self.info.set("dayChanged", self.dayChanged);711 708 if (self.isEdit) { 712 709 self._saveInfo(); 713 710 } else { 714 711 //in case we're inside a session and the break is added to a different day, we suppose it's not inside the session anymore 715 if(self.method == "schedule.slot.addBreak" && self.dayChanged){ 716 self.method = "schedule.event.addBreak"; 712 if(self.dayChanged){ 713 self.method = self.managementActions.methods['Break'].add; 714 } 715 else{ 716 if(exists(self.managementActions.timetable.parentTimetable)) 717 self.method = self.managementActions.methods['SessionBreak'].add; 717 718 } 718 719 self._submitInfo(); … … 725 726 self.days, 726 727 function(elem) { 727 var d = Util.formatDateTime(elem, IndicoDateTimeFormats. International, IndicoDateTimeFormats.Ordinal);728 var d = Util.formatDateTime(elem, IndicoDateTimeFormats.DefaultHourless, IndicoDateTimeFormats.Ordinal); 728 729 return Html.option({value: elem}, d); 729 730 } 730 731 ); 731 732 732 conferenceDays.set(Util.formatDateTime(self.info.get('startDate'), IndicoDateTimeFormats.Ordinal, IndicoDateTimeFormats.Server Hourless));733 conferenceDays.set(Util.formatDateTime(self.info.get('startDate'), IndicoDateTimeFormats.Ordinal, IndicoDateTimeFormats.Server/*Hourless*/)); 733 734 734 735 //We need to update the value of Time and endDateTime every time that is changed by the user … … 736 737 conferenceDays.observe(function(value) { 737 738 //it is neccesary to update the date in dateArgs with the new date to make the request 738 self.dateArgs.set("selectedDay", Util.formatDateTime(value, IndicoDateTimeFormats.Server , IndicoDateTimeFormats.Ordinal));739 self.dateArgs.set("selectedDay", Util.formatDateTime(value, IndicoDateTimeFormats.ServerHourless, IndicoDateTimeFormats.Ordinal)); 739 740 //but we need to check if are inside a session and if the day changed, in order 740 741 //to make the request for the session timetable or the top level timetable 741 742 742 if(self. managementActions.timetable.IntervalTimetableMixin &&743 if(self.previousDate.substr(0,10) != self.dateArgs.get('selectedDay')){ 743 744 /* if we chose a different day, it doesn't matter 744 745 if we are inside a session */ 745 self.previousDate.substr(0,10) != 746 self.dateArgs.get('selectedDay')){ 747 self.timeStartMethod = "schedule.event.getDayEndDate"; 748 } else { 749 self.timeStartMethod = "schedule.slot.getDayEndDate"; 750 } 746 self.timeStartMethod = self.managementActions.methods['Event'].dayEndDate; 747 } else { 748 if(exists(self.managementActions.timetable.parentTimetable)) 749 self.timeStartMethod = self.managementActions.methods[self.originalArgs.parentType].dayEndDate; 751 750 } 751 752 752 //we make a timeStartMethod request specifying the date for the request 753 753 //and we get the result of the request as a result 754 indicoRequest(self.timeStartMethod, self.dateArgs , function(result, error){754 indicoRequest(self.timeStartMethod, self.dateArgs, function(result, error){ 755 755 if (error) { 756 756 IndicoUtil.errorReport(error); … … 778 778 toTarget: function (value) { 779 779 var aux = conferenceDays.get(); 780 return Util.formatDateTime(aux, IndicoDateTimeFormats.Server , IndicoDateTimeFormats.Ordinal) + ' ' + value;780 return Util.formatDateTime(aux, IndicoDateTimeFormats.ServerHourless, IndicoDateTimeFormats.Ordinal) + ' ' + value; 781 781 }, 782 782 toSource: function(value) { -
indico/htdocs/js/indico/Timetable/Base.js
r03e2c9 rdbc739 268 268 }, 269 269 270 getDays: function() { 271 return keys(this.data);270 getDays: function() { 271 return this.sortedKeys; 272 272 }, 273 273 -
indico/htdocs/js/indico/Timetable/Management.js
r03e2c9 rdbc739 338 338 this.eventInfo.isConference, 339 339 this.eventInfo.favoriteRooms, 340 days .reverse(),340 days, 341 341 this.timetable, 342 342 function(result) { … … 364 364 $O(params.roomInfo), 365 365 false, 366 days .reverse(),366 days, 367 367 this.eventInfo.favoriteRooms); 368 368 … … 404 404 $O(params.roomInfo), 405 405 true, 406 days .reverse(),406 days, 407 407 this.eventInfo.favoriteRooms); 408 408 editDialog.open(); … … 416 416 417 417 //Get the days in which the conference is being held 418 var days = keys(this.timetable.getData());418 var days = this.timetable.getDays(); 419 419 420 420 IndicoUI.Dialogs.addSession( … … 426 426 params.selectedDay, 427 427 this.eventInfo.favoriteRooms, 428 days .reverse(),428 days, 429 429 function(result) { self.timetable._updateEntry(result, result.id); }); 430 430 }, … … 436 436 437 437 //Get the days in which the conference is being held 438 var days = keys(this.timetable.getData());438 var days = this.timetable.getDays(); 439 439 440 440 IndicoUI.Dialogs.addSessionSlot( … … 447 447 params.selectedDay, 448 448 this.eventInfo.favoriteRooms, 449 days .reverse(),449 days, 450 450 function(result) { self.timetable._updateEntry(result, result.id); } 451 451 ); … … 459 459 460 460 //Get the days in which the conference is being held 461 var days = keys(this.timetable.getData());461 var days = this.timetable.getDays(); 462 462 463 463 each(eventData, function(value, key) { … … 477 477 params.selectedDay, 478 478 this.eventInfo.favoriteRooms, 479 days .reverse(),479 days, 480 480 function(result) { 481 481 var aux = result.entry.entries
Note: See TracChangeset
for help on using the changeset viewer.
