@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v2 or later |
11 | 11 | */ |
12 | 12 | |
13 | -function xmldb_bigbluebuttonbn_upgrade($oldversion=0) { |
|
13 | +function xmldb_bigbluebuttonbn_upgrade($oldversion = 0) { |
|
14 | 14 | |
15 | 15 | global $CFG, $THEME, $DB; |
16 | 16 | $dbman = $DB->get_manager(); // loads ddl manager and xmldb classes |
@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | if ($result && $oldversion < 2012040200) { |
21 | 21 | // Define field intro to be droped from bigbluebuttonbn |
22 | 22 | $table = new xmldb_table('bigbluebuttonbn'); |
23 | - $field = new xmldb_field('intro', XMLDB_TYPE_TEXT, 'medium', null, null, null, null,'name'); |
|
23 | + $field = new xmldb_field('intro', XMLDB_TYPE_TEXT, 'medium', null, null, null, null, 'name'); |
|
24 | 24 | |
25 | 25 | // Drop field intro |
26 | 26 | if ($dbman->field_exists($table, $field)) { |
27 | - $dbman->drop_field($table, $field, $continue=true, $feedback=true); |
|
27 | + $dbman->drop_field($table, $field, $continue = true, $feedback = true); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | // Define field introformat to be droped from bigbluebuttonbn |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | // Drop field introformat |
35 | 35 | if ($dbman->field_exists($table, $field)) { |
36 | - $dbman->drop_field($table, $field, $continue=true, $feedback=true); |
|
36 | + $dbman->drop_field($table, $field, $continue = true, $feedback = true); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | // Once we reach this point, we can store the new version and consider the module |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $field = new xmldb_field('welcome'); |
74 | 74 | $field->set_attributes(XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null, null, null, 'type'); |
75 | 75 | |
76 | - $dbman->change_field_type($table, $field, $continue=true, $feedback=true); |
|
76 | + $dbman->change_field_type($table, $field, $continue = true, $feedback = true); |
|
77 | 77 | |
78 | 78 | upgrade_mod_savepoint(true, 2012100100, 'bigbluebuttonbn'); |
79 | 79 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $field->set_attributes(XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0); |
86 | 86 | |
87 | 87 | if (!$dbman->field_exists($table, $field)) { |
88 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
88 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | upgrade_mod_savepoint(true, 2014050100, 'bigbluebuttonbn'); |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $field = new xmldb_field('participants', XMLDB_TYPE_TEXT, 'medium', null, null, null, null); |
98 | 98 | |
99 | 99 | if (!$dbman->field_exists($table, $field)) { |
100 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
100 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | upgrade_mod_savepoint(true, 2014070420, 'bigbluebuttonbn'); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $field = new xmldb_field('participants'); |
110 | 110 | $field->set_attributes(XMLDB_TYPE_TEXT, 'medium', null, null, null, null); |
111 | 111 | |
112 | - $dbman->change_field_type($table, $field, $continue=true, $feedback=true); |
|
112 | + $dbman->change_field_type($table, $field, $continue = true, $feedback = true); |
|
113 | 113 | |
114 | 114 | upgrade_mod_savepoint(true, 2014101004, 'bigbluebuttonbn'); |
115 | 115 | } |
@@ -119,67 +119,67 @@ discard block |
||
119 | 119 | $table = new xmldb_table('bigbluebuttonbn'); |
120 | 120 | //// Drop field timeduration |
121 | 121 | $field = new xmldb_field('timeduration'); |
122 | - if( $dbman->field_exists($table, $field) ) { |
|
123 | - $dbman->drop_field($table, $field, $continue=true, $feedback=true); |
|
122 | + if ($dbman->field_exists($table, $field)) { |
|
123 | + $dbman->drop_field($table, $field, $continue = true, $feedback = true); |
|
124 | 124 | } |
125 | 125 | //// Drop field allmoderators |
126 | 126 | $field = new xmldb_field('allmoderators'); |
127 | - if( $dbman->field_exists($table, $field) ) { |
|
128 | - $dbman->drop_field($table, $field, $continue=true, $feedback=true); |
|
127 | + if ($dbman->field_exists($table, $field)) { |
|
128 | + $dbman->drop_field($table, $field, $continue = true, $feedback = true); |
|
129 | 129 | } |
130 | 130 | //// Add field intro |
131 | 131 | $field = new xmldb_field('intro'); |
132 | 132 | $field->set_attributes(XMLDB_TYPE_TEXT, 'medium', null, null, null, null, 'name'); |
133 | - if( !$dbman->field_exists($table, $field) ) { |
|
134 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
133 | + if (!$dbman->field_exists($table, $field)) { |
|
134 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
135 | 135 | } |
136 | 136 | //// Add field introformat |
137 | 137 | $field = new xmldb_field('introformat'); |
138 | 138 | $field->set_attributes(XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 1, 'intro'); |
139 | - if( !$dbman->field_exists($table, $field) ) { |
|
140 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
139 | + if (!$dbman->field_exists($table, $field)) { |
|
140 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
141 | 141 | } |
142 | 142 | //// Add field tagging |
143 | 143 | $field = new xmldb_field('tagging'); |
144 | 144 | $field->set_attributes(XMLDB_TYPE_INTEGER, '1', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0, 'record'); |
145 | - if( !$dbman->field_exists($table, $field) ) { |
|
146 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
145 | + if (!$dbman->field_exists($table, $field)) { |
|
146 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
147 | 147 | } |
148 | 148 | //// Add field presentation |
149 | 149 | $field = new xmldb_field('presentation'); |
150 | 150 | $field->set_attributes(XMLDB_TYPE_TEXT, 'medium', null, null, null, null, 'timemodified'); |
151 | - if( !$dbman->field_exists($table, $field) ) { |
|
152 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
151 | + if (!$dbman->field_exists($table, $field)) { |
|
152 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
153 | 153 | } |
154 | 154 | //// Add field type |
155 | 155 | $field = new xmldb_field('type'); |
156 | 156 | $field->set_attributes(XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0, 'course'); |
157 | - if( !$dbman->field_exists($table, $field) ) { |
|
158 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
157 | + if (!$dbman->field_exists($table, $field)) { |
|
158 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
159 | 159 | } |
160 | 160 | //// Rename field timeavailable |
161 | 161 | $field = new xmldb_field('timeavailable'); |
162 | 162 | $field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0); |
163 | - if( $dbman->field_exists($table, $field) ) { |
|
164 | - $dbman->rename_field($table, $field, 'openingtime', $continue=true, $feedback=true); |
|
163 | + if ($dbman->field_exists($table, $field)) { |
|
164 | + $dbman->rename_field($table, $field, 'openingtime', $continue = true, $feedback = true); |
|
165 | 165 | } |
166 | 166 | //// Rename field timedue |
167 | 167 | $field = new xmldb_field('timedue'); |
168 | 168 | $field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0); |
169 | - if( $dbman->field_exists($table, $field) ) { |
|
170 | - $dbman->rename_field($table, $field, 'closingtime', $continue=true, $feedback=true); |
|
169 | + if ($dbman->field_exists($table, $field)) { |
|
170 | + $dbman->rename_field($table, $field, 'closingtime', $continue = true, $feedback = true); |
|
171 | 171 | } |
172 | 172 | //// Add field timecreated |
173 | 173 | $field = new xmldb_field('timecreated'); |
174 | 174 | $field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0, 'closingtime'); |
175 | - if( !$dbman->field_exists($table, $field) ) { |
|
176 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
175 | + if (!$dbman->field_exists($table, $field)) { |
|
176 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
177 | 177 | } |
178 | 178 | //// Add field userlimit |
179 | 179 | $field = new xmldb_field('userlimit'); |
180 | 180 | $field->set_attributes(XMLDB_TYPE_INTEGER, '3', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0); |
181 | 181 | if (!$dbman->field_exists($table, $field)) { |
182 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
182 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | // Update the bigbluebuttonbn_log table |
@@ -187,18 +187,18 @@ discard block |
||
187 | 187 | //// Add field userid |
188 | 188 | $field = new xmldb_field('userid'); |
189 | 189 | $field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0, 'bigbluebuttonbnid'); |
190 | - if( !$dbman->field_exists($table, $field) ) { |
|
191 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
190 | + if (!$dbman->field_exists($table, $field)) { |
|
191 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
192 | 192 | } |
193 | 193 | //// Add field meta |
194 | 194 | $field = new xmldb_field('meta'); |
195 | 195 | $field->set_attributes(XMLDB_TYPE_TEXT, 'medium', null, null, null, null, 'event'); |
196 | - if( !$dbman->field_exists($table, $field) ) { |
|
197 | - $dbman->add_field($table, $field, $continue=true, $feedback=true); |
|
196 | + if (!$dbman->field_exists($table, $field)) { |
|
197 | + $dbman->add_field($table, $field, $continue = true, $feedback = true); |
|
198 | 198 | } |
199 | 199 | //// Drop field recording |
200 | 200 | $field = new xmldb_field('record'); |
201 | - if( $dbman->field_exists($table, $field) ) { |
|
201 | + if ($dbman->field_exists($table, $field)) { |
|
202 | 202 | //// Migrate data in field recording to new format in meta |
203 | 203 | $meta = new \stdClass(); |
204 | 204 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | $DB->set_field('bigbluebuttonbn_log', 'meta', json_encode($meta), array('event' => 'Create', 'record' => 0)); |
212 | 212 | |
213 | 213 | // Drop field recording |
214 | - $dbman->drop_field($table, $field, $continue=true, $feedback=true); |
|
214 | + $dbman->drop_field($table, $field, $continue = true, $feedback = true); |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | upgrade_mod_savepoint(true, 2015063000, 'bigbluebuttonbn'); |
@@ -222,14 +222,14 @@ discard block |
||
222 | 222 | $table = new xmldb_table('bigbluebuttonbn'); |
223 | 223 | //// Drop field description |
224 | 224 | $field = new xmldb_field('description'); |
225 | - if( $dbman->field_exists($table, $field) ) { |
|
226 | - $dbman->drop_field($table, $field, $continue=true, $feedback=true); |
|
225 | + if ($dbman->field_exists($table, $field)) { |
|
226 | + $dbman->drop_field($table, $field, $continue = true, $feedback = true); |
|
227 | 227 | } |
228 | 228 | //// Change welcome, allow null |
229 | 229 | $field = new xmldb_field('welcome'); |
230 | 230 | $field->set_attributes(XMLDB_TYPE_TEXT, null, null, null, null, null, null, null, 'type'); |
231 | - if( $dbman->field_exists($table, $field) ) { |
|
232 | - $dbman->change_field_notnull($table, $field, $continue=true, $feedback=true); |
|
231 | + if ($dbman->field_exists($table, $field)) { |
|
232 | + $dbman->change_field_notnull($table, $field, $continue = true, $feedback = true); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | // Update the bigbluebuttonbn_log table |
@@ -238,22 +238,22 @@ discard block |
||
238 | 238 | $field = new xmldb_field('userid'); |
239 | 239 | //$field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0, 'bigbluebuttonbnid'); |
240 | 240 | $field->set_attributes(XMLDB_TYPE_INTEGER, '10', XMLDB_UNSIGNED, null, null, null, null, null, 'bigbluebuttonbnid'); |
241 | - if( $dbman->field_exists($table, $field) ) { |
|
242 | - $dbman->change_field_notnull($table, $field, $continue=true, $feedback=true); |
|
241 | + if ($dbman->field_exists($table, $field)) { |
|
242 | + $dbman->change_field_notnull($table, $field, $continue = true, $feedback = true); |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | upgrade_mod_savepoint(true, 2015080605, 'bigbluebuttonbn'); |
246 | 246 | } |
247 | 247 | |
248 | - if ( $result && $oldversion < 2016011305 ) { |
|
248 | + if ($result && $oldversion < 2016011305) { |
|
249 | 249 | // Update the bigbluebuttonbn table |
250 | 250 | $table = new xmldb_table('bigbluebuttonbn'); |
251 | 251 | |
252 | 252 | // Define field type to be droped from bigbluebuttonbn |
253 | 253 | $field = new xmldb_field('type'); |
254 | 254 | $field->set_attributes(XMLDB_TYPE_INTEGER, '2', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, 0, 'course'); |
255 | - if ( $dbman->field_exists($table, $field) ) { |
|
256 | - $dbman->drop_field($table, $field, $continue=true, $feedback=true); |
|
255 | + if ($dbman->field_exists($table, $field)) { |
|
256 | + $dbman->drop_field($table, $field, $continue = true, $feedback = true); |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | // Define field 'event' to be renamed |
@@ -265,17 +265,17 @@ discard block |
||
265 | 265 | // Conditionally rename the table |
266 | 266 | if ($dbman->table_exists($table)) { |
267 | 267 | // Update the bigbluebuttonbn_log table |
268 | - if ( $dbman->field_exists($table, $field) ) { |
|
269 | - $dbman->rename_field($table, $field, 'log', $continue=true, $feedback=true); |
|
268 | + if ($dbman->field_exists($table, $field)) { |
|
269 | + $dbman->rename_field($table, $field, 'log', $continue = true, $feedback = true); |
|
270 | 270 | } |
271 | 271 | // Rename bigbluebuttonbn_log table to bigbluebuttonbn_logs |
272 | - $dbman->rename_table($table, 'bigbluebuttonbn_logs', $continue=true, $feedback=true); |
|
272 | + $dbman->rename_table($table, 'bigbluebuttonbn_logs', $continue = true, $feedback = true); |
|
273 | 273 | } else { |
274 | 274 | // It was already renamed, select it only |
275 | 275 | $table = new xmldb_table('bigbluebuttonbn_logs'); |
276 | 276 | // Update the bigbluebuttonbn_logs table |
277 | - if ( $dbman->field_exists($table, $field) ) { |
|
278 | - $dbman->rename_field($table, $field, 'log', $continue=true, $feedback=true); |
|
277 | + if ($dbman->field_exists($table, $field)) { |
|
278 | + $dbman->rename_field($table, $field, 'log', $continue = true, $feedback = true); |
|
279 | 279 | } |
280 | 280 | } |
281 | 281 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | * @return string |
39 | 39 | */ |
40 | 40 | public function get_description() { |
41 | - $a = (object) array('userid' => $this->userid, 'bigbluebuttonbnid' => $this->objectid, 'courseid' => $this->contextinstanceid); |
|
41 | + $a = (object)array('userid' => $this->userid, 'bigbluebuttonbnid' => $this->objectid, 'courseid' => $this->contextinstanceid); |
|
42 | 42 | return get_string('event_meeting_ended_description', 'bigbluebuttonbn', $a); |
43 | 43 | } |
44 | 44 |