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

(-)a/installer/data/mysql/de-DE/optional/sample_frequencies.sql (+16 lines)
Line 0 Link Here
1
INSERT INTO subscription_frequencies
2
    (description, unit, unitsperissue, issuesperunit, displayorder)
3
VALUES
4
    ('2/day', 'day', 1, 2, 1),
5
    ('1/day', 'day', 1, 1, 2),
6
    ('3/week', 'week', 1, 3, 3),
7
    ('1/week', 'week', 1, 1, 4),
8
    ('1/2 weeks', 'week', 2, 1, 5),
9
    ('1/3 weeks', 'week', 3, 1, 6),
10
    ('1/month', 'month', 1, 1, 7),
11
    ('1/2 months', 'month', 2, 1, 8),
12
    ('1/3 months', 'month', 3, 1, 9),
13
    ('2/year', 'month', 6, 1, 10),
14
    ('1/year', 'year', 1, 1, 11),
15
    ('1/2 year', 'year', 2, 1, 12),
16
    ('Irregular', NULL, 1, 1, 13);
(-)a/installer/data/mysql/de-DE/optional/sample_frequencies.txt (+1 lines)
Line 0 Link Here
1
Sample frequencies for subscriptions
(-)a/installer/data/mysql/de-DE/optional/sample_numberpatterns.sql (+25 lines)
Line 0 Link Here
1
INSERT INTO subscription_numberpatterns
2
    (label, displayorder, description, numberingmethod,
3
    label1, add1, every1, whenmorethan1, setto1, numbering1,
4
    label2, add2, every2, whenmorethan2, setto2, numbering2,
5
    label3, add3, every3, whenmorethan3, setto3, numbering3)
6
VALUES
7
    ('Number', 1, 'Simple Numbering method', 'No.{X}',
8
    'Number', 1, 1, 99999, 1, NULL,
9
    NULL, NULL, NULL, NULL, NULL, NULL,
10
    NULL, NULL, NULL, NULL, NULL, NULL),
11
12
    ('Volume, Number, Issue', 2, 'Volume Number Issue 1', 'Vol.{X}, Number {Y}, Issue {Z}',
13
    'Volume', 1, 48, 99999, 1, NULL,
14
    'Number', 1, 4, 12, 1, NULL,
15
    'Issue', 1, 1, 4, 1, NULL),
16
17
    ('Volume, Number', 3, 'Volume Number 1', 'Vol {X}, No {Y}',
18
    'Volume', 1, 12, 99999, 1, NULL,
19
    'Number', 1, 1, 12, 1, NULL,
20
    NULL, NULL, NULL, NULL, NULL, NULL),
21
22
    ('Seasonal', 4, 'Season Year', '{X} {Y}',
23
    'Season', 1, 1, 3, 0, 'season',
24
    'Year', 1, 4, 99999, 1, NULL,
25
    NULL, NULL, NULL, NULL, NULL, NULL);
(-)a/installer/data/mysql/de-DE/optional/sample_numberpatterns.txt (+1 lines)
Line 0 Link Here
1
Sample numbering patterns for subscriptions
(-)a/installer/data/mysql/en/optional/sample_frequencies.sql (+16 lines)
Line 0 Link Here
1
INSERT INTO subscription_frequencies
2
    (description, unit, unitsperissue, issuesperunit, displayorder)
3
VALUES
4
    ('2/day', 'day', 1, 2, 1),
5
    ('1/day', 'day', 1, 1, 2),
6
    ('3/week', 'week', 1, 3, 3),
7
    ('1/week', 'week', 1, 1, 4),
8
    ('1/2 weeks', 'week', 2, 1, 5),
9
    ('1/3 weeks', 'week', 3, 1, 6),
10
    ('1/month', 'month', 1, 1, 7),
11
    ('1/2 months', 'month', 2, 1, 8),
12
    ('1/3 months', 'month', 3, 1, 9),
13
    ('2/year', 'month', 6, 1, 10),
14
    ('1/year', 'year', 1, 1, 11),
15
    ('1/2 year', 'year', 2, 1, 12),
16
    ('Irregular', NULL, 1, 1, 13);
(-)a/installer/data/mysql/en/optional/sample_frequencies.txt (+1 lines)
Line 0 Link Here
1
Sample frequencies for subscriptions
(-)a/installer/data/mysql/en/optional/sample_numberpatterns.sql (+25 lines)
Line 0 Link Here
1
INSERT INTO subscription_numberpatterns
2
    (label, displayorder, description, numberingmethod,
3
    label1, add1, every1, whenmorethan1, setto1, numbering1,
4
    label2, add2, every2, whenmorethan2, setto2, numbering2,
5
    label3, add3, every3, whenmorethan3, setto3, numbering3)
6
VALUES
7
    ('Number', 1, 'Simple Numbering method', 'No.{X}',
8
    'Number', 1, 1, 99999, 1, NULL,
9
    NULL, NULL, NULL, NULL, NULL, NULL,
10
    NULL, NULL, NULL, NULL, NULL, NULL),
11
12
    ('Volume, Number, Issue', 2, 'Volume Number Issue 1', 'Vol.{X}, Number {Y}, Issue {Z}',
13
    'Volume', 1, 48, 99999, 1, NULL,
14
    'Number', 1, 4, 12, 1, NULL,
15
    'Issue', 1, 1, 4, 1, NULL),
16
17
    ('Volume, Number', 3, 'Volume Number 1', 'Vol {X}, No {Y}',
18
    'Volume', 1, 12, 99999, 1, NULL,
19
    'Number', 1, 1, 12, 1, NULL,
20
    NULL, NULL, NULL, NULL, NULL, NULL),
