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 1824-1829 DROP TABLE IF EXISTS `stopwords`; Link Here
1824
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1824
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1825
1825
1826
--
1826
--
1827
-- Table structure for table subscription_frequencies
1828
--
1829
1830
DROP TABLE IF EXISTS subscription_frequencies;
1831
CREATE TABLE subscription_frequencies (
1832
    id INTEGER NOT NULL AUTO_INCREMENT,
1833
    description TEXT NOT NULL,
1834
    displayorder INT DEFAULT NULL,
1835
    unit ENUM('day','week','month','year') DEFAULT NULL,
1836
    unitsperissue INTEGER NOT NULL DEFAULT '1',
1837
    issuesperunit INTEGER NOT NULL DEFAULT '1',
1838
    PRIMARY KEY (id)
1839
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1840
1841
--
1842
-- Table structure for table subscription_numberpatterns
1843
--
1844
1845
DROP TABLE IF EXISTS subscription_numberpatterns;
1846
CREATE TABLE subscription_numberpatterns (
1847
    id INTEGER NOT NULL AUTO_INCREMENT,
1848
    label VARCHAR(255) NOT NULL,
1849
    displayorder INTEGER DEFAULT NULL,
1850
    description TEXT NOT NULL,
1851
    numberingmethod VARCHAR(255) NOT NULL,
1852
    label1 VARCHAR(255) DEFAULT NULL,
1853
    add1 INTEGER DEFAULT NULL,
1854
    every1 INTEGER DEFAULT NULL,
1855
    whenmorethan1 INTEGER DEFAULT NULL,
1856
    setto1 INTEGER DEFAULT NULL,
1857
    numbering1 VARCHAR(255) DEFAULT NULL,
1858
    label2 VARCHAR(255) DEFAULT NULL,
1859
    add2 INTEGER DEFAULT NULL,
1860
    every2 INTEGER DEFAULT NULL,
1861
    whenmorethan2 INTEGER DEFAULT NULL,
1862
    setto2 INTEGER DEFAULT NULL,
1863
    numbering2 VARCHAR(255) DEFAULT NULL,
1864
    label3 VARCHAR(255) DEFAULT NULL,
1865
    add3 INTEGER DEFAULT NULL,
1866
    every3 INTEGER DEFAULT NULL,
1867
    whenmorethan3 INTEGER DEFAULT NULL,
1868
    setto3 INTEGER DEFAULT NULL,
1869
    numbering3 VARCHAR(255) DEFAULT NULL,
1870
    PRIMARY KEY (id)
1871
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1872
1873
--
1827
-- Table structure for table `subscription`
1874
-- Table structure for table `subscription`
1828
--
1875
--
1829
1876
Lines 1840-1886 CREATE TABLE `subscription` ( Link Here
1840
  `monthlength` int(11) default 0,
1887
  `monthlength` int(11) default 0,
1841
  `numberlength` int(11) default 0,
1888
  `numberlength` int(11) default 0,
1842
  `periodicity` tinyint(4) default 0,
1889
  `periodicity` tinyint(4) default 0,
1843
  `dow` varchar(100) default '',
1890
  countissuesperunit INTEGER NOT NULL DEFAULT 0,
1844
  `numberingmethod` varchar(100) default '',
1845
  `notes` mediumtext,
1891
  `notes` mediumtext,
1846
  `status` varchar(100) NOT NULL default '',
1892
  `status` varchar(100) NOT NULL default '',
1847
  `add1` int(11) default 0,
1848
  `every1` int(11) default 0,
1849
  `whenmorethan1` int(11) default 0,
1850
  `setto1` int(11) default NULL,
1851
  `lastvalue1` int(11) default NULL,
1893
  `lastvalue1` int(11) default NULL,
1852
  `add2` int(11) default 0,
1853
  `every2` int(11) default 0,
1854
  `whenmorethan2` int(11) default 0,
1855
  `setto2` int(11) default NULL,
1856
  `lastvalue2` int(11) default NULL,
1857
  `add3` int(11) default 0,
1858
  `every3` int(11) default 0,
1859
  `innerloop1` int(11) default 0,
1894
  `innerloop1` int(11) default 0,
1895
  `lastvalue2` int(11) default NULL,
1860
  `innerloop2` int(11) default 0,
1896
  `innerloop2` int(11) default 0,
1861
  `innerloop3` int(11) default 0,
1862
  `whenmorethan3` int(11) default 0,
1863
  `setto3` int(11) default NULL,
1864
  `lastvalue3` int(11) default NULL,
1897
  `lastvalue3` int(11) default NULL,
1865
  `issuesatonce` tinyint(3) NOT NULL default 1,
1898
  `innerloop3` int(11) default 0,
1866
  `firstacquidate` date default NULL,
1899
  `firstacquidate` date default NULL,
1867
  `manualhistory` tinyint(1) NOT NULL default 0,
1900
  `manualhistory` tinyint(1) NOT NULL default 0,
1868
  `irregularity` text,
1901
  `irregularity` text,
1902
  skip_serialseq BOOLEAN NOT NULL DEFAULT 0,
1869
  `letter` varchar(20) default NULL,
1903
  `letter` varchar(20) default NULL,
1870
  `numberpattern` tinyint(3) default 0,
1904
  `numberpattern` tinyint(3) default 0,
1905
  locale VARCHAR(80) DEFAULT NULL,
1871
  `distributedto` text,
1906
  `distributedto` text,
1872
  `internalnotes` longtext,
1907
  `internalnotes` longtext,
1873
  `callnumber` text,
1908
  `callnumber` text,
1874
  `location` varchar(80) NULL default '',
1909
  `location` varchar(80) NULL default '',
1875
  `branchcode` varchar(10) NOT NULL default '',
1910
  `branchcode` varchar(10) NOT NULL default '',
1876
  `hemisphere` tinyint(3) default 0,
1877
  `lastbranch` varchar(10),
1911
  `lastbranch` varchar(10),
1878
  `serialsadditems` tinyint(1) NOT NULL default '0',
1912
  `serialsadditems` tinyint(1) NOT NULL default '0',
1879
  `staffdisplaycount` VARCHAR(10) NULL,
1913
  `staffdisplaycount` VARCHAR(10) NULL,
1880
  `opacdisplaycount` VARCHAR(10) NULL,
1914
  `opacdisplaycount` VARCHAR(10) NULL,
1881
  `graceperiod` int(11) NOT NULL default '0',
1915
  `graceperiod` int(11) NOT NULL default '0',
1882
  `enddate` date default NULL,
1916
  `enddate` date default NULL,
1883
  PRIMARY KEY  (`subscriptionid`)
1917
  PRIMARY KEY  (`subscriptionid`),
1918
  CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id),
1919
  CONSTRAINT subscription_ibfk_2 FOREIGN KEY (numberpattern) REFERENCES subscription_numberpatterns (id)
1884
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1920
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
1885
1921
1886
--
1922
--
(-)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 5146-5151 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5146
    SetVersion($DBversion);
5146
    SetVersion($DBversion);
5147
}
5147
}
5148
5148
5149
$DBversion = "XXX";
5150
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5151
    $dbh->do(qq|
5152
        DROP TABLE IF EXISTS subscription_frequencies
5153
    |);
