View | Details | Raw Unified | Return to bug 33667
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt (-1 / +1 lines)
Lines 123-129 Link Here
123
                                                <input type="checkbox" name="allBranches" id="allBranches" />
123
                                                <input type="checkbox" name="allBranches" id="allBranches" />
124
                                                <label for="allBranches">Copy changes to all libraries</label>.
124
                                                <label for="allBranches">Copy changes to all libraries</label>.
125
                                                <a href="#" class="helptext">[?]</a>
125
                                                <a href="#" class="helptext">[?]</a>
126
                                                <div class="hint">If checked, changes for this holiday will be copied to all libraries. If the holiday doesn't exists for a library, no change is made.</div>
126
                                                <div class="hint">If checked, changes for this holiday will be copied to all libraries. If the holiday doesn't exists for a library, holiday is added to calendar. NOTE! This might overwrite existing holidays in other calendars.</div>
127
                                            </li>
127
                                            </li>
128
                                        </ol>
128
                                        </ol>
129
                                        <fieldset class="action">
129
                                        <fieldset class="action">
(-)a/tools/exceptionHolidays.pl (-22 / +77 lines)
Lines 86-112 sub edit_holiday { Link Here
86
                }
86
                }
87
            }
87
            }
88
    } elsif ($showoperation eq 'edit') {
88
    } elsif ($showoperation eq 'edit') {
89
        if($holidaytype eq 'weekday') {
89
        if ( $holidaytype eq 'weekday' ) {
90
        $calendar->ModWeekdayholiday(weekday => $weekday,
90
            my $isHoliday = $calendar->isHoliday( $day, $month, $year );
91
                                    title => $title,
91
            if ($isHoliday) {
92
                                    description => $description);
92
                $calendar->ModWeekdayholiday(
93
        } elsif ($holidaytype eq 'daymonth') {
93
                    weekday     => $weekday,
94
        $calendar->ModDaymonthholiday(day => $day,
94
                    title       => $title,
95
                                        month => $month,
95
                    description => $description
96
                                        title => $title,
96
                );
97
                                        description => $description);
97
            }
98
        } elsif ($holidaytype eq 'ymd') {
98
            else {
99
        $calendar->ModSingleholiday(day => $day,
99
                $calendar->insert_week_day_holiday(
100
                                    month => $month,
100
                    weekday     => $weekday,
101
                                    year => $year,
101
                    title       => $title,
102
                                    title => $title,
102
                    description => $description
103
                                    description => $description);
103
                );
104
        } elsif ($holidaytype eq 'exception') {
104
            }
105
        $calendar->ModExceptionholiday(day => $day,
105
        }
106
                                    month => $month,
106
        elsif ( $holidaytype eq 'daymonth' ) {
107
                                    year => $year,
107
            my $isHoliday = $calendar->isHoliday( $day, $month, $year );
108
                                    title => $title,
108
            if ($isHoliday) {
109
                                    description => $description);
109
                $calendar->ModDaymonthholiday(
110
                    day         => $day,
111
                    month       => $month,
112
                    title       => $title,
113
                    description => $description
114
                );
115
            }
116
            else {
117
                $calendar->insert_day_month_holiday(
118
                    day         => $day,
119
                    month       => $month,
120
                    title       => $title,
121
                    description => $description
122
                );
123
            }
124
        }
125
        elsif ( $holidaytype eq 'ymd' ) {
126
            my $isHoliday = $calendar->isHoliday( $day, $month, $year );
127
            if ($isHoliday) {
128
                $calendar->ModSingleholiday(
129
                    day         => $day,
130
                    month       => $month,
131
                    year        => $year,
132
                    title       => $title,
133
                    description => $description
134
                );
135
            }
136
            else {
137
                $calendar->insert_single_holiday(
138
                    day         => $day,
139
                    month       => $month,
140
                    year        => $year,
141
                    title       => $title,
142
                    description => $description
143
                );
144
            }
145
        }
146
        elsif ( $holidaytype eq 'exception' ) {
147
            my $isHoliday = $calendar->isHoliday( $day, $month, $year );
148
            if ($isHoliday) {
149
                $calendar->ModExceptionholiday(
150
                    day         => $day,
151
                    month       => $month,
152
                    year        => $year,
153
                    title       => $title,
154
                    description => $description
155
                );
156
            }
157
            else {
158
                $calendar->insert_exception_holiday(
159
                    day         => $day,
160
                    month       => $month,
161
                    year        => $year,
162
                    title       => $title,
163
                    description => $description
164
                );
165
            }
110
        }
166
        }
111
    } elsif ($showoperation eq 'delete') {
167
    } elsif ($showoperation eq 'delete') {
112
        $calendar->delete_holiday(weekday => $weekday,
168
        $calendar->delete_holiday(weekday => $weekday,
113
- 

Return to bug 33667