@@ -327,62 +327,62 @@ |
||
327 | 327 | |
328 | 328 | if ($mode!='daily') { |
329 | 329 | switch ($mode) { |
330 | - case 'weekly': |
|
331 | - if (isset($rows[$locationsFieldsMapping['schedule_weekdays']])) { |
|
332 | - if ($this->validateScheduleWeekDays($rows[$locationsFieldsMapping['schedule_weekdays']])) { |
|
333 | - $curSchedule.='"weekdays":['.$rows[$locationsFieldsMapping['schedule_weekdays']].']}'; |
|
334 | - } |
|
335 | - else {array_push($results['fail'],"$iRow --> Wrong weekdays"); $curSchedule="";} |
|
330 | + case 'weekly': |
|
331 | + if (isset($rows[$locationsFieldsMapping['schedule_weekdays']])) { |
|
332 | + if ($this->validateScheduleWeekDays($rows[$locationsFieldsMapping['schedule_weekdays']])) { |
|
333 | + $curSchedule.='"weekdays":['.$rows[$locationsFieldsMapping['schedule_weekdays']].']}'; |
|
336 | 334 | } |
337 | - else {array_push($results['fail'],"$iRow --> The parameters sched_weekdays is not set"); $curSchedule="";} |
|
338 | - break; |
|
339 | - case 'monthly': |
|
340 | - $monthlyMode=""; |
|
341 | - if (isset($rows[$locationsFieldsMapping['monthly_mode']])) { |
|
342 | - if ($this->validateScheduleMonthlyMode($rows[$locationsFieldsMapping['monthly_mode']])) { |
|
343 | - $monthlyMode=$rows[$locationsFieldsMapping['monthly_mode']]; |
|
344 | - $curSchedule.='"mode": "'.$rows[$locationsFieldsMapping['monthly_mode']].'",'; |
|
345 | - } |
|
346 | - else {array_push($results['fail'],"$iRow --> Wrong monthly mode"); $curSchedule="";} |
|
335 | + else {array_push($results['fail'],"$iRow --> Wrong weekdays"); $curSchedule="";} |
|
336 | + } |
|
337 | + else {array_push($results['fail'],"$iRow --> The parameters sched_weekdays is not set"); $curSchedule="";} |
|
338 | + break; |
|
339 | + case 'monthly': |
|
340 | + $monthlyMode=""; |
|
341 | + if (isset($rows[$locationsFieldsMapping['monthly_mode']])) { |
|
342 | + if ($this->validateScheduleMonthlyMode($rows[$locationsFieldsMapping['monthly_mode']])) { |
|
343 | + $monthlyMode=$rows[$locationsFieldsMapping['monthly_mode']]; |
|
344 | + $curSchedule.='"mode": "'.$rows[$locationsFieldsMapping['monthly_mode']].'",'; |
|
347 | 345 | } |
348 | - else {array_push($results['fail'],"$iRow --> The parameter sched_monthly_mode is not set"); $curSchedule="";} |
|
346 | + else {array_push($results['fail'],"$iRow --> Wrong monthly mode"); $curSchedule="";} |
|
347 | + } |
|
348 | + else {array_push($results['fail'],"$iRow --> The parameter sched_monthly_mode is not set"); $curSchedule="";} |
|
349 | 349 | |
350 | - if ($monthlyMode!="") { |
|
351 | - switch ($monthlyMode) { |
|
352 | - case 'dates': |
|
353 | - if (isset($rows[$locationsFieldsMapping['monthly_dates']])) { |
|
354 | - if ($this->validateScheduleMonthlyDates($rows[$locationsFieldsMapping['monthly_dates']])) { |
|
355 | - $curSchedule.='"dates":['.$rows[$locationsFieldsMapping['monthly_dates']].']}'; |
|
356 | - } |
|
357 | - else {array_push($results['fail'],"$iRow --> Wrong monthly dates"); $curSchedule="";} |
|
358 | - } |
|
359 | - break; |
|
360 | - case 'nth': |
|
361 | - if (isset($rows[$locationsFieldsMapping['monthly_nth_n']])) { |
|
362 | - if ($this->validateScheduleNthN($rows[$locationsFieldsMapping['monthly_nth_n']])) { |
|
363 | - $curSchedule.='"nth":{"n":'.$rows[$locationsFieldsMapping['monthly_nth_n']].','; |
|
364 | - } |
|
365 | - else {array_push($results['fail'],"$iRow --> Wrong parameter sched_nth_n"); $curSchedule="";} |
|
366 | - } |
|
367 | - else {array_push($results['fail'],"$iRow --> The parameter sched_nth_n is not set"); $curSchedule="";} |
|
368 | - |
|
369 | - if ($curSchedule!="") { |
|
370 | - if (isset($rows[$locationsFieldsMapping['monthly_nth_wwhat']])) { |
|
371 | - if ($this->validateScheduleNthWhat($rows[$locationsFieldsMapping['monthly_nth_wwhat']])) { |
|
372 | - $curSchedule.='"what":'.$rows[$locationsFieldsMapping['monthly_nth_wwhat']].'}}'; |
|
373 | - } |
|
374 | - else {array_push($results['fail'],"$iRow --> Wrong parameter sched_nth_what"); $curSchedule="";} |
|
375 | - } |
|
376 | - else {array_push($results['fail'],"$iRow --> The parameter sched_nth_what is not set"); $curSchedule="";} |
|
377 | - } |
|
350 | + if ($monthlyMode!="") { |
|
351 | + switch ($monthlyMode) { |
|
352 | + case 'dates': |
|
353 | + if (isset($rows[$locationsFieldsMapping['monthly_dates']])) { |
|
354 | + if ($this->validateScheduleMonthlyDates($rows[$locationsFieldsMapping['monthly_dates']])) { |
|
355 | + $curSchedule.='"dates":['.$rows[$locationsFieldsMapping['monthly_dates']].']}'; |
|
356 | + } |
|
357 | + else {array_push($results['fail'],"$iRow --> Wrong monthly dates"); $curSchedule="";} |
|
358 | + } |
|
359 | + break; |
|
360 | + case 'nth': |
|
361 | + if (isset($rows[$locationsFieldsMapping['monthly_nth_n']])) { |
|
362 | + if ($this->validateScheduleNthN($rows[$locationsFieldsMapping['monthly_nth_n']])) { |
|
363 | + $curSchedule.='"nth":{"n":'.$rows[$locationsFieldsMapping['monthly_nth_n']].','; |
|
364 | + } |
|
365 | + else {array_push($results['fail'],"$iRow --> Wrong parameter sched_nth_n"); $curSchedule="";} |
|
366 | + } |
|
367 | + else {array_push($results['fail'],"$iRow --> The parameter sched_nth_n is not set"); $curSchedule="";} |
|
378 | 368 | |
379 | - break; |
|
369 | + if ($curSchedule!="") { |
|
370 | + if (isset($rows[$locationsFieldsMapping['monthly_nth_wwhat']])) { |
|
371 | + if ($this->validateScheduleNthWhat($rows[$locationsFieldsMapping['monthly_nth_wwhat']])) { |
|
372 | + $curSchedule.='"what":'.$rows[$locationsFieldsMapping['monthly_nth_wwhat']].'}}'; |
|
380 | 373 | } |
374 | + else {array_push($results['fail'],"$iRow --> Wrong parameter sched_nth_what"); $curSchedule="";} |
|
375 | + } |
|
376 | + else {array_push($results['fail'],"$iRow --> The parameter sched_nth_what is not set"); $curSchedule="";} |
|
381 | 377 | } |
378 | + |
|
382 | 379 | break; |
383 | - default: |
|
384 | - $curSchedule==""; |
|
380 | + } |
|
381 | + } |
|
385 | 382 | break; |
383 | + default: |
|
384 | + $curSchedule==""; |
|
385 | + break; |
|
386 | 386 | } |
387 | 387 | |
388 | 388 | } |