21
22
    ('Seasonal', 4, 'Season Year', '{X} {Y}',
23
    'Season', 1, 1, 3, 0, 'season',
24
    'Year', 1, 4, 99999, 1, NULL,
25
    NULL, NULL, NULL, NULL, NULL, NULL);
(-)a/installer/data/mysql/en/optional/sample_numberpatterns.txt (+1 lines)
Line 0 Link Here
1
Sample numbering patterns for subscriptions
(-)a/installer/data/mysql/es-ES/optional/sample_frequencies.sql (+16 lines)
Line 0 Link Here
1
INSERT INTO subscription_frequencies
2
    (description, unit, unitsperissue, issuesperunit, displayorder)
3
VALUES
4
    ('2/day', 'day', 1, 2, 1),
5
    ('1/day', 'day', 1, 1, 2),
6
    ('3/week', 'week', 1, 3, 3),
7
    ('1/week', 'week', 1, 1, 4),
8
    ('1/2 weeks', 'week', 2, 1, 5),
9
    ('1/3 weeks', 'week', 3, 1, 6),
10
    ('1/month', 'month', 1, 1, 7),
11
    ('1/2 months', 'month', 2, 1, 8),
12
    ('1/3 months', 'month', 3, 1, 9),
13
    ('2/year', 'month', 6, 1, 10),
14
    ('1/year', 'year', 1, 1, 11),
15
    ('1/2 year', 'year', 2, 1, 12),
16
    ('Irregular', NULL, 1, 1, 13);
(-)a/installer/data/mysql/es-ES/optional/sample_frequencies.txt (+1 lines)
Line 0 Link Here
1
Sample frequencies for subscriptions
(-)a/installer/data/mysql/es-ES/optional/sample_numberpatterns.sql (+25 lines)
Line 0 Link Here
1
INSERT INTO subscription_numberpatterns
2
    (label, displayorder, description, numberingmethod,
3
    label1, add1, every1, whenmorethan1, setto1, numbering1,
4
    label2, add2, every2, whenmorethan2, setto2, numbering2,
5
    label3, add3, every3, whenmorethan3, setto3, numbering3)
6
VALUES
7
    ('Number', 1, 'Simple Numbering method', 'No.{X}',
8
    'Number', 1, 1, 99999, 1, NULL,
9
    NULL, NULL, NULL, NULL, NULL, NULL,
10
    NULL, NULL, NULL, NULL, NULL, NULL),
11
12
    ('Volume, Number, Issue', 2, 'Volume Number Issue 1', 'Vol.{X}, Number {Y}, Issue {Z}',
13
    'Volume', 1, 48, 99999, 1, NULL,
14
    'Number', 1, 4, 12, 1, NULL,
15
    'Issue', 1, 1, 4, 1, NULL),
16
17
    ('Volume, Number', 3, 'Volume Number 1', 'Vol {X}, No {Y}',
18
    'Volume', 1, 12, 99999, 1, NULL,
19
    'Number', 1, 1, 12, 1, NULL,
20
    NULL, NULL, NULL, NULL, NULL, NULL),
21
22
    ('Seasonal', 4, 'Season Year', '{X} {Y}',
23
    'Season', 1, 1, 3, 0, 'season',
24
    'Year', 1, 4, 99999, 1, NULL,
25
    NULL, NULL, NULL, NULL, NULL, NULL);
(-)a/installer/data/mysql/es-ES/optional/sample_numberpatterns.txt (+1 lines)
Line 0 Link Here
1
Sample numbering patterns for subscriptions
(-)a/installer/data/mysql/fr-FR/2-Optionel/sample_frequencies.sql (+16 lines)
Line 0 Link Here
1
INSERT INTO subscription_frequencies
2
    (description, unit, unitsperissue, issuesperunit, displayorder)
3
VALUES
4
    ('2/day', 'day', 1, 2, 1),
5
    ('1/day', 'day', 1, 1, 2),
6
    ('3/week', 'week', 1, 3, 3),
7
    ('1/week', 'week', 1, 1, 4),
8
    ('1/2 weeks', 'week', 2, 1, 5),
9
    ('1/3 weeks', 'week', 3, 1, 6),
10
    ('1/month', 'month', 1, 1, 7),
11
    ('1/2 months', 'month', 2, 1, 8),
12
    ('1/3 months', 'month', 3, 1, 9),
13
    ('2/year', 'month', 6, 1, 10),
14
    ('1/year', 'year', 1, 1, 11),
15
    ('1/2 year', 'year', 2, 1, 12),
16
    ('Irregular', NULL, 1, 1, 13);
(-)a/installer/data/mysql/fr-FR/2-Optionel/sample_frequencies.txt (+1 lines)
Line 0 Link Here
1
Sample frequencies for subscriptions
(-)a/installer/data/mysql/fr-FR/2-Optionel/sample_numberpatterns.sql (+25 lines)
Line 0 Link Here
1
INSERT INTO subscription_numberpatterns
2
    (label, displayorder, description, numberingmethod,
3
    label1, add1, every1, whenmorethan1, setto1, numbering1,
4
    label2, add2, every2, whenmorethan2, setto2, numbering2,
5
    label3, add3, every3, whenmorethan3, setto3, numbering3)
6
VALUES
7
    ('Number', 1, 'Simple Numbering method', 'No.{X}',
8
    'Number', 1, 1, 99999, 1, NULL,
9
    NULL, NULL, NULL, NULL, NULL, NULL,
10
    NULL, NULL, NULL, NULL, NULL, NULL),
11
12
    ('Volume, Number, Issue', 2, 'Volume Number Issue 1', 'Vol.{X}, Number {Y}, Issue {Z}',
13
    'Volume', 1, 48, 99999, 1, NULL,
14
    'Number', 1, 4, 12, 1, NULL,
15
    'Issue', 1, 1, 4, 1, NULL),
