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 5473-5478 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5473
    SetVersion($DBversion);
5473
    SetVersion($DBversion);
5474
}
5474
}
5475
5475
5476
$DBversion = "XXX";
5477
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5478
    $dbh->do(qq|
5479
        DROP TABLE IF EXISTS subscription_frequencies
5480
    |);
5481
    $dbh->do(qq|
5482
        CREATE TABLE subscription_frequencies (
5483
            id INTEGER NOT NULL AUTO_INCREMENT,
5484
            description TEXT NOT NULL,
5485
            displayorder INT DEFAULT NULL,
5486
            unit ENUM('day','week','month','year') DEFAULT NULL,
5487
            unitsperissue INTEGER NOT NULL DEFAULT '1',
5488
            issuesperunit INTEGER NOT NULL DEFAULT '1',
5489
            PRIMARY KEY (id)
5490
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8
5491
    |);
5492
5493
    $dbh->do(qq|
5494
        DROP TABLE IF EXISTS subscription_numberpatterns
5495
    |);
5496
    $dbh->do(qq|
5497
        CREATE TABLE subscription_numberpatterns (
5498
            id INTEGER NOT NULL AUTO_INCREMENT,
5499
            label VARCHAR(255) NOT NULL,
5500
            displayorder INTEGER DEFAULT NULL,
5501
            description TEXT NOT NULL,
5502
            numberingmethod VARCHAR(255) NOT NULL,
5503
            label1 VARCHAR(255) DEFAULT NULL,
5504
            add1 INTEGER DEFAULT NULL,
5505
            every1 INTEGER DEFAULT NULL,
5506
            whenmorethan1 INTEGER DEFAULT NULL,
5507
            setto1 INTEGER DEFAULT NULL,
5508
            numbering1 VARCHAR(255) DEFAULT NULL,
5509
            label2 VARCHAR(255) DEFAULT NULL,
5510
            add2 INTEGER DEFAULT NULL,
5511
            every2 INTEGER DEFAULT NULL,
5512
            whenmorethan2 INTEGER DEFAULT NULL,
5513
            setto2 INTEGER DEFAULT NULL,
5514
            numbering2 VARCHAR(255) DEFAULT NULL,
5515
            label3 VARCHAR(255) DEFAULT NULL,
5516
            add3 INTEGER DEFAULT NULL,
5517
            every3 INTEGER DEFAULT NULL,
5518
            whenmorethan3 INTEGER DEFAULT NULL,
5519
            setto3 INTEGER DEFAULT NULL,
5520
            numbering3 VARCHAR(255) DEFAULT NULL,
5521
            PRIMARY KEY (id)
5522
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8
5523
    |);
5524
5525
    $dbh->do(qq|
5526
        INSERT INTO subscription_frequencies (description, unit, unitsperissue, issuesperunit, displayorder)
5527
        VALUES
5528
            ('2/day', 'day', 1, 2, 1),
5529
            ('1/day', 'day', 1, 1, 2),
5530
            ('3/week', 'week', 1, 3, 3),
5531
            ('1/week', 'week', 1, 1, 4),
5532
            ('1/2 weeks', 'week', 2, 1, 5),
5533
            ('1/3 weeks', 'week', 3, 1, 6),
5534
            ('1/month', 'month', 1, 1, 7),
5535
            ('1/2 months', 'month', 2, 1, 8),
5536
            ('1/3 months', 'month', 3, 1, 9),
5537
            ('2/year', 'month', 6, 1, 10),
5538
            ('1/year', 'year', 1, 1, 11),
5539
            ('1/2 year', 'year', 2, 1, 12),
5540
            ('Irregular', NULL, 1, 1, 13)
5541
    |);
5542
5543
    # Used to link existing subscription to newly created frequencies
5544
    my $frequencies_mapping = {     # keys are old frequency numbers, values are the new ones
5545
        1 => 2,     # daily (n/week)
5546
        2 => 4,     # 1/week
5547
        3 => 5,     # 1/2 weeks
5548
        4 => 6,     # 1/3 weeks
5549
        5 => 7,     # 1/month
5550
        6 => 8,     # 1/2 months (6/year)
5551
        7 => 9,     # 1/3 months (1/quarter)
5552
        8 => 9,    # 1/quarter (seasonal)
5553
        9 => 10,    # 2/year
5554
        10 => 11,   # 1/year
5555
        11 => 12,   # 1/2 years
5556
        12 => 1,    # 2/day
5557
        16 => 13,   # Without periodicity
5558
        32 => 13,   # Irregular
5559
        48 => 13    # Unknown
5560
    };
5561
5562
    $dbh->do(qq|
5563
        INSERT INTO subscription_numberpatterns
5564
            (label, displayorder, description, numberingmethod,
5565
            label1, add1, every1, whenmorethan1, setto1, numbering1,
5566
            label2, add2, every2, whenmorethan2, setto2, numbering2,
5567
            label3, add3, every3, whenmorethan3, setto3, numbering3)
5568
        VALUES
5569
            ('Number', 1, 'Simple Numbering method', 'No.{X}',
5570
            'Number', 1, 1, 99999, 1, NULL,
5571
            NULL, NULL, NULL, NULL, NULL, NULL,
5572
            NULL, NULL, NULL, NULL, NULL, NULL),
5573
5574
            ('Volume, Number, Issue', 2, 'Volume Number Issue 1', 'Vol.{X}, Number {Y}, Issue {Z}',
5575
            'Volume', 1, 48, 99999, 1, NULL,
5576
            'Number', 1, 4, 12, 1, NULL,
5577
            'Issue', 1, 1, 4, 1, NULL),
5578
5579
            ('Volume, Number', 3, 'Volume Number 1', 'Vol {X}, No {Y}',
5580
            'Volume', 1, 12, 99999, 1, NULL,
5581
            'Number', 1, 1, 12, 1, NULL,
5582
            NULL, NULL, NULL, NULL, NULL, NULL),
5583
5584
            ('Seasonal', 4, 'Season Year', '{X} {Y}',
5585
            'Season', 1, 1, 3, 0, 'season',
5586
            'Year', 1, 4, 99999, 1, NULL,
5587
            NULL, NULL, NULL, NULL, NULL, NULL)
5588
    |);
5589
5590
    $dbh->do(qq|
5591
        ALTER TABLE subscription
5592
        MODIFY COLUMN numberpattern INTEGER DEFAULT NULL,
5593
        MODIFY COLUMN periodicity INTEGER DEFAULT NULL
5594
    |);
5595
5596
    # Update existing subscriptions
5597
5598
    my $query = qq|
5599
        SELECT subscriptionid, periodicity, numberingmethod,
5600
            add1, every1, whenmorethan1, setto1,
5601
            add2, every2, whenmorethan2, setto2,
5602
            add3, every3, whenmorethan3, setto3
5603
        FROM subscription
5604
        ORDER BY subscriptionid
5605
    |;
5606
    my $sth = $dbh->prepare($query);
5607
    $sth->execute;
5608
    my $insert_numberpatterns_sth = $dbh->prepare(qq|
5609
        INSERT INTO subscription_numberpatterns
5610
             (label, displayorder, description, numberingmethod,
5611
            label1, add1, every1, whenmorethan1, setto1, numbering1,
5612
            label2, add2, every2, whenmorethan2, setto2, numbering2,
5613
            label3, add3, every3, whenmorethan3, setto3, numbering3)
5614
        VALUES
5615
            (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
5616
    |);
5617
    my $update_subscription_sth = $dbh->prepare(qq|
5618
        UPDATE subscription
5619
        SET numberpattern = ?,
5620
            periodicity = ?
5621
        WHERE subscriptionid = ?
5622
    |);
5623
5624
    my $i = 1;
5625
    while(my $sub = $sth->fetchrow_hashref) {
5626
        # Create a new numbering pattern for each subscription
5627
        my $ok = $insert_numberpatterns_sth->execute(
5628
            "Backup pattern $i", 4+$i, "Automatically created pattern by updatedatabase", $sub->{numberingmethod},
5629
            "X", $sub->{add1}, $sub->{every1}, $sub->{whenmorethan1}, $sub->{setto1}, undef,
5630
            "Y", $sub->{add2}, $sub->{every2}, $sub->{whenmorethan2}, $sub->{setto2}, undef,
5631
            "Z", $sub->{add3}, $sub->{every3}, $sub->{whenmorethan3}, $sub->{setto3}, undef
5632
        );
5633
        if($ok) {
5634
            my $id = $dbh->last_insert_id(undef, undef, 'subscription_numberpatterns', undef);
5635
            # Link to subscription_numberpatterns and subscription_frequencies
5636
            $update_subscription_sth->execute($id,
5637
                $frequencies_mapping->{$sub->{periodicity}}, $sub->{subscriptionid});
5638
        }
5639
        $i++;
5640
    }
5641
5642
    # Remove now useless columns
5643
    $dbh->do(qq|
5644
        ALTER TABLE subscription
5645
        DROP COLUMN numberingmethod,
5646
        DROP COLUMN add1,
5647
        DROP COLUMN every1,
5648
        DROP COLUMN whenmorethan1,
5649
        DROP COLUMN setto1,
5650
        DROP COLUMN add2,
5651
        DROP COLUMN every2,
5652
        DROP COLUMN whenmorethan2,
5653
        DROP COLUMN setto2,
5654
        DROP COLUMN add3,
5655
        DROP COLUMN every3,
5656
        DROP COLUMN whenmorethan3,
5657
        DROP COLUMN setto3,
5658
        DROP COLUMN dow,
5659
        DROP COLUMN issuesatonce,
5660
        DROP COLUMN hemisphere,
5661
        ADD COLUMN countissuesperunit INTEGER NOT NULL DEFAULT 0 AFTER periodicity,
5662
        ADD COLUMN skip_serialseq BOOLEAN NOT NULL DEFAULT 0 AFTER irregularity,
5663
        ADD COLUMN locale VARCHAR(80) DEFAULT NULL AFTER numberpattern,
5664
        ADD CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id),
5665
        ADD CONSTRAINT subscription_ibfk_2 FOREIGN KEY (numberpattern) REFERENCES subscription_numberpatterns (id)
5666
    |);
5667
5668
    print "Upgrade to $DBversion done (Add subscription_frequencies and subscription_numberpatterns tables)\n";
5669
    SetVersion($DBversion);
5670
}
5671
5476
=head1 FUNCTIONS
5672
=head1 FUNCTIONS
5477
5673
5478
=head2 TableExists($table)
5674
=head2 TableExists($table)
5479
- 

Return to bug 7688