File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1095,6 +1095,41 @@ sub Run {
10951095 # add/edit appointment
10961096 # ------------------------------------------------------------ #
10971097 elsif ( $Self -> {Subaction } eq ' EditAppointment' ) {
1098+
1099+ my $ErrorMessage ;
1100+
1101+ if ( !$GetParam {Title } ) {
1102+ $ErrorMessage = ' Title is required!' ;
1103+ }
1104+ elsif ( !$GetParam {CalendarID } ) {
1105+ $ErrorMessage = ' Calendar is required!' ;
1106+ }
1107+ elsif ( $GetParam {RecurrenceLimit } eq " 2" && ( !$GetParam {RecurrenceCount } ) ) {
1108+ $ErrorMessage = ' Recurrence value is required!' ;
1109+ }
1110+ elsif ( $GetParam {RecurrenceLimit } eq " 2" && ( $GetParam {RecurrenceCount } !~ / \d\d / || $GetParam {RecurrenceCount } < 1 ) ) {
1111+ $ErrorMessage = ' Not a valid recurrence value!' ;
1112+ }
1113+
1114+ if ($ErrorMessage ) {
1115+
1116+ # build JSON output
1117+ $JSON = $LayoutObject -> JSONEncode(
1118+ Data => {
1119+ Success => 0,
1120+ Error => Translatable($ErrorMessage ),
1121+ },
1122+ );
1123+
1124+ # send JSON response
1125+ return $LayoutObject -> Attachment(
1126+ ContentType => ' application/json' ,
1127+ Content => $JSON ,
1128+ Type => ' inline' ,
1129+ NoCache => 1,
1130+ );
1131+ }
1132+
10981133 my %Appointment ;
10991134 if ( $GetParam {AppointmentID } ) {
11001135 %Appointment = $AppointmentObject -> AppointmentGet(
You can’t perform that action at this time.
0 commit comments