16
17
    ('Volume, Number', 3, 'Volume Number 1', 'Vol {X}, No {Y}',
18
    'Volume', 1, 12, 99999, 1, NULL,
19
    'Number', 1, 1, 12, 1, NULL,
20
    NULL, NULL, NULL, NULL, NULL, NULL),
21
22
    ('Seasonal', 4, 'Season Year', '{X} {Y}',
23
    'Season', 1, 1, 3, 0, 'season',
24
    'Year', 1, 4, 99999, 1, NULL,
25
    NULL, NULL, NULL, NULL, NULL, NULL);
(-)a/installer/data/mysql/fr-FR/2-Optionel/sample_numberpatterns.txt (+1 lines)
Line 0 Link Here
1
Sample numbering patterns for subscriptions
(-)a/installer/data/mysql/it-IT/optional/sample_frequencies.sql (+16 lines)
Line 0 Link Here
1
INSERT INTO subscription_frequencies
2
    (description, unit, unitsperissue, issuesperunit, displayorder)
3
VALUES
4
    ('2/day', 'day', 1, 2, 1),
5
    ('1/day', 'day', 1, 1, 2),
6
    ('3/week', 'week', 1, 3, 3),
7
    ('1/week', 'week', 1, 1, 4),
8
    ('1/2 weeks', 'week', 2, 1, 5),
9
    ('1/3 weeks', 'week', 3, 1, 6),
10
    ('1/month', 'month', 1, 1, 7),
11
    ('1/2 months', 'month', 2, 1, 8),
12
    ('1/3 months', 'month', 3, 1, 9),
13
    ('2/year', 'month', 6, 1, 10),
14
    ('1/year', 'year', 1, 1, 11),
15
    ('1/2 year', 'year', 2, 1, 12),
16
    ('Irregular', NULL, 1, 1, 13);
(-)a/installer/data/mysql/it-IT/optional/sample_frequencies.txt (+1 lines)
Line 0 Link Here
1
Sample frequencies for subscriptions
(-)a/installer/data/mysql/it-IT/optional/sample_numberpatterns.sql (+25 lines)
Line 0 Link Here
1
INSERT INTO subscription_numberpatterns
2
    (label, displayorder, description, numberingmethod,
3
    label1, add1, every1, whenmorethan1, setto1, numbering1,
4
    label2, add2, every2, whenmorethan2, setto2, numbering2,
5
    label3, add3, every3, whenmorethan3, setto3, numbering3)
6
VALUES
7
    ('Number', 1, 'Simple Numbering method', 'No.{X}',
8
    'Number', 1, 1, 99999, 1, NULL,
9
    NULL, NULL, NULL, NULL, NULL, NULL,
10
    NULL, NULL, NULL, NULL, NULL, NULL),
11
12
    ('Volume, Number, Issue', 2, 'Volume Number Issue 1', 'Vol.{X}, Number {Y}, Issue {Z}',
13
    'Volume', 1, 48, 99999, 1, NULL,
14
    'Number', 1, 4, 12, 1, NULL,
15
    'Issue', 1, 1, 4, 1, NULL),
16
17
    ('Volume, Number', 3, 'Volume Number 1', 'Vol {X}, No {Y}',
18
    'Volume', 1, 12, 99999, 1, NULL,
19
    'Number', 1, 1, 12, 1, NULL,
20
    NULL, NULL, NULL, NULL, NULL, NULL),
21
22
    ('Seasonal', 4, 'Season Year', '{X} {Y}',
23
    'Season', 1, 1, 3, 0, 'season',
24
    'Year', 1, 4, 99999, 1, NULL,
25
    NULL, NULL, NULL, NULL, NULL, NULL);
