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

(-)a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css (+2 lines)
Lines 554-559 div.yui-b fieldset.brief li.radio { Link Here
554
	padding : .7em 0;
554
	padding : .7em 0;
555
}
555
}
556
div.yui-b fieldset.brief li.radio label,
556
div.yui-b fieldset.brief li.radio label,
557
div.yui-b fieldset.brief li.dateinsert label,
558
div.yui-b fieldset.brief li.dateinsert span.label,
557
div.yui-b fieldset.brief li.radio span.label {
559
div.yui-b fieldset.brief li.radio span.label {
558
	display : inline;
560
	display : inline;
559
}
561
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt (-1 / +27 lines)
Lines 209-215 Link Here
209
				<input type="hidden" id="newBranchName" name="newBranchName" />
209
				<input type="hidden" id="newBranchName" name="newBranchName" />
210
			</li>
210
			</li>
211
			<li>
211
			<li>
212
				<strong>Date:</strong>
212
				<strong>From Date:</strong>
213
				<span id="newDaynameOutput"></span>, 
213
				<span id="newDaynameOutput"></span>, 
214
214
215
				[% IF ( dateformat_us ) %]<span id="newMonthOutput"></span>/<span id="newDayOutput"></span>/<span id="newYearOutput"></span>[% ELSIF ( dateformat_metric ) %]<span id="newDayOutput"></span>/<span id="newMonthOutput"></span>/<span id="newYearOutput"></span>[% ELSE %]<span id="newYearOutput"></span>/<span id="newMonthOutput"></span>/<span id="newDayOutput"></span>[% END %]
215
				[% IF ( dateformat_us ) %]<span id="newMonthOutput"></span>/<span id="newDayOutput"></span>/<span id="newYearOutput"></span>[% ELSIF ( dateformat_metric ) %]<span id="newDayOutput"></span>/<span id="newMonthOutput"></span>/<span id="newYearOutput"></span>[% ELSE %]<span id="newYearOutput"></span>/<span id="newMonthOutput"></span>/<span id="newDayOutput"></span>[% END %]
Lines 220-225 Link Here
220
				<input type="hidden" id="newMonth" name="newMonth" />
220
				<input type="hidden" id="newMonth" name="newMonth" />
221
				<input type="hidden" id="newYear" name="newYear" />
221
				<input type="hidden" id="newYear" name="newYear" />
222
			</li>
222
			</li>
223
			<li class="dateinsert">
224
			<b>To Date : </b>
225
			[% IF ( dateformat_us ) %]
226
			<label for="newMonth1">Month </label> <input type="text" size="2" id="newMonth1" name="newMonth1"/>
227
			<label for="newDay1">Day </label> <input type="text" size="2" id="newDay1" name="newDay1" />
228
			<label for="newYear1">Year </label> <input type="text" size="4" id="newYear1" name="newYear1"/>
229
			[% ELSIF ( dateformat_metric ) %]
230
			<label for="newDay1">Day </label> <input type="text" size="2" id="newDay1" name="newDay1" />
231
			<label for="newMonth1">Month </label> <input type="text" size="2" id="newMonth1" name="newMonth1"/>
232
			<label for="newYear1">Year </label> <input type="text" size="4" id="newYear1" name="newYear1"/>
233
			[% ELSE %]
234
			<label for="newYear1">Year </label> <input type="text" size="4" id="newYear1" name="newYear1"/>
235
			<label for="newMonth1">Month </label> <input type="text" size="2" id="newMonth1" name="newMonth1"/>
236
			<label for="newDay1">Day </label> <input type="text" size="2" id="newDay1" name="newDay1" />
237
			[% END %]
238
			</li>
223
			<li><label for="title">Title: </label><input type="text" name="newTitle" id="title" size="35" /></li>
239
			<li><label for="title">Title: </label><input type="text" name="newTitle" id="title" size="35" /></li>
224
			<li><label for="newDescription">Description:</label>
240
			<li><label for="newDescription">Description:</label>
225
				<textarea rows="2" cols="40" id="newDescription" name="newDescription"></textarea>
241
				<textarea rows="2" cols="40" id="newDescription" name="newDescription"></textarea>
Lines 239-244 Link Here
239
							<a href="#" class="helptext">[?]</a>
255
							<a href="#" class="helptext">[?]</a>
240
							<div class="hint">This will take this day and month as a reference to make it a holiday. Through this option, you can repeat this rule for every year. For example, selecting August 1st will make August 1st a holiday every year.</div>
256
							<div class="hint">This will take this day and month as a reference to make it a holiday. Through this option, you can repeat this rule for every year. For example, selecting August 1st will make August 1st a holiday every year.</div>
241
							</li>
257
							</li>
258
            <li class="radio"><input type="radio" name="newOperation" id="newOperationField" value="holidayrange" />
259
                            <label for="newOperationField">Holidays on a range</label>.
260
                            <a href="#" class="helptext">[?]</a>
261
                            <div class="hint">Make a single holiday on a range. For example, selecting August 1st, 2012  and August 10st, 2012 will make all days between 1st and 10st holiday, but will not affect August 1st-10st in other years.</div>
262
                            </li>
263
            <li class="radio"><input type="radio" name="newOperation" id="newOperationFieldyear" value="holidayrangerepeat" />
264
                            <label for="newOperationFieldyear">Holidays repeated yearly on a range</label>.
265
                            <a href="#" class="helptext">[?]</a>
266
                            <div class="hint">Make a single holiday on a range repeated yearly. For example, selecting August 1st, 2012  and August 10st, 2012 will make all days between 1st and 10st holiday, and will affect August 1st-10st in other years.</div>
267
                            </li>
242
				<li class="radio">
268
				<li class="radio">
243
				<input type="checkbox" name="allBranches" id="allBranches" />
269
				<input type="checkbox" name="allBranches" id="allBranches" />
244
				<label for="allBranches">Copy to all libraries</label>.
270
				<label for="allBranches">Copy to all libraries</label>.
(-)a/tools/newHolidays.pl (-17 / +67 lines)
Lines 10-33 use C4::Output; Link Here
10
10
11
11
12
use C4::Calendar;
12
use C4::Calendar;
13
use DateTime;
13
14
14
my $input = new CGI;
15
my $input               = new CGI;
15
my $dbh = C4::Context->dbh();
16
my $dbh                 = C4::Context->dbh();
16
17
17
my $branchcode = $input->param('newBranchName');
18
my $branchcode          = $input->param('newBranchName');
18
my $originalbranchcode = $branchcode;
19
my $originalbranchcode  = $branchcode;
19
my $weekday = $input->param('newWeekday');
20
my $weekday             = $input->param('newWeekday');
20
my $day = $input->param('newDay');
21
my $day                 = $input->param('newDay');
21
my $month = $input->param('newMonth');
22
my $month               = $input->param('newMonth');
22
my $year = $input->param('newYear');
23
my $year                = $input->param('newYear');
23
my $title = $input->param('newTitle');
24
my $day1                = $input->param('newDay1');
24
my $description = $input->param('newDescription');
25
my $month1              = $input->param('newMonth1');
25
my $newoperation = $input->param('newOperation');
26
my $year1               = $input->param('newYear1');
26
my $allbranches = $input->param('allBranches');
27
my $title               = $input->param('newTitle');
28
my $description         = $input->param('newDescription');
29
my $newoperation        = $input->param('newOperation');
30
my $allbranches         = $input->param('allBranches');
27
31
28
my $calendardate = sprintf("%04d-%02d-%02d", $year, $month, $day);
32
my $calendardate        = sprintf("%04d-%02d-%02d", $year, $month, $day);
29
my $isodate = C4::Dates->new($calendardate, 'iso');
33
my $isodate             = C4::Dates->new($calendardate, 'iso');
30
$calendardate = $isodate->output('syspref');
34
$calendardate           = $isodate->output('syspref');
31
35
32
$title || ($title = '');
36
$title || ($title = '');
33
if ($description) {
37
if ($description) {
Lines 80-84 sub add_holiday { Link Here
80
						             description => $description);
84
						             description => $description);
81
		}
85
		}
