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

(-)a/installer/data/mysql/de-DE/optional/sample_holidays.sql (+2 lines)
Lines 3-5 INSERT INTO `repeatable_holidays` VALUES Link Here
3
(3,'',NULL,1,1,'','Neujahr'),
3
(3,'',NULL,1,1,'','Neujahr'),
4
(4,'',NULL,25,12,'','1. Weihnachtsfeiertag'),
4
(4,'',NULL,25,12,'','1. Weihnachtsfeiertag'),
5
(5,'',NULL,26,12,'','2. Weihnachtsfeiertag');
5
(5,'',NULL,26,12,'','2. Weihnachtsfeiertag');
6
INSERT INTO `special_holidays` VALUES ('','MPL',16,11,2012,0,'Sample single holiday','This holiday is here for testing purposes only.');
7
INSERT INTO `special_holidays` VALUES ('','MPL',11,11,2012,1,'Sample sunday exception','This holiday exception is here for testing purposes only.');
(-)a/installer/data/mysql/de-DE/optional/sample_holidays.txt (+4 lines)
Lines 2-4 Beispiele für Schließtage: Link Here
2
	Sonntag
2
	Sonntag
3
	1. und 2. Weihnachtsfeiertag
3
	1. und 2. Weihnachtsfeiertag
4
	Neujahr
4
	Neujahr
5
Sample single holidays:
6
    16-11-2012
7
Sample holiday exceptions:
8
    11-11-2012 (Sunday exception)
(-)a/installer/data/mysql/en/optional/sample_holidays.sql (+2 lines)
Lines 2-4 INSERT INTO `repeatable_holidays` VALUES Link Here
2
(2,'MPL',0,NULL,NULL,'','Sundays'),
2
(2,'MPL',0,NULL,NULL,'','Sundays'),
3
(3,'MPL',NULL,1,1,'','New Year\'s Day'),
3
(3,'MPL',NULL,1,1,'','New Year\'s Day'),
4
(4,'MPL',NULL,25,12,'','Christmas');
4
(4,'MPL',NULL,25,12,'','Christmas');
5
INSERT INTO `special_holidays` VALUES ('','MPL',16,11,2012,0,'Sample single holiday','This holiday is here for testing purposes only.');
6
INSERT INTO `special_holidays` VALUES ('','MPL',11,11,2012,1,'Sample sunday exception','This holiday exception is here for testing purposes only.');
(-)a/installer/data/mysql/en/optional/sample_holidays.txt (-1 / +5 lines)
Lines 1-4 Link Here
1
Sample holidays:
1
Sample repeatable holidays:
2
	Sundays
2
	Sundays
3
	Christmas
3
	Christmas
4
	New Year's
4
	New Year's
5
Sample single holidays:
6
    16-11-2012
7
Sample holiday exceptions:
8
    11-11-2012 (Sunday exception)
(-)a/installer/data/mysql/es-ES/optional/sample_holidays.sql (+2 lines)
Lines 2-4 INSERT INTO `repeatable_holidays` VALUES Link Here
2
(2,'',0,NULL,NULL,'','Sundays'),
2
(2,'',0,NULL,NULL,'','Sundays'),
3
(3,'',NULL,1,1,'','New Year\'s Day'),
3
(3,'',NULL,1,1,'','New Year\'s Day'),
4
(4,'',NULL,25,12,'','Christmas');
4
(4,'',NULL,25,12,'','Christmas');
5
INSERT INTO `special_holidays` VALUES ('','MPL',16,11,2012,0,'Sample single holiday','This holiday is here for testing purposes only.');
6
INSERT INTO `special_holidays` VALUES ('','MPL',11,11,2012,1,'Sample sunday exception','This holiday exception is here for testing purposes only.');
(-)a/installer/data/mysql/es-ES/optional/sample_holidays.txt (-1 / +5 lines)
Lines 1-4 Link Here
1
Feriados de ejemplo:
1
Feriados repetibles de ejemplo:
2
	Domingos
2
	Domingos
3
	Navidad
3
	Navidad
4
	Año nuevo
4
	Año nuevo
5
Sample single holidays:
6
    16-11-2012
7
Sample holiday exceptions:
8
    11-11-2012 (Sunday exception)
(-)a/installer/data/mysql/fr-FR/2-Optionel/sample_holidays.sql (+6 lines)
Line 0 Link Here
1
INSERT INTO `repeatable_holidays` VALUES
2
(2,'MPL',0,NULL,NULL,'','Sundays'),
3
(3,'MPL',NULL,1,1,'','New Year\'s Day'),
4
(4,'MPL',NULL,25,12,'','Christmas');
5
INSERT INTO `special_holidays` VALUES ('','MPL',16,11,2012,0,'Sample single holiday','This holiday is here for testing purposes only.');
6
INSERT INTO `special_holidays` VALUES ('','MPL',11,11,2012,1,'Sample sunday exception','This holiday exception is here for testing purposes only.');
(-)a/installer/data/mysql/fr-FR/2-Optionel/sample_holidays.txt (+8 lines)
Line 0 Link Here
1
Sample repeatable holidays:
2
	Sundays