(-)a/installer/data/mysql/it-IT/optional/sample_numberpatterns.txt (+1 lines)
Line 0 Link Here
1
Sample numbering patterns for subscriptions
(-)a/installer/data/mysql/kohastructure.sql (-19 / +55 lines)
Lines 1832-1837 DROP TABLE IF EXISTS `stopwords`; Link Here
1832
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1832
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1833
1833
1834
--
1834
--
1835
-- Table structure for table subscription_frequencies
1836
--
1837
1838
DROP TABLE IF EXISTS subscription_frequencies;
1839
CREATE TABLE subscription_frequencies (
1840
    id INTEGER NOT NULL AUTO_INCREMENT,
1841
    description TEXT NOT NULL,
1842
    displayorder INT DEFAULT NULL,
1843
    unit ENUM('day','week','month','year') DEFAULT NULL,
1844
    unitsperissue INTEGER NOT NULL DEFAULT '1',
1845
    issuesperunit INTEGER NOT NULL DEFAULT '1',
1846
    PRIMARY KEY (id)
1847
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1848
1849
--
1850
-- Table structure for table subscription_numberpatterns
1851
--
1852
1853
DROP TABLE IF EXISTS subscription_numberpatterns;
1854
CREATE TABLE subscription_numberpatterns (
1855
    id INTEGER NOT NULL AUTO_INCREMENT,
1856
    label VARCHAR(255) NOT NULL,
1857
    displayorder INTEGER DEFAULT NULL,
1858
    description TEXT NOT NULL,
1859
    numberingmethod VARCHAR(255) NOT NULL,
1860
    label1 VARCHAR(255) DEFAULT NULL,
1861
    add1 INTEGER DEFAULT NULL,
1862
    every1 INTEGER DEFAULT NULL,
1863
    whenmorethan1 INTEGER DEFAULT NULL,
1864
    setto1 INTEGER DEFAULT NULL,
1865
    numbering1 VARCHAR(255) DEFAULT NULL,
1866
    label2 VARCHAR(255) DEFAULT NULL,
1867
    add2 INTEGER DEFAULT NULL,
1868
    every2 INTEGER DEFAULT NULL,
1869
    whenmorethan2 INTEGER DEFAULT NULL,
1870
    setto2 INTEGER DEFAULT NULL,
1871
    numbering2 VARCHAR(255) DEFAULT NULL,
1872
    label3 VARCHAR(255) DEFAULT NULL,
1873
    add3 INTEGER DEFAULT NULL,
1874
    every3 INTEGER DEFAULT NULL,
1875
    whenmorethan3 INTEGER DEFAULT NULL,
1876
    setto3 INTEGER DEFAULT NULL,
1877
    numbering3 VARCHAR(255) DEFAULT NULL,
1878
    PRIMARY KEY (id)
1879
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1880
1881
--
1835
-- Table structure for table `subscription`
1882
-- Table structure for table `subscription`
1836
--
1883
--
1837
1884
Lines 1848-1894 CREATE TABLE `subscription` ( Link Here
1848
  `monthlength` int(11) default 0,
1895
  `monthlength` int(11) default 0,
1849
  `numberlength` int(11) default 0,
1896
  `numberlength` int(11) default 0,
1850
  `periodicity` tinyint(4) default 0,
1897
  `periodicity` tinyint(4) default 0,
1851
  `dow` varchar(100) default '',
1898
  countissuesperunit INTEGER NOT NULL DEFAULT 0,
1852
  `numberingmethod` varchar(100) default '',
1853
  `notes` mediumtext,
1899
  `notes` mediumtext,
1854
  `status` varchar(100) NOT NULL default '',
1900
  `status` varchar(100) NOT NULL default '',
1855
  `add1` int(11) default 0,
1856
  `every1` int(11) default 0,
1857
  `whenmorethan1` int(11) default 0,
1858
  `setto1` int(11) default NULL,
1859
  `lastvalue1` int(11) default NULL,
1901
  `lastvalue1` int(11) default NULL,
1860
  `add2` int(11) default 0,
1861
  `every2` int(11) default 0,
1862
  `whenmorethan2` int(11) default 0,
1863
  `setto2` int(11) default NULL,
1864
  `lastvalue2` int(11) default NULL,
1865
  `add3` int(11) default 0,
1866
  `every3` int(11) default 0,
1867
  `innerloop1` int(11) default 0,
1902
  `innerloop1` int(11) default 0,
1903
  `lastvalue2` int(11) default NULL,
1868
  `innerloop2` int(11) default 0,
1904
  `innerloop2` int(11) default 0,
1869
  `innerloop3` int(11) default 0,
1870
  `whenmorethan3` int(11) default 0,
1871
  `setto3` int(11) default NULL,
1872
  `lastvalue3` int(11) default NULL,
1905
  `lastvalue3` int(11) default NULL,
1873
  `issuesatonce` tinyint(3) NOT NULL default 1,
1906
  `innerloop3` int(11) default 0,
1874
  `firstacquidate` date default NULL,
1907
  `firstacquidate` date default NULL,
1875
  `manualhistory` tinyint(1) NOT NULL default 0,
1908
  `manualhistory` tinyint(1) NOT NULL default 0,
1876
  `irregularity` text,
1909
  `irregularity` text,
1910
  skip_serialseq BOOLEAN NOT NULL DEFAULT 0,
1877
  `letter` varchar(20) default NULL,
1911
  `letter` varchar(20) default NULL,
1878
  `numberpattern` tinyint(3) default 0,
1912
  `numberpattern` tinyint(3) default 0,
1913
  locale VARCHAR(80) DEFAULT NULL,
1879
  `distributedto` text,
1914
  `distributedto` text,
1880
  `internalnotes` longtext,
1915
  `internalnotes` longtext,
1881
  `callnumber` text,
1916
  `callnumber` text,
1882
  `location` varchar(80) NULL default '',
1917
  `location` varchar(80) NULL default '',
1883
  `branchcode` varchar(10) NOT NULL default '',
1918
  `branchcode` varchar(10) NOT NULL default '',
1884
  `hemisphere` tinyint(3) default 0,
1885
  `lastbranch` varchar(10),
1919
  `lastbranch` varchar(10),
1886
  `serialsadditems` tinyint(1) NOT NULL default '0',
1920
  `serialsadditems` tinyint(1) NOT NULL default '0',
1887
  `staffdisplaycount` VARCHAR(10) NULL,
1921
  `staffdisplaycount` VARCHAR(10) NULL,
1888
  `opacdisplaycount` VARCHAR(10) NULL,
1922
  `opacdisplaycount` VARCHAR(10) NULL,
1889
  `graceperiod` int(11) NOT NULL default '0',
1923
  `graceperiod` int(11) NOT NULL default '0',
1890
  `enddate` date default NULL,
1924
  `enddate` date default NULL,
1891
  PRIMARY KEY  (`subscriptionid`)
1925
  PRIMARY KEY  (`subscriptionid`),
1926
  CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id),
1927
  CONSTRAINT subscription_ibfk_2 FOREIGN KEY (numberpattern) REFERENCES subscription_numberpatterns (id)
1892
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1928
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1893
1929
1894
--
1930
--
(-)a/installer/data/mysql/nb-NO/2-Valgfritt/sample_frequencies.sql (+16 lines)
Line 0 Link Here
1
INSERT INTO subscription_frequencies
2
    (description, unit, unitsperissue, issuesperunit, displayorder)
3
VALUES
4
    ('2/day', 'day', 1, 2, 1),
5
    ('1/day', 'day', 1, 1, 2),
6
    ('3/week', 'week', 1, 3, 3),
7
    ('1/week', 'week', 1, 1, 4),
8
    ('1/2 weeks', 'week', 2, 1, 5),
9
    ('1/3 weeks', 'week', 3, 1, 6),
10
    ('1/month', 'month', 1, 1, 7),
11
    ('1/2 months', 'month', 2, 1, 8),
12
    ('1/3 months', 'month', 3, 1, 9),
13
    ('2/year', 'month', 6, 1, 10),
14
    ('1/year', 'year', 1, 1, 11),
15
    ('1/2 year', 'year', 2, 1, 12),
16
    ('Irregular', NULL, 1, 1, 13);
(-)a/installer/data/mysql/nb-NO/2-Valgfritt/sample_frequencies.txt (+1 lines)
Line 0 Link Here
1
Sample frequencies for subscriptions
(-)a/installer/data/mysql/nb-NO/2-Valgfritt/sample_numberpatterns.sql (+25 lines)
Line 0 Link Here
1
INSERT INTO subscription_numberpatterns
2
    (label, displayorder, description, numberingmethod,
3
    label1, add1, every1, whenmorethan1, setto1, numbering1,
4
    label2, add2, every2, whenmorethan2, setto2, numbering2,
5
    label3, add3, every3, whenmorethan3, setto3, numbering3)
6
VALUES
7
    ('Number', 1, 'Simple Numbering method', 'No.{X}',
8
    'Number', 1, 1, 99999, 1, NULL,
9
    NULL, NULL, NULL, NULL, NULL, NULL,
10
    NULL, NULL, NULL, NULL, NULL, NULL),
11
12
    ('Volume, Number, Issue', 2, 'Volume Number Issue 1', 'Vol.{X}, Number {Y}, Issue {Z}',
13
    'Volume', 1, 48, 99999, 1, NULL,
14
    'Number', 1, 4, 12, 1, NULL,
15
    'Issue', 1, 1, 4, 1, NULL),
16
17
    ('Volume, Number', 3, 'Volume Number 1', 'Vol {X}, No {Y}',
18
    'Volume', 1, 12, 99999, 1, NULL,
19
    'Number', 1, 1, 12, 1, NULL,
20
    NULL, NULL, NULL, NULL, NULL, NULL),
21
22
    ('Seasonal', 4, 'Season Year', '{X} {Y}',
23
    'Season', 1, 1, 3, 0, 'season',
24
    'Year', 1, 4, 99999, 1, NULL,
25
    NULL, NULL, NULL, NULL, NULL, NULL);
(-)a/installer/data/mysql/nb-NO/2-Valgfritt/sample_numberpatterns.txt (+1 lines)
Line 0 Link Here
1
Sample numbering patterns for subscriptions
(-)a/installer/data/mysql/pl-PL/optional/sample_frequencies.sql (+16 lines)
Line 0 Link Here
1
INSERT INTO subscription_frequencies
2
    (description, unit, unitsperissue, issuesperunit, displayorder)
3
VALUES
4
    ('2/day', 'day', 1, 2, 1),
5
    ('1/day', 'day', 1, 1, 2),
6
    ('3/week', 'week', 1, 3, 3),
7
    ('1/week', 'week', 1, 1, 4),
8
    ('1/2 weeks', 'week', 2, 1, 5),
9
    ('1/3 weeks', 'week', 3, 1, 6),
10
    ('1/month', 'month', 1, 1, 7),
11
    ('1/2 months', 'month', 2, 1, 8),
12
    ('1/3 months', 'month', 3, 1, 9),
13
    ('2/year', 'month', 6, 1, 10),
14
    ('1/year', 'year', 1, 1, 11),
15
    ('1/2 year', 'year', 2, 1, 12),
16
    ('Irregular', NULL, 1, 1, 13);
(-)a/installer/data/mysql/pl-PL/optional/sample_frequencies.txt (+1 lines)
Line 0 Link Here
1
Sample frequencies for subscriptions
(-)a/installer/data/mysql/pl-PL/optional/sample_numberpatterns.sql (+25 lines)
Line 0 Link Here
1
INSERT INTO subscription_numberpatterns
2
    (label, displayorder, description, numberingmethod,
3
    label1, add1, every1, whenmorethan1, setto1, numbering1,
4
    label2, add2, every2, whenmorethan2, setto2, numbering2,
5
    label3, add3, every3, whenmorethan3, setto3, numbering3)
6
VALUES
7
    ('Number', 1, 'Simple Numbering method', 'No.{X}',
8
    'Number', 1, 1, 99999, 1, NULL,
9
    NULL, NULL, NULL, NULL, NULL, NULL,
10
    NULL, NULL, NULL, NULL, NULL, NULL),
11
12
    ('Volume, Number, Issue', 2, 'Volume Number Issue 1', 'Vol.{X}, Number {Y}, Issue {Z}',
13
    'Volume', 1, 48, 99999, 1, NULL,
14
    'Number', 1, 4, 12, 1, NULL,
15
    'Issue', 1, 1, 4, 1, NULL),
16
17
    ('Volume, Number', 3, 'Volume Number 1', 'Vol {X}, No {Y}',
18
    'Volume', 1, 12, 99999, 1, NULL,
19
    'Number', 1, 1, 12, 1, NULL,
20
    NULL, NULL, NULL, NULL, NULL, NULL),
21
22
    ('Seasonal', 4, 'Season Year', '{X} {Y}',
23
    'Season', 1, 1, 3, 0, 'season',
24
    'Year', 1, 4, 99999, 1, NULL,
25
    NULL, NULL, NULL, NULL, NULL, NULL);
(-)a/installer/data/mysql/pl-PL/optional/sample_numberpatterns.txt (+1 lines)
Line 0 Link Here
1
Sample numbering patterns for subscriptions
(-)a/installer/data/mysql/ru-RU/optional/sample_frequencies.sql (+16 lines)
Line 0 Link Here
1
INSERT INTO subscription_frequencies
2
    (description, unit, unitsperissue, issuesperunit, displayorder)
3
VALUES
4
    ('2/day', 'day', 1, 2, 1),
5
    ('1/day', 'day', 1, 1, 2),
6
    ('3/week', 'week', 1, 3, 3),
7
    ('1/week', 'week', 1, 1, 4),
8
    ('1/2 weeks', 'week', 2, 1, 5),
9
    ('1/3 weeks', 'week', 3, 1, 6),
10
    ('1/month', 'month', 1, 1, 7),
11
    ('1/2 months', 'month', 2, 1, 8),
12
    ('1/3 months', 'month', 3, 1, 9),
13
    ('2/year', 'month', 6, 1, 10),
14
    ('1/year', 'year', 1, 1, 11),
15
    ('1/2 year', 'year', 2, 1, 12),
16
    ('Irregular', NULL, 1, 1, 13);
(-)a/installer/data/mysql/ru-RU/optional/sample_frequencies.txt (+1 lines)
Line 0 Link Here
1
Sample frequencies for subscriptions
(-)a/installer/data/mysql/ru-RU/optional/sample_numberpatterns.sql (+25 lines)
Line 0 Link Here
1
INSERT INTO subscription_numberpatterns
2
    (label, displayorder, description, numberingmethod,
3
    label1, add1, every1, whenmorethan1, setto1, numbering1,
4
    label2, add2, every2, whenmorethan2, setto2, numbering2,
5
    label3, add3, every3, whenmorethan3, setto3, numbering3)
6
VALUES
7
    ('Number', 1, 'Simple Numbering method', 'No.{X}',
8
    'Number', 1, 1, 99999, 1, NULL,
9
    NULL, NULL, NULL, NULL, NULL, NULL,
10
    NULL, NULL, NULL, NULL, NULL, NULL),
11
12
    ('Volume, Number, Issue', 2, 'Volume Number Issue 1', 'Vol.{X}, Number {Y}, Issue {Z}',
13
    'Volume', 1, 48, 99999, 1, NULL,
14
    'Number', 1, 4, 12, 1, NULL,
15
    'Issue', 1, 1, 4, 1, NULL),
16
17
    ('Volume, Number', 3, 'Volume Number 1', 'Vol {X}, No {Y}',
18
    'Volume', 1, 12, 99999, 1, NULL,
19
    'Number', 1, 1, 12, 1, NULL,
20
    NULL, NULL, NULL, NULL, NULL, NULL),
21
22
    ('Seasonal', 4, 'Season Year', '{X} {Y}',
23
    'Season', 1, 1, 3, 0, 'season',
24
    'Year', 1, 4, 99999, 1, NULL,
25
    NULL, NULL, NULL, NULL, NULL, NULL);
(-)a/installer/data/mysql/ru-RU/optional/sample_numberpatterns.txt (+1 lines)
Line 0 Link Here
1
Sample numbering patterns for subscriptions
(-)a/installer/data/mysql/uk-UA/optional/sample_frequencies.sql (+16 lines)
Line 0 Link Here
1
INSERT INTO subscription_frequencies
2
    (description, unit, unitsperissue, issuesperunit, displayorder)
3
VALUES
4
    ('2/day', 'day', 1, 2, 1),
5
    ('1/day', 'day', 1, 1, 2),
6
    ('3/week', 'week', 1, 3, 3),
7
    ('1/week', 'week', 1, 1, 4),
8
    ('1/2 weeks', 'week', 2, 1, 5),
9
    ('1/3 weeks', 'week', 3, 1, 6),
10
    ('1/month', 'month', 1, 1, 7),
11
    ('1/2 months', 'month', 2, 1, 8),
12
    ('1/3 months', 'month', 3, 1, 9),
13
    ('2/year', 'month', 6, 1, 10),
14
    ('1/year', 'year', 1, 1, 11),
15
    ('1/2 year', 'year', 2, 1, 12),
16
    ('Irregular', NULL, 1, 1, 13);
(-)a/installer/data/mysql/uk-UA/optional/sample_frequencies.txt (+1 lines)
Line 0 Link Here
1
Sample frequencies for subscriptions
(-)a/installer/data/mysql/uk-UA/optional/sample_numberpatterns.sql (+25 lines)
Line 0 Link Here
1
INSERT INTO subscription_numberpatterns
2
    (label, displayorder, description, numberingmethod,
3
    label1, add1, every1, whenmorethan1, setto1, numbering1,
4
    label2, add2, every2, whenmorethan2, setto2, numbering2,
5
    label3, add3, every3, whenmorethan3, setto3, numbering3)
6
VALUES
7
    ('Number', 1, 'Simple Numbering method', 'No.{X}',
8
    'Number', 1, 1, 99999, 1, NULL,
9
    NULL, NULL, NULL, NULL, NULL, NULL,
10
    NULL, NULL, NULL, NULL, NULL, NULL),
11
12
    ('Volume, Number, Issue', 2, 'Volume Number Issue 1', 'Vol.{X}, Number {Y}, Issue {Z}',
13
    'Volume', 1, 48, 99999, 1, NULL,
14
    'Number', 1, 4, 12, 1, NULL,
15
    'Issue', 1, 1, 4, 1, NULL),
16
17
    ('Volume, Number', 3, 'Volume Number 1', 'Vol {X}, No {Y}',
18
    'Volume', 1, 12, 99999, 1, NULL,
19
    'Number', 1, 1, 12, 1, NULL,
20
    NULL, NULL, NULL, NULL, NULL, NULL),
21
22
    ('Seasonal', 4, 'Season Year', '{X} {Y}',
23
    'Season', 1, 1, 3, 0, 'season',
24
    'Year', 1, 4, 99999, 1, NULL,
25
    NULL, NULL, NULL, NULL, NULL, NULL);
(-)a/installer/data/mysql/uk-UA/optional/sample_numberpatterns.txt (+1 lines)
Line 0 Link Here
1
Sample numbering patterns for subscriptions
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +196 lines)
Lines 5343-5348 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5343
    SetVersion($DBversion);
5343
    SetVersion($DBversion);
5344
}
5344
}
5345
5345
5346
$DBversion = "XXX";
5347
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5348
    $dbh->do(qq|
5349
        DROP TABLE IF EXISTS subscription_frequencies
5350
    |);
