|
15 | 15 | final class PeriodInsert extends Constraint |
16 | 16 | { |
17 | 17 | public const MISSING_TIME_RANGE_ERROR = 'kimai-period-insert-bundle-01'; |
18 | | - public const MISSING_ACTIVITY_ERROR = 'kimai-period-insert-bundle-02'; |
19 | | - public const DISABLED_ACTIVITY_ERROR = 'kimai-period-insert-bundle-03'; |
20 | | - public const MISSING_PROJECT_ERROR = 'kimai-period-insert-bundle-04'; |
21 | | - public const DISABLED_PROJECT_ERROR = 'kimai-period-insert-bundle-05'; |
22 | | - public const ACTIVITY_PROJECT_MISMATCH_ERROR = 'kimai-period-insert-bundle-06'; |
23 | | - public const PROJECT_DISALLOWS_GLOBAL_ACTIVITY_ERROR = 'kimai-period-insert-bundle-07'; |
24 | | - public const DISABLED_CUSTOMER_ERROR = 'kimai-period-insert-bundle-08'; |
25 | | - public const ZERO_DURATION_ERROR = 'kimai-period-insert-bundle-09'; |
26 | | - public const NEGATIVE_DURATION_ERROR = 'kimai-period-insert-bundle-10'; |
27 | | - public const MISSING_DAY_ERROR = 'kimai-period-insert-bundle-11'; |
28 | | - public const PROJECT_NOT_STARTED_ERROR = 'kimai-period-insert-bundle-12'; |
29 | | - public const PROJECT_ALREADY_ENDED_ERROR = 'kimai-period-insert-bundle-13'; |
30 | | - public const TIME_RANGE_IN_FUTURE_ERROR = 'kimai-period-insert-bundle-14'; |
31 | | - public const BEGIN_IN_FUTURE_ERROR = 'kimai-period-insert-bundle-15'; |
32 | | - public const END_IN_FUTURE_ERROR = 'kimai-period-insert-bundle-16'; |
33 | | - public const RECORD_OVERLAPPING_ERROR = 'kimai-period-insert-bundle-17'; |
34 | | - public const BUDGET_USED_ERROR = 'kimai-period-insert-bundle-18'; |
| 18 | + public const MISSING_BEGIN_TIME_ERROR = 'kimai-period-insert-bundle-02'; |
| 19 | + public const MISSING_DURATION_ERROR = 'kimai-period-insert-bundle-03'; |
| 20 | + public const NEGATIVE_DURATION_ERROR = 'kimai-period-insert-bundle-04'; |
| 21 | + public const INVALID_DURATION_ERROR = 'kimai-period-insert-bundle-05'; |
| 22 | + public const ZERO_DURATION_ERROR = 'kimai-period-insert-bundle-06'; |
| 23 | + public const NEGATIVE_BREAK_ERROR = 'kimai-period-insert-bundle-07'; |
| 24 | + public const INVALID_BREAK_ERROR = 'kimai-period-insert-bundle-08'; |
| 25 | + public const DURATION_BREAK_ERROR = 'kimai-period-insert-bundle-09'; |
| 26 | + public const MISSING_ACTIVITY_ERROR = 'kimai-period-insert-bundle-10'; |
| 27 | + public const DISABLED_ACTIVITY_ERROR = 'kimai-period-insert-bundle-11'; |
| 28 | + public const MISSING_PROJECT_ERROR = 'kimai-period-insert-bundle-12'; |
| 29 | + public const DISABLED_PROJECT_ERROR = 'kimai-period-insert-bundle-13'; |
| 30 | + public const ACTIVITY_PROJECT_MISMATCH_ERROR = 'kimai-period-insert-bundle-14'; |
| 31 | + public const PROJECT_DISALLOWS_GLOBAL_ACTIVITY_ERROR = 'kimai-period-insert-bundle-15'; |
| 32 | + public const DISABLED_CUSTOMER_ERROR = 'kimai-period-insert-bundle-16'; |
| 33 | + public const MISSING_DATE_ERROR = 'kimai-period-insert-bundle-17'; |
| 34 | + public const PROJECT_NOT_STARTED_ERROR = 'kimai-period-insert-bundle-18'; |
| 35 | + public const PROJECT_ALREADY_ENDED_ERROR = 'kimai-period-insert-bundle-19'; |
| 36 | + public const TIME_RANGE_IN_FUTURE_ERROR = 'kimai-period-insert-bundle-20'; |
| 37 | + public const BEGIN_IN_FUTURE_ERROR = 'kimai-period-insert-bundle-21'; |
| 38 | + public const END_IN_FUTURE_ERROR = 'kimai-period-insert-bundle-22'; |
| 39 | + public const RECORD_OVERLAPPING_ERROR = 'kimai-period-insert-bundle-23'; |
| 40 | + public const BUDGET_USED_ERROR = 'kimai-period-insert-bundle-24'; |
35 | 41 |
|
36 | 42 | protected const ERROR_NAMES = [ |
37 | 43 | self::MISSING_TIME_RANGE_ERROR => 'You must submit a time range.', |
| 44 | + self::MISSING_BEGIN_TIME_ERROR => 'You must submit a begin time.', |
| 45 | + self::MISSING_DURATION_ERROR => 'You must submit a duration.', |
| 46 | + self::NEGATIVE_DURATION_ERROR => 'A negative duration is not allowed.', |
| 47 | + self::INVALID_DURATION_ERROR => 'Duration cannot be be longer than 24 hours.', |
| 48 | + self::ZERO_DURATION_ERROR => 'An empty duration is not allowed.', |
| 49 | + self::NEGATIVE_BREAK_ERROR => 'A negative break is not allowed.', |
| 50 | + self::INVALID_BREAK_ERROR => 'Break cannot be be longer than 24 hours.', |
| 51 | + self::DURATION_BREAK_ERROR => 'Break must be shorter than the duration.', |
38 | 52 | self::MISSING_ACTIVITY_ERROR => 'An activity needs to be selected.', |
39 | 53 | self::DISABLED_ACTIVITY_ERROR => 'Cannot start a disabled activity.', |
40 | 54 | self::MISSING_PROJECT_ERROR => 'A project needs to be selected.', |
41 | 55 | self::DISABLED_PROJECT_ERROR => 'Cannot start a disabled project.', |
42 | 56 | self::ACTIVITY_PROJECT_MISMATCH_ERROR => 'Project mismatch, project specific activity and period insert project are different.', |
43 | 57 | self::PROJECT_DISALLOWS_GLOBAL_ACTIVITY_ERROR => 'Global activities are forbidden for the selected project.', |
44 | 58 | self::DISABLED_CUSTOMER_ERROR => 'Cannot start a disabled customer.', |
45 | | - self::ZERO_DURATION_ERROR => 'Duration cannot be zero.', |
46 | | - self::NEGATIVE_DURATION_ERROR => 'Duration cannot be negative.', |
47 | | - self::MISSING_DAY_ERROR => 'Could not find a valid day in the selected time range. Check the time range for absences and working days.', |
| 59 | + self::MISSING_DATE_ERROR => 'Could not find a valid date in the selected time range. Check the time range for absences and working days.', |
48 | 60 | self::PROJECT_NOT_STARTED_ERROR => 'The project has not started during the selected time range.', |
49 | 61 | self::PROJECT_ALREADY_ENDED_ERROR => 'The project is finished during the selected time range.', |
50 | 62 | self::TIME_RANGE_IN_FUTURE_ERROR => 'The time range cannot be in the future.', |
|
0 commit comments