5154
    $dbh->do(qq|
5155
        CREATE TABLE subscription_frequencies (
5156
            id INTEGER NOT NULL AUTO_INCREMENT,
5157
            description TEXT NOT NULL,
5158
            displayorder INT DEFAULT NULL,
5159
            unit ENUM('day','week','month','year') DEFAULT NULL,
5160
            unitsperissue INTEGER NOT NULL DEFAULT '1',
5161
            issuesperunit INTEGER NOT NULL DEFAULT '1',
5162
            PRIMARY KEY (id)
5163
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8
5164
    |);
5165
5166
    $dbh->do(qq|
5167
        DROP TABLE IF EXISTS subscription_numberpatterns
5168
    |);
5169
    $dbh->do(qq|
5170
        CREATE TABLE subscription_numberpatterns (
5171
            id INTEGER NOT NULL AUTO_INCREMENT,
5172
            label VARCHAR(255) NOT NULL,
5173
            displayorder INTEGER DEFAULT NULL,
5174
            description TEXT NOT NULL,
5175
            numberingmethod VARCHAR(255) NOT NULL,
5176
            label1 VARCHAR(255) DEFAULT NULL,
5177
            add1 INTEGER DEFAULT NULL,
5178
            every1 INTEGER DEFAULT NULL,
5179
            whenmorethan1 INTEGER DEFAULT NULL,
5180
            setto1 INTEGER DEFAULT NULL,
5181
            numbering1 VARCHAR(255) DEFAULT NULL,
5182
            label2 VARCHAR(255) DEFAULT NULL,
5183
            add2 INTEGER DEFAULT NULL,
5184
            every2 INTEGER DEFAULT NULL,
5185
            whenmorethan2 INTEGER DEFAULT NULL,
5186
            setto2 INTEGER DEFAULT NULL,
5187
            numbering2 VARCHAR(255) DEFAULT NULL,
5188
            label3 VARCHAR(255) DEFAULT NULL,
5189
            add3 INTEGER DEFAULT NULL,
5190
            every3 INTEGER DEFAULT NULL,
5191
            whenmorethan3 INTEGER DEFAULT NULL,
5192
            setto3 INTEGER DEFAULT NULL,
5193
            numbering3 VARCHAR(255) DEFAULT NULL,
5194
            PRIMARY KEY (id)
5195
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8
5196
    |);
5197
5198
    $dbh->do(qq|
5199
        INSERT INTO subscription_frequencies (description, unit, unitsperissue, issuesperunit, displayorder)
5200
        VALUES
5201
            ('2/day', 'day', 1, 2, 1),
5202
            ('1/day', 'day', 1, 1, 2),
5203
            ('3/week', 'week', 1, 3, 3),
5204
            ('1/week', 'week', 1, 1, 4),
5205
            ('1/2 weeks', 'week', 2, 1, 5),
5206
            ('1/3 weeks', 'week', 3, 1, 6),
5207
            ('1/month', 'month', 1, 1, 7),
5208
            ('1/2 months', 'month', 2, 1, 8),
5209
            ('1/3 months', 'month', 3, 1, 9),
5210
            ('2/year', 'month', 6, 1, 10),
5211
            ('1/year', 'year', 1, 1, 11),
5212
            ('1/2 year', 'year', 2, 1, 12),
5213
            ('Irregular', NULL, 1, 1, 13)
5214
    |);
5215
5216
    # Used to link existing subscription to newly created frequencies
5217
    my $frequencies_mapping = {     # keys are old frequency numbers, values are the new ones
5218
        1 => 2,     # daily (n/week)
5219
        2 => 4,     # 1/week
5220
        3 => 5,     # 1/2 weeks
5221
        4 => 6,     # 1/3 weeks
5222
        5 => 7,     # 1/month
5223
        6 => 8,     # 1/2 months (6/year)
5224
        7 => 9,     # 1/3 months (1/quarter)
5225
        8 => 9,    # 1/quarter (seasonal)
5226
        9 => 10,    # 2/year
5227
        10 => 11,   # 1/year
5228
        11 => 12,   # 1/2 years
5229
        12 => 1,    # 2/day
5230
        16 => 13,   # Without periodicity
5231
        32 => 13,   # Irregular
5232
        48 => 13    # Unknown
5233
    };
5234
5235
    $dbh->do(qq|
5236
        INSERT INTO subscription_numberpatterns
5237
            (label, displayorder, description, numberingmethod,
5238
            label1, add1, every1, whenmorethan1, setto1, numbering1,
5239
            label2, add2, every2, whenmorethan2, setto2, numbering2,
5240
            label3, add3, every3, whenmorethan3, setto3, numbering3)
5241
        VALUES
5242
            ('Number', 1, 'Simple Numbering method', 'No.{X}',
5243
            'Number', 1, 1, 99999, 1, NULL,
5244
            NULL, NULL, NULL, NULL, NULL, NULL,
5245
            NULL, NULL, NULL, NULL, NULL, NULL),
5246
5247
            ('Volume, Number, Issue', 2, 'Volume Number Issue 1', 'Vol.{X}, Number {Y}, Issue {Z}',
5248
            'Volume', 1, 48, 99999, 1, NULL,
5249
            'Number', 1, 4, 12, 1, NULL,
5250
            'Issue', 1, 1, 4, 1, NULL),
5251
5252
            ('Volume, Number', 3, 'Volume Number 1', 'Vol {X}, No {Y}',
5253
            'Volume', 1, 12, 99999, 1, NULL,
5254
            'Number', 1, 1, 12, 1, NULL,
5255
            NULL, NULL, NULL, NULL, NULL, NULL),
5256
5257
            ('Seasonal', 4, 'Season Year', '{X} {Y}',
5258
            'Season', 1, 1, 3, 0, 'season',
5259
            'Year', 1, 4, 99999, 1, NULL,
5260
            NULL, NULL, NULL, NULL, NULL, NULL)
5261
    |);
5262
5263
    $dbh->do(qq|
5264
        ALTER TABLE subscription
5265
        MODIFY COLUMN numberpattern INTEGER DEFAULT NULL,
5266
        MODIFY COLUMN periodicity INTEGER DEFAULT NULL
5267
    |);
5268
5269
    # Update existing subscriptions
5270
5271
    my $query = qq|
5272
        SELECT subscriptionid, periodicity, numberingmethod,
5273
            add1, every1, whenmorethan1, setto1,
5274
            add2, every2, whenmorethan2, setto2,
5275
            add3, every3, whenmorethan3, setto3
5276
        FROM subscription
5277
        ORDER BY subscriptionid
5278
    |;
5279
    my $sth = $dbh->prepare($query);
5280
    $sth->execute;
5281
    my $insert_numberpatterns_sth = $dbh->prepare(qq|
5282
        INSERT INTO subscription_numberpatterns
5283
             (label, displayorder, description, numberingmethod,
5284
            label1, add1, every1, whenmorethan1, setto1, numbering1,
5285
            label2, add2, every2, whenmorethan2, setto2, numbering2,
5286
            label3, add3, every3, whenmorethan3, setto3, numbering3)
5287
        VALUES
5288
            (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
5289
    |);
5290
    my $update_subscription_sth = $dbh->prepare(qq|
5291
        UPDATE subscription
5292
        SET numberpattern = ?,
5293
            periodicity = ?
5294
        WHERE subscriptionid = ?
5295
    |);
5296
5297
    my $i = 1;
5298
    while(my $sub = $sth->fetchrow_hashref) {
5299
        # Create a new numbering pattern for each subscription
5300
        my $ok = $insert_numberpatterns_sth->execute(
5301
            "Backup pattern $i", 4+$i, "Automatically created pattern by updatedatabase", $sub->{numberingmethod},
5302
            "X", $sub->{add1}, $sub->{every1}, $sub->{whenmorethan1}, $sub->{setto1}, undef,
5303
            "Y", $sub->{add2}, $sub->{every2}, $sub->{whenmorethan2}, $sub->{setto2}, undef,
5304
            "Z", $sub->{add3}, $sub->{every3}, $sub->{whenmorethan3}, $sub->{setto3}, undef
5305
        );
5306
        if($ok) {
5307
            my $id = $dbh->last_insert_id(undef, undef, 'subscription_numberpatterns', undef);
5308
            # Link to subscription_numberpatterns and subscription_frequencies
5309
            $update_subscription_sth->execute($id,
5310
                $frequencies_mapping->{$sub->{periodicity}}, $sub->{subscriptionid});
5311
        }
5312
        $i++;
5313
    }
5314
5315
    # Remove now useless columns
5316
    $dbh->do(qq|
5317
        ALTER TABLE subscription
5318
        DROP COLUMN numberingmethod,
5319
        DROP COLUMN add1,
5320
        DROP COLUMN every1,
5321
        DROP COLUMN whenmorethan1,
5322
        DROP COLUMN setto1,
5323
        DROP COLUMN add2,
5324
        DROP COLUMN every2,
5325
        DROP COLUMN whenmorethan2,
5326
        DROP COLUMN setto2,
5327
        DROP COLUMN add3,
5328
        DROP COLUMN every3,
5329
        DROP COLUMN whenmorethan3,
5330
        DROP COLUMN setto3,
5331
        DROP COLUMN dow,
5332
        DROP COLUMN issuesatonce,
5333
        DROP COLUMN hemisphere,
5334
        ADD COLUMN countissuesperunit INTEGER NOT NULL DEFAULT 0 AFTER periodicity,
5335
        ADD COLUMN skip_serialseq BOOLEAN NOT NULL DEFAULT 0 AFTER irregularity,
5336
        ADD COLUMN locale VARCHAR(80) DEFAULT NULL AFTER numberpattern,
5337
        ADD CONSTRAINT subscription_ibfk_1 FOREIGN KEY (periodicity) REFERENCES subscription_frequencies (id),
5338
        ADD CONSTRAINT subscription_ibfk_2 FOREIGN KEY (numberpattern) REFERENCES subscription_numberpatterns (id)
5339
    |);
5340
5341
    print "Upgrade to $DBversion done (Add subscription_frequencies and subscription_numberpatterns tables)\n";
5342
    SetVersion($DBversion);
5343
}
5344
5149
=head1 FUNCTIONS
5345
=head1 FUNCTIONS
5150
5346
5151
=head2 DropAllForeignKeys($table)
5347
=head2 DropAllForeignKeys($table)
5152
- 

Return to bug 7688