Status: | Merged | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Approved by: | Dan Garner | ||||||||||||
Approved revision: | 9 | ||||||||||||
Merged at revision: | not available | ||||||||||||
Proposed branch: | lp:~dangarner/xibo/334359 | ||||||||||||
Merge into: | lp:xibo/1.0 | ||||||||||||
Diff against target: | None lines | ||||||||||||
To merge this branch: | bzr merge lp:~dangarner/xibo/334359 | ||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Dan Garner | Approve | ||
Review via email: mp+4024@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Dan Garner (dangarner) wrote : | # |
Revision history for this message
Dan Garner (dangarner) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'server/modules/flash.module.php' |
2 | --- server/modules/flash.module.php 2009-01-11 18:20:19 +0000 |
3 | +++ server/modules/flash.module.php 2009-02-27 19:30:45 +0000 |
4 | @@ -504,7 +504,7 @@ |
5 | |
6 | // Other properties |
7 | $name = Kit::GetParam('name', _POST, _STRING); |
8 | - $duration = Kit::GetParam('duration', _POST, _INT, 1); |
9 | + $duration = Kit::GetParam('duration', _POST, _INT, 0); |
10 | $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1); |
11 | |
12 | if ($name == '') $name = Kit::ValidateParam($fileName, _FILENAME); |
13 | @@ -525,6 +525,13 @@ |
14 | return $this->response; |
15 | } |
16 | |
17 | + if ($duration == 0) |
18 | + { |
19 | + $this->response->SetError('You must enter a duration.'); |
20 | + $this->response->keepOpen = true; |
21 | + return $this->response; |
22 | + } |
23 | + |
24 | // Ensure the name is not already in the database |
25 | $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d", $db->escape_string($name), $userid); |
26 | |
27 | @@ -653,7 +660,7 @@ |
28 | |
29 | // Other properties |
30 | $name = Kit::GetParam('name', _POST, _STRING); |
31 | - $duration = Kit::GetParam('duration', _POST, _INT, 1); |
32 | + $duration = Kit::GetParam('duration', _POST, _INT, 0); |
33 | $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1); |
34 | |
35 | if ($name == '') |
36 | @@ -678,6 +685,13 @@ |
37 | return $this->response; |
38 | } |
39 | |
40 | + if ($duration == 0) |
41 | + { |
42 | + $this->response->SetError('You must enter a duration.'); |
43 | + $this->response->keepOpen = true; |
44 | + return $this->response; |
45 | + } |
46 | + |
47 | // Ensure the name is not already in the database |
48 | $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d AND mediaid <> %d ", $db->escape_string($name), $userid, $mediaid); |
49 | |
50 | @@ -804,6 +818,18 @@ |
51 | |
52 | // Stored As from the XML |
53 | $this->uri = $this->GetOption('uri'); |
54 | + |
55 | + // Do we need to remove this from a layout? |
56 | + if ($layoutid != '') |
57 | + { |
58 | + // Call base method - which will set up the response |
59 | + parent::DeleteMedia(); |
60 | + } |
61 | + else |
62 | + { |
63 | + // Set this message now in preparation |
64 | + $this->response->message = 'Deleted the Media.'; |
65 | + } |
66 | |
67 | // If we are set to retire we retire |
68 | if ($options == "retire") |
69 | @@ -838,20 +864,8 @@ |
70 | |
71 | $this->DeleteMediaFiles(); |
72 | } |
73 | - |
74 | - // Options |
75 | - if ($layoutid != '') |
76 | - { |
77 | - // Call base method - which will handle the response too |
78 | - return parent::DeleteMedia(); |
79 | - } |
80 | - else |
81 | - { |
82 | - // We want to load a new form |
83 | - $this->response->message = 'Deleted the Media.'; |
84 | - |
85 | - return $this->response; |
86 | - } |
87 | + |
88 | + return $this->response; |
89 | } |
90 | |
91 | /** |
92 | |
93 | === modified file 'server/modules/image.module.php' |
94 | --- server/modules/image.module.php 2009-01-11 17:55:31 +0000 |
95 | +++ server/modules/image.module.php 2009-02-27 19:30:45 +0000 |
96 | @@ -504,7 +504,7 @@ |
97 | |
98 | // Other properties |
99 | $name = Kit::GetParam('name', _POST, _STRING); |
100 | - $duration = Kit::GetParam('duration', _POST, _INT, 1); |
101 | + $duration = Kit::GetParam('duration', _POST, _INT, 0); |
102 | $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1); |
103 | |
104 | if ($name == '') $name = Kit::ValidateParam($fileName, _FILENAME); |
105 | @@ -525,6 +525,13 @@ |
106 | return $this->response; |
107 | } |
108 | |
109 | + if ($duration == 0) |
110 | + { |
111 | + $this->response->SetError('You must enter a duration.'); |
112 | + $this->response->keepOpen = true; |
113 | + return $this->response; |
114 | + } |
115 | + |
116 | // Ensure the name is not already in the database |
117 | $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d", $db->escape_string($name), $userid); |
118 | |
119 | @@ -656,7 +663,7 @@ |
120 | |
121 | // Other properties |
122 | $name = Kit::GetParam('name', _POST, _STRING); |
123 | - $duration = Kit::GetParam('duration', _POST, _INT, 1); |
124 | + $duration = Kit::GetParam('duration', _POST, _INT, 0); |
125 | $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1); |
126 | |
127 | if ($name == '') |
128 | @@ -681,6 +688,13 @@ |
129 | return $this->response; |
130 | } |
131 | |
132 | + if ($duration == 0) |
133 | + { |
134 | + $this->response->SetError('You must enter a duration.'); |
135 | + $this->response->keepOpen = true; |
136 | + return $this->response; |
137 | + } |
138 | + |
139 | // Ensure the name is not already in the database |
140 | $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d AND mediaid <> %d ", $db->escape_string($name), $userid, $mediaid); |
141 | |
142 | @@ -814,6 +828,18 @@ |
143 | |
144 | // Stored As from the XML |
145 | $this->uri = $this->GetOption('uri'); |
146 | + |
147 | + // Do we need to remove this from a layout? |
148 | + if ($layoutid != '') |
149 | + { |
150 | + // Call base method - which will set up the response |
151 | + parent::DeleteMedia(); |
152 | + } |
153 | + else |
154 | + { |
155 | + // Set this message now in preparation |
156 | + $this->response->message = 'Deleted the Media.'; |
157 | + } |
158 | |
159 | // If we are set to retire we retire |
160 | if ($options == "retire") |
161 | @@ -849,19 +875,7 @@ |
162 | $this->DeleteMediaFiles(); |
163 | } |
164 | |
165 | - // Options |
166 | - if ($layoutid != '') |
167 | - { |
168 | - // Call base method - which will handle the response too |
169 | - return parent::DeleteMedia(); |
170 | - } |
171 | - else |
172 | - { |
173 | - // We want to load a new form |
174 | - $this->response->message = 'Deleted the Media.'; |
175 | - |
176 | - return $this->response; |
177 | - } |
178 | + return $this->response; |
179 | } |
180 | |
181 | /** |
182 | |
183 | === modified file 'server/modules/powerpoint.module.php' |
184 | --- server/modules/powerpoint.module.php 2009-01-11 18:20:19 +0000 |
185 | +++ server/modules/powerpoint.module.php 2009-02-27 19:30:45 +0000 |
186 | @@ -504,7 +504,7 @@ |
187 | |
188 | // Other properties |
189 | $name = Kit::GetParam('name', _POST, _STRING); |
190 | - $duration = Kit::GetParam('duration', _POST, _INT, 1); |
191 | + $duration = Kit::GetParam('duration', _POST, _INT, 0); |
192 | $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1); |
193 | |
194 | if ($name == '') $name = Kit::ValidateParam($fileName, _FILENAME); |
195 | @@ -525,6 +525,13 @@ |
196 | return $this->response; |
197 | } |
198 | |
199 | + if ($duration == 0) |
200 | + { |
201 | + $this->response->SetError('You must enter a duration.'); |
202 | + $this->response->keepOpen = true; |
203 | + return $this->response; |
204 | + } |
205 | + |
206 | // Ensure the name is not already in the database |
207 | $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d", $db->escape_string($name), $userid); |
208 | |
209 | @@ -653,7 +660,7 @@ |
210 | |
211 | // Other properties |
212 | $name = Kit::GetParam('name', _POST, _STRING); |
213 | - $duration = Kit::GetParam('duration', _POST, _INT, 1); |
214 | + $duration = Kit::GetParam('duration', _POST, _INT, 0); |
215 | $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1); |
216 | |
217 | if ($name == '') |
218 | @@ -678,6 +685,13 @@ |
219 | return $this->response; |
220 | } |
221 | |
222 | + if ($duration == 0) |
223 | + { |
224 | + $this->response->SetError('You must enter a duration.'); |
225 | + $this->response->keepOpen = true; |
226 | + return $this->response; |
227 | + } |
228 | + |
229 | // Ensure the name is not already in the database |
230 | $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d AND mediaid <> %d ", $db->escape_string($name), $userid, $mediaid); |
231 | |
232 | @@ -804,6 +818,18 @@ |
233 | |
234 | // Stored As from the XML |
235 | $this->uri = $this->GetOption('uri'); |
236 | + |
237 | + // Do we need to remove this from a layout? |
238 | + if ($layoutid != '') |
239 | + { |
240 | + // Call base method - which will set up the response |
241 | + parent::DeleteMedia(); |
242 | + } |
243 | + else |
244 | + { |
245 | + // Set this message now in preparation |
246 | + $this->response->message = 'Deleted the Media.'; |
247 | + } |
248 | |
249 | // If we are set to retire we retire |
250 | if ($options == "retire") |
251 | @@ -838,20 +864,8 @@ |
252 | |
253 | $this->DeleteMediaFiles(); |
254 | } |
255 | - |
256 | - // Options |
257 | - if ($layoutid != '') |
258 | - { |
259 | - // Call base method - which will handle the response too |
260 | - return parent::DeleteMedia(); |
261 | - } |
262 | - else |
263 | - { |
264 | - // We want to load a new form |
265 | - $this->response->message = 'Deleted the Media.'; |
266 | |
267 | - return $this->response; |
268 | - } |
269 | + return $this->response; |
270 | } |
271 | |
272 | /** |
273 | |
274 | === modified file 'server/modules/text.module.php' |
275 | --- server/modules/text.module.php 2009-01-10 14:57:08 +0000 |
276 | +++ server/modules/text.module.php 2009-02-27 19:30:45 +0000 |
277 | @@ -167,7 +167,7 @@ |
278 | |
279 | //Other properties |
280 | $direction = Kit::GetParam('direction', _POST, _WORD, 'none'); |
281 | - $duration = Kit::GetParam('duration', _POST, _INT, 1); |
282 | + $duration = Kit::GetParam('duration', _POST, _INT, 0); |
283 | $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING); |
284 | |
285 | $url = "index.php?p=layout&layoutid=$layoutid®ionid=$regionid&q=RegionOptions"; |
286 | @@ -180,6 +180,13 @@ |
287 | return $this->response; |
288 | } |
289 | |
290 | + if ($duration == 0) |
291 | + { |
292 | + $this->response->SetError('You must enter a duration.'); |
293 | + $this->response->keepOpen = true; |
294 | + return $this->response; |
295 | + } |
296 | + |
297 | // Required Attributes |
298 | $this->mediaid = md5(uniqid()); |
299 | $this->duration = $duration; |
300 | @@ -216,7 +223,7 @@ |
301 | |
302 | //Other properties |
303 | $direction = Kit::GetParam('direction', _POST, _WORD, 'none'); |
304 | - $duration = Kit::GetParam('duration', _POST, _INT, 1); |
305 | + $duration = Kit::GetParam('duration', _POST, _INT, 0); |
306 | $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING); |
307 | |
308 | $url = "index.php?p=layout&layoutid=$layoutid®ionid=$regionid&q=RegionOptions"; |
309 | @@ -229,6 +236,13 @@ |
310 | return $this->response; |
311 | } |
312 | |
313 | + if ($duration == 0) |
314 | + { |
315 | + $this->response->SetError('You must enter a duration.'); |
316 | + $this->response->keepOpen = true; |
317 | + return $this->response; |
318 | + } |
319 | + |
320 | // Required Attributes |
321 | $this->duration = $duration; |
322 | |
323 | |
324 | === modified file 'server/modules/ticker.module.php' |
325 | --- server/modules/ticker.module.php 2009-02-23 19:48:15 +0000 |
326 | +++ server/modules/ticker.module.php 2009-02-27 19:30:45 +0000 |
327 | @@ -178,7 +178,7 @@ |
328 | //Other properties |
329 | $uri = Kit::GetParam('uri', _POST, _URI); |
330 | $direction = Kit::GetParam('direction', _POST, _WORD, 'none'); |
331 | - $duration = Kit::GetParam('duration', _POST, _INT, 1); |
332 | + $duration = Kit::GetParam('duration', _POST, _INT, 0); |
333 | $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING); |
334 | $copyright = Kit::GetParam('copyright', _POST, _STRING); |
335 | |
336 | @@ -200,6 +200,13 @@ |
337 | return $this->response; |
338 | } |
339 | |
340 | + if ($duration == 0) |
341 | + { |
342 | + $this->response->SetError('You must enter a duration.'); |
343 | + $this->response->keepOpen = true; |
344 | + return $this->response; |
345 | + } |
346 | + |
347 | // Required Attributes |
348 | $this->mediaid = md5(uniqid()); |
349 | $this->duration = $duration; |
350 | @@ -240,7 +247,7 @@ |
351 | //Other properties |
352 | $uri = Kit::GetParam('uri', _POST, _URI); |
353 | $direction = Kit::GetParam('direction', _POST, _WORD, 'none'); |
354 | - $duration = Kit::GetParam('duration', _POST, _INT, 1); |
355 | + $duration = Kit::GetParam('duration', _POST, _INT, 0); |
356 | $text = Kit::GetParam('ta_text', _POST, _HTMLSTRING); |
357 | $copyright = Kit::GetParam('copyright', _POST, _STRING); |
358 | |
359 | @@ -262,6 +269,13 @@ |
360 | return $this->response; |
361 | } |
362 | |
363 | + if ($duration == 0) |
364 | + { |
365 | + $this->response->SetError('You must enter a duration.'); |
366 | + $this->response->keepOpen = true; |
367 | + return $this->response; |
368 | + } |
369 | + |
370 | // Required Attributes |
371 | $this->duration = $duration; |
372 | |
373 | |
374 | === modified file 'server/modules/video.module.php' |
375 | --- server/modules/video.module.php 2009-01-11 18:20:19 +0000 |
376 | +++ server/modules/video.module.php 2009-02-27 19:30:45 +0000 |
377 | @@ -504,7 +504,7 @@ |
378 | |
379 | // Other properties |
380 | $name = Kit::GetParam('name', _POST, _STRING); |
381 | - $duration = Kit::GetParam('duration', _POST, _INT, 1); |
382 | + $duration = Kit::GetParam('duration', _POST, _INT, 0); |
383 | $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1); |
384 | |
385 | if ($name == '') $name = Kit::ValidateParam($fileName, _FILENAME); |
386 | @@ -525,6 +525,13 @@ |
387 | return $this->response; |
388 | } |
389 | |
390 | + if ($duration == 0) |
391 | + { |
392 | + $this->response->SetError('You must enter a duration.'); |
393 | + $this->response->keepOpen = true; |
394 | + return $this->response; |
395 | + } |
396 | + |
397 | // Ensure the name is not already in the database |
398 | $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d", $db->escape_string($name), $userid); |
399 | |
400 | @@ -654,7 +661,7 @@ |
401 | |
402 | // Other properties |
403 | $name = Kit::GetParam('name', _POST, _STRING); |
404 | - $duration = Kit::GetParam('duration', _POST, _INT, 1); |
405 | + $duration = Kit::GetParam('duration', _POST, _INT, 0); |
406 | $permissionid = Kit::GetParam('permissionid', _POST, _INT, 1); |
407 | |
408 | if ($name == '') |
409 | @@ -679,6 +686,13 @@ |
410 | return $this->response; |
411 | } |
412 | |
413 | + if ($duration == 0) |
414 | + { |
415 | + $this->response->SetError('You must enter a duration.'); |
416 | + $this->response->keepOpen = true; |
417 | + return $this->response; |
418 | + } |
419 | + |
420 | // Ensure the name is not already in the database |
421 | $SQL = sprintf("SELECT name FROM media WHERE name = '%s' AND userid = %d AND mediaid <> %d ", $db->escape_string($name), $userid, $mediaid); |
422 | |
423 | @@ -805,6 +819,18 @@ |
424 | |
425 | // Stored As from the XML |
426 | $this->uri = $this->GetOption('uri'); |
427 | + |
428 | + // Do we need to remove this from a layout? |
429 | + if ($layoutid != '') |
430 | + { |
431 | + // Call base method - which will set up the response |
432 | + parent::DeleteMedia(); |
433 | + } |
434 | + else |
435 | + { |
436 | + // Set this message now in preparation |
437 | + $this->response->message = 'Deleted the Media.'; |
438 | + } |
439 | |
440 | // If we are set to retire we retire |
441 | if ($options == "retire") |
442 | @@ -839,20 +865,8 @@ |
443 | |
444 | $this->DeleteMediaFiles(); |
445 | } |
446 | - |
447 | - // Options |
448 | - if ($layoutid != '') |
449 | - { |
450 | - // Call base method - which will handle the response too |
451 | - return parent::DeleteMedia(); |
452 | - } |
453 | - else |
454 | - { |
455 | - // We want to load a new form |
456 | - $this->response->message = 'Deleted the Media.'; |
457 | |
458 | - return $this->response; |
459 | - } |
460 | + return $this->response; |
461 | } |
462 | |
463 | /** |
464 | |
465 | === modified file 'server/modules/webpage.module.php' |
466 | --- server/modules/webpage.module.php 2009-01-10 15:24:06 +0000 |
467 | +++ server/modules/webpage.module.php 2009-02-27 19:30:45 +0000 |
468 | @@ -149,7 +149,7 @@ |
469 | |
470 | //Other properties |
471 | $uri = Kit::GetParam('uri', _POST, _URI); |
472 | - $duration = Kit::GetParam('duration', _POST, _INT, 1); |
473 | + $duration = Kit::GetParam('duration', _POST, _INT, 0); |
474 | |
475 | $url = "index.php?p=layout&layoutid=$layoutid®ionid=$regionid&q=RegionOptions"; |
476 | |
477 | @@ -161,6 +161,13 @@ |
478 | return $this->response; |
479 | } |
480 | |
481 | + if ($duration == 0) |
482 | + { |
483 | + $this->response->SetError('You must enter a duration.'); |
484 | + $this->response->keepOpen = true; |
485 | + return $this->response; |
486 | + } |
487 | + |
488 | // Required Attributes |
489 | $this->mediaid = md5(uniqid()); |
490 | $this->duration = $duration; |
491 | @@ -196,7 +203,7 @@ |
492 | |
493 | //Other properties |
494 | $uri = Kit::GetParam('uri', _POST, _URI); |
495 | - $duration = Kit::GetParam('duration', _POST, _INT, 1); |
496 | + $duration = Kit::GetParam('duration', _POST, _INT, 0); |
497 | |
498 | $url = "index.php?p=layout&layoutid=$layoutid®ionid=$regionid&q=RegionOptions"; |
499 | |
500 | @@ -208,6 +215,13 @@ |
501 | return $this->response; |
502 | } |
503 | |
504 | + if ($duration == 0) |
505 | + { |
506 | + $this->response->SetError('You must enter a duration.'); |
507 | + $this->response->keepOpen = true; |
508 | + return $this->response; |
509 | + } |
510 | + |
511 | // Required Attributes |
512 | $this->duration = $duration; |
513 |
Fixed the two bugs as indicated in the Bug reports.