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

(-)a/tools/exceptionHolidays.pl (-14 / +13 lines)
Lines 17-34 my $dbh = C4::Context->dbh(); Link Here
17
checkauth($input, 0, {tools=> 'edit_calendar'}, 'intranet');
17
checkauth($input, 0, {tools=> 'edit_calendar'}, 'intranet');
18
18
19
19
20
my $branchcode = $input->param('showBranchName');
20
our $branchcode = $input->param('showBranchName');
21
my $originalbranchcode  = $branchcode;
21
my $originalbranchcode  = $branchcode;
22
my $weekday = $input->param('showWeekday');
22
our $weekday = $input->param('showWeekday');
23
my $day = $input->param('showDay');
23
our $day = $input->param('showDay');
24
my $month = $input->param('showMonth');
24
our $month = $input->param('showMonth');
25
my $year = $input->param('showYear');
25
our $year = $input->param('showYear');
26
my $title = $input->param('showTitle');
26
our $title = $input->param('showTitle');
27
my $description = $input->param('showDescription');
27
our $description = $input->param('showDescription');
28
my $holidaytype = $input->param('showHolidayType');
28
our $holidaytype = $input->param('showHolidayType');
29
my $datecancelrange_dt = eval { dt_from_string( scalar $input->param('datecancelrange') ) };
29
my $datecancelrange_dt = eval { dt_from_string( scalar $input->param('datecancelrange') ) };
30
my $calendardate = sprintf("%04d-%02d-%02d", $year, $month, $day);
30
my $calendardate = sprintf("%04d-%02d-%02d", $year, $month, $day);
31
my $showoperation = $input->param('showOperation');
31
our $showoperation = $input->param('showOperation');
32
my $allbranches = $input->param('allBranches');
32
my $allbranches = $input->param('allBranches');
33
33
34
$title || ($title = '');
34
$title || ($title = '');
Lines 40-46 if ($description) { Link Here
40
}   
40
}   
41
41
42
# We make an array with holiday's days
42
# We make an array with holiday's days
43
my @holiday_list;
43
our @holiday_list;
44
if ($datecancelrange_dt){
44
if ($datecancelrange_dt){
45
            my $first_dt = DateTime->new(year => $year, month  => $month,  day => $day);
45
            my $first_dt = DateTime->new(year => $year, month  => $month,  day => $day);
46
46
Lines 55-70 if ($datecancelrange_dt){ Link Here
55
if($allbranches) {
55
if($allbranches) {
56
    my $libraries = Koha::Libraries->search;
56
    my $libraries = Koha::Libraries->search;
57
    while ( my $library = $libraries->next ) {
57
    while ( my $library = $libraries->next ) {
58
        edit_holiday($showoperation, $library->branchcode, $weekday, $day, $month, $year, $title, $description, $holidaytype);
58
        edit_holiday($showoperation, $library->branchcode, $weekday, $day, $month, $year, $title, $description, $holidaytype, @holiday_list);
59
    }
59
    }
60
} else {
60
} else {
61
    edit_holiday($showoperation, $branchcode, $weekday, $day, $month, $year, $title, $description, $holidaytype);
61
    edit_holiday($showoperation, $branchcode, $weekday, $day, $month, $year, $title, $description, $holidaytype, @holiday_list);
62
}
62
}
63
63
64
print $input->redirect("/cgi-bin/koha/tools/holidays.pl?branch=$originalbranchcode&calendardate=$calendardate");
64
print $input->redirect("/cgi-bin/koha/tools/holidays.pl?branch=$originalbranchcode&calendardate=$calendardate");
65
65
66
sub edit_holiday {
66
sub edit_holiday {
67
    ($showoperation, $branchcode, $weekday, $day, $month, $year, $title, $description, $holidaytype) = @_;
67
    ($showoperation, $branchcode, $weekday, $day, $month, $year, $title, $description, $holidaytype, @holiday_list) = @_;
68
    my $calendar = C4::Calendar->new(branchcode => $branchcode);
68
    my $calendar = C4::Calendar->new(branchcode => $branchcode);
69
69
70
    if ($showoperation eq 'exception') {
70
    if ($showoperation eq 'exception') {
71
- 

Return to bug 4985