@@ -168,9 +168,6 @@ public function executeCommand()
168
168
$ form = $ this ->initCreateForm ("sess " );
169
169
} else {
170
170
$ form = $ this ->initForm ("edit " );
171
- if ($ form === true ) {
172
- $ form = $ this ->form ;
173
- }
174
171
}
175
172
$ ilCtrl ->forwardCommand ($ form );
176
173
break ;
@@ -770,8 +767,7 @@ protected function initCreateForm($a_new_type)
770
767
if (!is_object ($ this ->object )) {
771
768
$ this ->object = new ilObjSession ();
772
769
}
773
- $ this ->initForm ('create ' );
774
- return $ this ->form ;
770
+ return $ this ->initForm ('create ' );
775
771
}
776
772
777
773
/**
@@ -806,10 +802,13 @@ public function saveObject($a_redirect_on_success = true)
806
802
807
803
$ this ->ctrl ->saveParameter ($ this , "new_type " );
808
804
809
- $ this ->initForm ('create ' );
805
+ $ form = $ this ->initForm ('create ' );
810
806
$ ilErr ->setMessage ('' );
811
- if (!$ this ->form ->checkInput ()) {
807
+ if (!$ form ->checkInput ()) {
808
+ $ form ->setValuesByPost ();
812
809
$ ilErr ->setMessage ($ this ->lng ->txt ('err_check_input ' ));
810
+ $ this ->createObject ($ form );
811
+ return false ;
813
812
}
814
813
815
814
if (
@@ -1057,10 +1056,13 @@ public function updateObject()
1057
1056
1058
1057
$ old_autofill = $ this ->object ->hasWaitingListAutoFill ();
1059
1058
1060
- $ this ->initForm ('edit ' );
1059
+ $ form = $ this ->initForm ('edit ' );
1061
1060
$ ilErr ->setMessage ('' );
1062
1061
if (!$ this ->form ->checkInput ()) {
1063
1062
$ ilErr ->setMessage ($ this ->lng ->txt ('err_check_input ' ));
1063
+ $ form ->setValuesByPost ();
1064
+ $ this ->editObject ();
1065
+ return false ;
1064
1066
}
1065
1067
1066
1068
if (
@@ -1580,7 +1582,7 @@ protected function initForm($a_mode)
1580
1582
$ ilUser = $ DIC ['ilUser ' ];
1581
1583
1582
1584
if (is_object ($ this ->form )) {
1583
- return true ;
1585
+ return $ this -> form ;
1584
1586
}
1585
1587
1586
1588
$ this ->lng ->loadLanguageModule ('dateplaner ' );
@@ -1640,6 +1642,7 @@ protected function initForm($a_mode)
1640
1642
1641
1643
// title
1642
1644
$ title = new ilTextInputGUI ($ this ->lng ->txt ('event_title ' ), 'title ' );
1645
+ $ title ->setRequired (true );
1643
1646
$ title ->setValue ($ this ->object ->getTitle ());
1644
1647
$ title ->setSize (50 );
1645
1648
$ title ->setMaxLength (70 );
@@ -1786,22 +1789,18 @@ protected function initForm($a_mode)
1786
1789
switch ($ a_mode ) {
1787
1790
case 'create ' :
1788
1791
$ this ->form ->setTitle ($ this ->lng ->txt ('event_table_create ' ));
1789
-
1790
1792
$ this ->form ->addCommandButton ('save ' , $ this ->lng ->txt ('event_btn_add ' ));
1791
1793
$ this ->form ->addCommandButton ('saveAndAssignMaterials ' , $ this ->lng ->txt ('event_btn_add_edit ' ));
1792
1794
$ this ->form ->addCommandButton ('cancel ' , $ this ->lng ->txt ('cancel ' ));
1793
-
1794
- return true ;
1795
+ return $ this ->form ;
1795
1796
1796
1797
case 'edit ' :
1797
1798
$ this ->form ->setTitle ($ this ->lng ->txt ('event_table_update ' ));
1798
-
1799
1799
$ this ->form ->addCommandButton ('update ' , $ this ->lng ->txt ('save ' ));
1800
1800
$ this ->form ->addCommandButton ('cancelEdit ' , $ this ->lng ->txt ('cancel ' ));
1801
-
1802
- return true ;
1801
+ return $ this ->form ;
1803
1802
}
1804
- return true ;
1803
+ return $ this -> form ;
1805
1804
}
1806
1805
1807
1806
/**
0 commit comments