3
	Christmas
4
	New Year's
5
Sample single holidays:
6
    16-11-2012
7
Sample holiday exceptions:
8
    11-11-2012 (Sunday exception)
(-)a/installer/data/mysql/it-IT/necessari/sample_holidays.sql (-1 / +3 lines)
Lines 4-8 INSERT INTO `repeatable_holidays` VALUES Link Here
4
(2,'',0,NULL,NULL,'','Domenica'),
4
(2,'',0,NULL,NULL,'','Domenica'),
5
(3,'',NULL,1,1,'','Nuovo anno'),
5
(3,'',NULL,1,1,'','Nuovo anno'),
6
(4,'',NULL,25,12,'','Natale');
6
(4,'',NULL,25,12,'','Natale');
7
INSERT INTO `special_holidays` VALUES ('','MPL',16,11,2012,0,'Sample single holiday','This holiday is here for testing purposes only.');
8
INSERT INTO `special_holidays` VALUES ('','MPL',11,11,2012,1,'Sample sunday exception','This holiday exception is here for testing purposes only.');
7
9
8
SET FOREIGN_KEY_CHECKS=1;
10
SET FOREIGN_KEY_CHECKS=1;INSERT INTO `repeatable_holidays` VALUES
(-)a/installer/data/mysql/it-IT/necessari/sample_holidays.txt (+4 lines)
Lines 2-4 Esempio vacanze: Link Here
2
	Domenica
2
	Domenica
3
	Natale
3
	Natale
4
	Nuovo anno
4
	Nuovo anno
5
Sample single holidays:
6
    16-11-2012
7
Sample holiday exceptions:
8
    11-11-2012 (Sunday exception)
(-)a/installer/data/mysql/nb-NO/2-Valgfritt/sample_holidays.sql (+2 lines)
Lines 26-28 INSERT INTO `repeatable_holidays` VALUES Link Here
26
(5,'',NULL,17,5,'','17. mai'),
26
(5,'',NULL,17,5,'','17. mai'),
27
(6,'',NULL,25,12,'','1. juledag'),
27
(6,'',NULL,25,12,'','1. juledag'),
28
(7,'',NULL,26,12,'','2. juledag');
28
(7,'',NULL,26,12,'','2. juledag');
29
INSERT INTO `special_holidays` VALUES ('','MPL',16,11,2012,0,'Sample single holiday','This holiday is here for testing purposes only.');
30
INSERT INTO `special_holidays` VALUES ('','MPL',11,11,2012,1,'Sample sunday exception','This holiday exception is here for testing purposes only.');
(-)a/installer/data/mysql/nb-NO/2-Valgfritt/sample_holidays.txt (+7 lines)
Line 1 Link Here
1
Eksempler på fridager.
1
Eksempler på fridager.
2
	Sundays
3
	Christmas
4
	New Year's
5
Sample single holidays:
6
    16-11-2012
7
Sample holiday exceptions:
8
    11-11-2012 (Sunday exception)
(-)a/installer/data/mysql/pl-PL/optional/sample_holidays.sql (+2 lines)
Lines 2-4 INSERT INTO `repeatable_holidays` VALUES Link Here
2
(2,'',0,NULL,NULL,'','Niedziele'),
2
(2,'',0,NULL,NULL,'','Niedziele'),
3
(3,'',NULL,1,1,'','Nowy Rok'),
3
(3,'',NULL,1,1,'','Nowy Rok'),
4
(4,'',NULL,25,12,'','Boże Narodzenie');
4
(4,'',NULL,25,12,'','Boże Narodzenie');
5
INSERT INTO `special_holidays` VALUES ('','MPL',16,11,2012,0,'Sample single holiday','This holiday is here for testing purposes only.');
6
INSERT INTO `special_holidays` VALUES ('','MPL',11,11,2012,1,'Sample sunday exception','This holiday exception is here for testing purposes only.');
(-)a/installer/data/mysql/pl-PL/optional/sample_holidays.txt (+4 lines)
Lines 2-4 Przykładowe dni wolne: Link Here
2
	Niedziele
2
	Niedziele
3
	Boże Narodzenie
3
	Boże Narodzenie
4
	Nowy Rok
4
	Nowy Rok
5
Sample single holidays:
6
    16-11-2012
7
Sample holiday exceptions:
8
    11-11-2012 (Sunday exception)
