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 5392-5397 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
5392
    SetVersion ($DBversion);
5392
    SetVersion ($DBversion);
5393
}
5393
}
5394
5394
5395
$DBversion = "XXX";
5396
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5397
    $dbh->do(qq|
5398
        DROP TABLE IF EXISTS subscription_frequencies
5399
    |);
5400
    $dbh->do(qq|
5401
        CREATE TABLE subscription_frequencies (
5402
            id INTEGER NOT NULL AUTO_INCREMENT,
5403
            description TEXT NOT NULL,
5404
            displayorder INT DEFAULT NULL,
5405
            unit ENUM('day','week','month','year') DEFAULT NULL,
5406
            unitsperissue INTEGER NOT NULL DEFAULT '1',
5407
            issuesperunit INTEGER NOT NULL DEFAULT '1',
5408
            PRIMARY KEY (id)
5409
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8
5410
    |);
5411
5412
    $dbh->do(qq|
5413
        DROP TABLE IF EXISTS subscription_numberpatterns
5414
    |);
5415
    $dbh->do(qq|
5416
        CREATE TABLE subscription_numberpatterns (
5417
            id INTEGER NOT NULL AUTO_INCREMENT,
5418
            label VARCHAR(255) NOT NULL,
5419
            displayorder INTEGER DEFAULT NULL,
5420
            description TEXT NOT NULL,
5421
            numberingmethod VARCHAR(255) NOT NULL,
5422
            label1 VARCHAR(255) DEFAULT NULL,
5423
            add1 INTEGER DEFAULT NULL,
5424
            every1 INTEGER DEFAULT NULL,
5425
            whenmorethan1 INTEGER DEFAULT NULL,
5426
            setto1 INTEGER DEFAULT NULL,
5427
            numbering1 VARCHAR(255) DEFAULT NULL,
5428
            label2 VARCHAR(255) DEFAULT NULL,
5429
            add2 INTEGER DEFAULT NULL,
5430
            every2 INTEGER DEFAULT NULL,
5431
            whenmorethan2 INTEGER DEFAULT NULL,
5432
            setto2 INTEGER DEFAULT NULL,
5433
            numbering2 VARCHAR(255) DEFAULT NULL,
5434
            label3 VARCHAR(255) DEFAULT NULL,
5435
            add3 INTEGER DEFAULT NULL,
5436
            every3 INTEGER DEFAULT NULL,
5437
            whenmorethan3 INTEGER DEFAULT NULL,
5438
            setto3 INTEGER DEFAULT NULL,
5439
            numbering3 VARCHAR(255) DEFAULT NULL,
5440
            PRIMARY KEY (id)
5441
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8
5442
    |);
5443
5444
    $dbh->do(qq|
5445
        INSERT INTO subscription_frequencies (description, unit, unitsperissue, issuesperunit, displayorder)
5446
        VALUES
5447
            ('2/day', 'day', 1, 2, 1),
5448
            ('1/day', 'day', 1, 1, 2),
5449
            ('3/week', 'week', 1, 3, 3),
5450
            ('1/week', 'week', 1, 1, 4),
5451
            ('1/2 weeks', 'week', 2, 1, 5),
5452
            ('1/3 weeks', 'week', 3, 1, 6),
5453
            ('1/month', 'month', 1, 1, 7),
5454
            ('1/2 months', 'month', 2, 1, 8),
5455
            ('1/3 months', 'month', 3, 1, 9),
5456
            ('2/year', 'month', 6, 1, 10),
5457
            ('1/year', 'year', 1, 1, 11),
5458
            ('1/2 year', 'year', 2, 1, 12),
5459
            ('Irregular', NULL, 1, 1, 13)
5460
    |);
5461
5462
    # Used to link existing subscription to newly created frequencies
5463
    my $frequencies_mapping = {     # keys are old frequency numbers, values are the new ones
5464
        1 => 2,     # daily (n/week)
5465
        2 => 4,     # 1/week
5466
        3 => 5,     # 1/2 weeks
5467
        4 => 6,     # 1/3 weeks
5468
        5 => 7,     # 1/month
5469
        6 => 8,     # 1/2 months (6/year)
5470
        7 => 9,     # 1/3 months (1/quarter)
5471
        8 => 9,    # 1/quarter (seasonal)
5472
        9 => 10,    # 2/year
5473
        10 => 11,   # 1/year
5474
        11 => 12,   # 1/2 years
5475
        12 => 1,    # 2/day
5476
        16 => 13,   # Without periodicity
5477
        32 => 13,   # Irregular
5478
        48 => 13    # Unknown
5479
    };
5480
5481
    $dbh->do(qq|
5482
        INSERT INTO subscription_numberpatterns
5483
            (label, displayorder, description, numberingmethod,
5484
            label1, add1, every1, whenmorethan1, setto1, numbering1,
5485
            label2, add2, every2, whenmorethan2, setto2, numbering2,
5486
            label3, add3, every3, whenmorethan3, setto3, numbering3)
5487
        VALUES
5488
            ('Number', 1, 'Simple Numbering method', 'No.{X}',
5489
            'Number', 1, 1, 99999, 1, NULL,
5490
            NULL, NULL, NULL, NULL, NULL, NULL,
5491
            NULL, NULL, NULL, NULL, NULL, NULL),
5492
5493
            ('Volume, Number, Issue', 2, 'Volume Number Issue 1', 'Vol.{X}, Number {Y}, Issue {Z}',
5494
            'Volume', 1, 48, 99999, 1, NULL,
5495
            'Number', 1, 4, 12, 1, NULL,
5496
            'Issue', 1, 1, 4, 1, NULL),
5497
5498
            ('Volume, Number', 3, 'Volume Number 1', 'Vol {X}, No {Y}',
5499
            'Volume', 1, 12, 99999, 1, NULL,
5500
            'Number', 1, 1, 12, 1, NULL,
5501
            NULL, NULL, NULL, NULL, NULL, NULL),
5502
5503
            ('Seasonal', 4, 'Season Year', '{X} {Y}',
5504
            'Season', 1, 1, 3, 0, 'season',
5505
            'Year', 1, 4, 99999, 1, NULL,
5506
            NULL, NULL, NULL, NULL, NULL, NULL)
5507
    |);
5508
5509
    $dbh->do(qq|
5510
        ALTER TABLE subscription
5511
        MODIFY COLUMN numberpattern INTEGER DEFAULT NULL,
5512
        MODIFY COLUMN periodicity INTEGER DEFAULT NULL
5513
    |);
5514
5515
    # Update existing subscriptions
5516
5517
    my $query = qq|
5518
        SELECT subscriptionid, periodicity, numberingmethod,
5519
            add1, every1, whenmorethan1, setto1,
5520
            add2, every2, whenmorethan2, setto2,
5521
            add3, every3, whenmorethan3, setto3
5522
        FROM subscription
5523
        ORDER BY subscriptionid
5524
    |;
5525
    my $sth = $dbh->prepare($query);
5526
    $sth->execute;
5527
    my $insert_numberpatterns_sth = $dbh->prepare(qq|
5528
        INSERT INTO subscription_numberpatterns
5529
             (label, displayorder, description, numberingmethod,
5530
            label1, add1, every1, whenmorethan1, setto1, numbering1,
5531
            label2, add2, every2, whenmorethan2, setto2, numbering2,
5532
            label3, add3, every3, whenmorethan3, setto3, numbering3)
5533
        VALUES
5534
            (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
5535
    |);
5536
    my $update_subscription_sth = $dbh->prepare(qq|
5537
        UPDATE subscription
5538
        SET numberpattern = ?,
5539
            periodicity = ?
5540
        WHERE subscriptionid = ?
5541
    |);
5542
5543
    my $i = 1;
5544
    while(my $sub = $sth->fetchrow_hashref) {
5545
        # Create a new numbering pattern for each subscription
5546
        my $ok = $insert_numberpatterns_sth->execute(
5547
            "Backup pattern $i", 4+$i, "Automatically created pattern by updatedatabase", $sub->{numberingmethod},
5548
            "X", $sub->{add1}, $sub->{every1}, $sub->{whenmorethan1}, $sub->{setto1}, undef,
5549
            "Y", $sub->{add2}, $sub->{every2}, $sub->{whenmorethan2}, $sub->{setto2}, undef,
5550
            "Z", $sub->{add3}, $sub->{every3}, $sub->{whenmorethan3}, $sub->{setto3}, undef
5551
        );
5552
        if($ok) {
5553
            my $id = $dbh->last_insert_id(undef, undef, 'subscription_numberpatterns', undef);
5554
            # Link to subscription_numberpatterns and subscription_frequencies
5555
            $update_subscription_sth->execute($id,
5556
                $frequencies_mapping->{$sub->{periodicity}}, $sub->{subscriptionid});
5557
        }
5558
        $i++;
5559
    }
5560
5561
    # Remove now useless columns
5562
    $dbh->do(qq|
5563
        ALTER TABLE subscription
5564
        DROP COLUMN numberingmethod,
5565
        DROP COLUMN add1,
5566
        DROP COLUMN every1,
5567
        DROP COLUMN whenmorethan1,
5568
        DROP COLUMN setto1,
5569
        DROP COLUMN add2,
5570
        DROP COLUMN every2,
5571
        DROP COLUMN whenmorethan2,
5572
        DROP COLUMN setto2,
5573
        DROP COLUMN add3,
5574
        DROP COLUMN every3,
5575
        DROP COLUMN whenmorethan3,
5576
        DROP COLUMN setto3,
5577
        DROP COLUMN dow,
5578
        DROP COLUMN issuesatonce,
5579
        DROP COLUMN hemisphere,
5580
        ADD COLUMN countissuesperunit INTEGER NOT NULL DEFAULT 0 AFTER periodicity,
5581
        ADD COLUMN skip_serialseq BOOLEAN NOT NULL DEFAULT 0 AFTER irregularity,
5582
        ADD COLUMN locale VARCHAR(80) DEFAULT NULL AFTER numberpattern,
5583
        ADD CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id),
5584
        ADD CONSTRAINT subscription_ibfk_2 FOREIGN KEY (numberpattern) REFERENCES subscription_numberpatterns (id)
5585
    |);
5586
5587
    print "Upgrade to $DBversion done (Add subscription_frequencies and subscription_numberpatterns tables)\n";
5588
    SetVersion($DBversion);
5589
}
5590
5395
=head1 FUNCTIONS
5591
=head1 FUNCTIONS
5396
5592
5397
=head2 TableExists($table)
5593
=head2 TableExists($table)
5398
- 

Return to bug 7688