82
86
83
	}
87
	} elsif ( $newoperation eq 'holidayrange' ) {
88
        #Make an array with holiday's days
89
        my $first_dt = DateTime->new(year => $year, month  => $month,  day => $day);
90
        my $end_dt   = DateTime->new(year => $year1, month  => $month1,  day => $day1);
91
        my @holiday_list = ();
92
93
        for (my $dt = $first_dt->clone();
94
            $dt <= $end_dt;
95
            $dt->add(days => 1) )
96
            {
97
            push @holiday_list, $dt->clone();
98
            }
99
100
        foreach my $date (@holiday_list){
101
            unless ( $calendar->isHoliday( $date->{local_c}->{day}, $date->{local_c}->{month}, $date->{local_c}->{year} ) ) {
102
            $calendar->insert_single_holiday(
103
                day         => $date->{local_c}->{day},
104
                month       => $date->{local_c}->{month},
105
                year        => $date->{local_c}->{year},
106
                title       => $title,
107
                description => $description
108
                );
109
            }
110
        }
111
    } elsif ( $newoperation eq 'holidayrangerepeat' ) {
112
        #Make an array with holiday's days
113
        my $first_dt = DateTime->new(year => $year, month  => $month,  day => $day);
114
        my $end_dt   = DateTime->new(year => $year1, month  => $month1,  day => $day1);
115
        my @holiday_list = ();
116
117
        for (my $dt = $first_dt->clone();
118
            $dt <= $end_dt;
119
            $dt->add(days => 1) )
120
            {
121
            push @holiday_list, $dt->clone();
122
            }
123
124
        foreach my $date (@holiday_list){
125
            unless ( $calendar->isHoliday( $date->{local_c}->{day}, $date->{local_c}->{month}, $date->{local_c}->{year} ) ) {
126
            $calendar->insert_day_month_holiday(
127
                day         => $date->{local_c}->{day},
128
                month       => $date->{local_c}->{month},
129
                title       => $title,
130
                description => $description
131
                );
132
            }
133
        }
134
    }
84
}
135
}
85
- 

Return to bug 6663