(-)a/installer/data/mysql/ru-RU/optional/holidays.sql (+2 lines)
Lines 21-23 VALUES (7, '',NULL,2,5,'','День Труда'); Link Here
21
INSERT INTO `repeatable_holidays` (`id`, `branchcode`, `weekday`, `day`, `month`, `title`, `description`) 
21
INSERT INTO `repeatable_holidays` (`id`, `branchcode`, `weekday`, `day`, `month`, `title`, `description`) 
22
VALUES (8, '',NULL,9,5,'','День Победы');
22
VALUES (8, '',NULL,9,5,'','День Победы');
23
23
24
INSERT INTO `special_holidays` VALUES ('','MPL',16,11,2012,0,'Sample single holiday','This holiday is here for testing purposes only.');
25
INSERT INTO `special_holidays` VALUES ('','MPL',11,11,2012,1,'Sample sunday exception','This holiday exception is here for testing purposes only.');
(-)a/installer/data/mysql/ru-RU/optional/holidays.txt (-1 / +8 lines)
Line 1 Link Here
1
Повторяемые праздники.
1
Повторяемые праздники.:
2
	Sundays
3
	Christmas
4
	New Year's
5
Sample single holidays:
6
    16-11-2012
7
Sample holiday exceptions:
8
    11-11-2012 (Sunday exception)
(-)a/installer/data/mysql/uk-UA/optional/holidays.sql (+6 lines)
Lines 22-24 INSERT INTO `repeatable_holidays` (`branchcode`, `weekday`, `day`, `month`, `tit Link Here
22
('LNSL', NULL, 28,   6,   '', 'День Конституції'),
22
('LNSL', NULL, 28,   6,   '', 'День Конституції'),
23
('LNSL', NULL, 24,   8,   '', 'День Незалежності');
23
('LNSL', NULL, 24,   8,   '', 'День Незалежності');
24
24
25
INSERT INTO `repeatable_holidays` VALUES
26
('','MPL',0,NULL,NULL,'','Sundays'),
27
('','MPL',NULL,1,1,'','New Year\'s Day'),
28
('','MPL',NULL,25,12,'','Christmas');
29
INSERT INTO `special_holidays` VALUES ('','MPL',16,11,2012,0,'Sample single holiday','This holiday is here for testing purposes only.');
30
INSERT INTO `special_holidays` VALUES ('','MPL',11,11,2012,1,'Sample sunday exception','This holiday exception is here for testing purposes only.');
(-)a/installer/data/mysql/uk-UA/optional/holidays.txt (+8 lines)
Line 1 Link Here
1
Офіційні повторювальні свята в Україні.
1
Офіційні повторювальні свята в Україні.
2
Sample repeatable holidays:
3
	Sundays
4
	Christmas
5
	New Year's
6
Sample single holidays:
7
    16-11-2012
8
Sample holiday exceptions:
9
    11-11-2012 (Sunday exception)
(-)a/t/db_dependent/Holidays.t (-2 / +31 lines)
Lines 5-11 use DateTime; Link Here
5
use DateTime::TimeZone;
5
use DateTime::TimeZone;
6
6
7
use C4::Context;
7
use C4::Context;
8
use Test::More tests => 8;
8
use Test::More tests => 11;
9
9
10
BEGIN { use_ok('Koha::Calendar'); }
10
BEGIN { use_ok('Koha::Calendar'); }
11
BEGIN { use_ok('C4::Calendar'); }
11
BEGIN { use_ok('C4::Calendar'); }
Lines 39-45 my $newyear = DateTime->new( Link Here
39
    day   => 1,
39
    day   => 1,
40
);
40
);
41
41
42
my $special_holiday = DateTime->new(
43
    year  => 2012,
44
    month => 11,
45
    day   => 16
46
);
47
48
my $exception_sunday = DateTime->new(
49
    year  => 2012,
50
    month => 11,
51
    day   => 11
52
);
53
42
is( $koha_calendar->is_holiday($sunday),    1, 'Sunday is a closed day' );
54
is( $koha_calendar->is_holiday($sunday),    1, 'Sunday is a closed day' );
43
is( $koha_calendar->is_holiday($monday),    0, 'Monday is not a closed day' );
55
is( $koha_calendar->is_holiday($monday),    0, 'Monday is not a closed day' );
44
is( $koha_calendar->is_holiday($christmas), 1, 'Christmas is a closed day' );
56
is( $koha_calendar->is_holiday($christmas), 1, 'Christmas is a closed day' );
45
is( $koha_calendar->is_holiday($newyear), 1, 'New Years day is a closed day' );
57
is( $koha_calendar->is_holiday($newyear), 1, 'New Years day is a closed day' );
46
- 
58
is( $koha_calendar->is_holiday($special_holiday), 1, 'Sample single holiday is a closed day' );
59
is( $koha_calendar->is_holiday($exception_sunday), 0, 'Sample sunday exception is not a closed day' );
60
61
62
# is_holiday truncates the date to day as that's
63
# how they are stored/retreived from db. This is a
64
# regression test for a bug introduced by 8966, fixed in 8800
65
my $special_holiday_time = DateTime->new(
66
    year  => 2012,
67
    month => 11,
68
    day   => 16,
69
    hour  => 11,
70
    minute  => 2
71
);
72
73
is( $koha_calendar->is_holiday($special_holiday_time),
74
    $koha_calendar->is_holiday($special_holiday) ,
75
    'is_holiday should truncate the date for holiday validation' );

Return to bug 9074