5351
    $dbh->do(qq|
5352
        CREATE TABLE subscription_frequencies (
5353
            id INTEGER NOT NULL AUTO_INCREMENT,
5354
            description TEXT NOT NULL,
5355
            displayorder INT DEFAULT NULL,
5356
            unit ENUM('day','week','month','year') DEFAULT NULL,
5357
            unitsperissue INTEGER NOT NULL DEFAULT '1',
5358
            issuesperunit INTEGER NOT NULL DEFAULT '1',
5359
            PRIMARY KEY (id)
5360
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8
5361
    |);
5362
5363
    $dbh->do(qq|
5364
        DROP TABLE IF EXISTS subscription_numberpatterns
5365
    |);
5366
    $dbh->do(qq|
5367
        CREATE TABLE subscription_numberpatterns (
5368
            id INTEGER NOT NULL AUTO_INCREMENT,
5369
            label VARCHAR(255) NOT NULL,
5370
            displayorder INTEGER DEFAULT NULL,
5371
            description TEXT NOT NULL,
5372
            numberingmethod VARCHAR(255) NOT NULL,
5373
            label1 VARCHAR(255) DEFAULT NULL,
5374
            add1 INTEGER DEFAULT NULL,
5375
            every1 INTEGER DEFAULT NULL,
5376
            whenmorethan1 INTEGER DEFAULT NULL,
5377
            setto1 INTEGER DEFAULT NULL,
5378
            numbering1 VARCHAR(255) DEFAULT NULL,
5379
            label2 VARCHAR(255) DEFAULT NULL,
5380
            add2 INTEGER DEFAULT NULL,
5381
            every2 INTEGER DEFAULT NULL,
5382
            whenmorethan2 INTEGER DEFAULT NULL,
5383
            setto2 INTEGER DEFAULT NULL,
5384
            numbering2 VARCHAR(255) DEFAULT NULL,
5385
            label3 VARCHAR(255) DEFAULT NULL,
5386
            add3 INTEGER DEFAULT NULL,
5387
            every3 INTEGER DEFAULT NULL,
5388
            whenmorethan3 INTEGER DEFAULT NULL,
5389
            setto3 INTEGER DEFAULT NULL,
5390
            numbering3 VARCHAR(255) DEFAULT NULL,
5391
            PRIMARY KEY (id)
5392
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8
5393
    |);
5394
5395
    $dbh->do(qq|
5396
        INSERT INTO subscription_frequencies (description, unit, unitsperissue, issuesperunit, displayorder)
5397
        VALUES
5398
            ('2/day', 'day', 1, 2, 1),
5399
            ('1/day', 'day', 1, 1, 2),
5400
            ('3/week', 'week', 1, 3, 3),
5401
            ('1/week', 'week', 1, 1, 4),
5402
            ('1/2 weeks', 'week', 2, 1, 5),
5403
            ('1/3 weeks', 'week', 3, 1, 6),
5404
            ('1/month', 'month', 1, 1, 7),
5405
            ('1/2 months', 'month', 2, 1, 8),
5406
            ('1/3 months', 'month', 3, 1, 9),
5407
            ('2/year', 'month', 6, 1, 10),
5408
            ('1/year', 'year', 1, 1, 11),
5409
            ('1/2 year', 'year', 2, 1, 12),
5410
            ('Irregular', NULL, 1, 1, 13)
5411
    |);
5412
5413
    # Used to link existing subscription to newly created frequencies
5414
    my $frequencies_mapping = {     # keys are old frequency numbers, values are the new ones
5415
        1 => 2,     # daily (n/week)
5416
        2 => 4,     # 1/week
5417
        3 => 5,     # 1/2 weeks
5418
        4 => 6,     # 1/3 weeks
5419
        5 => 7,     # 1/month
5420
        6 => 8,     # 1/2 months (6/year)
5421
        7 => 9,     # 1/3 months (1/quarter)
5422
        8 => 9,    # 1/quarter (seasonal)
5423
        9 => 10,    # 2/year
5424
        10 => 11,   # 1/year
5425
        11 => 12,   # 1/2 years
5426
        12 => 1,    # 2/day
5427
        16 => 13,   # Without periodicity
5428
        32 => 13,   # Irregular
5429
        48 => 13    # Unknown
5430
    };
5431
5432
    $dbh->do(qq|
5433
        INSERT INTO subscription_numberpatterns
5434
            (label, displayorder, description, numberingmethod,
5435
            label1, add1, every1, whenmorethan1, setto1, numbering1,
5436
            label2, add2, every2, whenmorethan2, setto2, numbering2,
5437
            label3, add3, every3, whenmorethan3, setto3, numbering3)
5438
        VALUES
5439
            ('Number', 1, 'Simple Numbering method', 'No.{X}',
5440
            'Number', 1, 1, 99999, 1, NULL,
5441
            NULL, NULL, NULL, NULL, NULL, NULL,
5442
            NULL, NULL, NULL, NULL, NULL, NULL),
5443
5444
            ('Volume, Number, Issue', 2, 'Volume Number Issue 1', 'Vol.{X}, Number {Y}, Issue {Z}',
5445
            'Volume', 1, 48, 99999, 1, NULL,
5446
            'Number', 1, 4, 12, 1, NULL,
5447
            'Issue', 1, 1, 4, 1, NULL),
5448
5449
            ('Volume, Number', 3, 'Volume Number 1', 'Vol {X}, No {Y}',
5450
            'Volume', 1, 12, 99999, 1, NULL,
5451
            'Number', 1, 1, 12, 1, NULL,
5452
            NULL, NULL, NULL, NULL, NULL, NULL),
5453
5454
            ('Seasonal', 4, 'Season Year', '{X} {Y}',
5455
            'Season', 1, 1, 3, 0, 'season',
5456
            'Year', 1, 4, 99999, 1, NULL,
5457
            NULL, NULL, NULL, NULL, NULL, NULL)
5458
    |);
5459
5460
    $dbh->do(qq|
5461
        ALTER TABLE subscription
5462
        MODIFY COLUMN numberpattern INTEGER DEFAULT NULL,
5463
        MODIFY COLUMN periodicity INTEGER DEFAULT NULL
5464
    |);
5465
5466
    # Update existing subscriptions
5467
5468
    my $query = qq|
5469
        SELECT subscriptionid, periodicity, numberingmethod,
5470
            add1, every1, whenmorethan1, setto1,
5471
            add2, every2, whenmorethan2, setto2,
5472
            add3, every3, whenmorethan3, setto3
5473
        FROM subscription
5474
        ORDER BY subscriptionid
5475
    |;
5476
    my $sth = $dbh->prepare($query);
5477
    $sth->execute;
5478
    my $insert_numberpatterns_sth = $dbh->prepare(qq|
5479
        INSERT INTO subscription_numberpatterns
5480
             (label, displayorder, description, numberingmethod,
5481
            label1, add1, every1, whenmorethan1, setto1, numbering1,
5482
            label2, add2, every2, whenmorethan2, setto2, numbering2,
5483
            label3, add3, every3, whenmorethan3, setto3, numbering3)
5484
        VALUES
5485
            (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
5486
    |);
5487
    my $update_subscription_sth = $dbh->prepare(qq|
5488
        UPDATE subscription
5489
        SET numberpattern = ?,
5490
            periodicity = ?
5491
        WHERE subscriptionid = ?
5492
    |);
5493
5494
    my $i = 1;
5495
    while(my $sub = $sth->fetchrow_hashref) {
5496
        # Create a new numbering pattern for each subscription
5497
        my $ok = $insert_numberpatterns_sth->execute(
5498
            "Backup pattern $i", 4+$i, "Automatically created pattern by updatedatabase", $sub->{numberingmethod},
5499
            "X", $sub->{add1}, $sub->{every1}, $sub->{whenmorethan1}, $sub->{setto1}, undef,
5500
            "Y", $sub->{add2}, $sub->{every2}, $sub->{whenmorethan2}, $sub->{setto2}, undef,
5501
            "Z", $sub->{add3}, $sub->{every3}, $sub->{whenmorethan3}, $sub->{setto3}, undef
5502
        );
5503
        if($ok) {
5504
            my $id = $dbh->last_insert_id(undef, undef, 'subscription_numberpatterns', undef);
5505
            # Link to subscription_numberpatterns and subscription_frequencies
5506
            $update_subscription_sth->execute($id,
5507
                $frequencies_mapping->{$sub->{periodicity}}, $sub->{subscriptionid});
5508
        }
5509
        $i++;
5510
    }
5511
5512
    # Remove now useless columns
5513
    $dbh->do(qq|
5514
        ALTER TABLE subscription
5515
        DROP COLUMN numberingmethod,
5516
        DROP COLUMN add1,
5517
        DROP COLUMN every1,
5518
        DROP COLUMN whenmorethan1,
5519
        DROP COLUMN setto1,
5520
        DROP COLUMN add2,
5521
        DROP COLUMN every2,
5522
        DROP COLUMN whenmorethan2,
5523
        DROP COLUMN setto2,
5524
        DROP COLUMN add3,
5525
        DROP COLUMN every3,
5526
        DROP COLUMN whenmorethan3,
5527
        DROP COLUMN setto3,
5528
        DROP COLUMN dow,
5529
        DROP COLUMN issuesatonce,
5530
        DROP COLUMN hemisphere,
5531
        ADD COLUMN countissuesperunit INTEGER NOT NULL DEFAULT 0 AFTER periodicity,
5532
        ADD COLUMN skip_serialseq BOOLEAN NOT NULL DEFAULT 0 AFTER irregularity,
5533
        ADD COLUMN locale VARCHAR(80) DEFAULT NULL AFTER numberpattern,
5534
        ADD CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id),
5535
        ADD CONSTRAINT subscription_ibfk_2 FOREIGN KEY (numberpattern) REFERENCES subscription_numberpatterns (id)
5536
    |);
5537
5538
    print "Upgrade to $DBversion done (Add subscription_frequencies and subscription_numberpatterns tables)\n";
5539
    SetVersion($DBversion);
5540
}
5541
5346
=head1 FUNCTIONS
5542
=head1 FUNCTIONS
5347
5543
5348
=head2 TableExists($table)
5544
=head2 TableExists($table)
5349
- 

Return to bug 7688