You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(275) |
Jul
(81) |
Aug
(19) |
Sep
(26) |
Oct
(190) |
Nov
(118) |
Dec
(16) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(9) |
Feb
(318) |
Mar
(251) |
Apr
(354) |
May
(209) |
Jun
(261) |
Jul
(226) |
Aug
(136) |
Sep
(156) |
Oct
(30) |
Nov
(5) |
Dec
(13) |
| 2009 |
Jan
(26) |
Feb
(35) |
Mar
(63) |
Apr
(21) |
May
(26) |
Jun
(33) |
Jul
(55) |
Aug
(71) |
Sep
(23) |
Oct
(40) |
Nov
(18) |
Dec
(13) |
| 2010 |
Jan
(17) |
Feb
(98) |
Mar
(39) |
Apr
(25) |
May
(107) |
Jun
(257) |
Jul
(270) |
Aug
(206) |
Sep
(237) |
Oct
(187) |
Nov
(302) |
Dec
(187) |
| 2011 |
Jan
(63) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Tomas M. <to...@us...> - 2010-11-17 15:08:59
|
Update of /cvsroot/unitime/UniTime/WebContent/tt In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11418/WebContent/tt Modified Files: Tag: dev_curriculum suggestions.jsp info.jsp Log Message: Suggestions, Class Assignment, Examination Assignment -- reload parent page on assignment feature - parent.location.reload(...) is causing a confirm message to pop up (asking about re-submitting the form) on some (older) browsers -> trying a different approach Index: suggestions.jsp =================================================================== RCS file: /cvsroot/unitime/UniTime/WebContent/tt/suggestions.jsp,v retrieving revision 1.2.2.3 retrieving revision 1.2.2.4 diff -C2 -d -r1.2.2.3 -r1.2.2.4 *** suggestions.jsp 9 Nov 2010 12:25:48 -0000 1.2.2.3 --- suggestions.jsp 17 Nov 2010 15:08:49 -0000 1.2.2.4 *************** *** 137,141 **** <script language="JavaScript" type="text/javascript"> parent.hideGwtDialog(); ! parent.location.reload(false); </script> </logic:equal> --- 137,141 ---- <script language="JavaScript" type="text/javascript"> parent.hideGwtDialog(); ! parent.refreshPage(); </script> </logic:equal> Index: info.jsp =================================================================== RCS file: /cvsroot/unitime/UniTime/WebContent/tt/info.jsp,v retrieving revision 1.5.2.3 retrieving revision 1.5.2.4 diff -C2 -d -r1.5.2.3 -r1.5.2.4 *** info.jsp 9 Nov 2010 12:25:48 -0000 1.5.2.3 --- info.jsp 17 Nov 2010 15:08:49 -0000 1.5.2.4 *************** *** 41,45 **** <script language="JavaScript" type="text/javascript"> parent.hideGwtDialog(); ! parent.location.reload(false); </script> </logic:equal> --- 41,45 ---- <script language="JavaScript" type="text/javascript"> parent.hideGwtDialog(); ! parent.refreshPage(); </script> </logic:equal> |
|
From: Tomas M. <to...@us...> - 2010-11-17 15:08:57
|
Update of /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/client/page In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11418/JavaSource/org/unitime/timetable/gwt/client/page Added Files: Tag: dev_curriculum Refresh.java Log Message: Suggestions, Class Assignment, Examination Assignment -- reload parent page on assignment feature - parent.location.reload(...) is causing a confirm message to pop up (asking about re-submitting the form) on some (older) browsers -> trying a different approach --- NEW FILE: Refresh.java --- /* * UniTime 3.2 (University Timetabling Application) * Copyright (C) 2010, UniTime LLC, and individual contributors * as indicated by the @authors tag. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. * */ package org.unitime.timetable.gwt.client.page; import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.Window; public class Refresh { public static native void createTriggers()/*-{ $wnd.refreshPage = function(message) { @org.unitime.timetable.gwt.client.page.Refresh::refreshPage()(); }; @org.unitime.timetable.gwt.client.page.Refresh::scrollDown()(); }-*/; public static void refreshPage() { String url = Window.Location.getHref(); if (url.indexOf('#') >= 0) url = url.substring(0, url.lastIndexOf('#')); url += "#" + Window.getScrollLeft() + ":" + Window.getScrollTop(); Window.Location.assign(url); new Timer() { @Override public void run() { Window.Location.reload(); } }.schedule(100); } public static void scrollDown() { String hash = Window.Location.getHash(); if (hash != null && hash.matches("#[0-9]+:[0-9]+")) { String[] scroll = hash.substring(1).split(":"); Window.scrollTo(Integer.parseInt(scroll[0]), Integer.parseInt(scroll[1])); } } } |
|
From: Tomas M. <to...@us...> - 2010-11-17 15:08:57
|
Update of /cvsroot/unitime/UniTime/WebContent/exam In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11418/WebContent/exam Modified Files: Tag: dev_curriculum info.jsp Log Message: Suggestions, Class Assignment, Examination Assignment -- reload parent page on assignment feature - parent.location.reload(...) is causing a confirm message to pop up (asking about re-submitting the form) on some (older) browsers -> trying a different approach Index: info.jsp =================================================================== RCS file: /cvsroot/unitime/UniTime/WebContent/exam/info.jsp,v retrieving revision 1.10.2.3 retrieving revision 1.10.2.4 diff -C2 -d -r1.10.2.3 -r1.10.2.4 *** info.jsp 9 Nov 2010 12:25:49 -0000 1.10.2.3 --- info.jsp 17 Nov 2010 15:08:49 -0000 1.10.2.4 *************** *** 49,53 **** <script language="JavaScript" type="text/javascript"> parent.hideGwtDialog(); ! parent.location.reload(false); </script> </logic:equal> --- 49,53 ---- <script language="JavaScript" type="text/javascript"> parent.hideGwtDialog(); ! parent.refreshPage(); </script> </logic:equal> |
|
From: Tomas M. <to...@us...> - 2010-11-17 15:08:57
|
Update of /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/client In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11418/JavaSource/org/unitime/timetable/gwt/client Modified Files: Tag: dev_curriculum Triggers.java Log Message: Suggestions, Class Assignment, Examination Assignment -- reload parent page on assignment feature - parent.location.reload(...) is causing a confirm message to pop up (asking about re-submitting the form) on some (older) browsers -> trying a different approach Index: Triggers.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/client/Attic/Triggers.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** Triggers.java 9 Nov 2010 12:25:50 -0000 1.1.2.2 --- Triggers.java 17 Nov 2010 15:08:49 -0000 1.1.2.3 *************** *** 20,23 **** --- 20,24 ---- package org.unitime.timetable.gwt.client; + import org.unitime.timetable.gwt.client.page.Refresh; import org.unitime.timetable.gwt.client.page.UniTimeMenuBar; import org.unitime.timetable.gwt.client.widgets.LoadingWidget; *************** *** 47,50 **** --- 48,56 ---- LoadingWidget.createTriggers(); } + }), + refresh(new Command() { + public void execute() { + Refresh.createTriggers(); + } }); |
|
From: Tomas M. <to...@us...> - 2010-11-17 15:06:16
|
Update of /cvsroot/unitime/UniTime/WebContent/help In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv10428/WebContent/help Modified Files: Tag: dev_curriculum Release-Notes.xml Log Message: Examination timetabling - added ability to automatically put a preference on an original building (i.e., building of a room in which the related class took place) - this rule may or may not be applied only in cases when the original room is examination room - see the new application properties for more details (tmtbl.exam.defaultPrefs.{final|midterm}.originalRoom.{pref|onlyForExaminationRooms}) Index: Release-Notes.xml =================================================================== RCS file: /cvsroot/unitime/UniTime/WebContent/help/Release-Notes.xml,v retrieving revision 1.62.2.15 retrieving revision 1.62.2.16 diff -C2 -d -r1.62.2.15 -r1.62.2.16 *** Release-Notes.xml 12 Nov 2010 20:27:00 -0000 1.62.2.15 --- Release-Notes.xml 17 Nov 2010 15:06:07 -0000 1.62.2.16 *************** *** 139,142 **** --- 139,143 ---- </line> <line>Added query log (Page Statistics page)</line> + <line>Examinations: Added ability to automatically put a preference on an original building (i.e., building of a room in which the related class took place)</line> </description> </item> |
|
From: Tomas M. <to...@us...> - 2010-11-17 13:29:52
|
Update of /cvsroot/unitime/UniTime/JavaSource In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv20584/JavaSource Modified Files: Tag: dev_curriculum application.properties Log Message: Examination timetabling - added ability to automatically put a preference on an original building (i.e., building of a room in which the related class took place) - this rule may or may not be applied only in cases when the original room is examination room - see the new application properties for more details (tmtbl.exam.defaultPrefs.{final|midterm}.originalRoom.{pref|onlyForExaminationRooms}) Index: application.properties =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/application.properties,v retrieving revision 1.33.2.16 retrieving revision 1.33.2.17 diff -C2 -d -r1.33.2.16 -r1.33.2.17 *** application.properties 9 Nov 2010 12:25:48 -0000 1.33.2.16 --- application.properties 17 Nov 2010 12:56:05 -0000 1.33.2.17 *************** *** 305,308 **** --- 305,321 ---- # Midterm exams -> rule disabled tmtbl.exam.defaultPrefs.midterm.originalRoom.pref=0 + # + # For an exam that is attached to a class -> put building preference on a room of the class + # Final exams -> prefer original building (of the room where the class is placed) + #tmtbl.exam.defaultPrefs.final.originalBuilding.pref=-1 + # Final exams -> rule disabled + tmtbl.exam.defaultPrefs.final.originalBuilding.pref=0 + # Midterm exams -> rule disabled + tmtbl.exam.defaultPrefs.midterm.originalBuilding.pref=0 + # If the rule is enabled, set whether it is to be applied only when a class is in a room that allows exams. + #tmtbl.exam.defaultPrefs.final.originalBuilding.onlyForExaminationRooms=false + #tmtbl.exam.defaultPrefs.midterm.originalBuilding.onlyForExaminationRooms=false + + # Exams default start and stop offsets - This is to be used to reserve time for |
|
From: Tomas M. <to...@us...> - 2010-11-17 12:56:13
|
Update of /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv20584/JavaSource/org/unitime/timetable/model Modified Files: Tag: dev_curriculum Exam.java Log Message: Examination timetabling - added ability to automatically put a preference on an original building (i.e., building of a room in which the related class took place) - this rule may or may not be applied only in cases when the original room is examination room - see the new application properties for more details (tmtbl.exam.defaultPrefs.{final|midterm}.originalRoom.{pref|onlyForExaminationRooms}) Index: Exam.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/model/Exam.java,v retrieving revision 1.40.2.2 retrieving revision 1.40.2.3 diff -C2 -d -r1.40.2.2 -r1.40.2.3 *** Exam.java 9 Nov 2010 12:25:47 -0000 1.40.2.2 --- Exam.java 17 Nov 2010 12:56:05 -0000 1.40.2.3 *************** *** 1091,1094 **** --- 1091,1137 ---- } } + + //Prefer original building + PreferenceLevel originalBuildingPref = PreferenceLevel.getPreferenceLevel(ApplicationProperties.getProperty( + "tmtbl.exam.defaultPrefs."+(getExamType()==Exam.sExamTypeMidterm?"midterm":"final")+".originalBuilding.pref", + (getExamType()==Exam.sExamTypeMidterm?PreferenceLevel.sNeutral:PreferenceLevel.sPreferred))); + boolean examRoomsOnly = "true".equals(ApplicationProperties.getProperty( + "tmtbl.exam.defaultPrefs."+(getExamType()==Exam.sExamTypeMidterm?"midterm":"final")+".originalBuilding.onlyForExaminationRooms", "false")); + if (!PreferenceLevel.sNeutral.equals(originalBuildingPref.getPrefProlog()) && (override || getPreferences(BuildingPref.class).isEmpty())) { + HashSet<Building> buildings = new HashSet<Building>(); + for (Iterator i=getOwners().iterator();i.hasNext();) { + ExamOwner owner = (ExamOwner)i.next(); + if (ExamOwner.sOwnerTypeClass!=owner.getOwnerType()) continue; + Event event = ((Class_)owner.getOwnerObject()).getEvent(); + if (event==null) continue; + for (Iterator j=event.getMeetings().iterator();j.hasNext();) { + Meeting meeting = (Meeting)j.next(); + Location location = meeting.getLocation(); + if (location == null || !(location instanceof Room)) continue; + if (examRoomsOnly && !location.isExamEnabled(getExamType())) continue; + buildings.add(((Room)location).getBuilding()); + } + } + if (!buildings.isEmpty()) { + for (Iterator i=getPreferences(BuildingPref.class).iterator();i.hasNext();) { + BuildingPref pref = (BuildingPref)i.next(); + if (buildings.contains(pref.getBuilding())) { + buildings.remove(pref.getBuilding()); + if (!pref.getPrefLevel().equals(originalBuildingPref)) { + pref.setPrefLevel(originalBuildingPref); + } + } else { + getPreferences().remove(pref); + } + } + for (Building building : buildings) { + BuildingPref pref = new BuildingPref(); + pref.setPrefLevel(originalBuildingPref); + pref.setOwner(this); + pref.setBuilding(building); + getPreferences().add(pref); + } + } + } } |
|
From: Tomas M. <to...@us...> - 2010-11-17 11:05:42
|
Update of /cvsroot/unitime/UniTime/WebContent/admin In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18001/WebContent/admin Modified Files: Tag: dev_curriculum editRoom.jsp addNonUnivLocation.jsp buildingEdit.jsp Log Message: Edit Room / Building - added an ability to geocode a given address to get building / room coordinates Index: addNonUnivLocation.jsp =================================================================== RCS file: /cvsroot/unitime/UniTime/WebContent/admin/addNonUnivLocation.jsp,v retrieving revision 1.5.2.3 retrieving revision 1.5.2.4 diff -C2 -d -r1.5.2.3 -r1.5.2.4 *** addNonUnivLocation.jsp 9 Nov 2010 12:25:49 -0000 1.5.2.3 --- addNonUnivLocation.jsp 17 Nov 2010 11:05:33 -0000 1.5.2.4 *************** *** 199,216 **** visible: false }); ! google.maps.event.addListener(marker, 'position_changed', function() { ! document.getElementById("coordX").value = '' + marker.getPosition().lat().toFixed(6); ! document.getElementById("coordY").value = '' + marker.getPosition().lng().toFixed(6); geocoder.geocode({'location': marker.getPosition()}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[0]) { marker.setTitle(results[0].formatted_address); } else { marker.setTitle(null); } } else { marker.setTitle(null); } }); }); google.maps.event.addListener(map, 'rightclick', function(event) { --- 199,287 ---- visible: false }); ! ! var searchBox = createGoogleSeachControl(map); ! ! function createGoogleSeachControl(map) { ! var controlDiv = document.createElement('DIV'); ! controlDiv.index = 1; ! controlDiv.style.marginBottom = '15px'; ! var controlUI = document.createElement('DIV'); ! controlUI.style.backgroundColor = 'transparent'; ! controlUI.style.cursor = 'pointer'; ! controlUI.style.textAlign = 'center'; ! controlUI.title = "Seach"; ! controlDiv.appendChild(controlUI); ! var controltxtbox = document.createElement('input'); ! controltxtbox.setAttribute("id", "txt_googleseach"); ! controltxtbox.setAttribute("type", "text"); ! controltxtbox.setAttribute("value", ""); ! controltxtbox.style.height = '22px'; ! controltxtbox.style.width = '450px'; ! controltxtbox.style.marginRight = '2px'; ! controlUI.appendChild(controltxtbox); ! var controlbtn = document.createElement('input'); ! controlbtn.setAttribute("id", "btn_googleseach"); ! controlbtn.setAttribute("type", "button"); ! controlbtn.setAttribute("value", "Geocode"); ! controlUI.appendChild(controlbtn); ! google.maps.event.addDomListener(controlbtn, 'click', function() { ! geoceodeAddress(controltxtbox.value); ! }); ! controltxtbox.onkeypress = function(e) { ! var key = e.keyCode || e.which; ! if (key == 13) { ! geoceodeAddress(controltxtbox.value); ! return false; ! } ! return true; ! }; ! map.controls[google.maps.ControlPosition.BOTTOM_LEFT].push(controlDiv); ! return controltxtbox; ! } ! ! function geoceodeAddress(address) { ! var address = document.getElementById("txt_googleseach").value; ! geocoder.geocode({ 'address': address }, function(results, status) { ! if (status == google.maps.GeocoderStatus.OK) { ! if (results[0]) { ! marker.setPosition(results[0].geometry.location); ! marker.setTitle(results[0].formatted_address); ! marker.setVisible(true); ! if (map.getZoom() <= 10) map.setZoom(16); ! map.panTo(results[0].geometry.location); ! } else { ! marker.setVisible(false); ! } ! } else { ! marker.setVisible(false); ! } ! }); ! } ! ! function geoceodeMarker() { geocoder.geocode({'location': marker.getPosition()}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[0]) { marker.setTitle(results[0].formatted_address); + if (searchBox != null) + searchBox.value = results[0].formatted_address; } else { marker.setTitle(null); + if (searchBox != null) searchBox.value = ""; } } else { marker.setTitle(null); + if (searchBox != null) searchBox.value = ""; } }); + } + + var t = null; + + google.maps.event.addListener(marker, 'position_changed', function() { + document.getElementById("coordX").value = '' + marker.getPosition().lat().toFixed(6); + document.getElementById("coordY").value = '' + marker.getPosition().lng().toFixed(6); + if (t != null) clearTimeout(t); + t = setTimeout("geoceodeMarker()", 500); }); google.maps.event.addListener(map, 'rightclick', function(event) { Index: editRoom.jsp =================================================================== RCS file: /cvsroot/unitime/UniTime/WebContent/admin/editRoom.jsp,v retrieving revision 1.13.2.5 retrieving revision 1.13.2.6 diff -C2 -d -r1.13.2.5 -r1.13.2.6 *** editRoom.jsp 9 Nov 2010 12:25:49 -0000 1.13.2.5 --- editRoom.jsp 17 Nov 2010 11:05:33 -0000 1.13.2.6 *************** *** 349,366 **** visible: false }); ! google.maps.event.addListener(marker, 'position_changed', function() { ! document.getElementById("coordX").value = '' + marker.getPosition().lat().toFixed(6); ! document.getElementById("coordY").value = '' + marker.getPosition().lng().toFixed(6); geocoder.geocode({'location': marker.getPosition()}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[0]) { marker.setTitle(results[0].formatted_address); } else { marker.setTitle(null); } } else { marker.setTitle(null); } }); }); <% if (examMgr) { %> --- 349,441 ---- visible: false }); ! ! <% if (examMgr) { %> ! var searchBox = null; ! <% } else { %> ! var searchBox = createGoogleSeachControl(map); ! <% } %> ! ! function createGoogleSeachControl(map) { ! var controlDiv = document.createElement('DIV'); ! controlDiv.index = 1; ! controlDiv.style.marginBottom = '15px'; ! var controlUI = document.createElement('DIV'); ! controlUI.style.backgroundColor = 'transparent'; ! controlUI.style.cursor = 'pointer'; ! controlUI.style.textAlign = 'center'; ! controlUI.title = "Seach"; ! controlDiv.appendChild(controlUI); ! var controltxtbox = document.createElement('input'); ! controltxtbox.setAttribute("id", "txt_googleseach"); ! controltxtbox.setAttribute("type", "text"); ! controltxtbox.setAttribute("value", ""); ! controltxtbox.style.height = '22px'; ! controltxtbox.style.width = '450px'; ! controltxtbox.style.marginRight = '2px'; ! controlUI.appendChild(controltxtbox); ! var controlbtn = document.createElement('input'); ! controlbtn.setAttribute("id", "btn_googleseach"); ! controlbtn.setAttribute("type", "button"); ! controlbtn.setAttribute("value", "Geocode"); ! controlUI.appendChild(controlbtn); ! google.maps.event.addDomListener(controlbtn, 'click', function() { ! geoceodeAddress(controltxtbox.value); ! }); ! controltxtbox.onkeypress = function(e) { ! var key = e.keyCode || e.which; ! if (key == 13) { ! geoceodeAddress(controltxtbox.value); ! return false; ! } ! return true; ! }; ! map.controls[google.maps.ControlPosition.BOTTOM_LEFT].push(controlDiv); ! return controltxtbox; ! } ! ! function geoceodeAddress(address) { ! var address = document.getElementById("txt_googleseach").value; ! geocoder.geocode({ 'address': address }, function(results, status) { ! if (status == google.maps.GeocoderStatus.OK) { ! if (results[0]) { ! marker.setPosition(results[0].geometry.location); ! marker.setTitle(results[0].formatted_address); ! marker.setVisible(true); ! if (map.getZoom() <= 10) map.setZoom(16); ! map.panTo(results[0].geometry.location); ! } else { ! marker.setVisible(false); ! } ! } else { ! marker.setVisible(false); ! } ! }); ! } ! ! function geoceodeMarker() { geocoder.geocode({'location': marker.getPosition()}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[0]) { marker.setTitle(results[0].formatted_address); + if (searchBox != null) + searchBox.value = results[0].formatted_address; } else { marker.setTitle(null); + if (searchBox != null) searchBox.value = ""; } } else { marker.setTitle(null); + if (searchBox != null) searchBox.value = ""; } }); + } + + var t = null; + + google.maps.event.addListener(marker, 'position_changed', function() { + document.getElementById("coordX").value = '' + marker.getPosition().lat().toFixed(6); + document.getElementById("coordY").value = '' + marker.getPosition().lng().toFixed(6); + if (t != null) clearTimeout(t); + t = setTimeout("geoceodeMarker()", 500); }); <% if (examMgr) { %> Index: buildingEdit.jsp =================================================================== RCS file: /cvsroot/unitime/UniTime/WebContent/admin/buildingEdit.jsp,v retrieving revision 1.5.2.5 retrieving revision 1.5.2.6 diff -C2 -d -r1.5.2.5 -r1.5.2.6 *** buildingEdit.jsp 9 Nov 2010 12:25:49 -0000 1.5.2.5 --- buildingEdit.jsp 17 Nov 2010 11:05:33 -0000 1.5.2.6 *************** *** 155,172 **** visible: false }); ! google.maps.event.addListener(marker, 'position_changed', function() { ! document.getElementById("coordX").value = '' + marker.getPosition().lat().toFixed(6); ! document.getElementById("coordY").value = '' + marker.getPosition().lng().toFixed(6); geocoder.geocode({'location': marker.getPosition()}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[0]) { marker.setTitle(results[0].formatted_address); } else { marker.setTitle(null); } } else { marker.setTitle(null); } }); }); google.maps.event.addListener(map, 'rightclick', function(event) { --- 155,243 ---- visible: false }); ! ! var searchBox = createGoogleSeachControl(map); ! ! function createGoogleSeachControl(map) { ! var controlDiv = document.createElement('DIV'); ! controlDiv.index = 1; ! controlDiv.style.marginBottom = '15px'; ! var controlUI = document.createElement('DIV'); ! controlUI.style.backgroundColor = 'transparent'; ! controlUI.style.cursor = 'pointer'; ! controlUI.style.textAlign = 'center'; ! controlUI.title = "Seach"; ! controlDiv.appendChild(controlUI); ! var controltxtbox = document.createElement('input'); ! controltxtbox.setAttribute("id", "txt_googleseach"); ! controltxtbox.setAttribute("type", "text"); ! controltxtbox.setAttribute("value", ""); ! controltxtbox.style.height = '22px'; ! controltxtbox.style.width = '450px'; ! controltxtbox.style.marginRight = '2px'; ! controlUI.appendChild(controltxtbox); ! var controlbtn = document.createElement('input'); ! controlbtn.setAttribute("id", "btn_googleseach"); ! controlbtn.setAttribute("type", "button"); ! controlbtn.setAttribute("value", "Geocode"); ! controlUI.appendChild(controlbtn); ! google.maps.event.addDomListener(controlbtn, 'click', function() { ! geoceodeAddress(controltxtbox.value); ! }); ! controltxtbox.onkeypress = function(e) { ! var key = e.keyCode || e.which; ! if (key == 13) { ! geoceodeAddress(controltxtbox.value); ! return false; ! } ! return true; ! }; ! map.controls[google.maps.ControlPosition.BOTTOM_LEFT].push(controlDiv); ! return controltxtbox; ! } ! ! function geoceodeAddress(address) { ! var address = document.getElementById("txt_googleseach").value; ! geocoder.geocode({ 'address': address }, function(results, status) { ! if (status == google.maps.GeocoderStatus.OK) { ! if (results[0]) { ! marker.setPosition(results[0].geometry.location); ! marker.setTitle(results[0].formatted_address); ! marker.setVisible(true); ! if (map.getZoom() <= 10) map.setZoom(16); ! map.panTo(results[0].geometry.location); ! } else { ! marker.setVisible(false); ! } ! } else { ! marker.setVisible(false); ! } ! }); ! } ! ! function geoceodeMarker() { geocoder.geocode({'location': marker.getPosition()}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[0]) { marker.setTitle(results[0].formatted_address); + if (searchBox != null) + searchBox.value = results[0].formatted_address; } else { marker.setTitle(null); + if (searchBox != null) searchBox.value = ""; } } else { marker.setTitle(null); + if (searchBox != null) searchBox.value = ""; } }); + } + + var t = null; + + google.maps.event.addListener(marker, 'position_changed', function() { + document.getElementById("coordX").value = '' + marker.getPosition().lat().toFixed(6); + document.getElementById("coordY").value = '' + marker.getPosition().lng().toFixed(6); + if (t != null) clearTimeout(t); + t = setTimeout("geoceodeMarker()", 500); }); google.maps.event.addListener(map, 'rightclick', function(event) { |
|
From: Nightly B. <no...@un...> - 2010-11-16 00:00:29
|
Download the resultant file at http://www.unitime.org/uct_builds.php, see the attached build and change logs for more details. |
|
From: Tomas M. <to...@us...> - 2010-11-15 18:43:05
|
Update of /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/server In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv28691/JavaSource/org/unitime/timetable/gwt/server Modified Files: Tag: dev_curriculum EventServlet.java Log Message: PersonalTimetable - avoid returning all class / exam events when there is match on the main contact Index: EventServlet.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/server/Attic/EventServlet.java,v retrieving revision 1.1.2.10 retrieving revision 1.1.2.11 diff -C2 -d -r1.1.2.10 -r1.1.2.11 *** EventServlet.java 9 Nov 2010 12:25:51 -0000 1.1.2.10 --- EventServlet.java 15 Nov 2010 18:42:57 -0000 1.1.2.11 *************** *** 606,609 **** --- 606,610 ---- meetings.addAll( (List<Meeting>)hibSession.createQuery("select m from Meeting m, Session s where s.uniqueId = :sessionId and " + + "m.event.class in (CourseEvent, SpecialEvent) and " + "m.event.mainContact.externalUniqueId = :externalId and " + "m.meetingDate >= s.eventBeginDate and m.meetingDate <= s.eventEndDate and m.approvedDate is not null") |
|
From: Tomas M. <to...@us...> - 2010-11-15 18:42:24
|
Update of /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/server In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv28464/JavaSource/org/unitime/timetable/gwt/server Modified Files: Tag: dev_curriculum SectioningServlet.java Log Message: print exception only if it is not SectioningException Index: SectioningServlet.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/server/Attic/SectioningServlet.java,v retrieving revision 1.1.2.11 retrieving revision 1.1.2.12 diff -C2 -d -r1.1.2.11 -r1.1.2.12 *** SectioningServlet.java 15 Nov 2010 18:17:35 -0000 1.1.2.11 --- SectioningServlet.java 15 Nov 2010 18:42:16 -0000 1.1.2.12 *************** *** 211,214 **** --- 211,215 ---- } } catch (Exception e) { + if (e instanceof SectioningException) throw (SectioningException)e; sLog.error(e.getMessage(), e); throw new SectioningException(SectioningExceptionType.UNKNOWN, e); *************** *** 842,847 **** throw new SectioningException(SectioningExceptionType.NO_STUDENT_REQUESTS); } catch (Exception e) { - sLog.error(e.getMessage(), e); if (e instanceof SectioningException) throw (SectioningException)e; throw new SectioningException(SectioningExceptionType.UNKNOWN, e); } finally { --- 843,848 ---- throw new SectioningException(SectioningExceptionType.NO_STUDENT_REQUESTS); } catch (Exception e) { if (e instanceof SectioningException) throw (SectioningException)e; + sLog.error(e.getMessage(), e); throw new SectioningException(SectioningExceptionType.UNKNOWN, e); } finally { |
|
From: Tomas M. <to...@us...> - 2010-11-15 18:17:43
|
Update of /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/server In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18377/JavaSource/org/unitime/timetable/gwt/server Modified Files: Tag: dev_curriculum SectioningServlet.java Log Message: Student Sectioning Assistant - allow student lookup (when used by admin) Student Course Requests - allow student lookup (when used by admin) - requires authentication - ensure that student course requests are reloaded when academic session is changed Index: SectioningServlet.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/server/Attic/SectioningServlet.java,v retrieving revision 1.1.2.10 retrieving revision 1.1.2.11 diff -C2 -d -r1.1.2.10 -r1.1.2.11 *** SectioningServlet.java 15 Nov 2010 15:15:43 -0000 1.1.2.10 --- SectioningServlet.java 15 Nov 2010 18:17:35 -0000 1.1.2.11 *************** *** 570,573 **** --- 570,594 ---- public String logIn(String userName, String password) throws SectioningException { + if ("LOOKUP".equals(userName)) { + if (!isAdmin()) + throw new SectioningException(SectioningExceptionType.LOGIN_FAILED); + org.hibernate.Session hibSession = StudentDAO.getInstance().createNewSession(); + try { + List<Student> student = hibSession.createQuery("select m from Student m where m.externalUniqueId = :uid").setString("uid", password).list(); + if (!student.isEmpty()) { + User user = Web.getUser(getThreadLocalRequest().getSession()); + UniTimePrincipal principal = new UniTimePrincipal(user.getId(), user.getName()); + for (Student s: student) { + principal.addStudentId(s.getSession().getUniqueId(), s.getUniqueId()); + principal.setName(s.getName(DepartmentalInstructor.sNameFormatLastFirstMiddle)); + } + getThreadLocalRequest().getSession().setAttribute("user", principal); + getThreadLocalRequest().getSession().removeAttribute("login.nrAttempts"); + return principal.getName(); + } + } finally { + hibSession.close(); + } + } Integer nrAttempts = (Integer)getThreadLocalRequest().getSession().getAttribute("login.nrAttempts"); if (nrAttempts == null) nrAttempts = 1; else nrAttempts ++; *************** *** 728,731 **** --- 749,754 ---- public CourseRequestInterface lastRequest(Long sessionId) throws SectioningException { CourseRequestInterface request = getLastRequest(); + if (request != null && !request.getAcademicSessionId().equals(sessionId)) request = null; + if (request != null && request.getCourses().isEmpty() && request.getAlternatives().isEmpty()) request = null; if (request == null) { Long studentId = getStudentId(sessionId); *************** *** 1158,1160 **** --- 1181,1195 ---- } + public Boolean isAdmin() throws SectioningException { + try { + User user = Web.getUser(getThreadLocalRequest().getSession()); + if (user == null) throw new SectioningException(SectioningExceptionType.UNKNOWN, "not authenticated"); + return Roles.ADMIN_ROLE.equals(user.getRole()); + } catch (Exception e) { + if (e instanceof SectioningException) throw (SectioningException)e; + sLog.error(e.getMessage(), e); + throw new SectioningException(SectioningExceptionType.UNKNOWN, e.getMessage()); + } + } + } \ No newline at end of file |
|
From: Tomas M. <to...@us...> - 2010-11-15 18:17:43
|
Update of /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/resources In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18377/JavaSource/org/unitime/timetable/gwt/resources Modified Files: Tag: dev_curriculum StudentSectioningConstants.java StudentSectioningMessages.java Log Message: Student Sectioning Assistant - allow student lookup (when used by admin) Student Course Requests - allow student lookup (when used by admin) - requires authentication - ensure that student course requests are reloaded when academic session is changed Index: StudentSectioningConstants.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/resources/Attic/StudentSectioningConstants.java,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** StudentSectioningConstants.java 15 Nov 2010 15:15:43 -0000 1.1.2.4 --- StudentSectioningConstants.java 15 Nov 2010 18:17:35 -0000 1.1.2.5 *************** *** 52,56 **** @DefaultStringArrayValue({ ! "Tip: Enter a free time (e.g., Monday 8am - 10am) or use the mouse to select it."}) String[] freeTimeTips(); --- 52,57 ---- @DefaultStringArrayValue({ ! "Tip: Enter a free time (e.g., Monday 8am - 10am) or use the mouse to select it.", ! "Tip: The numbers in the selected times counts the number of overlapping standard time patterns (3x50, 2x75, 1x150), try to avoid overlapping too many of those."}) String[] freeTimeTips(); Index: StudentSectioningMessages.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/resources/Attic/StudentSectioningMessages.java,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** StudentSectioningMessages.java 15 Nov 2010 15:15:43 -0000 1.1.2.4 --- StudentSectioningMessages.java 15 Nov 2010 18:17:35 -0000 1.1.2.5 *************** *** 363,366 **** --- 363,369 ---- String buttonUserSkip(); + @DefaultMessage("Lookup") + String buttonUserLookup(); + @DefaultMessage("Guest") String userGuest(); |
|
From: Tomas M. <to...@us...> - 2010-11-15 18:17:43
|
Update of /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/client/sectioning In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18377/JavaSource/org/unitime/timetable/gwt/client/sectioning Modified Files: Tag: dev_curriculum StudentSectioningPage.java UserAuthentication.java Log Message: Student Sectioning Assistant - allow student lookup (when used by admin) Student Course Requests - allow student lookup (when used by admin) - requires authentication - ensure that student course requests are reloaded when academic session is changed Index: StudentSectioningPage.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/client/sectioning/Attic/StudentSectioningPage.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** StudentSectioningPage.java 15 Nov 2010 15:15:44 -0000 1.1.2.3 --- StudentSectioningPage.java 15 Nov 2010 18:17:35 -0000 1.1.2.4 *************** *** 50,54 **** }; ! public StudentSectioningPage(Mode mode) { Grid titlePanel = new Grid(1, 3); titlePanel.getCellFormatter().setWidth(0, 0, "33%"); --- 50,54 ---- }; ! public StudentSectioningPage(final Mode mode) { Grid titlePanel = new Grid(1, 3); titlePanel.getCellFormatter().setWidth(0, 0, "33%"); *************** *** 60,64 **** titlePanel.setHTML(0, 0, " "); ! final UserAuthentication userAuthentication = new UserAuthentication(true); titlePanel.setWidget(0, 1, userAuthentication); --- 60,64 ---- titlePanel.setHTML(0, 0, " "); ! final UserAuthentication userAuthentication = new UserAuthentication(mode.isSectioning()); titlePanel.setWidget(0, 1, userAuthentication); *************** *** 68,72 **** } public void onSuccess(String result) { ! userAuthentication.authenticated(result); } }); --- 68,84 ---- } public void onSuccess(String result) { ! if (!mode.isSectioning() && MESSAGES.userGuest().equals(result)) { ! userAuthentication.authenticate(); ! } else { ! userAuthentication.authenticated(result); ! } ! } ! }); ! iSectioningService.isAdmin(new AsyncCallback<Boolean>() { ! public void onFailure(Throwable caught) { ! } ! ! public void onSuccess(Boolean result) { ! if (result) userAuthentication.setAllowLookup(true); } }); *************** *** 84,87 **** --- 96,101 ---- userAuthentication.addUserAuthenticatedHandler(new UserAuthentication.UserAuthenticatedHandler() { public void onLogIn(UserAuthenticatedEvent event) { + if (!mode.isSectioning()) + sessionSelector.selectSession(null); sessionSelector.selectSession(); } Index: UserAuthentication.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/client/sectioning/Attic/UserAuthentication.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** UserAuthentication.java 9 Nov 2010 12:25:52 -0000 1.1.2.3 --- UserAuthentication.java 15 Nov 2010 18:17:35 -0000 1.1.2.4 *************** *** 22,25 **** --- 22,26 ---- import java.util.ArrayList; + import org.unitime.timetable.gwt.client.Lookup; import org.unitime.timetable.gwt.resources.StudentSectioningMessages; import org.unitime.timetable.gwt.services.SectioningService; *************** *** 27,30 **** --- 28,32 ---- import com.google.gwt.core.client.GWT; + import com.google.gwt.core.client.JavaScriptObject; import com.google.gwt.core.client.Scheduler; import com.google.gwt.core.client.Scheduler.ScheduledCommand; *************** *** 56,60 **** private Label iHint; ! private Button iLogIn, iSkip; private TextBox iUserName; --- 58,62 ---- private Label iHint; ! private Button iLogIn, iSkip, iLookup; private TextBox iUserName; *************** *** 67,81 **** private ArrayList<UserAuthenticatedHandler> iUserAuthenticatedHandlers = new ArrayList<UserAuthenticatedHandler>(); ! private final SectioningServiceAsync iSectioningService = GWT.create(SectioningService.class); ! private AsyncCallback<String> iAuthenticateCallback = null; private boolean iLoggedIn = false; private boolean iGuest = false; private String iLastUser = null; private Command iOnLoginCommand = null; ! public UserAuthentication(boolean allowGuset) { iUserLabel = new Label(MESSAGES.userNotAuthenticated(), false); iUserLabel.setStyleName("unitime-SessionSelector"); --- 69,85 ---- private ArrayList<UserAuthenticatedHandler> iUserAuthenticatedHandlers = new ArrayList<UserAuthenticatedHandler>(); ! private static final SectioningServiceAsync sSectioningService = GWT.create(SectioningService.class); ! private static AsyncCallback<String> sAuthenticateCallback = null; private boolean iLoggedIn = false; private boolean iGuest = false; private String iLastUser = null; + private boolean iAllowGuest = false; private Command iOnLoginCommand = null; ! public UserAuthentication(boolean allowGuest) { ! iAllowGuest = allowGuest; iUserLabel = new Label(MESSAGES.userNotAuthenticated(), false); iUserLabel.setStyleName("unitime-SessionSelector"); *************** *** 129,132 **** --- 133,143 ---- iSkip = new Button(MESSAGES.buttonUserSkip()); buttonPanel.add(iSkip); + iSkip.setVisible(iAllowGuest); + + Lookup.getInstance().setOptions("mustHaveExternalId"); + Lookup.getInstance().setCallback(createLookupCallback()); + iLookup = new Button(MESSAGES.buttonUserLookup()); + buttonPanel.add(iLookup); + iLookup.setVisible(false); iSkip.addClickHandler(new ClickHandler() { *************** *** 142,145 **** --- 153,164 ---- }); + iLookup.addClickHandler(new ClickHandler() { + @Override + public void onClick(ClickEvent event) { + iDialog.hide(); + Lookup.getInstance().center(); + } + }); + iUserName.addKeyUpHandler(new KeyUpHandler() { public void onKeyUp(KeyUpEvent event) { *************** *** 153,157 **** }); } ! if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) { logIn(true); } --- 172,176 ---- }); } ! if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE && iAllowGuest) { logIn(true); } *************** *** 164,168 **** logIn(false); } ! if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) { logIn(true); } --- 183,187 ---- logIn(false); } ! if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE && iAllowGuest) { logIn(true); } *************** *** 183,186 **** --- 202,244 ---- initWidget(vertical); + + sAuthenticateCallback = new AsyncCallback<String>() { + public void onFailure(Throwable caught) { + iError.setText(caught.getMessage()); + iError.setVisible(true); + iUserName.setEnabled(true); + iUserPassword.setEnabled(true); + iLogIn.setEnabled(true); + iSkip.setEnabled(true); + Scheduler.get().scheduleDeferred(new ScheduledCommand() { + @Override + public void execute() { + iUserName.selectAll(); + iUserName.setFocus(true); + } + }); + } + public void onSuccess(String result) { + iUserName.setEnabled(true); + iUserPassword.setEnabled(true); + iLogIn.setEnabled(true); + iSkip.setEnabled(true); + iError.setVisible(false); + iDialog.hide(); + iUserLabel.setText(MESSAGES.userLabel(result)); + iLastUser = result; + iHint.setText(MESSAGES.userHintLogout()); + iLoggedIn = true; + iGuest = false; + UserAuthenticatedEvent e = new UserAuthenticatedEvent(iGuest); + for (UserAuthenticatedHandler h: iUserAuthenticatedHandlers) + h.onLogIn(e); + if (iOnLoginCommand != null) iOnLoginCommand.execute(); + } + }; + } + + public void setAllowLookup(boolean allow) { + iLookup.setVisible(allow); } *************** *** 213,217 **** iError.setVisible(false); if (guest) { ! iSectioningService.logOut(new AsyncCallback<Boolean>() { public void onFailure(Throwable caught) { } public void onSuccess(Boolean result) { --- 271,275 ---- iError.setVisible(false); if (guest) { ! sSectioningService.logOut(new AsyncCallback<Boolean>() { public void onFailure(Throwable caught) { } public void onSuccess(Boolean result) { *************** *** 229,277 **** return; } - if (iAuthenticateCallback == null) { - iAuthenticateCallback = new AsyncCallback<String>() { - public void onFailure(Throwable caught) { - iError.setText(caught.getMessage()); - iError.setVisible(true); - iUserName.setEnabled(true); - iUserPassword.setEnabled(true); - iLogIn.setEnabled(true); - iSkip.setEnabled(true); - Scheduler.get().scheduleDeferred(new ScheduledCommand() { - @Override - public void execute() { - iUserName.selectAll(); - iUserName.setFocus(true); - } - }); - } - public void onSuccess(String result) { - iUserName.setEnabled(true); - iUserPassword.setEnabled(true); - iLogIn.setEnabled(true); - iSkip.setEnabled(true); - iError.setVisible(false); - iDialog.hide(); - iUserLabel.setText(MESSAGES.userLabel(result)); - iLastUser = result; - iHint.setText(MESSAGES.userHintLogout()); - iLoggedIn = true; - iGuest = false; - UserAuthenticatedEvent e = new UserAuthenticatedEvent(iGuest); - for (UserAuthenticatedHandler h: iUserAuthenticatedHandlers) - h.onLogIn(e); - if (iOnLoginCommand != null) iOnLoginCommand.execute(); - } - }; - } iUserName.setEnabled(false); iUserPassword.setEnabled(false); iLogIn.setEnabled(false); iSkip.setEnabled(false); ! iSectioningService.logIn(iUserName.getText(), iUserPassword.getText(), iAuthenticateCallback); } public void logOut() { ! iSectioningService.logOut(new AsyncCallback<Boolean>() { public void onFailure(Throwable caught) { } public void onSuccess(Boolean result) { --- 287,299 ---- return; } iUserName.setEnabled(false); iUserPassword.setEnabled(false); iLogIn.setEnabled(false); iSkip.setEnabled(false); ! sSectioningService.logIn(iUserName.getText(), iUserPassword.getText(), sAuthenticateCallback); } public void logOut() { ! sSectioningService.logOut(new AsyncCallback<Boolean>() { public void onFailure(Throwable caught) { } public void onSuccess(Boolean result) { *************** *** 327,329 **** --- 349,362 ---- } + public static void personFound(String externalUniqueId) { + sSectioningService.logIn("LOOKUP", externalUniqueId, sAuthenticateCallback); + } + + private native JavaScriptObject createLookupCallback() /*-{ + return function(person) { + @org.unitime.timetable.gwt.client.sectioning.UserAuthentication::personFound(Ljava/lang/String;)(person[0]); + }; + }-*/; + + } |
|
From: Tomas M. <to...@us...> - 2010-11-15 18:17:43
|
Update of /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/services In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18377/JavaSource/org/unitime/timetable/gwt/services Modified Files: Tag: dev_curriculum SectioningServiceAsync.java SectioningService.java Log Message: Student Sectioning Assistant - allow student lookup (when used by admin) Student Course Requests - allow student lookup (when used by admin) - requires authentication - ensure that student course requests are reloaded when academic session is changed Index: SectioningService.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/services/Attic/SectioningService.java,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** SectioningService.java 15 Nov 2010 15:15:43 -0000 1.1.2.5 --- SectioningService.java 15 Nov 2010 18:17:35 -0000 1.1.2.6 *************** *** 51,53 **** --- 51,54 ---- Boolean saveRequest(CourseRequestInterface request) throws SectioningException; ArrayList<Long> enroll(CourseRequestInterface request, ArrayList<ClassAssignmentInterface.ClassAssignment> currentAssignment) throws SectioningException; + public Boolean isAdmin() throws SectioningException; } Index: SectioningServiceAsync.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/services/Attic/SectioningServiceAsync.java,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** SectioningServiceAsync.java 15 Nov 2010 15:15:43 -0000 1.1.2.4 --- SectioningServiceAsync.java 15 Nov 2010 18:17:35 -0000 1.1.2.5 *************** *** 49,51 **** --- 49,52 ---- void saveRequest(CourseRequestInterface request, AsyncCallback<Boolean> callback) throws SectioningException; void enroll(CourseRequestInterface request, ArrayList<ClassAssignmentInterface.ClassAssignment> currentAssignment, AsyncCallback<ArrayList<Long>> callback) throws SectioningException; + void isAdmin(AsyncCallback<Boolean> isAdmin) throws SectioningException; } |
|
From: Tomas M. <to...@us...> - 2010-11-15 18:15:50
|
Update of /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/client/sectioning In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv17742/JavaSource/org/unitime/timetable/gwt/client/sectioning Modified Files: Tag: dev_curriculum FreeTimePicker.java Log Message: Selection of free times in the Student Scheduling Assistant - in some cases the page froze - it seems to start happening after the GWT 2.1 update, in for cycles like: for (int p0=0; p0<CONSTANTS.freeTimePeriods().length - 1; p0++) { for (int d0=0; d0<CONSTANTS.freeTimeDays().length; d0++) { if (!s[d0][p0]) continue; - when continue was called d0 was not increased for some reason -> changed the component to avoid continue Index: FreeTimePicker.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/client/sectioning/Attic/FreeTimePicker.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** FreeTimePicker.java 9 Nov 2010 12:25:52 -0000 1.1.2.2 --- FreeTimePicker.java 15 Nov 2010 18:15:41 -0000 1.1.2.3 *************** *** 140,159 **** for (int p0=0; p0<CONSTANTS.freeTimePeriods().length - 1; p0++) { for (int d0=0; d0<CONSTANTS.freeTimeDays().length; d0++) { ! if (!s[d0][p0]) continue; ! int lastP1 = p0; ! p1: for (int p1=p0+1; p1<CONSTANTS.freeTimePeriods().length - 1; p1++) { ! for (int d=0; d<CONSTANTS.freeTimeDays().length; d++) { ! if (s[d][p0] && !s[d][p1]) break p1; } ! lastP1 = p1; for (int d=0; d<CONSTANTS.freeTimeDays().length; d++) ! if (s[d][p0]) s[d][p1] = false; } - CourseRequestInterface.FreeTime ft = new CourseRequestInterface.FreeTime(); - for (int d=0; d<CONSTANTS.freeTimeDays().length; d++) - if (s[d][p0]) { ft.addDay(d); s[d][p0] = false; } - ft.setStart(toSlot(p0)); - ft.setLength(toSlot(lastP1 + 1) - toSlot(p0)); - return ft; } } --- 140,160 ---- for (int p0=0; p0<CONSTANTS.freeTimePeriods().length - 1; p0++) { for (int d0=0; d0<CONSTANTS.freeTimeDays().length; d0++) { ! if (s[d0][p0]) { ! int lastP1 = p0; ! p1: for (int p1=p0+1; p1<CONSTANTS.freeTimePeriods().length - 1; p1++) { ! for (int d=0; d<CONSTANTS.freeTimeDays().length; d++) { ! if (s[d][p0] && !s[d][p1]) break p1; ! } ! lastP1 = p1; ! for (int d=0; d<CONSTANTS.freeTimeDays().length; d++) ! if (s[d][p0]) s[d][p1] = false; } ! CourseRequestInterface.FreeTime ft = new CourseRequestInterface.FreeTime(); for (int d=0; d<CONSTANTS.freeTimeDays().length; d++) ! if (s[d][p0]) { ft.addDay(d); s[d][p0] = false; } ! ft.setStart(toSlot(p0)); ! ft.setLength(toSlot(lastP1 + 1) - toSlot(p0)); ! return ft; } } } *************** *** 187,193 **** for (CourseRequestInterface.FreeTime f: freeTimes) { for (int day: f.getDays()) { ! if (day >= CONSTANTS.freeTimeDays().length) continue; ! for (int p = toPeriod(f.getStart()); p < toPeriod(f.getStart() + f.getLength()); p++) ! iSelected[day][p] = true; } } --- 188,195 ---- for (CourseRequestInterface.FreeTime f: freeTimes) { for (int day: f.getDays()) { ! if (day < CONSTANTS.freeTimeDays().length) { ! for (int p = toPeriod(f.getStart()); p < toPeriod(f.getStart() + f.getLength()); p++) ! iSelected[day][p] = true; ! } } } *************** *** 199,261 **** for (int p0=0; p0<CONSTANTS.freeTimePeriods().length - 1; p0++) for (int d0=0; d0<CONSTANTS.freeTimeDays().length; d0++) { ! if (!s[d0][p0]) continue; ! boolean mwf0 = (d0 % 2 == 0); ! boolean odd0 = (mwf0 ? p0 % 4 <= 1 : p0 % 6 > 2); ! int first = 0; ! for (int i=0; i<CONSTANTS.freeTimeOneDay150().length; i++) ! if (Integer.parseInt(CONSTANTS.freeTimeOneDay150()[i]) <= p0) first = Integer.parseInt(CONSTANTS.freeTimeOneDay150()[i]); ! if (mwf0) { ! boolean hasM = false, hasF = false; ! boolean hasS = false, hasT = false; ! boolean allTheSame = true; ! for (int p1=first; p1<Math.min(first + 6, CONSTANTS.freeTimePeriods().length - 1); p1++) { ! if (s[0][p1]) hasM = true; ! if (s[4][p1]) hasF = true; ! if (p1 - first >= 2 && p1 - first < 4 && (s[0][p1] || s[2][p1] || s[4][p1])) hasS = true; ! if (p1 - first >= 4 && (s[0][p1] || s[2][p1] || s[4][p1])) hasT = true; ! if (d0!=0 && s[0][p1]) allTheSame = false; ! if (d0!=2 && s[2][p1]) allTheSame = false; ! if (d0!=4 && s[4][p1]) allTheSame = false; ! } ! if (((!hasM || !hasT || !hasF) && hasS && hasT) || ! (allTheSame && (hasS || hasT))) { for (int p1=first; p1<Math.min(first + 6, CONSTANTS.freeTimePeriods().length - 1); p1++) { ! if (s[d0][p1]) { ! iGrid.setText(1 + d0, 1 + p1, String.valueOf(priority)); ! s[d0][p1] = false; } } ! return true; ! } ! } else { ! boolean allTheSame = true; ! boolean hasT = false; ! for (int p1=first; p1<Math.min(first + 6, CONSTANTS.freeTimePeriods().length - 1); p1++) { ! if (p1 - first >= 4 && (s[1][p1] || s[3][p1])) hasT = true; ! if (d0!=1 && s[1][p1]) allTheSame = false; ! if (d0!=3 && s[3][p1]) allTheSame = false; ! } ! if (allTheSame || (hasT && 3 * (first / 3) != first)) { for (int p1=first; p1<Math.min(first + 6, CONSTANTS.freeTimePeriods().length - 1); p1++) { ! if (s[d0][p1]) { ! iGrid.setText(1 + d0, 1 + p1, String.valueOf(priority)); ! s[d0][p1] = false; } } - return true; } ! } ! p1: for (int p1=p0; p1<CONSTANTS.freeTimePeriods().length - 1; p1++) ! for (int d1=0; d1<CONSTANTS.freeTimeDays().length; d1++) { ! boolean mwf1 = (d1 % 2 == 0); ! boolean odd1 = (mwf1 ? p1 % 4 <= 1 : p1 % 6 > 2); ! if (mwf0 == mwf1 && odd0 != odd1) break p1; ! if (!s[d1][p1]) continue; ! if (mwf0 == mwf1 && odd0 == odd1) { ! iGrid.setText(1 + d1, 1 + p1, String.valueOf(priority)); ! s[d1][p1] = false; } ! } ! return true; } return false; --- 201,265 ---- for (int p0=0; p0<CONSTANTS.freeTimePeriods().length - 1; p0++) for (int d0=0; d0<CONSTANTS.freeTimeDays().length; d0++) { ! if (s[d0][p0]) { ! boolean mwf0 = (d0 % 2 == 0); ! boolean odd0 = (mwf0 ? p0 % 4 <= 1 : p0 % 6 > 2); ! int first = 0; ! for (int i=0; i<CONSTANTS.freeTimeOneDay150().length; i++) ! if (Integer.parseInt(CONSTANTS.freeTimeOneDay150()[i]) <= p0) first = Integer.parseInt(CONSTANTS.freeTimeOneDay150()[i]); ! if (mwf0) { ! boolean hasM = false, hasF = false; ! boolean hasS = false, hasT = false; ! boolean allTheSame = true; for (int p1=first; p1<Math.min(first + 6, CONSTANTS.freeTimePeriods().length - 1); p1++) { ! if (s[0][p1]) hasM = true; ! if (s[4][p1]) hasF = true; ! if (p1 - first >= 2 && p1 - first < 4 && (s[0][p1] || s[2][p1] || s[4][p1])) hasS = true; ! if (p1 - first >= 4 && (s[0][p1] || s[2][p1] || s[4][p1])) hasT = true; ! if (d0!=0 && s[0][p1]) allTheSame = false; ! if (d0!=2 && s[2][p1]) allTheSame = false; ! if (d0!=4 && s[4][p1]) allTheSame = false; ! } ! if (((!hasM || !hasT || !hasF) && hasS && hasT) || ! (allTheSame && (hasS || hasT))) { ! for (int p1=first; p1<Math.min(first + 6, CONSTANTS.freeTimePeriods().length - 1); p1++) { ! if (s[d0][p1]) { ! iGrid.setText(1 + d0, 1 + p1, String.valueOf(priority)); ! s[d0][p1] = false; ! } } + return true; } ! } else { ! boolean allTheSame = true; ! boolean hasT = false; for (int p1=first; p1<Math.min(first + 6, CONSTANTS.freeTimePeriods().length - 1); p1++) { ! if (p1 - first >= 4 && (s[1][p1] || s[3][p1])) hasT = true; ! if (d0!=1 && s[1][p1]) allTheSame = false; ! if (d0!=3 && s[3][p1]) allTheSame = false; ! } ! if (allTheSame || (hasT && 3 * (first / 3) != first)) { ! for (int p1=first; p1<Math.min(first + 6, CONSTANTS.freeTimePeriods().length - 1); p1++) { ! if (s[d0][p1]) { ! iGrid.setText(1 + d0, 1 + p1, String.valueOf(priority)); ! s[d0][p1] = false; ! } } + return true; } } ! p1: for (int p1=p0; p1<CONSTANTS.freeTimePeriods().length - 1; p1++) ! for (int d1=0; d1<CONSTANTS.freeTimeDays().length; d1++) { ! boolean mwf1 = (d1 % 2 == 0); ! boolean odd1 = (mwf1 ? p1 % 4 <= 1 : p1 % 6 > 2); ! if (mwf0 == mwf1 && odd0 != odd1) break p1; ! if (s[d1][p1]) { ! if (mwf0 == mwf1 && odd0 == odd1) { ! iGrid.setText(1 + d1, 1 + p1, String.valueOf(priority)); ! s[d1][p1] = false; ! } ! } } ! return true; ! } } return false; *************** *** 298,313 **** boolean mwfDown = (iDownDay % 2 == 0); all: for (int d=d0; d<=d1; d++) { ! if (d1 - d0 > 1 && (d % 2 == 0) != mwfDown) continue; ! for (int p=p0; p<=p1; p++) ! if (!iSelected[d][p]) { ! allSelected = false; break all; ! } } long ts = iTime++; for (int d=d0; d<=d1; d++) { ! if (d1 - d0 > 1 && (d % 2 == 0) != mwfDown) continue; ! for (int p=p0; p<=p1; p++) { ! iSelected[d][p] = !allSelected; ! iLastSelectedTime[d][p] = ts; } } --- 302,319 ---- boolean mwfDown = (iDownDay % 2 == 0); all: for (int d=d0; d<=d1; d++) { ! if (d1 - d0 <= 0 || (d % 2 == 0) == mwfDown) { ! for (int p=p0; p<=p1; p++) ! if (!iSelected[d][p]) { ! allSelected = false; break all; ! } ! } } long ts = iTime++; for (int d=d0; d<=d1; d++) { ! if (d1 - d0 <= 1 || (d % 2 == 0) == mwfDown) { ! for (int p=p0; p<=p1; p++) { ! iSelected[d][p] = !allSelected; ! iLastSelectedTime[d][p] = ts; ! } } } |
|
From: Tomas M. <to...@us...> - 2010-11-15 16:42:36
|
Update of /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/action In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv3514/JavaSource/org/unitime/timetable/action Modified Files: Tag: dev_curriculum PersonalizedExamReportAction.java Log Message: Personal Schedule - fixed ArrayIndexOutOfBoundsException when sorting by the last column (Examination Schedule and Examination Conflicts tables) - when sorting is changed (user clicked on a column name) - remember user and current academic session -- pass back in an encoded form (so that user external id is not shown in the URL) Index: PersonalizedExamReportAction.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/action/PersonalizedExamReportAction.java,v retrieving revision 1.30.2.6 retrieving revision 1.30.2.7 diff -C2 -d -r1.30.2.6 -r1.30.2.7 *** PersonalizedExamReportAction.java 9 Nov 2010 12:25:49 -0000 1.30.2.6 --- PersonalizedExamReportAction.java 15 Nov 2010 16:42:24 -0000 1.30.2.7 *************** *** 151,154 **** --- 151,162 ---- } + if (request.getParameter("q") != null) { + String[] params = CalendarServlet.decode(request.getParameter("q")).split(":"); + if (params != null && params.length == 2) { + myForm.setUid(params[0]); + myForm.setSessionId(Long.valueOf(params[1])); + } + } + myForm.setAdmin(user.isAdmin()); myForm.setLogout(!"back".equals(back)); *************** *** 569,573 **** PdfWebTable table = new PdfWebTable( 5, "Available Academic Sessions for "+name, ! "personalSchedule.do?o0=%%", new String[] { "Term", --- 577,581 ---- PdfWebTable table = new PdfWebTable( 5, "Available Academic Sessions for "+name, ! "personalSchedule.do?o0=%%" + (sessionId == null ? "" : "&sessionId=" + sessionId), new String[] { "Term", *************** *** 598,602 **** PdfWebTable table = new PdfWebTable( 5, student.getSession().getLabel()+" Examination Schedule for "+student.getName(DepartmentalInstructor.sNameFormatLastFist), ! "personalSchedule.do?o1=%%&uid="+student.getExternalUniqueId(), new String[] { "Class / Course", --- 606,610 ---- PdfWebTable table = new PdfWebTable( 5, student.getSession().getLabel()+" Examination Schedule for "+student.getName(DepartmentalInstructor.sNameFormatLastFist), ! "personalSchedule.do?o1=%%&q=" + CalendarServlet.encode(student.getExternalUniqueId()+ ":" + student.getSession().getUniqueId()), new String[] { "Class / Course", *************** *** 633,637 **** table.setWebTableTweakStyle(new WebTableTweakStyle() { public String getStyleHtml(WebTableLine current, WebTableLine next, int order) { ! if (next!=null && ((MultiComparable)current.getOrderBy()[Math.abs(order)]).getContent()[0].compareTo(((MultiComparable)next.getOrderBy()[Math.abs(order)]).getContent()[0])!=0) return "border-bottom: rgb(81,81,81) 1px dashed"; return null; --- 641,645 ---- table.setWebTableTweakStyle(new WebTableTweakStyle() { public String getStyleHtml(WebTableLine current, WebTableLine next, int order) { ! if (next!=null && ((MultiComparable)current.getOrderBy()[0]).getContent()[0].compareTo(((MultiComparable)next.getOrderBy()[0]).getContent()[0])!=0) return "border-bottom: rgb(81,81,81) 1px dashed"; return null; *************** *** 645,649 **** PdfWebTable table = new PdfWebTable( 6, student.getSession().getLabel()+" Examination Conflicts and/or Back-To-Back Examinations for "+student.getName(DepartmentalInstructor.sNameFormatLastFist), ! "personalSchedule.do?o3=%%&uid="+student.getExternalUniqueId(), new String[] { "Type", --- 653,657 ---- PdfWebTable table = new PdfWebTable( 6, student.getSession().getLabel()+" Examination Conflicts and/or Back-To-Back Examinations for "+student.getName(DepartmentalInstructor.sNameFormatLastFist), ! "personalSchedule.do?o3=%%&q=" + CalendarServlet.encode(student.getExternalUniqueId()+ ":" + student.getSession().getUniqueId()), new String[] { "Type", *************** *** 817,821 **** table.setWebTableTweakStyle(new WebTableTweakStyle() { public String getStyleHtml(WebTableLine current, WebTableLine next, int order) { ! if (next!=null && ((MultiComparable)current.getOrderBy()[Math.abs(order)]).getContent()[0].compareTo(((MultiComparable)next.getOrderBy()[Math.abs(order)]).getContent()[0])!=0) return "border-bottom: rgb(81,81,81) 1px dashed"; return null; --- 825,829 ---- table.setWebTableTweakStyle(new WebTableTweakStyle() { public String getStyleHtml(WebTableLine current, WebTableLine next, int order) { ! if (next!=null && ((MultiComparable)current.getOrderBy()[0]).getContent()[0].compareTo(((MultiComparable)next.getOrderBy()[0]).getContent()[0])!=0) return "border-bottom: rgb(81,81,81) 1px dashed"; return null; *************** *** 830,834 **** PdfWebTable table = new PdfWebTable( 8, instructor.getDepartment().getSession().getLabel()+" Examination Instructor Schedule for "+instructor.getName(DepartmentalInstructor.sNameFormatLastFist), ! "personalSchedule.do?o2=%%&uid="+instructor.getExternalUniqueId(), new String[] { "Class / Course", --- 838,842 ---- PdfWebTable table = new PdfWebTable( 8, instructor.getDepartment().getSession().getLabel()+" Examination Instructor Schedule for "+instructor.getName(DepartmentalInstructor.sNameFormatLastFist), ! "personalSchedule.do?o2=%%&q=" + CalendarServlet.encode(instructor.getExternalUniqueId()+ ":" + instructor.getDepartment().getSession().getUniqueId()), new String[] { "Class / Course", *************** *** 872,876 **** table.setWebTableTweakStyle(new WebTableTweakStyle() { public String getStyleHtml(WebTableLine current, WebTableLine next, int order) { ! if (next!=null && ((MultiComparable)current.getOrderBy()[Math.abs(order)]).getContent()[0].compareTo(((MultiComparable)next.getOrderBy()[Math.abs(order)]).getContent()[0])!=0) return "border-bottom: rgb(81,81,81) 1px dashed"; return null; --- 880,884 ---- table.setWebTableTweakStyle(new WebTableTweakStyle() { public String getStyleHtml(WebTableLine current, WebTableLine next, int order) { ! if (next!=null && ((MultiComparable)current.getOrderBy()[0]).getContent()[0].compareTo(((MultiComparable)next.getOrderBy()[0]).getContent()[0])!=0) return "border-bottom: rgb(81,81,81) 1px dashed"; return null; *************** *** 884,888 **** PdfWebTable table = new PdfWebTable( 8, instructor.getDepartment().getSession().getLabel()+" Examination Instructor Conflicts and/or Back-To-Back Examinations for "+instructor.getName(DepartmentalInstructor.sNameFormatLastFist), ! "personalSchedule.do?o4=%%&uid="+instructor.getExternalUniqueId(), new String[] { "Type", --- 892,896 ---- PdfWebTable table = new PdfWebTable( 8, instructor.getDepartment().getSession().getLabel()+" Examination Instructor Conflicts and/or Back-To-Back Examinations for "+instructor.getName(DepartmentalInstructor.sNameFormatLastFist), ! "personalSchedule.do?o4=%%&q=" + CalendarServlet.encode(instructor.getExternalUniqueId()+ ":"+instructor.getDepartment().getSession().getUniqueId()), new String[] { "Type", *************** *** 1077,1081 **** table.setWebTableTweakStyle(new WebTableTweakStyle() { public String getStyleHtml(WebTableLine current, WebTableLine next, int order) { ! if (next!=null && ((MultiComparable)current.getOrderBy()[Math.abs(order)]).getContent()[0].compareTo(((MultiComparable)next.getOrderBy()[Math.abs(order)]).getContent()[0])!=0) return "border-bottom: rgb(81,81,81) 1px dashed"; return null; --- 1085,1089 ---- table.setWebTableTweakStyle(new WebTableTweakStyle() { public String getStyleHtml(WebTableLine current, WebTableLine next, int order) { ! if (next!=null && ((MultiComparable)current.getOrderBy()[0]).getContent()[0].compareTo(((MultiComparable)next.getOrderBy()[0]).getContent()[0])!=0) return "border-bottom: rgb(81,81,81) 1px dashed"; return null; *************** *** 1089,1093 **** PdfWebTable table = new PdfWebTable( 8, instructor.getDepartment().getSession().getLabel()+" Examination Conflicts for "+instructor.getName(DepartmentalInstructor.sNameFormatLastFist), ! "personalSchedule.do?o5=%%&uid="+instructor.getExternalUniqueId(), new String[] { "Name", --- 1097,1101 ---- PdfWebTable table = new PdfWebTable( 8, instructor.getDepartment().getSession().getLabel()+" Examination Conflicts for "+instructor.getName(DepartmentalInstructor.sNameFormatLastFist), ! "personalSchedule.do?o5=%%&q=" + CalendarServlet.encode(instructor.getExternalUniqueId()+ ":"+instructor.getDepartment().getSession().getUniqueId()), new String[] { "Name", *************** *** 1304,1308 **** table.setWebTableTweakStyle(new WebTableTweakStyle() { public String getStyleHtml(WebTableLine current, WebTableLine next, int order) { ! if (next!=null && ((MultiComparable)current.getOrderBy()[Math.abs(order)]).getContent()[0].compareTo(((MultiComparable)next.getOrderBy()[Math.abs(order)]).getContent()[0])!=0) return "border-bottom: rgb(81,81,81) 1px solid"; return null; --- 1312,1316 ---- table.setWebTableTweakStyle(new WebTableTweakStyle() { public String getStyleHtml(WebTableLine current, WebTableLine next, int order) { ! if (next!=null && ((MultiComparable)current.getOrderBy()[0]).getContent()[0].compareTo(((MultiComparable)next.getOrderBy()[0]).getContent()[0])!=0) return "border-bottom: rgb(81,81,81) 1px solid"; return null; *************** *** 1396,1400 **** PdfWebTable table = new PdfWebTable( 6, student.getSession().getLabel()+" Class Schedule for "+student.getName(DepartmentalInstructor.sNameFormatLastFist), ! "personalSchedule.do?o6=%%&uid="+student.getExternalUniqueId(), new String[] { "Course", --- 1404,1408 ---- PdfWebTable table = new PdfWebTable( 6, student.getSession().getLabel()+" Class Schedule for "+student.getName(DepartmentalInstructor.sNameFormatLastFist), ! "personalSchedule.do?o6=%%&q=" + CalendarServlet.encode(student.getExternalUniqueId()+ ":"+student.getSession().getUniqueId()), new String[] { "Course", *************** *** 1445,1449 **** PdfWebTable table = new PdfWebTable( 6, instructor.getDepartment().getSession().getLabel()+" Class Schedule for "+instructor.getName(DepartmentalInstructor.sNameFormatLastFist), ! "personalSchedule.do?o7=%%&uid="+instructor.getExternalUniqueId(), new String[] { "Course", --- 1453,1457 ---- PdfWebTable table = new PdfWebTable( 6, instructor.getDepartment().getSession().getLabel()+" Class Schedule for "+instructor.getName(DepartmentalInstructor.sNameFormatLastFist), ! "personalSchedule.do?o7=%%&q=" + CalendarServlet.encode(instructor.getExternalUniqueId()+ ":"+instructor.getDepartment().getSession().getUniqueId()), new String[] { "Course", |
|
From: Tomas M. <to...@us...> - 2010-11-15 16:37:48
|
Update of /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/filter In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv1491/JavaSource/org/unitime/timetable/filter Modified Files: Tag: dev_curriculum QueryLogFilter.java Log Message: exception handling corrected Index: QueryLogFilter.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/filter/Attic/QueryLogFilter.java,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** QueryLogFilter.java 9 Nov 2010 19:40:42 -0000 1.1.2.4 --- QueryLogFilter.java 15 Nov 2010 16:37:39 -0000 1.1.2.5 *************** *** 124,127 **** --- 124,128 ---- if (t.getStackTrace() != null && t.getStackTrace().length > 0) ex += " (at " + t.getStackTrace()[0].getFileName() + ":" + t.getStackTrace()[0].getLineNumber() + ")"; + t = t.getCause(); } if (!ex.isEmpty()) |
|
From: Tomas M. <to...@us...> - 2010-11-15 15:15:57
|
Update of /cvsroot/unitime/UniTime/JavaSource In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv3673/JavaSource Modified Files: Tag: dev_curriculum menu.xml Log Message: Student Course Requests page added - added ability to record student course and free time requests (pre-registration) using the Student Scheduling Assistant interface - added session status option (sectioning -- registration), Student Course Requests page is only available for academic sessions with a status enabling this feature - authenticated students should see "Course Requests" in the menu (if there is at least one academic session with this feature enabled) Index: menu.xml =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/Attic/menu.xml,v retrieving revision 1.1.2.14 retrieving revision 1.1.2.15 diff -C2 -d -r1.1.2.14 -r1.1.2.15 *** menu.xml 9 Nov 2010 12:25:48 -0000 1.1.2.14 --- menu.xml 15 Nov 2010 15:15:44 -0000 1.1.2.15 *************** *** 130,133 **** --- 130,138 ---- </condition> </item> + <item name="Course Requests" page="requests" type="gwt"> + <condition> + <isRegistrationEnabled/> + </condition> + </item> <item name="Enrollment Audits" page="enrollmentAuditPdfReport.do"/> </menu> *************** *** 231,234 **** --- 236,247 ---- <item name="Timetable" page="timetable" type="gwt" /> </menu> + <item name="Course Requests" page="requests" type="gwt"> + <condition> + <and> + <isStudent/> + <isRegistrationEnabled/> + </and> + </condition> + </item> <item name="Scheduling Assistant" page="sectioning" type="gwt"> <condition> |
|
From: Tomas M. <to...@us...> - 2010-11-15 15:15:53
|
Update of /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/form In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv3673/JavaSource/org/unitime/timetable/form Modified Files: Tag: dev_curriculum DeptStatusTypeEditForm.java Log Message: Student Course Requests page added - added ability to record student course and free time requests (pre-registration) using the Student Scheduling Assistant interface - added session status option (sectioning -- registration), Student Course Requests page is only available for academic sessions with a status enabling this feature - authenticated students should see "Course Requests" in the menu (if there is at least one academic session with this feature enabled) Index: DeptStatusTypeEditForm.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/form/DeptStatusTypeEditForm.java,v retrieving revision 1.6.2.3 retrieving revision 1.6.2.4 diff -C2 -d -r1.6.2.3 -r1.6.2.4 *** DeptStatusTypeEditForm.java 9 Nov 2010 12:25:47 -0000 1.6.2.3 --- DeptStatusTypeEditForm.java 15 Nov 2010 15:15:43 -0000 1.6.2.4 *************** *** 63,66 **** --- 63,67 ---- private boolean iCanNoRoleReportClass = false; private boolean iCanSectioningStudents = false; + private boolean iCanPreRegisterStudents = false; *************** *** 109,112 **** --- 110,114 ---- iCanNoRoleReportClass = false; iCanSectioningStudents = false; + iCanPreRegisterStudents = false; } *************** *** 163,166 **** --- 165,170 ---- public void setCanSectioningStudents(boolean canSectioningStudents) { iCanSectioningStudents = canSectioningStudents; } public boolean getCanSectioningStudents() { return iCanSectioningStudents; } + public void setCanPreRegisterStudents(boolean canPreRegisterStudents) { iCanPreRegisterStudents = canPreRegisterStudents; } + public boolean getCanPreRegisterStudents() { return iCanPreRegisterStudents; } public int getRights() { *************** *** 182,185 **** --- 186,190 ---- if (getCanNoRoleReportClass()) rights += DepartmentStatusType.sCanNoRoleReportClass; if (getCanSectioningStudents()) rights += DepartmentStatusType.sCanSectioningStudents; + if (getCanPreRegisterStudents()) rights += DepartmentStatusType.sCanPreRegisterStudents; return rights; } *************** *** 201,204 **** --- 206,210 ---- setCanNoRoleReportClass((rights&DepartmentStatusType.sCanNoRoleReportClass)==DepartmentStatusType.sCanNoRoleReportClass); setCanSectioningStudents((rights&DepartmentStatusType.sCanSectioningStudents)==DepartmentStatusType.sCanSectioningStudents); + setCanPreRegisterStudents((rights&DepartmentStatusType.sCanPreRegisterStudents)==DepartmentStatusType.sCanPreRegisterStudents); } |
|
From: Tomas M. <to...@us...> - 2010-11-15 15:15:52
|
Update of /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/server In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv3673/JavaSource/org/unitime/timetable/gwt/server Modified Files: Tag: dev_curriculum MenuServlet.java SectioningServer.java SectioningServlet.java Log Message: Student Course Requests page added - added ability to record student course and free time requests (pre-registration) using the Student Scheduling Assistant interface - added session status option (sectioning -- registration), Student Course Requests page is only available for academic sessions with a status enabling this feature - authenticated students should see "Course Requests" in the menu (if there is at least one academic session with this feature enabled) Index: SectioningServlet.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/server/Attic/SectioningServlet.java,v retrieving revision 1.1.2.9 retrieving revision 1.1.2.10 diff -C2 -d -r1.1.2.9 -r1.1.2.10 *** SectioningServlet.java 9 Nov 2010 12:25:51 -0000 1.1.2.9 --- SectioningServlet.java 15 Nov 2010 15:15:43 -0000 1.1.2.10 *************** *** 37,40 **** --- 37,41 ---- import javax.servlet.ServletException; + import net.sf.cpsolver.coursett.model.Placement; import net.sf.cpsolver.coursett.model.RoomLocation; import net.sf.cpsolver.studentsct.model.Config; *************** *** 49,74 **** --- 50,83 ---- import org.unitime.timetable.authenticate.jaas.LoginConfiguration; import org.unitime.timetable.authenticate.jaas.UserPasswordHandler; + import org.unitime.timetable.gwt.server.custom.CourseDetailsProvider; import org.unitime.timetable.gwt.server.custom.CustomSectionNames; import org.unitime.timetable.gwt.services.SectioningService; import org.unitime.timetable.gwt.shared.ClassAssignmentInterface; import org.unitime.timetable.gwt.shared.CourseRequestInterface; + import org.unitime.timetable.gwt.shared.CurriculaException; import org.unitime.timetable.gwt.shared.SectioningException; import org.unitime.timetable.gwt.shared.SectioningExceptionType; import org.unitime.timetable.gwt.shared.ClassAssignmentInterface.CourseAssignment; import org.unitime.timetable.model.Assignment; + import org.unitime.timetable.model.ClassInstructor; import org.unitime.timetable.model.Class_; import org.unitime.timetable.model.CourseDemand; import org.unitime.timetable.model.CourseOffering; + import org.unitime.timetable.model.CourseOfferingReservation; import org.unitime.timetable.model.CourseRequest; import org.unitime.timetable.model.DepartmentalInstructor; import org.unitime.timetable.model.FreeTime; + import org.unitime.timetable.model.InstrOfferingConfig; import org.unitime.timetable.model.Location; import org.unitime.timetable.model.Roles; + import org.unitime.timetable.model.SchedulingSubpart; import org.unitime.timetable.model.Session; import org.unitime.timetable.model.Student; import org.unitime.timetable.model.StudentClassEnrollment; import org.unitime.timetable.model.StudentSectioningQueue; + import org.unitime.timetable.model.comparators.ClassComparator; import org.unitime.timetable.model.dao.Class_DAO; import org.unitime.timetable.model.dao.CourseOfferingDAO; + import org.unitime.timetable.model.dao.CurriculumDAO; import org.unitime.timetable.model.dao.SessionDAO; import org.unitime.timetable.model.dao.StudentDAO; *************** *** 144,167 **** if (sessionId==null) throw new SectioningException(SectioningExceptionType.NO_ACADEMIC_SESSION); setLastSessionId(sessionId); ! ArrayList<ClassAssignmentInterface.CourseAssignment> ret = new ArrayList<ClassAssignmentInterface.CourseAssignment>(); ! try { ! for (CourseInfo c: SectioningServer.getInstance(sessionId).findCourses(query, limit)) { CourseAssignment course = new CourseAssignment(); course.setCourseId(c.getUniqueId()); ! course.setSubject(c.getSubjectArea()); course.setCourseNbr(c.getCourseNbr()); ! course.setNote(c.getNote()); course.setTitle(c.getTitle()); ! course.setHasUniqueName(c.hasUniqueName()); ! ret.add(course); } ! } catch (Exception e) { ! sLog.error(e.getMessage(), e); ! throw new SectioningException(SectioningExceptionType.UNKNOWN, e); ! } ! if (ret.isEmpty()) { ! throw new SectioningException(SectioningExceptionType.COURSE_NOT_EXIST, query); } - return ret; } --- 153,222 ---- if (sessionId==null) throw new SectioningException(SectioningExceptionType.NO_ACADEMIC_SESSION); setLastSessionId(sessionId); ! if (SectioningServer.getInstance(sessionId) == null) { ! ArrayList<ClassAssignmentInterface.CourseAssignment> results = new ArrayList<ClassAssignmentInterface.CourseAssignment>(); ! org.hibernate.Session hibSession = CurriculumDAO.getInstance().getSession(); ! for (CourseOffering c: (List<CourseOffering>)hibSession.createQuery( ! "select c from CourseOffering c where " + ! "c.subjectArea.session.uniqueId = :sessionId and (" + ! "lower(c.subjectArea.subjectAreaAbbreviation || ' ' || c.courseNbr) like :q || '%' " + ! (query.length()>2 ? "or lower(c.title) like '%' || :q || '%'" : "") + ") " + ! "order by case " + ! "when lower(c.subjectArea.subjectAreaAbbreviation || ' ' || c.courseNbr) like :q || '%' then 0 else 1 end," + // matches on course name first ! "c.subjectArea.subjectAreaAbbreviation, c.courseNbr") ! .setString("q", query.toLowerCase()) ! .setLong("sessionId", sessionId) ! .setCacheable(true).setMaxResults(limit == null || limit < 0 ? Integer.MAX_VALUE : limit).list()) { CourseAssignment course = new CourseAssignment(); course.setCourseId(c.getUniqueId()); ! course.setSubject(c.getSubjectAreaAbbv()); course.setCourseNbr(c.getCourseNbr()); ! course.setNote(c.getScheduleBookNote()); course.setTitle(c.getTitle()); ! course.setHasUniqueName(true); ! boolean unlimited = false; ! int courseLimit = 0; ! for (Iterator<InstrOfferingConfig> i = c.getInstructionalOffering().getInstrOfferingConfigs().iterator(); i.hasNext(); ) { ! InstrOfferingConfig cfg = i.next(); ! if (cfg.isUnlimitedEnrollment()) unlimited = true; ! if (cfg.getLimit() != null) courseLimit += cfg.getLimit(); ! } ! for (Iterator<CourseOfferingReservation> k = c.getCourseReservations().iterator(); k.hasNext(); ) { ! CourseOfferingReservation reservation = k.next(); ! if (reservation.getCourseOffering().equals(c) && reservation.getReserved()!=null) ! courseLimit = reservation.getReserved(); ! } ! if (courseLimit >= 9999) unlimited = true; ! course.setLimit(unlimited ? -1 : courseLimit); ! course.setProjected(c.getProjectedDemand()); ! course.setEnrollment(c.getEnrollment()); ! course.setLastLike(c.getDemand()); ! results.add(course); } ! if (results.isEmpty()) { ! throw new SectioningException(SectioningExceptionType.COURSE_NOT_EXIST, query); ! } ! return results; ! } else { ! ArrayList<ClassAssignmentInterface.CourseAssignment> ret = new ArrayList<ClassAssignmentInterface.CourseAssignment>(); ! try { ! for (CourseInfo c: SectioningServer.getInstance(sessionId).findCourses(query, limit)) { ! CourseAssignment course = new CourseAssignment(); ! course.setCourseId(c.getUniqueId()); ! course.setSubject(c.getSubjectArea()); ! course.setCourseNbr(c.getCourseNbr()); ! course.setNote(c.getNote()); ! course.setTitle(c.getTitle()); ! course.setHasUniqueName(c.hasUniqueName()); ! ret.add(course); ! } ! } catch (Exception e) { ! sLog.error(e.getMessage(), e); ! throw new SectioningException(SectioningExceptionType.UNKNOWN, e); ! } ! if (ret.isEmpty()) { ! throw new SectioningException(SectioningExceptionType.COURSE_NOT_EXIST, query); ! } ! return ret; } } *************** *** 169,312 **** public Collection<ClassAssignmentInterface.ClassAssignment> listClasses(Long sessionId, String course) throws SectioningException { setLastSessionId(sessionId); ! ArrayList<ClassAssignmentInterface.ClassAssignment> ret = new ArrayList<ClassAssignmentInterface.ClassAssignment>(); ! try { ! if (sessionId==null) throw new SectioningException(SectioningExceptionType.NO_ACADEMIC_SESSION); ! SectioningServer server = SectioningServer.getInstance(sessionId); ! CourseInfo c = server.getCourseInfo(course); ! if (c == null) throw new SectioningException(SectioningExceptionType.COURSE_NOT_EXIST, course); ! Long studentId = getStudentId(sessionId); ! List<Section> sections = server.getSections(c); ! Collections.sort(sections, new Comparator<Section>() { ! public int compare(Config c1, Config c2) { ! int cmp = c1.getName().compareToIgnoreCase(c2.getName()); ! if (cmp != 0) return cmp; ! return Double.compare(c1.getId(), c2.getId()); } ! public boolean isParent(Subpart s1, Subpart s2) { ! Subpart p1 = s1.getParent(); ! if (p1==null) return false; ! if (p1.equals(s2)) return true; ! return isParent(p1, s2); } ! public int compare(Subpart s1, Subpart s2) { ! int cmp = compare(s1.getConfig(), s2.getConfig()); ! if (cmp != 0) return cmp; ! if (isParent(s1,s2)) return 1; ! if (isParent(s2,s1)) return -1; ! cmp = s1.getInstructionalType().compareTo(s2.getInstructionalType()); ! if (cmp != 0) return cmp; ! return Double.compare(s1.getId(), s2.getId()); } ! public int compare(Section s1, Section s2) { ! int cmp = compare(s1.getSubpart(), s2.getSubpart()); ! if (cmp != 0) return cmp; ! cmp = (s1.getName() == null ? "" : s1.getName()).compareTo(s2.getName() == null ? "" : s2.getName()); ! if (cmp != 0) return cmp; ! return Double.compare(s1.getId(), s2.getId()); } ! }); ! Hashtable<Long, int[]> limits = null; ! if (SectioningServer.sSectionLimitProvider != null) { ! ArrayList<Long> classIds = new ArrayList<Long>(); ! final Hashtable<Long, String> classNames = new Hashtable<Long, String>(); ! for (Section section: sections) { ! classIds.add(section.getId()); ! classNames.put(section.getId(), section.getName()); } ! CustomSectionNames x = new CustomSectionNames() { ! public void update(AcademicSessionInfo session) { } ! ! public String getClassSuffix(Long sessionId, Long courseId, Long classId) { ! if (SectioningServer.sCustomSectionNames != null) { ! String ret = SectioningServer.sCustomSectionNames.getClassSuffix(sessionId, courseId, classId); ! if (ret != null) return ret; ! } ! return classNames.get(classId); } ! }; ! limits = SectioningServer.sSectionLimitProvider.getSectionLimits(server.getAcademicSession(), c.getUniqueId(), classIds, x); ! } ! ClassAssignmentInterface.CourseAssignment courseAssign = new ClassAssignmentInterface.CourseAssignment(); ! courseAssign.setCourseId(c.getUniqueId()); ! courseAssign.setCourseNbr(c.getCourseNbr()); ! courseAssign.setSubject(c.getSubjectArea()); ! for (Section section: sections) { ! String room = null; ! if (section.getRooms() != null) { ! for (RoomLocation rm: section.getRooms()) { ! if (room == null) room = ""; else room += ", "; ! room += rm.getName(); } } ! int[] limit = (limits == null ? new int[] { -1, section.getLimit()} : limits.get(section.getId())); ! if (limits == null) { ! int actual = section.getEnrollments().size(); ! if (studentId != null) { ! for (Iterator<Enrollment> i = section.getEnrollments().iterator(); i.hasNext();) { ! Enrollment enrollment = i.next(); ! if (enrollment.getStudent().getId() == studentId) { actual--; break; } } } ! limit = new int[] {actual, section.getLimit()}; ! } ! ClassAssignmentInterface.ClassAssignment a = courseAssign.addClassAssignment(); ! a.setClassId(section.getId()); ! a.setSubpart(section.getSubpart().getName()); ! a.setSection(server.getSectionName(c.getUniqueId(), section)); ! a.setLimit(limit); ! if (section.getTime() != null) { ! for (DayCode d: DayCode.toDayCodes(section.getTime().getDayCode())) ! a.addDay(d.getIndex()); ! a.setStart(section.getTime().getStartSlot()); ! a.setLength(section.getTime().getLength()); ! a.setBreakTime(section.getTime().getBreakTime()); ! a.setDatePattern(section.getTime().getDatePatternName()); ! } ! if (section.getRooms() != null) { ! for (RoomLocation rm: section.getRooms()) { ! a.addRoom(rm.getName()); } ! } ! if (section.getChoice().getInstructorNames() != null && !section.getChoice().getInstructorNames().isEmpty()) { ! String[] instructors = section.getChoice().getInstructorNames().split(":"); ! for (String instructor: instructors) { ! String[] nameEmail = instructor.split("\\|"); ! a.addInstructor(nameEmail[0]); ! a.addInstructoEmailr(nameEmail.length < 2 ? "" : nameEmail[1]); } } ! if (section.getParent() != null) ! a.setParentSection(server.getSectionName(c.getUniqueId(), section.getParent())); ! a.setSubpartId(section.getSubpart().getId()); ! if (a.getParentSection() == null) ! a.setParentSection(c.getConsent()); ! a.setExpected(section.getSpaceExpected()); ! ret.add(a); } ! } catch (Exception e) { ! if (e instanceof SectioningException) throw (SectioningException)e; ! sLog.error(e.getMessage(), e); ! throw new SectioningException(SectioningExceptionType.UNKNOWN, e); } - if (ret.isEmpty()) - throw new SectioningException(SectioningExceptionType.NO_CLASSES_FOR_COURSE, course); - return ret; } ! public Collection<String[]> listAcademicSessions() throws SectioningException { ! UniTimePrincipal principal = (UniTimePrincipal)getThreadLocalRequest().getSession().getAttribute("user"); ArrayList<String[]> ret = new ArrayList<String[]>(); ! for (AcademicSessionInfo s: SectioningServer.getAcademicSessions()) { ! if (principal != null && principal.getStudentId(s.getUniqueId()) == null) continue; ! ret.add(new String[] { ! String.valueOf(s.getUniqueId()), ! s.getYear(), ! s.getTerm(), ! s.getCampus() ! }); ! } ! if (ret.isEmpty() && principal != null) for (AcademicSessionInfo s: SectioningServer.getAcademicSessions()) { ret.add(new String[] { String.valueOf(s.getUniqueId()), --- 224,436 ---- public Collection<ClassAssignmentInterface.ClassAssignment> listClasses(Long sessionId, String course) throws SectioningException { setLastSessionId(sessionId); ! if (SectioningServer.getInstance(sessionId) == null) { ! ArrayList<ClassAssignmentInterface.ClassAssignment> results = new ArrayList<ClassAssignmentInterface.ClassAssignment>(); ! org.hibernate.Session hibSession = CurriculumDAO.getInstance().getSession(); ! CourseOffering courseOffering = null; ! for (CourseOffering c: (List<CourseOffering>)hibSession.createQuery( ! "select c from CourseOffering c where " + ! "c.subjectArea.session.uniqueId = :sessionId and " + ! "lower(c.subjectArea.subjectAreaAbbreviation || ' ' || c.courseNbr) = :course") ! .setString("course", course.toLowerCase()) ! .setLong("sessionId", sessionId) ! .setCacheable(true).setMaxResults(1).list()) { ! courseOffering = c; break; ! } ! if (courseOffering == null) throw new CurriculaException("course " + course + " does not exist"); ! List<Class_> classes = new ArrayList<Class_>(); ! for (Iterator<InstrOfferingConfig> i = courseOffering.getInstructionalOffering().getInstrOfferingConfigs().iterator(); i.hasNext(); ) { ! InstrOfferingConfig config = i.next(); ! for (Iterator<SchedulingSubpart> j = config.getSchedulingSubparts().iterator(); j.hasNext(); ) { ! SchedulingSubpart subpart = j.next(); ! classes.addAll(subpart.getClasses()); } ! } ! Collections.sort(classes, new ClassComparator(ClassComparator.COMPARE_BY_HIERARCHY)); ! for (Class_ clazz: classes) { ! ClassAssignmentInterface.ClassAssignment a = new ClassAssignmentInterface.ClassAssignment(); ! a.setClassId(clazz.getUniqueId()); ! a.setSubpart(clazz.getSchedulingSubpart().getItypeDesc()); ! a.setSection(clazz.getClassSuffix(courseOffering)); ! ! Assignment ass = clazz.getCommittedAssignment(); ! Placement p = (ass == null ? null : ass.getPlacement()); ! ! int minLimit = clazz.getExpectedCapacity(); ! int maxLimit = clazz.getMaxExpectedCapacity(); ! int limit = maxLimit; ! if (minLimit < maxLimit && p != null) { ! int roomLimit = Math.round((clazz.getRoomRatio() == null ? 1.0f : clazz.getRoomRatio()) * p.getRoomSize()); ! limit = Math.min(Math.max(minLimit, roomLimit), maxLimit); ! } ! if (clazz.getSchedulingSubpart().getInstrOfferingConfig().isUnlimitedEnrollment() || limit >= 9999) limit = -1; ! a.setLimit(new int[] {-1, limit}); ! ! if (p != null && p.getTimeLocation() != null) { ! for (DayCode d: DayCode.toDayCodes(p.getTimeLocation().getDayCode())) ! a.addDay(d.getIndex()); ! a.setStart(p.getTimeLocation().getStartSlot()); ! a.setLength(p.getTimeLocation().getLength()); ! a.setBreakTime(p.getTimeLocation().getBreakTime()); ! a.setDatePattern(p.getTimeLocation().getDatePatternName()); } ! if (p != null && p.getRoomLocations() != null) { ! for (RoomLocation rm: p.getRoomLocations()) { ! a.addRoom(rm.getName()); ! } } ! if (p != null && p.getRoomLocation() != null) { ! a.addRoom(p.getRoomLocation().getName()); } ! if (!clazz.getClassInstructors().isEmpty()) { ! for (Iterator<ClassInstructor> i = clazz.getClassInstructors().iterator(); i.hasNext(); ) { ! ClassInstructor instr = i.next(); ! a.addInstructor(instr.getInstructor().getName(DepartmentalInstructor.sNameFormatShort)); ! a.addInstructoEmailr(instr.getInstructor().getEmail()); ! } } ! if (clazz.getParentClass() != null) ! a.setParentSection(clazz.getParentClass().getClassSuffix(courseOffering)); ! a.setSubpartId(clazz.getSchedulingSubpart().getUniqueId()); ! if (a.getParentSection() == null) ! a.setParentSection(courseOffering.getInstructionalOffering().getConsentType() == null ? null : courseOffering.getInstructionalOffering().getConsentType().getLabel()); ! //TODO: Do we want to populate expected space? ! a.setExpected(0.0); ! results.add(a); ! } ! return results; ! } else { ! ArrayList<ClassAssignmentInterface.ClassAssignment> ret = new ArrayList<ClassAssignmentInterface.ClassAssignment>(); ! try { ! if (sessionId==null) throw new SectioningException(SectioningExceptionType.NO_ACADEMIC_SESSION); ! SectioningServer server = SectioningServer.getInstance(sessionId); ! CourseInfo c = server.getCourseInfo(course); ! if (c == null) throw new SectioningException(SectioningExceptionType.COURSE_NOT_EXIST, course); ! Long studentId = getStudentId(sessionId); ! List<Section> sections = server.getSections(c); ! Collections.sort(sections, new Comparator<Section>() { ! public int compare(Config c1, Config c2) { ! int cmp = c1.getName().compareToIgnoreCase(c2.getName()); ! if (cmp != 0) return cmp; ! return Double.compare(c1.getId(), c2.getId()); } ! public boolean isParent(Subpart s1, Subpart s2) { ! Subpart p1 = s1.getParent(); ! if (p1==null) return false; ! if (p1.equals(s2)) return true; ! return isParent(p1, s2); } ! public int compare(Subpart s1, Subpart s2) { ! int cmp = compare(s1.getConfig(), s2.getConfig()); ! if (cmp != 0) return cmp; ! if (isParent(s1,s2)) return 1; ! if (isParent(s2,s1)) return -1; ! cmp = s1.getInstructionalType().compareTo(s2.getInstructionalType()); ! if (cmp != 0) return cmp; ! return Double.compare(s1.getId(), s2.getId()); } + public int compare(Section s1, Section s2) { + int cmp = compare(s1.getSubpart(), s2.getSubpart()); + if (cmp != 0) return cmp; + cmp = (s1.getName() == null ? "" : s1.getName()).compareTo(s2.getName() == null ? "" : s2.getName()); + if (cmp != 0) return cmp; + return Double.compare(s1.getId(), s2.getId()); + } + }); + Hashtable<Long, int[]> limits = null; + if (SectioningServer.sSectionLimitProvider != null) { + ArrayList<Long> classIds = new ArrayList<Long>(); + final Hashtable<Long, String> classNames = new Hashtable<Long, String>(); + for (Section section: sections) { + classIds.add(section.getId()); + classNames.put(section.getId(), section.getName()); + } + CustomSectionNames x = new CustomSectionNames() { + public void update(AcademicSessionInfo session) { + } + + public String getClassSuffix(Long sessionId, Long courseId, Long classId) { + if (SectioningServer.sCustomSectionNames != null) { + String ret = SectioningServer.sCustomSectionNames.getClassSuffix(sessionId, courseId, classId); + if (ret != null) return ret; + } + return classNames.get(classId); + } + }; + limits = SectioningServer.sSectionLimitProvider.getSectionLimits(server.getAcademicSession(), c.getUniqueId(), classIds, x); } ! ClassAssignmentInterface.CourseAssignment courseAssign = new ClassAssignmentInterface.CourseAssignment(); ! courseAssign.setCourseId(c.getUniqueId()); ! courseAssign.setCourseNbr(c.getCourseNbr()); ! courseAssign.setSubject(c.getSubjectArea()); ! for (Section section: sections) { ! String room = null; ! if (section.getRooms() != null) { ! for (RoomLocation rm: section.getRooms()) { ! if (room == null) room = ""; else room += ", "; ! room += rm.getName(); } } ! int[] limit = (limits == null ? new int[] { -1, section.getLimit()} : limits.get(section.getId())); ! if (limits == null) { ! int actual = section.getEnrollments().size(); ! if (studentId != null) { ! for (Iterator<Enrollment> i = section.getEnrollments().iterator(); i.hasNext();) { ! Enrollment enrollment = i.next(); ! if (enrollment.getStudent().getId() == studentId) { actual--; break; } ! } ! } ! limit = new int[] {actual, section.getLimit()}; } ! ClassAssignmentInterface.ClassAssignment a = courseAssign.addClassAssignment(); ! a.setClassId(section.getId()); ! a.setSubpart(section.getSubpart().getName()); ! a.setSection(server.getSectionName(c.getUniqueId(), section)); ! a.setLimit(limit); ! if (section.getTime() != null) { ! for (DayCode d: DayCode.toDayCodes(section.getTime().getDayCode())) ! a.addDay(d.getIndex()); ! a.setStart(section.getTime().getStartSlot()); ! a.setLength(section.getTime().getLength()); ! a.setBreakTime(section.getTime().getBreakTime()); ! a.setDatePattern(section.getTime().getDatePatternName()); ! } ! if (section.getRooms() != null) { ! for (RoomLocation rm: section.getRooms()) { ! a.addRoom(rm.getName()); ! } ! } ! if (section.getChoice().getInstructorNames() != null && !section.getChoice().getInstructorNames().isEmpty()) { ! String[] instructors = section.getChoice().getInstructorNames().split(":"); ! for (String instructor: instructors) { ! String[] nameEmail = instructor.split("\\|"); ! a.addInstructor(nameEmail[0]); ! a.addInstructoEmailr(nameEmail.length < 2 ? "" : nameEmail[1]); ! } } + if (section.getParent() != null) + a.setParentSection(server.getSectionName(c.getUniqueId(), section.getParent())); + a.setSubpartId(section.getSubpart().getId()); + if (a.getParentSection() == null) + a.setParentSection(c.getConsent()); + a.setExpected(section.getSpaceExpected()); + ret.add(a); } ! } catch (Exception e) { ! if (e instanceof SectioningException) throw (SectioningException)e; ! sLog.error(e.getMessage(), e); ! throw new SectioningException(SectioningExceptionType.UNKNOWN, e); } ! if (ret.isEmpty()) ! throw new SectioningException(SectioningExceptionType.NO_CLASSES_FOR_COURSE, course); ! return ret; } } ! public Collection<String[]> listAcademicSessions(boolean sectioning) throws SectioningException { ArrayList<String[]> ret = new ArrayList<String[]>(); ! if (sectioning) { ! UniTimePrincipal principal = (UniTimePrincipal)getThreadLocalRequest().getSession().getAttribute("user"); for (AcademicSessionInfo s: SectioningServer.getAcademicSessions()) { + if (principal != null && principal.getStudentId(s.getUniqueId()) == null) continue; ret.add(new String[] { String.valueOf(s.getUniqueId()), *************** *** 316,319 **** --- 440,463 ---- }); } + if (ret.isEmpty() && principal != null) + for (AcademicSessionInfo s: SectioningServer.getAcademicSessions()) { + ret.add(new String[] { + String.valueOf(s.getUniqueId()), + s.getYear(), + s.getTerm(), + s.getCampus() + }); + } + } else { + for (Session session: SessionDAO.getInstance().findAll()) { + if (session.getStatusType().canPreRegisterStudents() && !session.getStatusType().canSectioningStudents()) + ret.add(new String[] { + String.valueOf(session.getUniqueId()), + session.getAcademicYear(), + session.getAcademicTerm(), + session.getAcademicInitiative() + }); + } + } if (ret.isEmpty()) { throw new SectioningException(SectioningExceptionType.NO_SUITABLE_ACADEMIC_SESSIONS); *************** *** 321,330 **** return ret; } public String retrieveCourseDetails(Long sessionId, String course) throws SectioningException { setLastSessionId(sessionId); ! CourseInfo c = SectioningServer.getInstance(sessionId).getCourseInfo(course); ! if (c == null) throw new SectioningException(SectioningExceptionType.COURSE_NOT_EXIST, course); ! return c.getDetails(); } --- 465,502 ---- return ret; } + + private CourseOffering getCourse(Long sessionId, String courseName) { + for (CourseOffering co: (List<CourseOffering>)CourseOfferingDAO.getInstance().getSession().createQuery( + "select c from CourseOffering c where " + + "c.subjectArea.session.uniqueId = :sessionId and " + + "lower(c.subjectArea.subjectAreaAbbreviation || ' ' || c.courseNbr) = :course") + .setString("course", courseName.toLowerCase()) + .setLong("sessionId", sessionId) + .setCacheable(true).setMaxResults(1).list()) { + return co; + } + return null; + } public String retrieveCourseDetails(Long sessionId, String course) throws SectioningException { setLastSessionId(sessionId); ! if (SectioningServer.getInstance(sessionId) == null) { ! CourseOffering courseOffering = getCourse(sessionId, course); ! if (courseOffering == null) throw new SectioningException(SectioningExceptionType.COURSE_NOT_EXIST, course); ! CourseDetailsProvider provider = null; ! try { ! provider = (CourseDetailsProvider)Class.forName(ApplicationProperties.getProperty("unitime.custom.CourseDetailsProvider")).newInstance(); ! } catch (Exception e) { ! throw new CurriculaException("course detail interface not provided"); ! } ! String details = provider.getDetails( ! new AcademicSessionInfo(courseOffering.getSubjectArea().getSession()), ! courseOffering.getSubjectAreaAbbv(), courseOffering.getCourseNbr()); ! return details; ! } else { ! CourseInfo c = SectioningServer.getInstance(sessionId).getCourseInfo(course); ! if (c == null) throw new SectioningException(SectioningExceptionType.COURSE_NOT_EXIST, course); ! return c.getDetails(); ! } } *************** *** 353,358 **** setLastSessionId(request.getAcademicSessionId()); setLastRequest(request); ! request.setStudentId(getStudentId(request.getAcademicSessionId())); ! return SectioningServer.getInstance(request.getAcademicSessionId()).checkCourses(request); } catch (Exception e) { if (e instanceof SectioningException) throw (SectioningException)e; --- 525,551 ---- setLastSessionId(request.getAcademicSessionId()); setLastRequest(request); ! if (SectioningServer.getInstance(request.getAcademicSessionId()) == null) { ! ArrayList<String> notFound = new ArrayList<String>(); ! for (CourseRequestInterface.Request cr: request.getCourses()) { ! if (!cr.hasRequestedFreeTime() && cr.hasRequestedCourse() && getCourse(request.getAcademicSessionId(), cr.getRequestedCourse()) == null) ! notFound.add(cr.getRequestedCourse()); ! if (cr.hasFirstAlternative() && getCourse(request.getAcademicSessionId(), cr.getFirstAlternative()) == null) ! notFound.add(cr.getFirstAlternative()); ! if (cr.hasSecondAlternative() && getCourse(request.getAcademicSessionId(), cr.getSecondAlternative()) == null) ! notFound.add(cr.getSecondAlternative()); ! } ! for (CourseRequestInterface.Request cr: request.getAlternatives()) { ! if (cr.hasRequestedCourse() && getCourse(request.getAcademicSessionId(),cr.getRequestedCourse()) == null) ! notFound.add(cr.getRequestedCourse()); ! if (cr.hasFirstAlternative() && getCourse(request.getAcademicSessionId(),cr.getFirstAlternative()) == null) ! notFound.add(cr.getFirstAlternative()); ! if (cr.hasSecondAlternative() && getCourse(request.getAcademicSessionId(),cr.getSecondAlternative()) == null) ! notFound.add(cr.getSecondAlternative()); ! } ! return notFound; ! } else { ! request.setStudentId(getStudentId(request.getAcademicSessionId())); ! return SectioningServer.getInstance(request.getAcademicSessionId()).checkCourses(request); ! } } catch (Exception e) { if (e instanceof SectioningException) throw (SectioningException)e; *************** *** 503,520 **** } ! public String[] lastAcademicSession() throws SectioningException { if (getThreadLocalRequest().getSession().isNew()) throw new SectioningException(SectioningExceptionType.USER_NOT_LOGGED_IN); Long sessionId = getLastSessionId(); if (sessionId == null) throw new SectioningException(SectioningExceptionType.LAST_ACADEMIC_SESSION_FAILED, "no session was used"); ! SectioningServer server = SectioningServer.getInstance(sessionId); ! if (server == null) throw new SectioningException(SectioningExceptionType.LAST_ACADEMIC_SESSION_FAILED, "no server data"); ! AcademicSessionInfo s = server.getAcademicSession(); ! if (s == null) throw new SectioningException(SectioningExceptionType.LAST_ACADEMIC_SESSION_FAILED, "no session info"); ! return new String[] { ! String.valueOf(s.getUniqueId()), ! s.getYear(), ! s.getTerm(), ! s.getCampus() ! }; } --- 696,727 ---- } ! public String[] lastAcademicSession(boolean sectioning) throws SectioningException { if (getThreadLocalRequest().getSession().isNew()) throw new SectioningException(SectioningExceptionType.USER_NOT_LOGGED_IN); Long sessionId = getLastSessionId(); if (sessionId == null) throw new SectioningException(SectioningExceptionType.LAST_ACADEMIC_SESSION_FAILED, "no session was used"); ! if (sectioning) { ! SectioningServer server = SectioningServer.getInstance(sessionId); ! if (server == null) throw new SectioningException(SectioningExceptionType.LAST_ACADEMIC_SESSION_FAILED, "no server data"); ! AcademicSessionInfo s = server.getAcademicSession(); ! if (s == null) throw new SectioningException(SectioningExceptionType.LAST_ACADEMIC_SESSION_FAILED, "no session info"); ! return new String[] { ! String.valueOf(s.getUniqueId()), ! s.getYear(), ! s.getTerm(), ! s.getCampus() ! }; ! } else { ! Session session = SessionDAO.getInstance().get(sessionId); ! if (session == null) ! throw new SectioningException(SectioningExceptionType.LAST_ACADEMIC_SESSION_FAILED, "session not found"); ! if (!session.getStatusType().canPreRegisterStudents() || session.getStatusType().canSectioningStudents()) ! throw new SectioningException(SectioningExceptionType.LAST_ACADEMIC_SESSION_FAILED, "registration is not allowed"); ! return new String[] { ! session.getUniqueId().toString(), ! session.getAcademicYear(), ! session.getAcademicTerm(), ! session.getAcademicInitiative() ! }; ! } } *************** *** 559,563 **** r = new CourseRequestInterface.Request(); r.addRequestedFreeTime(ft); ! r.setRequestedCourse("Free " + ft.toString()); if (cd.isAlternative()) request.getAlternatives().add(r); --- 766,770 ---- r = new CourseRequestInterface.Request(); r.addRequestedFreeTime(ft); ! r.setRequestedCourse(ft.toString()); if (cd.isAlternative()) request.getAlternatives().add(r); *************** *** 569,573 **** for (Iterator<CourseRequest> i = cd.getCourseRequests().iterator(); i.hasNext(); ) { CourseRequest course = i.next(); ! CourseInfo c = server.getCourseInfo(course.getCourseOffering().getUniqueId()); if (c == null) continue; switch (course.getOrder()) { --- 776,780 ---- for (Iterator<CourseRequest> i = cd.getCourseRequests().iterator(); i.hasNext(); ) { CourseRequest course = i.next(); ! CourseInfo c = (server == null ? new CourseInfo(course.getCourseOffering()) : server.getCourseInfo(course.getCourseOffering().getUniqueId())); if (c == null) continue; switch (course.getOrder()) { *************** *** 598,602 **** for (Iterator<StudentClassEnrollment> i = student.getClassEnrollments().iterator(); i.hasNext(); ) { StudentClassEnrollment enrl = i.next(); ! CourseInfo c = server.getCourseInfo(enrl.getCourseOffering().getUniqueId()); if (c != null) courses.add(c); } --- 805,809 ---- for (Iterator<StudentClassEnrollment> i = student.getClassEnrollments().iterator(); i.hasNext(); ) { StudentClassEnrollment enrl = i.next(); ! CourseInfo c = (server == null ? new CourseInfo(enrl.getCourseOffering()) : server.getCourseInfo(enrl.getCourseOffering().getUniqueId())); if (c != null) courses.add(c); } *************** *** 612,615 **** --- 819,823 ---- throw new SectioningException(SectioningExceptionType.NO_STUDENT_REQUESTS); } catch (Exception e) { + sLog.error(e.getMessage(), e); if (e instanceof SectioningException) throw (SectioningException)e; throw new SectioningException(SectioningExceptionType.UNKNOWN, e); *************** *** 659,669 **** public Boolean saveRequest(CourseRequestInterface request) throws SectioningException { - if ("true".equals(ApplicationProperties.getProperty("unitime.enrollment.enabled","true"))) return false; - if (!"true".equals(ApplicationProperties.getProperty("unitime.enrollment.requests.save","false"))) return false; UniTimePrincipal principal = (UniTimePrincipal)getThreadLocalRequest().getSession().getAttribute("user"); if (principal == null) throw new SectioningException(SectioningExceptionType.ENROLL_NOT_AUTHENTICATED); Long studentId = principal.getStudentId(request.getAcademicSessionId()); SectioningServer server = SectioningServer.getInstance(request.getAcademicSessionId()); ! if (studentId == null) throw new SectioningException(SectioningExceptionType.ENROLL_NOT_STUDENT, server.getAcademicSession().toString()); org.hibernate.Session hibSession = StudentDAO.getInstance().getSession(); try { --- 867,884 ---- public Boolean saveRequest(CourseRequestInterface request) throws SectioningException { UniTimePrincipal principal = (UniTimePrincipal)getThreadLocalRequest().getSession().getAttribute("user"); if (principal == null) throw new SectioningException(SectioningExceptionType.ENROLL_NOT_AUTHENTICATED); Long studentId = principal.getStudentId(request.getAcademicSessionId()); SectioningServer server = SectioningServer.getInstance(request.getAcademicSessionId()); ! if (server != null) { ! if ("true".equals(ApplicationProperties.getProperty("unitime.enrollment.enabled","true"))) return false; ! if (!"true".equals(ApplicationProperties.getProperty("unitime.enrollment.requests.save","false"))) return false; ! } ! if (studentId == null) { ! if (server != null) ! throw new SectioningException(SectioningExceptionType.ENROLL_NOT_STUDENT, server.getAcademicSession().toString()); ! else ! throw new SectioningException(SectioningExceptionType.ENROLL_NOT_STUDENT, SessionDAO.getInstance().get(request.getAcademicSessionId()).getLabel()); ! } org.hibernate.Session hibSession = StudentDAO.getInstance().getSession(); try { *************** *** 727,730 **** --- 942,946 ---- free.setSession(student.getSession()); free.setName(ft.toString()); + hibSession.saveOrUpdate(free); cd.setFreeTime(free); cd.setStudent(student); *************** *** 739,744 **** cd.setCourseRequests(new HashSet<CourseRequest>()); if (r.hasRequestedCourse()) { ! CourseInfo c = server.getCourseInfo(r.getRequestedCourse()); ! CourseOffering co = (c == null ? null : CourseOfferingDAO.getInstance().get(c.getUniqueId(), hibSession)); if (co != null) { CourseRequest cr = new CourseRequest(); --- 955,960 ---- cd.setCourseRequests(new HashSet<CourseRequest>()); if (r.hasRequestedCourse()) { ! CourseInfo c = (server == null ? null : server.getCourseInfo(r.getRequestedCourse())); ! CourseOffering co = (c == null ? getCourse(request.getAcademicSessionId(), r.getRequestedCourse()) : CourseOfferingDAO.getInstance().get(c.getUniqueId(), hibSession)); if (co != null) { CourseRequest cr = new CourseRequest(); *************** *** 753,758 **** } if (r.hasFirstAlternative()) { ! CourseInfo c = server.getCourseInfo(r.getFirstAlternative()); ! CourseOffering co = (c == null ? null : CourseOfferingDAO.getInstance().get(c.getUniqueId(), hibSession)); if (co != null) { CourseRequest cr = new CourseRequest(); --- 969,974 ---- } if (r.hasFirstAlternative()) { ! CourseInfo c = (server == null ? null : server.getCourseInfo(r.getFirstAlternative())); ! CourseOffering co = (c == null ? getCourse(request.getAcademicSessionId(), r.getFirstAlternative()) : CourseOfferingDAO.getInstance().get(c.getUniqueId(), hibSession)); if (co != null) { CourseRequest cr = new CourseRequest(); *************** *** 767,772 **** } if (r.hasSecondAlternative()) { ! CourseInfo c = server.getCourseInfo(r.getSecondAlternative()); ! CourseOffering co = (c == null ? null : CourseOfferingDAO.getInstance().get(c.getUniqueId(), hibSession)); if (co != null) { CourseRequest cr = new CourseRequest(); --- 983,988 ---- } if (r.hasSecondAlternative()) { ! CourseInfo c = (server == null ? null : server.getCourseInfo(r.getSecondAlternative())); ! CourseOffering co = (c == null ? getCourse(request.getAcademicSessionId(), r.getSecondAlternative()) : CourseOfferingDAO.getInstance().get(c.getUniqueId(), hibSession)); if (co != null) { CourseRequest cr = new CourseRequest(); *************** *** 795,800 **** cd.setCourseRequests(new HashSet<CourseRequest>()); if (r.hasRequestedCourse()) { ! CourseInfo c = server.getCourseInfo(r.getRequestedCourse()); ! CourseOffering co = (c == null ? null : CourseOfferingDAO.getInstance().get(c.getUniqueId(), hibSession)); if (co != null) { CourseRequest cr = new CourseRequest(); --- 1011,1016 ---- cd.setCourseRequests(new HashSet<CourseRequest>()); if (r.hasRequestedCourse()) { ! CourseInfo c = (server == null ? null : server.getCourseInfo(r.getRequestedCourse())); ! CourseOffering co = (c == null ? getCourse(request.getAcademicSessionId(), r.getRequestedCourse()) : CourseOfferingDAO.getInstance().get(c.getUniqueId(), hibSession)); if (co != null) { CourseRequest cr = new CourseRequest(); *************** *** 809,814 **** } if (r.hasFirstAlternative()) { ! CourseInfo c = server.getCourseInfo(r.getFirstAlternative()); ! CourseOffering co = (c == null ? null : CourseOfferingDAO.getInstance().get(c.getUniqueId(), hibSession)); if (co != null) { CourseRequest cr = new CourseRequest(); --- 1025,1030 ---- } if (r.hasFirstAlternative()) { ! CourseInfo c = (server == null ? null : server.getCourseInfo(r.getFirstAlternative())); ! CourseOffering co = (c == null ? getCourse(request.getAcademicSessionId(), r.getFirstAlternative()) : CourseOfferingDAO.getInstance().get(c.getUniqueId(), hibSession)); if (co != null) { CourseRequest cr = new CourseRequest(); *************** *** 823,828 **** } if (r.hasSecondAlternative()) { ! CourseInfo c = server.getCourseInfo(r.getSecondAlternative()); ! CourseOffering co = (c == null ? null : CourseOfferingDAO.getInstance().get(c.getUniqueId(), hibSession)); if (co != null) { CourseRequest cr = new CourseRequest(); --- 1039,1044 ---- } if (r.hasSecondAlternative()) { ! CourseInfo c = (server == null ? null : server.getCourseInfo(r.getSecondAlternative())); ! CourseOffering co = (c == null ? getCourse(request.getAcademicSessionId(), r.getSecondAlternative()) : CourseOfferingDAO.getInstance().get(c.getUniqueId(), hibSession)); if (co != null) { CourseRequest cr = new CourseRequest(); Index: SectioningServer.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/server/Attic/SectioningServer.java,v retrieving revision 1.1.2.16 retrieving revision 1.1.2.17 diff -C2 -d -r1.1.2.16 -r1.1.2.17 *** SectioningServer.java 9 Nov 2010 12:25:51 -0000 1.1.2.16 --- SectioningServer.java 15 Nov 2010 15:15:43 -0000 1.1.2.17 *************** *** 152,155 **** --- 152,162 ---- } + public static boolean isRegistrationEnabled() { + for (Session session: SessionDAO.getInstance().findAll()) { + if (!session.getStatusType().canSectioningStudents() && session.getStatusType().canPreRegisterStudents()) return true; + } + return false; + } + private SectioningServer(Long sessionId) throws SectioningException { org.hibernate.Session hibSession = SessionDAO.getInstance().createNewSession(); Index: MenuServlet.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/server/Attic/MenuServlet.java,v retrieving revision 1.1.2.16 retrieving revision 1.1.2.17 diff -C2 -d -r1.1.2.16 -r1.1.2.17 *** MenuServlet.java 11 Nov 2010 14:27:51 -0000 1.1.2.16 --- MenuServlet.java 15 Nov 2010 15:15:43 -0000 1.1.2.17 *************** *** 60,63 **** --- 60,64 ---- import org.unitime.timetable.model.dao.SessionDAO; import org.unitime.timetable.model.dao.SolverGroupDAO; + import org.unitime.timetable.model.dao.StudentDAO; import org.unitime.timetable.solver.SolverProxy; import org.unitime.timetable.solver.WebSolver; *************** *** 271,274 **** --- 272,279 ---- } else if ("isSectioningEnabled".equals(cond)) { return SectioningServer.isEnabled(); + } else if ("isStudent".equals(cond)) { + return userInfo != null && userInfo.isStudent(); + } else if ("isRegistrationEnabled".equals(cond)) { + return SectioningServer.isRegistrationEnabled(); } else { User user = userInfo.getUser(); *************** *** 319,322 **** --- 324,333 ---- public Session getSession() { return iSession; } public TimetableManager getManager() { return iManager; } + public boolean isStudent() { + if (getUser() == null) return false; + return ((Number)StudentDAO.getInstance().getSession().createQuery("select count(s) from Student s where " + + "s.externalUniqueId = :uid") + .setString("uid", getUser().getId()).setCacheable(true).uniqueResult()).intValue() > 0; + } } |
|
From: Tomas M. <to...@us...> - 2010-11-15 15:15:52
|
Update of /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/model In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv3673/JavaSource/org/unitime/timetable/model Modified Files: Tag: dev_curriculum DepartmentStatusType.java Log Message: Student Course Requests page added - added ability to record student course and free time requests (pre-registration) using the Student Scheduling Assistant interface - added session status option (sectioning -- registration), Student Course Requests page is only available for academic sessions with a status enabling this feature - authenticated students should see "Course Requests" in the menu (if there is at least one academic session with this feature enabled) Index: DepartmentStatusType.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/model/DepartmentStatusType.java,v retrieving revision 1.7.2.3 retrieving revision 1.7.2.4 diff -C2 -d -r1.7.2.3 -r1.7.2.4 *** DepartmentStatusType.java 9 Nov 2010 12:25:47 -0000 1.7.2.3 --- DepartmentStatusType.java 15 Nov 2010 15:15:44 -0000 1.7.2.4 *************** *** 46,50 **** public static final int sCanNoRoleReportExamMid = 8192; public static final int sCanNoRoleReportClass = 16384; ! public static final int sCanSectioningStudents = 32768; public static final int sApplySession = 1; --- 46,51 ---- public static final int sCanNoRoleReportExamMid = 8192; public static final int sCanNoRoleReportClass = 16384; ! public static final int sCanSectioningStudents = 32768; ! public static final int sCanPreRegisterStudents = 65536; public static final int sApplySession = 1; *************** *** 182,185 **** --- 183,190 ---- return can(sCanSectioningStudents); } + + public boolean canPreRegisterStudents() { + return can(sCanPreRegisterStudents); + } public boolean canNoRoleReportExam() { |
|
From: Tomas M. <to...@us...> - 2010-11-15 15:15:52
|
Update of /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/client In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv3673/JavaSource/org/unitime/timetable/gwt/client Modified Files: Tag: dev_curriculum Pages.java Log Message: Student Course Requests page added - added ability to record student course and free time requests (pre-registration) using the Student Scheduling Assistant interface - added session status option (sectioning -- registration), Student Course Requests page is only available for academic sessions with a status enabling this feature - authenticated students should see "Course Requests" in the menu (if there is at least one academic session with this feature enabled) Index: Pages.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/client/Attic/Pages.java,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -d -r1.1.2.7 -r1.1.2.8 *** Pages.java 9 Nov 2010 12:25:50 -0000 1.1.2.7 --- Pages.java 15 Nov 2010 15:15:43 -0000 1.1.2.8 *************** *** 36,40 **** curricula("Curricula", new PageFactory() { public Widget create() { return new CurriculaPage(); } }), curprojrules("Curriculum Projection Rules", new PageFactory() { public Widget create() { return new CurriculumProjectionRulesPage(); } }), ! sectioning("Student Scheduling Assistant", new PageFactory() { public Widget create() { return new StudentSectioningPage(); } }), admin("Administration", new PageFactory() { public Widget create() { return new SimpleEditPage(); } }), timetable("Event Timetable", new PageFactory() { public Widget create() { return new EventResourceTimetable(); } }); --- 36,41 ---- curricula("Curricula", new PageFactory() { public Widget create() { return new CurriculaPage(); } }), curprojrules("Curriculum Projection Rules", new PageFactory() { public Widget create() { return new CurriculumProjectionRulesPage(); } }), ! sectioning("Student Scheduling Assistant", new PageFactory() { public Widget create() { return new StudentSectioningPage(StudentSectioningPage.Mode.SECTIONING); } }), ! requests("Student Course Requests", new PageFactory() { public Widget create() { return new StudentSectioningPage(StudentSectioningPage.Mode.REQUESTS); } }), admin("Administration", new PageFactory() { public Widget create() { return new SimpleEditPage(); } }), timetable("Event Timetable", new PageFactory() { public Widget create() { return new EventResourceTimetable(); } }); |
Update of /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/client/sectioning In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv3673/JavaSource/org/unitime/timetable/gwt/client/sectioning Modified Files: Tag: dev_curriculum StudentSectioningPage.java StudentSectioningWidget.java AcademicSessionSelector.java Log Message: Student Course Requests page added - added ability to record student course and free time requests (pre-registration) using the Student Scheduling Assistant interface - added session status option (sectioning -- registration), Student Course Requests page is only available for academic sessions with a status enabling this feature - authenticated students should see "Course Requests" in the menu (if there is at least one academic session with this feature enabled) Index: StudentSectioningWidget.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/client/sectioning/Attic/StudentSectioningWidget.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** StudentSectioningWidget.java 9 Nov 2010 12:25:52 -0000 1.1.2.3 --- StudentSectioningWidget.java 15 Nov 2010 15:15:44 -0000 1.1.2.4 *************** *** 83,87 **** private VerticalPanel iPanel; private HorizontalPanel iFooter; ! private Button iPrev, iNext, iEnroll, iPrint, iExport; private HTML iErrorMessage; private UniTimeTabPabel iAssignmentPanel; --- 83,87 ---- private VerticalPanel iPanel; private HorizontalPanel iFooter; ! private Button iPrev, iNext, iEnroll, iPrint, iExport, iSave; private HTML iErrorMessage; private UniTimeTabPabel iAssignmentPanel; *************** *** 100,104 **** private boolean iInRestore = false; ! public StudentSectioningWidget(AcademicSessionSelector sessionSelector, UserAuthentication userAuthentication) { iSessionSelector = sessionSelector; iUserAuthentication = userAuthentication; --- 100,104 ---- private boolean iInRestore = false; ! public StudentSectioningWidget(AcademicSessionSelector sessionSelector, UserAuthentication userAuthentication, StudentSectioningPage.Mode mode) { iSessionSelector = sessionSelector; iUserAuthentication = userAuthentication; *************** *** 133,137 **** --- 133,144 ---- iNext.setAccessKey('n'); rightFooterPanel.add(iNext); + iNext.setVisible(mode.isSectioning()); + iSave = new Button(MESSAGES.buttonSave()); + iSave.setWidth("75"); + iSave.setAccessKey('s'); + rightFooterPanel.add(iSave); + iSave.setVisible(!mode.isSectioning()); + iEnroll = new Button(MESSAGES.buttonEnroll()); iEnroll.setWidth("75"); *************** *** 414,417 **** --- 421,463 ---- } }); + + iSave.addClickHandler(new ClickHandler() { + public void onClick(ClickEvent event) { + iCourseRequests.changeTip(); + iErrorMessage.setHTML(""); + iCourseRequests.getValidator().validate(new AsyncCallback<Boolean>() { + public void onSuccess(Boolean result) { + updateHistory(); + if (result) { + iSectioningService.saveRequest(iCourseRequests.getRequest(), new AsyncCallback<Boolean>() { + public void onSuccess(Boolean result) { + if (result) { + iErrorMessage.setHTML("<font color='blue'>" + MESSAGES.saveRequestsOK() + "</font>"); + iErrorMessage.setVisible(true); + } + iCourseRequests.getValidator().hide(); + } + public void onFailure(Throwable caught) { + iErrorMessage.setHTML(MESSAGES.saveRequestsFail(caught.getMessage())); + iErrorMessage.setVisible(true); + iCourseRequests.getValidator().hide(); + } + }); + } else { + iErrorMessage.setHTML(MESSAGES.validationFailed()); + iErrorMessage.setVisible(true); + iCourseRequests.getValidator().hide(); + updateHistory(); + } + } + public void onFailure(Throwable caught) { + iErrorMessage.setHTML(MESSAGES.validationFailed()); + iErrorMessage.setVisible(true); + iCourseRequests.getValidator().hide(); + updateHistory(); + } + }); + } + }); } Index: StudentSectioningPage.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/client/sectioning/Attic/StudentSectioningPage.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** StudentSectioningPage.java 9 Nov 2010 12:25:52 -0000 1.1.2.2 --- StudentSectioningPage.java 15 Nov 2010 15:15:44 -0000 1.1.2.3 *************** *** 42,46 **** private final SectioningServiceAsync iSectioningService = GWT.create(SectioningService.class); ! public StudentSectioningPage() { Grid titlePanel = new Grid(1, 3); titlePanel.getCellFormatter().setWidth(0, 0, "33%"); --- 42,54 ---- private final SectioningServiceAsync iSectioningService = GWT.create(SectioningService.class); ! public static enum Mode { ! SECTIONING(true), ! REQUESTS(false); ! boolean iSectioning; ! private Mode(boolean isSectioning) { iSectioning = isSectioning; } ! public boolean isSectioning() { return iSectioning; } ! }; ! ! public StudentSectioningPage(Mode mode) { Grid titlePanel = new Grid(1, 3); titlePanel.getCellFormatter().setWidth(0, 0, "33%"); *************** *** 64,68 **** }); ! final AcademicSessionSelector sessionSelector = new AcademicSessionSelector(); titlePanel.setWidget(0, 2, sessionSelector); --- 72,76 ---- }); ! final AcademicSessionSelector sessionSelector = new AcademicSessionSelector(mode); titlePanel.setWidget(0, 2, sessionSelector); *************** *** 70,74 **** RootPanel.get("UniTimeGWT:Header").add(titlePanel); ! final StudentSectioningWidget widget = new StudentSectioningWidget(sessionSelector, userAuthentication); initWidget(widget); --- 78,82 ---- RootPanel.get("UniTimeGWT:Header").add(titlePanel); ! final StudentSectioningWidget widget = new StudentSectioningWidget(sessionSelector, userAuthentication, mode); initWidget(widget); *************** *** 95,99 **** }); ! iSectioningService.lastAcademicSession(new AsyncCallback<String[]>() { public void onFailure(Throwable caught) { if (!userAuthentication.isShowing()) --- 103,107 ---- }); ! iSectioningService.lastAcademicSession(mode.isSectioning(), new AsyncCallback<String[]>() { public void onFailure(Throwable caught) { if (!userAuthentication.isShowing()) Index: AcademicSessionSelector.java =================================================================== RCS file: /cvsroot/unitime/UniTime/JavaSource/org/unitime/timetable/gwt/client/sectioning/Attic/AcademicSessionSelector.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** AcademicSessionSelector.java 9 Nov 2010 12:25:52 -0000 1.1.2.2 --- AcademicSessionSelector.java 15 Nov 2010 15:15:44 -0000 1.1.2.3 *************** *** 59,64 **** private Vector<AcademicSessionChangeHandler> iAcademicSessionChangeHandlers = new Vector<AcademicSessionChangeHandler>(); ! public AcademicSessionSelector() { iSessionLabel = new Label(MESSAGES.sessionSelectorNoSession(), false); iSessionLabel.setStyleName("unitime-SessionSelector"); --- 59,66 ---- private Vector<AcademicSessionChangeHandler> iAcademicSessionChangeHandlers = new Vector<AcademicSessionChangeHandler>(); + private StudentSectioningPage.Mode iMode; ! public AcademicSessionSelector(StudentSectioningPage.Mode mode) { ! iMode = mode; iSessionLabel = new Label(MESSAGES.sessionSelectorNoSession(), false); iSessionLabel.setStyleName("unitime-SessionSelector"); *************** *** 128,132 **** public void selectSession() { iDialog.setAutoHideEnabled(getAcademicSessionId()!=null); ! iSectioningService.listAcademicSessions(new AsyncCallback<Collection<String[]>>() { public void onSuccess(Collection<String[]> result) { WebTable.Row[] records = new WebTable.Row[result.size()]; --- 130,134 ---- public void selectSession() { iDialog.setAutoHideEnabled(getAcademicSessionId()!=null); ! iSectioningService.listAcademicSessions(iMode.isSectioning(), new AsyncCallback<Collection<String[]>>() { public void onSuccess(Collection<String[]> result) { WebTable.Row[] records = new WebTable.Row[result.size()]; *************** *** 163,167 **** callback.onSuccess(true); } else { ! iSectioningService.listAcademicSessions(new AsyncCallback<Collection<String[]>>() { public void onSuccess(Collection<String[]> result) { for (String[] record: result) { --- 165,169 ---- callback.onSuccess(true); } else { ! iSectioningService.listAcademicSessions(iMode.isSectioning(), new AsyncCallback<Collection<String[]>>() { public void onSuccess(Collection<String[]> result) { for (String[] record: result) { |
|
From: Tomas M. <to...@us...> - 2010-11-15 15:15:52
|
Update of /cvsroot/unitime/UniTime/WebContent/admin In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv3673/WebContent/admin Modified Files: Tag: dev_curriculum deptStatusTypeEdit.jsp Log Message: Student Course Requests page added - added ability to record student course and free time requests (pre-registration) using the Student Scheduling Assistant interface - added session status option (sectioning -- registration), Student Course Requests page is only available for academic sessions with a status enabling this feature - authenticated students should see "Course Requests" in the menu (if there is at least one academic session with this feature enabled) Index: deptStatusTypeEdit.jsp =================================================================== RCS file: /cvsroot/unitime/UniTime/WebContent/admin/deptStatusTypeEdit.jsp,v retrieving revision 1.7.2.3 retrieving revision 1.7.2.4 diff -C2 -d -r1.7.2.3 -r1.7.2.4 *** deptStatusTypeEdit.jsp 9 Nov 2010 12:25:49 -0000 1.7.2.3 --- deptStatusTypeEdit.jsp 15 Nov 2010 15:15:44 -0000 1.7.2.4 *************** *** 111,115 **** <TR><TD colspan='3'><tt:section-title><br>Student Sectioning</tt:section-title></TD></TR> ! <TR><TD nowrap>Enabled:</TD><TD><html:checkbox property="canSectioningStudents"/></TD> <TD><i>Unauthenticated users and students are able to use the Student Scheduling Assistant.</i></TD></TR> --- 111,117 ---- <TR><TD colspan='3'><tt:section-title><br>Student Sectioning</tt:section-title></TD></TR> ! <TR><TD nowrap>Registration:</TD><TD><html:checkbox property="canPreRegisterStudents"/></TD> ! <TD><i>Students are able to use the Student Course Requests page to fill in their course and free time requests.</i></TD></TR> ! <TR><TD nowrap>Assistant:</TD><TD><html:checkbox property="canSectioningStudents"/></TD> <TD><i>Unauthenticated users and students are able to use the Student Scheduling Assistant.</i></TD></TR> |