-
Notifications
You must be signed in to change notification settings - Fork 0
/
upei_roblib_ill.install
184 lines (179 loc) · 4.78 KB
/
upei_roblib_ill.install
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<?php
/**
* @file
* Implementations of installation hooks.
*/
/**
* Implements hook_uninstall().
*/
function upei_roblib_ill_uninstall() {
$variables = [
'upei_roblib_ill_add_url',
'upei_roblib_ill_auth_url',
'upei_roblib_ill_relais_key',
'upei_roblib_ill_library_symbol',
'upei_roblib_ill_contact_email',
'upei_roblib_ill_contact_phonel',
'upei_roblib_ill_header_message',
];
array_walk($variables, 'variable_del');
}
function upei_roblib_ill_update_7100() {
db_change_field('upei_roblib_ill_request', 'isbn', 'isbn',
array(
'description' => 'book isbn',
'type' => 'varchar',
'length' => '200',
'not null' => FALSE,
)
);
}
/**
* Implements hook_schema().
*/
function upei_roblib_ill_schema() {
$schema['upei_roblib_ill_request'] = [
'description' => 'Log table for ILL requests',
'fields' => [
'id' => [
'description' => 'primary key',
'type' => 'serial',
'size' => 'big',
'not null' => TRUE,
],
'patron_id' => [
'description' => 'The id of the user that submitted the request',
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
],
'patron_email' => [
'description' => 'The email address of the user that submitted the request',
'type' => 'varchar',
'length' => '255',
'not null' => FALSE,
],
'patron_lastname' => [
'description' => 'Lastname of the user that submitted the request',
'type' => 'varchar',
'length' => '60',
'not null' => TRUE,
],
'patron_firstname' => [
'description' => 'Firstname of the user that submitted the request',
'type' => 'varchar',
'length' => '60',
'not null' => TRUE,
],
'patron_department' => [
'description' => 'The department the user that submitted the request belongs',
'type' => 'varchar',
'length' => '128',
'not null' => TRUE,
],
'patron_type' => [
'description' => 'The type of patron ',
'type' => 'varchar',
'length' => '128',
'not null' => FALSE,
],
'author' => [
'description' => 'authors name',
'type' => 'varchar',
'length' => '128',
'not null' => FALSE,
],
'title' => [
'description' => 'book or journal title',
'type' => 'varchar',
'length' => '512',
'not null' => FALSE,
],
'atitle' => [
'description' => 'article or chapter title',
'type' => 'varchar',
'length' => '512',
'not null' => FALSE,
],
'issn' => [
'description' => 'Article issn',
'type' => 'varchar',
'length' => '18',
'not null' => FALSE,
],
'isbn' => [
'description' => 'book isbn',
'type' => 'varchar',
'length' => '200',
'not null' => FALSE,
],
'article_author' => [
'description' => 'Article author',
'type' => 'varchar',
'length' => '128',
'not null' => FALSE,
],
'citation_date' => [
'description' => 'Date and time of the request',
'type' => 'varchar',
'length' => '30',
'not null' => TRUE,
],
'pages_requested' => [
'description' => 'pages requested',
'type' => 'varchar',
'length' => '30',
'not null' => FALSE,
],
'volume' => [
'description' => 'Volume',
'type' => 'varchar',
'length' => '30',
'not null' => FALSE,
],
'issue' => [
'description' => 'Issue',
'type' => 'varchar',
'length' => '50',
'not null' => FALSE,
],
'genre' => [
'description' => 'type of material requested (article, book, book chapter)',
'type' => 'varchar',
'length' => '30',
'not null' => TRUE,
],
'doi' => [
'description' => 'The DOI',
'type' => 'varchar',
'length' => '255',
'not null' => FALSE,
],
'relais_request_id' => [
'description' => 'The request id stored in the Relais datbabase',
'type' => 'varchar',
'length' => '30',
'not null' => FALSE,
],
'relais_message' => [
'description' => 'If the ILL request failed we will store a reason.',
'type' => 'varchar',
'length' => '255',
'not null' => FALSE,
],
'time_submitted' => [
'description' => 'The time the request was submitted',
'type' => 'int',
'not null' => FALSE,
],
'notes' => [
'description' => 'Notes',
'type' => 'varchar',
'length' => '512',
'not null' => FALSE,
],
],
'primary key' => ['id'],
];
return $schema;
}