-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.php
115 lines (101 loc) · 3.52 KB
/
install.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
$path = OW::getPluginManager()->getPlugin('cocreation')->getRootDir() . 'langs.zip';
BOL_LanguageService::getInstance()->importPrefixFromZip($path, 'cocreation');
$sql = 'CREATE TABLE IF NOT EXISTS `' . OW_DB_PREFIX . 'cocreation_room` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(255),
`ownerId` int(11) NOT NULL,
`albumId` int(11),
`name` varchar(255),
`subject` varchar(255),
`description` varchar(255),
`from` date,
`to` date,
`goal` varchar(255),
`invitationText` varchar(255),
`isOpen` tinyint(1),
`timestamp` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE IF NOT EXISTS `' . OW_DB_PREFIX . 'cocreation_room_doc` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`roomId` int(11) NOT NULL,
`url` varchar(255),
`description` varchar(255),
`templateId` int(11),
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE IF NOT EXISTS `' . OW_DB_PREFIX . 'cocreation_room_dataset` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`roomId` int(11) NOT NULL,
`url` varchar(255),
`name` varchar(255),
`description` varchar(255),
`fields` text,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE IF NOT EXISTS `' . OW_DB_PREFIX . 'cocreation_room_member` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`roomId` int(11) NOT NULL,
`userId` int(11) NOT NULL,
`email` varchar(255),
`isJoined` tinyint(1),
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE IF NOT EXISTS `' . OW_DB_PREFIX . 'cocreation_room_datalet` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`roomId` int(11) NOT NULL,
`dataletId` int(11),
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE IF NOT EXISTS `' . OW_DB_PREFIX . 'cocreation_room_postit` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`roomId` int(11) NOT NULL,
`dataletId` int(11),
`title` varchar(255),
`content` varchar(255),
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE IF NOT EXISTS `' . OW_DB_PREFIX . 'cocreation_room_sheet` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`roomId` int(11) NOT NULL,
`url` varchar(255),
`description` varchar(255),
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE IF NOT EXISTS `' . OW_DB_PREFIX . 'cocreation_room_metadata` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`roomId` int(11) NOT NULL,
`common_core_required` mediumtext,
`common_core_if_applicable` mediumtext,
`expanded` mediumtext,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE IF NOT EXISTS `' . OW_DB_PREFIX . 'cocreation_dataset` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`owners` text,
`roomId` int(11) NOT NULL,
`datasetId` varchar(255) NOT NULL,
`version` int(11) NOT NULL,
`data` mediumtext,
`notes` mediumtext,
`common_core_required_metadata` mediumtext,
`common_core_if_applicable_metadata` mediumtext,
`expanded_metadata` mediumtext,
`timestamp` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
CREATE TABLE IF NOT EXISTS `' . OW_DB_PREFIX . 'cocreation_template` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`description` varchar(255),
`url` varchar(255),
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
';
OW::getDbo()->query($sql);
$authorization = OW::getAuthorization();
$groupName = 'cocreation';
$authorization->addGroup($groupName);
$authorization->addAction($groupName, 'view', true);
$authorization->addAction($groupName, 'add_comment');