summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Spitzer2014-08-26 10:05:01 +0200
committerTobias Spitzer2014-08-26 10:05:01 +0200
commit6341861d1ccc6b468c6c0ac7d7d5b0aa038cd4c3 (patch)
treebff30ab8c1c9fc99689e009d0ce25da3de2dab60
parentMerge branch 'master' of git.openslx.org:openslx-ng/tutor-module (diff)
downloadtutor-module-6341861d1ccc6b468c6c0ac7d7d5b0aa038cd4c3.tar.gz
tutor-module-6341861d1ccc6b468c6c0ac7d7d5b0aa038cd4c3.tar.xz
tutor-module-6341861d1ccc6b468c6c0ac7d7d5b0aa038cd4c3.zip
Datum angepasst wenn es zu weit in der Zukunft liegt
-rw-r--r--Dozentenmodul/bin/gui/image/SearchImage_GUI.classbin16757 -> 16760 bytes
-rw-r--r--Dozentenmodul/bin/gui/lecture/CreateLectureAllgemein_GUI.classbin10564 -> 10739 bytes
-rw-r--r--Dozentenmodul/src/gui/lecture/CreateLectureAllgemein_GUI.java39
3 files changed, 27 insertions, 12 deletions
diff --git a/Dozentenmodul/bin/gui/image/SearchImage_GUI.class b/Dozentenmodul/bin/gui/image/SearchImage_GUI.class
index d59c5e1b..8173d4ba 100644
--- a/Dozentenmodul/bin/gui/image/SearchImage_GUI.class
+++ b/Dozentenmodul/bin/gui/image/SearchImage_GUI.class
Binary files differ
diff --git a/Dozentenmodul/bin/gui/lecture/CreateLectureAllgemein_GUI.class b/Dozentenmodul/bin/gui/lecture/CreateLectureAllgemein_GUI.class
index 7812fdd2..a2a12096 100644
--- a/Dozentenmodul/bin/gui/lecture/CreateLectureAllgemein_GUI.class
+++ b/Dozentenmodul/bin/gui/lecture/CreateLectureAllgemein_GUI.class
Binary files differ
diff --git a/Dozentenmodul/src/gui/lecture/CreateLectureAllgemein_GUI.java b/Dozentenmodul/src/gui/lecture/CreateLectureAllgemein_GUI.java
index 9c30cce7..ad1383e7 100644
--- a/Dozentenmodul/src/gui/lecture/CreateLectureAllgemein_GUI.java
+++ b/Dozentenmodul/src/gui/lecture/CreateLectureAllgemein_GUI.java
@@ -16,6 +16,7 @@ import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.net.URI;
import java.net.URISyntaxException;
+import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
@@ -45,6 +46,8 @@ import util.GuiOrganizer;
import util.OpenLinks;
import com.toedter.calendar.JDateChooser;
+import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeEvent;
@SuppressWarnings("serial")
public class CreateLectureAllgemein_GUI extends JFrame {
@@ -63,6 +66,7 @@ public class CreateLectureAllgemein_GUI extends JFrame {
JDateChooser dateChooserstart;
Date startDate = new Date();
Date endDate;
+
int maxLifeTime = 180; // Anzahl Tage, die eine Veranstaltung in der Zukunft
// aktiv sein darf
boolean isDateOrderCorrect, isDateMaxLifeTimeCorrect,
@@ -269,9 +273,27 @@ public class CreateLectureAllgemein_GUI extends JFrame {
scrollPane.add(description);
description.setBounds(0, 0, 4, 22);
scrollPane.add(description);
+ dateChooserstart = new JDateChooser();
+ dateChooserstart.addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent arg0) {
+ endDate = addDays(dateChooserstart.getDate(), maxLifeTime); // Datum darf weiter als 6
+ // Monate in der Zukunft
+ // liegen
+ }
+ });
+ if (Lecture.lecture.getStartdate() == null) {
+ // is not defined yet
+ dateChooserstart.setDate(startDate);
+ } else {
+ // already defined from last visit on this page
+ dateChooserstart.setDate(Lecture.lecture.getStartdate());
+ }
+ dateChooserstart.setDateFormatString("yyyy-MM-dd HH:mm:ss");
+ dateChooserstart.setBounds(226, 188, 143, 20);
+ panel_2.add(dateChooserstart);
dateChooserend = new JDateChooser();
- endDate = addDays(new Date(), maxLifeTime); // Datum darf weiter als 6
+ endDate = addDays(dateChooserstart.getDate(), maxLifeTime); // Datum darf weiter als 6
// Monate in der Zukunft
// liegen
dateChooserend.setDate(endDate);
@@ -290,17 +312,7 @@ public class CreateLectureAllgemein_GUI extends JFrame {
lblBis.setBounds(378, 188, 21, 20);
panel_2.add(lblBis);
- dateChooserstart = new JDateChooser();
- if (Lecture.lecture.getStartdate() == null) {
- // is not defined yet
- dateChooserstart.setDate(startDate);
- } else {
- // already defined from last visit on this page
- dateChooserstart.setDate(Lecture.lecture.getStartdate());
- }
- dateChooserstart.setDateFormatString("yyyy-MM-dd HH:mm:ss");
- dateChooserstart.setBounds(226, 188, 143, 20);
- panel_2.add(dateChooserstart);
+
JLabel label_6 = new JLabel("von:");
label_6.setBounds(200, 188, 30, 20);
@@ -403,6 +415,8 @@ public class CreateLectureAllgemein_GUI extends JFrame {
"Das End-Datum liegt zu weit in der Zukunft. Erlaubt ist maximal:\n"
+ endDate, "Datum fehlerhaft",
JOptionPane.INFORMATION_MESSAGE);
+
+
dateChooserend.setDate(endDate); //setze Datum auf maximum
} else {
// bereit
@@ -442,6 +456,7 @@ public class CreateLectureAllgemein_GUI extends JFrame {
Lecture.lecture.setEnddate(dateChooserend.getDate());
Lecture.lecture.setStartdate(dateChooserstart
.getDate());
+
Image.image.setImagename(txtFldVeranstaltungsname
.getText());