Changeset 03e2c9 in indico
- Timestamp:
- 01/25/10 14:50:17 (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, b8c30da8ebdbdcbd675a873997cc3e95f567de49, 4287315ec967a3da168d83963c14001db8487d53
- Children:
- dbc739
- Parents:
- 93394d
- git-author:
- Pedro Ferreira <jose.pedro.ferreira@…> (01/13/10 12:10:00)
- git-committer:
- Pedro Ferreira <jose.pedro.ferreira@…> (01/25/10 14:50:17)
- Location:
- indico
- Files:
-
- 9 edited
-
MaKaC/conference.py (modified) (3 diffs)
-
MaKaC/schedule.py (modified) (4 diffs)
-
MaKaC/services/implementation/schedule.py (modified) (3 diffs)
-
htdocs/js/indico/Core/Data.js (modified) (7 diffs)
-
htdocs/js/indico/Legacy/Dialogs.js (modified) (11 diffs)
-
htdocs/js/indico/Legacy/Widgets.js (modified) (4 diffs)
-
htdocs/js/indico/Management/Timetable.js (modified) (23 diffs)
-
htdocs/js/indico/Timetable/Base.js (modified) (2 diffs)
-
htdocs/js/indico/Timetable/Management.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indico/MaKaC/conference.py
r93394d r03e2c9 6877 6877 self.setEndDate(st,2) 6878 6878 6879 def setValues(self,data,check=2, moveEntriesBelow=0 ,):6879 def setValues(self,data,check=2, moveEntriesBelow=0): 6880 6880 """check parameter: 6881 6881 0: no check at all … … 6883 6883 2: check and adapt the owner dates 6884 6884 """ 6885 6885 6886 6886 # In order to move the entries below, it is needed to know the diff (we have to move them) 6887 6887 # and the list of entries to move. It's is needed to take those datas in advance because they … … 6939 6939 elif sDate != None: 6940 6940 sDateUTC = sDate.astimezone(timezone('UTC')) 6941 self.setStartDate(sDateUTC,check,moveEntries=move) 6941 self.setStartDate(sDateUTC,check,moveEntries=move) 6942 6942 if data.get("durHours","")!="" and data.get("durMins","")!="": 6943 6943 self.setDuration(hours=data["durHours"],minutes=data["durMins"],check=check) -
indico/MaKaC/schedule.py
r93394d r03e2c9 103 103 """Tells wether there is any entry after the specified date 104 104 """ 105 entries=self.getEntries() 105 106 if len(entries)==0: 106 107 return False … … 108 109 109 110 def checkSanity( self ): 110 entries=self.getEntries()111 111 if self.hasEntriesBefore(self.getStartDate()) or self.hasEntriesAfter(self.getEndDate()): 112 112 raise TimingError("Sorry, cannot perform this date change: Some entries in the timetable would be outside the new dates [conference id => %s ]"%(self.getOwner().getConference().getId())) … … 307 307 return self.calculateDayEndDate(day) 308 308 309 def calculateDayEndDate(self,day,hour=0,min=0): 309 def calculateDayEndDate(self,day,hour=0,min=0): 310 310 if day is None: 311 311 return self.calculateEndDate() … … 357 357 if not day.tzinfo: 358 358 day = timezone(self.getTimezone()).localize(day) 359 res = [] 359 res = [] 360 360 for entry in self.getEntries(): 361 361 if entry.inDay( day ): -
indico/MaKaC/services/implementation/schedule.py
r93394d r03e2c9 368 368 self._description = pManager.extract("description", pType=str, 369 369 allowEmpty=True) 370 self._dayChanged = pManager.extract("dayChanged", pType=bool, allowEmpty=True) 370 self._dayChanged = pManager.extract("dayChanged", pType=bool, allowEmpty=True) 371 371 372 372 def _performOperation(self): … … 446 446 447 447 def _addToSchedule(self, b): 448 if self._dayChanged: 449 owner = self._schEntry.getOwner() 448 if self._dayChanged: 449 owner = self._schEntry.getOwner() 450 450 451 451 self._schEntry.getSchedule().removeEntry(self._schEntry) 452 452 453 453 self._schEntry.setStartDate(self._dateTime) 454 if isinstance(owner, conference.Contribution):455 owner.setSession(None)456 454 self._conf.getSchedule().addEntry(self._schEntry, check=2) 457 455 … … 626 624 def _performOperation(self): 627 625 #if there is something inside the session we have to move it as well 626 627 values = {"title": self._title or "", 628 "sDate": self._startDateTime, 629 "eDate": self._endDateTime} 630 628 631 if len(self._slot.getEntries()) != 0 : 629 self._slot.setValues({"title": self._title or "", 630 "sDate": self._startDateTime, 631 "eDate": self._endDateTime, 632 "move": 1}) 633 else: 634 self._slot.setValues({"title": self._title or "", 635 "sDate": self._startDateTime, 636 "eDate": self._endDateTime}) 632 values.update({"move": 1}) 633 634 self._slot.setValues(values) 635 637 636 self. _addConveners(self._slot) 638 637 self._setLocationInfo(self._slot) -
indico/htdocs/js/indico/Core/Data.js
r93394d r03e2c9 11 11 12 12 // [1234.]s0.0 13 m = id.match(/^(?:([^\.]+)\.)s(\d+)( \.|l)(\d+)$/);14 if (m) { 15 return concat(["SessionSlot"], /*m.slice(1)*/concat(m.slice(1,3), m.slice(4)));13 m = id.match(/^(?:([^\.]+)\.)s(\d+)(?:\.|l)(\d+)$/); 14 if (m) { 15 return concat(["SessionSlot"], m.slice(1)); 16 16 } 17 17 … … 45 45 var m1 = null, m2 = null; 46 46 47 if (obj == null) {47 if (obj === null) { 48 48 return null; 49 49 } … … 54 54 } else if (typeof(obj) == 'object'){ 55 55 // handle datetime dictionaries 56 // data comes from the server in %Y-%m-%d %H:%M 57 m1 = obj.date.match(/(\d+)[- /](\d+)[-/](\d+)/);56 // data comes from the server in %Y-%m-%d %H:%M:%S 57 m1 = obj.date.match(/(\d+)[-\/](\d+)[-\/](\d+)/); 58 58 m2 = obj.time.match(/(\d+):(\d+):(\d+)/); 59 59 } else if (sourceFormat){ … … 66 66 m1 = [null, results['%Y'], results['%m'], results['%d']]; 67 67 //If we do not want to show the hour 68 if(sourceFormat == IndicoDateTimeFormats.InternationalHourLess || sourceFormat == IndicoDateTimeFormats.ServerHourSlashLess) 69 m2 = [null, '', '', '']; 70 else 71 m2 = [null, results['%H'], results['%M'], results['%S']]; 68 m2 = [null, any(results['%H'],''), any(results['%M'],''), any(results['%S'],'')]; 72 69 } else { 73 70 throw 'unknown source object'; … … 78 75 } 79 76 80 // follow the formatting rules. If no time needed we need to delete the ' :' after the date81 var s = '';82 if(sourceFormat != IndicoDateTimeFormats.InternationalHourLess && sourceFormat != IndicoDateTimeFormats.ServerHourSlashLess)83 s = ':';84 77 return format.replace('%Y', zeropad(m1[1])). 85 78 replace('%m', zeropad(m1[2])). … … 87 80 replace('%H', zeropad(m2[1])). 88 81 replace('%M', zeropad(m2[2])). 89 replace('%S', zeropad(m2[3])). 90 replace(' :', s); 82 replace('%S', zeropad(m2[3])); 91 83 }, 92 84 … … 190 182 International: '%d/%m/%Y %H:%M', 191 183 ISO8601: '%Y/%m/%d %H:%M', 192 Default: '%d/%m/%Y %H:%M', 193 DefaultHourless: '%d/%m/%Y', 194 InternationalHourLess: '%d/%m/%Y', 195 ServerHourSlashLess: '%Y%m%d' 184 Ordinal: '%Y%m%d' 196 185 }; 186 187 IndicoDateTimeFormats.Default = IndicoDateTimeFormats.International; 188 IndicoDateTimeFormats.Server = IndicoDateTimeFormats.ISO8601; 189 190 IndicoDateTimeFormats.DefaultHourless = IndicoDateTimeFormats.Default.split(' ')[0]; 191 IndicoDateTimeFormats.ServerHourless = IndicoDateTimeFormats.Server.split(' ')[0]; -
indico/htdocs/js/indico/Legacy/Dialogs.js
r93394d r03e2c9 124 124 days, 125 125 function(elem) { 126 var d = Util.formatDateTime(elem, IndicoDateTimeFormats.International, IndicoDateTimeFormats. ServerHourSlashLess);126 var d = Util.formatDateTime(elem, IndicoDateTimeFormats.International, IndicoDateTimeFormats.Ordinal); 127 127 return Html.option({value: elem}, d); 128 128 } 129 129 ); 130 //the hour added to dayStartDate is irrelevant and it won't be used, it is only passed to avoid the function crash 131 conferenceDays.set(Util.formatDateTime(dayStartDate + ' 00:00', IndicoDateTimeFormats.ServerHourSlashLess, IndicoDateTimeFormats.Server)); 132 130 conferenceDays.set(Util.formatDateTime(dayStartDate, IndicoDateTimeFormats.Ordinal, IndicoDateTimeFormats.ServerHourless)); 131 133 132 //We need to update the value of startDateTime and endDateTime every time that is changed by the user 134 133 //value is the new date 135 134 conferenceDays.observe(function(value) { 136 135 //it is neccesary to update the date in dateArgs with the new date to make the request 137 dateArgs.selectedDay = Util.formatDateTime(value, IndicoDateTimeFormats.Server, IndicoDateTimeFormats. ServerHourSlashLess);136 dateArgs.selectedDay = Util.formatDateTime(value, IndicoDateTimeFormats.Server, IndicoDateTimeFormats.Ordinal); 138 137 //we make a timeStartMethod request specifying the date for the request 139 138 //and we get the result of the request in result … … 146 145 var startDate = Util.parseJSDateTime(result, IndicoDateTimeFormats.Server); 147 146 var endDate = Util.parseJSDateTime(result, IndicoDateTimeFormats.Server); 148 147 149 148 var diffHours = dateArgs.endDate.time.substr(0,2) - dateArgs.startDate.time.substr(0,2); 150 149 var diffMinutes = Math.abs(dateArgs.endDate.time.substr(3,2) - dateArgs.startDate.time.substr(3,2)); … … 154 153 endDate.setHours(23); 155 154 endDate.setMinutes(59); 156 } else { 155 } else { 157 156 endDate.setHours(startDate.getHours()+diffHours); 158 157 endDate.setMinutes(startDate.getMinutes()+diffMinutes); … … 162 161 } 163 162 }); 164 163 165 164 /* 166 165 * parameterManager is not called because if you just change the date and it's not correct you just need 167 166 * to have red fields in the date, so what we're doing is just adding a dispatchEvent for both hour fields 168 * (they are Html.input, so they can be added to the dispatchEvent) to know when they have changed 167 * (they are Html.input, so they can be added to the dispatchEvent) to know when they have changed 169 168 */ 170 169 startEndTimeField.startTimeField.dispatchEvent('change'); 171 170 startEndTimeField.endTimeField.dispatchEvent('change'); 172 171 }); 173 172 174 173 var startEndTimeField = IndicoUI.Widgets.Generic.dateStartEndTimeField(info.get('startDateTime').substr(11,5), info.get('endDateTime').substr(11,5)); 175 174 var startEndTimeComponent; … … 178 177 toTarget: function (value) { 179 178 var aux = conferenceDays.get(); 180 return Util.formatDateTime(aux, IndicoDateTimeFormats.Server, IndicoDateTimeFormats. ServerHourSlashLess) + ' ' + value;179 return Util.formatDateTime(aux, IndicoDateTimeFormats.Server, IndicoDateTimeFormats.Ordinal) + ' ' + value; 181 180 }, 182 181 toSource: function(value) { … … 247 246 var args = isEdit?params:params.args 248 247 var dateArgs = clone(args); 249 dateArgs.selectedDay = dayStartDate; 248 dateArgs.selectedDay = dayStartDate; 250 249 var info = new WatchObject(); 251 250 var favorites; … … 299 298 info.set('dayChanged', true); 300 299 else 301 info.set('dayChanged', false); 300 info.set('dayChanged', false); 302 301 each(info, function(value, key) { 303 302 args[key] = value; … … 384 383 days, 385 384 function(elem) { 386 var d = Util.formatDateTime(elem, IndicoDateTimeFormats.International, IndicoDateTimeFormats. ServerHourSlashLess);385 var d = Util.formatDateTime(elem, IndicoDateTimeFormats.International, IndicoDateTimeFormats.Ordinal); 387 386 return Html.option({value: elem}, d); 388 387 } 389 388 ); 390 389 //the hour added to dayStartDate is irrelevant and it won't be used, it is only passed to avoid the function crash 391 conferenceDays.set(Util.formatDateTime(dayStartDate + ' 00:00', IndicoDateTimeFormats.ServerHourSlashLess, IndicoDateTimeFormats.Server));392 390 conferenceDays.set(Util.formatDateTime(dayStartDate, IndicoDateTimeFormats.Ordinal, IndicoDateTimeFormats.ServerHourless)); 391 393 392 //We need to update the value of startDateTime and endDateTime every time that is changed by the user 394 393 //value is the new date 395 394 conferenceDays.observe(function(value) { 396 395 //it is neccesary to update the date in dateArgs with the new date to make the request 397 dateArgs.selectedDay = Util.formatDateTime(value, IndicoDateTimeFormats.Server, IndicoDateTimeFormats. ServerHourSlashLess);396 dateArgs.selectedDay = Util.formatDateTime(value, IndicoDateTimeFormats.Server, IndicoDateTimeFormats.Ordinal); 398 397 //we make a timeStartMethod request specifying the date for the request 399 398 //and we get the result of the request in result … … 406 405 var startDate = Util.parseJSDateTime(result, IndicoDateTimeFormats.Server); 407 406 var endDate = Util.parseJSDateTime(result, IndicoDateTimeFormats.Server); 408 407 409 408 var diffHours = dateArgs.endDate.time.substr(0,2) - dateArgs.startDate.time.substr(0,2); 410 409 var diffMinutes = Math.abs(dateArgs.endDate.time.substr(3,2) - dateArgs.startDate.time.substr(3,2)); … … 422 421 } 423 422 }); 424 423 425 424 /* 426 425 * parameterManager is not called because if you just change the date and it's not correct you just need 427 426 * to have red fields in the date, so what we're doing is just adding a dispatchEvent for both hour fields 428 * (they are Html.input, so they can be added to the dispatchEvent) to know when they have changed 427 * (they are Html.input, so they can be added to the dispatchEvent) to know when they have changed 429 428 */ 430 429 startEndTimeField.startTimeField.dispatchEvent('change'); 431 430 startEndTimeField.endTimeField.dispatchEvent('change'); 432 431 }); 433 432 434 433 var startEndTimeField = IndicoUI.Widgets.Generic.dateStartEndTimeField(info.get('startDateTime').substr(11,5), info.get('endDateTime').substr(11,5)); 435 434 var startEndTimeComponent; … … 437 436 toTarget: function (value) { 438 437 var aux = conferenceDays.get(); 439 return Util.formatDateTime(aux, IndicoDateTimeFormats.Server, IndicoDateTimeFormats. ServerHourSlashLess) + ' ' + value;438 return Util.formatDateTime(aux, IndicoDateTimeFormats.Server, IndicoDateTimeFormats.Ordinal) + ' ' + value; 440 439 }, 441 440 toSource: function(value) { -
indico/htdocs/js/indico/Legacy/Widgets.js
r93394d r03e2c9 939 939 attributes = attributes || {}; 940 940 var elem = Html.input("text",attributes); 941 IndicoUI.Widgets.Generic.input2dateField(elem, showTime, hiddenFields) 941 IndicoUI.Widgets.Generic.input2dateField(elem, showTime, hiddenFields); 942 942 return elem; 943 943 }, … … 945 945 attributes = attributes || {}; 946 946 var elem = Html.input("text",{'id':'sdate', 'name':'sdate'},attributes); 947 IndicoUI.Widgets.Generic.input2dateField(elem, showTime, hiddenFields) 947 IndicoUI.Widgets.Generic.input2dateField(elem, showTime, hiddenFields); 948 948 return elem; 949 949 }, … … 952 952 attributes = attributes || {}; 953 953 var elem = Html.input("text",{'id':'edate', 'name':'edate'},attributes); 954 IndicoUI.Widgets.Generic.input2dateField(elem, showTime, hiddenFields) 954 IndicoUI.Widgets.Generic.input2dateField(elem, showTime, hiddenFields); 955 955 return elem; 956 956 }, … … 1011 1011 return Html.edit(attributes, defaultVal); 1012 1012 }, 1013 1013 1014 1014 applyForParticipationForm: function(conf) { 1015 1015 alert('hejsan'); -
indico/htdocs/js/indico/Management/Timetable.js
r93394d r03e2c9 201 201 } 202 202 else { 203 203 204 var startDate = Util.parseJSDateTime(result, IndicoDateTimeFormats.Server); 204 205 … … 212 213 } 213 214 self.startTimeField.set(Util.formatDateTime(startDate, IndicoDateTimeFormats.Server).substr(11,5)); 214 215 self.info.set('startDate', Util.formatDateTime(startDate, IndicoDateTimeFormats.Server ));215 216 self.info.set('startDate', Util.formatDateTime(startDate, IndicoDateTimeFormats.ServerHourless)); 216 217 hook.set(true); 217 218 } … … 220 221 } 221 222 }, 222 223 223 224 224 225 function(hook) { 225 226 var self = this; … … 290 291 info.set('privileges', presListWidget.getPrivileges()); 291 292 292 conferenceDays.set(Util.formatDateTime(self.datStartDate + ' ' + self.confStartDate.substr(11,5), IndicoDateTimeFormats. ServerHourSlashLess, IndicoDateTimeFormats.Server));293 293 conferenceDays.set(Util.formatDateTime(self.datStartDate + ' ' + self.confStartDate.substr(11,5), IndicoDateTimeFormats.Ordinal, IndicoDateTimeFormats.ServerHourless)); 294 294 295 //We need to update the value of Time and endDateTime every time that is changed by the user 295 296 //value is the new date 296 297 conferenceDays.observe(function(value) { 297 //it is neccesary to update the date in dateArgs with the new date 298 self.dateArgs.selectedDay = Util.formatDateTime(value, IndicoDateTimeFormats.Server, IndicoDateTimeFormats./* InternationalHourLess*/ServerHourSlashLess);298 //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); 299 300 //but we need to check if the contribution is inside a session and if the day changed, in order 300 301 //to make the request for the session timetable or the top level timetable 301 if(exists(self.timetable.parentTimetable)){ 302 303 if(self.timetable.IntervalTimetableMixin){ 302 304 if(self.previousDate.substr(0,10) != self.dateArgsselectedDay) 303 305 self.timeStartMethod = "schedule.event.getDayEndDate"; … … 305 307 self.timeStartMethod = "schedule.slot.getDayEndDate"; 306 308 } 307 309 308 310 //we make a timeStartMethod request specifying the date for the request 309 311 //and we get the result of the request in result … … 323 325 } 324 326 }); 325 327 326 328 /* 327 329 * parameterManager is not called because if you just change the date and it's not correct you just need 328 330 * to have red fields in the date, so what we're doing is just adding a dispatchEvent for both hour fields 329 * (they are Html.input, so they can be added to the dispatchEvent) to know when they have changed 331 * (they are Html.input, so they can be added to the dispatchEvent) to know when they have changed 330 332 */ 331 333 self.startTimeField.dispatchEvent('change'); … … 336 338 toTarget: function (value) { 337 339 var aux = conferenceDays.get(); 338 return Util.formatDateTime(aux, IndicoDateTimeFormats.Server, IndicoDateTimeFormats. ServerHourSlashLess) + ' ' + value;340 return Util.formatDateTime(aux, IndicoDateTimeFormats.Server, IndicoDateTimeFormats.Ordinal) + ' ' + value; 339 341 }, 340 342 toSource: function(value) { … … 345 347 var datecomponent; 346 348 var duration; 347 if (this.timeStartMethod !== null) { 349 if (this.timeStartMethod !== null) { 348 350 $B(info.accessor('startDate'), self.startTimeField, timeTranslation); 349 351 $B(info.accessor('duration'), self.timeField); … … 369 371 $T(' Duration '), this.timeField, $T('min'))], 370 372 [$T('Presenter(s)'), presListWidget.draw()] 371 ]); 372 373 374 373 ]); 374 375 376 375 377 376 378 }, … … 485 487 self.days, 486 488 function(elem) { 487 var d = Util.formatDateTime(elem, IndicoDateTimeFormats. International, IndicoDateTimeFormats.ServerHourSlashLess);489 var d = Util.formatDateTime(elem, IndicoDateTimeFormats.DefaultHourless, IndicoDateTimeFormats.Ordinal); 488 490 return Html.option({value: elem}, d); 489 491 } 490 492 ); 491 493 492 494 addButton.observeClick(function(){ 493 495 //check if the day changed 494 if(Util.formatDateTime(conferenceDays.get(), IndicoDateTimeFormats.Server, IndicoDateTimeFormats. ServerHourSlashLess) !=496 if(Util.formatDateTime(conferenceDays.get(), IndicoDateTimeFormats.Server, IndicoDateTimeFormats.Ordinal) != 495 497 self.previousDate.substr(0,10)){ 496 498 self.dayChanged = true; … … 543 545 this.successFunc = successFunc; 544 546 this.favoriteRooms = favoriteRooms; 545 547 546 548 this.previousDate = dayStartDate; 547 549 this.info = new WatchObject(); … … 550 552 args.schedule = false; 551 553 } 552 554 553 555 var attributes = { 554 556 style: { … … 618 620 startDate.setMinutes(0); 619 621 } 620 self.startTimeField.set(Util.formatDateTime(startDate, 622 self.startTimeField.set(Util.formatDateTime(startDate, 621 623 IndicoDateTimeFormats.Server).substr(11,5)); 622 623 self.info.set('startDate', Util.formatDateTime(startDate, 624 625 self.info.set('startDate', Util.formatDateTime(startDate, 624 626 IndicoDateTimeFormats.Server)); 625 627 hook.set(true); … … 700 702 addButton.observeClick(function(){ 701 703 //check if the day changed 702 if(Util.formatDateTime(conferenceDays.get(), IndicoDateTimeFormats.Server, IndicoDateTimeFormats.ServerHourSlashLess) != 704 if(Util.formatDateTime(conferenceDays.get(), 705 IndicoDateTimeFormats.ServerHourless, 706 IndicoDateTimeFormats.Ordinal) != 703 707 self.previousDate.substr(0,10)){ 704 708 self.dayChanged = true; … … 715 719 } 716 720 }); 717 721 718 722 //Create the list of the days in which the conference is being held 719 723 var conferenceDays = bind.element( … … 721 725 self.days, 722 726 function(elem) { 723 var d = Util.formatDateTime(elem, IndicoDateTimeFormats.International, IndicoDateTimeFormats. ServerHourSlashLess);727 var d = Util.formatDateTime(elem, IndicoDateTimeFormats.International, IndicoDateTimeFormats.Ordinal); 724 728 return Html.option({value: elem}, d); 725 729 } 726 730 ); 727 731 728 conferenceDays.set(Util.formatDateTime(self.info.get('startDate'), IndicoDateTimeFormats. ServerHourSlashLess, IndicoDateTimeFormats.Server));729 732 conferenceDays.set(Util.formatDateTime(self.info.get('startDate'), IndicoDateTimeFormats.Ordinal, IndicoDateTimeFormats.ServerHourless)); 733 730 734 //We need to update the value of Time and endDateTime every time that is changed by the user 731 735 //value is the new date 732 736 conferenceDays.observe(function(value) { 733 737 //it is neccesary to update the date in dateArgs with the new date to make the request 734 self.dateArgs.set("selectedDay", Util.formatDateTime(value, IndicoDateTimeFormats.Server, IndicoDateTimeFormats. ServerHourSlashLess));738 self.dateArgs.set("selectedDay", Util.formatDateTime(value, IndicoDateTimeFormats.Server, IndicoDateTimeFormats.Ordinal)); 735 739 //but we need to check if are inside a session and if the day changed, in order 736 740 //to make the request for the session timetable or the top level timetable 737 if(exists(self.managementActions.timetable.parentTimetable)){ 738 if(self.previousDate.substr(0,10) != self.dateArgs.get('selectedDay')) 741 742 if(self.managementActions.timetable.IntervalTimetableMixin && 743 /* if we chose a different day, it doesn't matter 744 if we are inside a session */ 745 self.previousDate.substr(0,10) != 746 self.dateArgs.get('selectedDay')){ 739 747 self.timeStartMethod = "schedule.event.getDayEndDate"; 740 else748 } else { 741 749 self.timeStartMethod = "schedule.slot.getDayEndDate"; 750 } 742 751 } 743 752 //we make a timeStartMethod request specifying the date for the request 744 //and we get the result of the request inresult753 //and we get the result of the request as a result 745 754 indicoRequest(self.timeStartMethod, self.dateArgs , function(result, error){ 746 755 if (error) { … … 760 769 * parameterManager is not called because if you just change the date and it's not correct you just need 761 770 * to have red fields in the date, so what we're doing is just adding a dispatchEvent for both hour fields 762 * (they are Html.input, so they can be added to the dispatchEvent) to know when they have changed 771 * (they are Html.input, so they can be added to the dispatchEvent) to know when they have changed 763 772 */ 764 773 self.startTimeField.dispatchEvent('change'); … … 769 778 toTarget: function (value) { 770 779 var aux = conferenceDays.get(); 771 return Util.formatDateTime(aux, IndicoDateTimeFormats.Server, IndicoDateTimeFormats. ServerHourSlashLess) + ' ' + value;780 return Util.formatDateTime(aux, IndicoDateTimeFormats.Server, IndicoDateTimeFormats.Ordinal) + ' ' + value; 772 781 }, 773 782 toSource: function(value) { … … 775 784 } 776 785 }; 777 786 778 787 // some properties have default values, and the initialization 779 788 // of the binding must be set … … 786 795 this.timeField, 787 796 this.isEdit); 788 797 789 798 self.parameterManager.add(self.startTimeField, 'time', false); 790 799 self.parameterManager.add(self.timeField, 'unsigned_int', false); 791 800 792 801 return this.ServiceDialog.prototype.draw.call( 793 802 this, … … 798 807 width: '300px' 799 808 } 800 })), this.info.accessor('title'))], 801 809 })), this.info.accessor('title'))], 810 802 811 [$T('Description'), $B(Html.textarea({ 803 812 cols: 40, 804 813 rows: 2 805 }), this.info.accessor('description'))], 806 [$T('Place'), this.roomEditor.draw()], 814 }), this.info.accessor('description'))], 815 [$T('Place'), this.roomEditor.draw()], 807 816 [$T('Date'), conferenceDays], 808 817 [$T('Start time'), Html.div({class: 'popUpLabel', style:{textAlign: 'left'}}, this.startTimeField, … … 884 893 /* 885 894 * if we are inside a session and we add a break outside that session, in another day, 886 * we need to update the entry in the parentTimetable. 895 * we need to update the entry in the parentTimetable. 887 896 */ 888 897 this.ChangeEditDialog(managementActions.methods[args.get('type')].add, … … 892 901 if(exists(managementActions.timetable.parentTimetable) && this.dayChanged) 893 902 managementActions.timetable.parentTimetable._updateEntry(result, result.id); 894 else 903 else 895 904 managementActions.timetable._updateEntry(result, result.id); 896 905 }); -
indico/htdocs/js/indico/Timetable/Base.js
r93394d r03e2c9 268 268 }, 269 269 270 getDays: function() { 271 return keys(this.data); 272 }, 273 270 274 disable: function() { 271 275 this.enabled = false; … … 474 478 this.infoBox.set(this._getInfoBoxContent()); 475 479 480 }, 481 482 getDays: function() { 483 return this.parentTimetable.getDays(); 476 484 }, 477 485 -
indico/htdocs/js/indico/Timetable/Management.js
r93394d r03e2c9 319 319 320 320 var params; 321 322 //Get the days in which the conference is being held 323 //if the contribution is inside a session we need to get the days from parentTimetable, not from timetable 324 if(exists(this.timetable.parentTimetable)) 325 var days = keys(this.timetable.parentTimetable.getData()); 326 else 327 var days = keys(this.timetable.getData()); 321 322 var days = this.timetable.getDays(); 328 323 329 324 if (this.session !== null) { … … 355 350 356 351 var params; 357 358 //Get the days in which the conference is being held 359 //if the break is inside a session we need to get the days from parentTimetable, not from timetable 360 if(exists(this.timetable.parentTimetable)) 361 var days = keys(this.timetable.parentTimetable.getData()); 362 else 363 var days = keys(this.timetable.getData()); 352 353 var days = this.timetable.getDays(); 364 354 365 355 if (this.session !== null) { … … 385 375 386 376 var params; 387 388 //Get the days in which the conference is being held 389 //if the break is inside a session we need to get the days from parentTimetable, not from timetable 390 if(exists(this.timetable.parentTimetable)) 391 var days = keys(this.timetable.parentTimetable.getData()); 392 else 393 var days = keys(this.timetable.getData()); 377 378 var days = this.timetable.getDays(); 394 379 395 380 if (this.session !== null) { … … 449 434 var params = this._addToSessionParams(session, 'SessionSlot'); 450 435 params.parentType = 'Session'; 451 436 452 437 //Get the days in which the conference is being held 453 438 var days = keys(this.timetable.getData()); … … 475 460 //Get the days in which the conference is being held 476 461 var days = keys(this.timetable.getData()); 477 462 478 463 each(eventData, function(value, key) { 479 464 params[key] = value; … … 499 484 * You need to create the aux before doing the updateEntry because otherwise the subentries 500 485 * in the session won't have the correct value 501 */ 486 */ 502 487 self.timetable.data[result.day][result.id].entries = aux; 503 488 },
Note: See TracChangeset
for help on using the changeset viewer.
