Merge lp:~dangarner/xibo/server-668068 into lp:xibo/1.2

Proposed by Dan Garner
Status: Merged
Merged at revision: 202
Proposed branch: lp:~dangarner/xibo/server-668068
Merge into: lp:xibo/1.2
Diff against target: 91 lines (+22/-7)
3 files modified
server/lib/data/display.data.class.php (+11/-5)
server/lib/data/displaygroup.data.class.php (+9/-0)
server/lib/pages/display.class.php (+2/-2)
To merge this branch: bzr merge lp:~dangarner/xibo/server-668068
Reviewer Review Type Date Requested Status
Xibo Maintainters Pending
Review via email: mp+44924@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'server/lib/data/display.data.class.php'
2--- server/lib/data/display.data.class.php 2010-09-18 15:40:51 +0000
3+++ server/lib/data/display.data.class.php 2010-12-30 21:37:13 +0000
4@@ -61,10 +61,10 @@
5 $SQL .= " ) ";
6 $SQL .= " VALUES ";
7 $SQL .= " ( ";
8- $SQL .= sprintf(" '%s', ", $display);
9+ $SQL .= sprintf(" '%s', ", $db->escape_string($display));
10 $SQL .= " 0 , ";
11 $SQL .= " 1 , ";
12- $SQL .= sprintf(" '%s', ", $license);
13+ $SQL .= sprintf(" '%s', ", $db->escape_string($license));
14 $SQL .= " 0 , ";
15 $SQL .= " 0 , ";
16 $SQL .= " 1 , ";
17@@ -166,9 +166,7 @@
18
19 Debug::LogEntry($db, 'audit', 'IN', 'DisplayGroup', 'Delete');
20
21- //TODO: Need to put some logic in here that tests whether or not we ought to be able to delete this display.
22-
23- // Pass over to the DisplayGroup data class so that it can try and delete the
24+ // Pass over to the DisplayGroup data class so that it can try and delete the
25 // display specific group first (it is that group which is linked to schedules)
26 $displayGroupObject = new DisplayGroup($db);
27
28@@ -179,6 +177,14 @@
29
30 return false;
31 }
32+
33+ // Delete the blacklist
34+ $SQL = sprintf("DELETE FROM blacklist WHERE DisplayID = %d", $displayID);
35+
36+ Debug::LogEntry($db, 'audit', $SQL);
37+
38+ if (!$db->query($SQL))
39+ return $this->SetError(25016,__('Unable to delete blacklist records.'));
40
41 // Now we know the Display Group is gone - and so are any links
42 // delete the display
43
44=== modified file 'server/lib/data/displaygroup.data.class.php'
45--- server/lib/data/displaygroup.data.class.php 2010-09-18 15:40:51 +0000
46+++ server/lib/data/displaygroup.data.class.php 2010-12-30 21:37:13 +0000
47@@ -25,6 +25,7 @@
48 public function __construct(database $db)
49 {
50 include_once('lib/data/schedule.data.class.php');
51+ include_once('lib/data/displaygroupsecurity.data.class.php');
52
53 parent::__construct($db);
54 }
55@@ -189,6 +190,14 @@
56
57 return false;
58 }
59+
60+ // Delete this display groups link to any groups
61+ $SQL = sprintf("DELETE FROM lkgroupdg WHERE DisplayGroupId = %d", $displayGroupID);
62+
63+ Debug::LogEntry($db, 'audit', $SQL);
64+
65+ if (!$db->query($SQL))
66+ return $this->SetError(25016,__('Unable to delete Display Group Links.'));
67
68 // Delete the Display Group Itself
69 if (!$this->Delete($displayGroupID))
70
71=== modified file 'server/lib/pages/display.class.php'
72--- server/lib/pages/display.class.php 2010-07-31 22:40:44 +0000
73+++ server/lib/pages/display.class.php 2010-12-30 21:37:13 +0000
74@@ -1,7 +1,7 @@
75 <?php
76 /*
77 * Xibo - Digitial Signage - http://www.xibo.org.uk
78- * Copyright (C) 2006,2007,2008 Daniel Garner and James Packer
79+ * Copyright (C) 2006-2010 Daniel Garner and James Packer
80 *
81 * This file is part of Xibo.
82 *
83@@ -598,7 +598,7 @@
84 $helpManager = new HelpManager($db, $user);
85
86 // Output the delete form
87- $msgInfo = __('You will only be able to delete this display if there is no associated information contained in Xibo.');
88+ $msgInfo = __('Deleting a display cannot be undone.');
89 $msgWarn = __('Are you sure you want to delete this display?');
90 $msgYes = __('Yes');
91 $msgNo = __('No');

Subscribers

People subscribed via source and target branches