Merge lp:~dangarner/xibo/server-141 into lp:~xibo-maintainers/xibo/d-arrest

Proposed by Dan Garner
Status: Merged
Merged at revision: 263
Proposed branch: lp:~dangarner/xibo/server-141
Merge into: lp:~xibo-maintainers/xibo/d-arrest
Diff against target: 371 lines (+96/-24) (has conflicts)
14 files modified
server/install/database/50.php (+26/-0)
server/install/database/51.sql (+6/-0)
server/lib/include.php (+5/-0)
server/lib/js/layout.js (+15/-15)
server/lib/modules/module.class.php (+3/-1)
server/lib/pages/display.class.php (+1/-1)
server/lib/pages/module.class.php (+19/-5)
server/modules/counter.module.php (+3/-0)
server/modules/datasetview.module.php (+3/-2)
server/modules/image.module.php (+3/-0)
server/modules/shellcommand.module.php (+3/-0)
server/modules/text.module.php (+3/-0)
server/modules/ticker.module.php (+3/-0)
server/modules/webpage.module.php (+3/-0)
Text conflict in server/lib/include.php
To merge this branch: bzr merge lp:~dangarner/xibo/server-141
Reviewer Review Type Date Requested Status
Xibo Maintainters Pending
Review via email: mp+137429@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=== added file 'server/install/database/50.php'
2--- server/install/database/50.php 1970-01-01 00:00:00 +0000
3+++ server/install/database/50.php 2012-12-02 17:37:34 +0000
4@@ -0,0 +1,26 @@
5+<?php
6+
7+class Step50 extends UpgradeStep
8+{
9+
10+ public function Boot()
11+ {
12+ global $db;
13+
14+ // Get a list of all pagegroups assigned to groups
15+ if (!$results = $db->GetArray("SELECT DISTINCT groupid, pages.pagegroupid FROM `lkpagegroup` INNER JOIN pages ON lkpagegroup.pageid = pages.pageid"))
16+ return true;
17+
18+ foreach($results as $page)
19+ {
20+ // Delete it
21+ $db->query("DELETE FROM lkpagegroup WHERE groupid = " . $page['groupid'] . " AND pageID IN (SELECT pageid FROM pages WHERE pagegroupid = " . $page['pagegroupid'] . ")");
22+
23+ // Re-add it
24+ $db->query("INSERT INTO lkpagegroup (groupID, pageID) SELECT " . $page['groupid'] . ", pageid FROM pages WHERE pagegroupid = " . $page['pagegroupid']);
25+ }
26+
27+ return true;
28+ }
29+}
30+?>
31
32=== added file 'server/install/database/51.sql'
33--- server/install/database/51.sql 1970-01-01 00:00:00 +0000
34+++ server/install/database/51.sql 2012-12-02 17:37:34 +0000
35@@ -0,0 +1,6 @@
36+
37+ALTER TABLE `module` ADD `PreviewEnabled` TINYINT NOT NULL DEFAULT '1';
38+
39+UPDATE `version` SET `app_ver` = '1.4.1', `XmdsVersion` = 3;
40+UPDATE `setting` SET `value` = 0 WHERE `setting` = 'PHONE_HOME_DATE';
41+UPDATE `version` SET `DBVersion` = '51';
42\ No newline at end of file
43
44=== modified file 'server/lib/include.php'
45--- server/lib/include.php 2012-10-27 12:55:10 +0000
46+++ server/lib/include.php 2012-12-02 17:37:34 +0000
47@@ -108,8 +108,13 @@
48 Config::Version($db);
49
50 // Does the version in the DB match the version of the code?
51+<<<<<<< TREE
52 if (DBVERSION != '60')
53 die(sprintf('Incompatible database version detected. Please ensure your database and website versions match. You have %d and the website for %d', DBVERSION, 60));
54+=======
55+if (DBVERSION != '51')
56+ die(sprintf('Incompatible database version detected. Please ensure your database and website versions match. You have %d and the website for %d', DBVERSION, 51));
57+>>>>>>> MERGE-SOURCE
58
59 // What is the production mode of the server?
60 if(Config::GetSetting($db, 'SERVER_MODE') == 'Test') ini_set('display_errors', 1);
61
62=== modified file 'server/lib/js/layout.js'
63--- server/lib/js/layout.js 2012-10-13 19:39:08 +0000
64+++ server/lib/js/layout.js 2012-12-02 17:37:34 +0000
65@@ -45,8 +45,6 @@
66
67 var XiboTimelineSaveOrder = function(mediaListId, layoutId, regionId) {
68
69- //console.log(mediaListId);
70-
71 // Load the media id's into an array
72 var mediaList = "";
73
74@@ -54,8 +52,6 @@
75 mediaList = mediaList + $(this).attr("mediaid") + "&" + $(this).attr("lkid") + "|";
76 });
77
78- //console.log("Media List: " + mediaList);
79-
80 // Call the server to do the reorder
81 $.ajax({
82 type:"post",
83@@ -87,22 +83,28 @@
84 });
85
86 $(this).sortable('cancel');
87- },
88- revert: true
89+ }
90 }).disableSelection();
91
92 $("#LibraryAssignSortable").sortable({
93- dropOnEmpty: true
94+ connectWith: '.connectedSortable',
95+ dropOnEmpty: true,
96+ remove: function(event, ui) {
97+ ui.item.remove();
98+ }
99 }).disableSelection();
100
101+ $(".li-sortable", "#LibraryAssignSortable").dblclick(function(e){
102+ $(this).remove();
103+ });
104+
105 $(".li-sortable", "#LibraryAvailableSortable").dblclick(function(e){
106 var otherList = $($(e.currentTarget).parent().sortable("option","connectWith")).not($(e.currentTarget).parent());
107-
108- otherList.append($(e.currentTarget).clone());
109- });
110-
111- $(".li-sortable", "#LibraryAssignSortable").dblclick(function(e){
112- $(this).remove();
113+ var clone = $(e.currentTarget).clone().dblclick(function(e){
114+ $(this).remove();
115+ });
116+
117+ otherList.append(clone);
118 });
119 }
120
121@@ -113,8 +115,6 @@
122
123 mediaList = mediaList + "&regionid=" + regionId;
124
125- console.log(mediaList);
126-
127 $.ajax({
128 type: "post",
129 url: "index.php?p=layout&q=AddFromLibrary&layoutid="+layoutId+"&ajax=true",
130
131=== modified file 'server/lib/modules/module.class.php'
132--- server/lib/modules/module.class.php 2012-09-12 19:58:41 +0000
133+++ server/lib/modules/module.class.php 2012-12-02 17:37:34 +0000
134@@ -42,7 +42,8 @@
135 protected $lkid;
136 protected $validExtensions;
137 protected $validExtensionsText;
138-
139+ protected $previewEnabled;
140+
141 protected $xml;
142
143 protected $existingMedia;
144@@ -128,6 +129,7 @@
145 $this->validExtensionsText = Kit::ValidateParam($row['ValidExtensions'], _STRING);
146 $this->validExtensions = explode(',', $this->validExtensionsText);
147 $this->validExtensionsText = str_replace(',', ', ', $this->validExtensionsText);
148+ $this->previewEnabled = Kit::ValidateParam($row['PreviewEnabled'], _INT);
149
150 return true;
151 }
152
153=== modified file 'server/lib/pages/display.class.php'
154--- server/lib/pages/display.class.php 2012-09-16 14:50:02 +0000
155+++ server/lib/pages/display.class.php 2012-12-02 17:37:34 +0000
156@@ -233,7 +233,7 @@
157 $emailHelp = $helpManager->HelpIcon(__("Do you want to be notified by email if there is a problem with this display?"), true);
158 $alertHelp = $helpManager->HelpIcon(__("How long in minutes after the display last connected to the webservice should we send an alert. Set this value higher than the collection interval on the client. Set to 0 to use global default."), true);
159 $wolHelp = $helpManager->HelpIcon(__('Wake on Lan requires the correct network configuration to route the magic packet to the display PC'), true);
160- $wolTimeHelp = $helpManager->HelpIcon(_('The time this display should receive the WOL command, using the 24hr clock - e.g. 19:00. Maintenance must be enabled.'), true);
161+ $wolTimeHelp = $helpManager->HelpIcon(__('The time this display should receive the WOL command, using the 24hr clock - e.g. 19:00. Maintenance must be enabled.'), true);
162
163 // List of layouts
164 $layoutList = Kit::SelectList('defaultlayoutid', $this->user->LayoutList(), 'layoutid', 'layout', $layoutid);
165
166=== modified file 'server/lib/pages/module.class.php'
167--- server/lib/pages/module.class.php 2012-09-10 19:36:42 +0000
168+++ server/lib/pages/module.class.php 2012-12-02 17:37:34 +0000
169@@ -124,7 +124,8 @@
170 $SQL .= ' Description, ';
171 $SQL .= ' RegionSpecific, ';
172 $SQL .= ' ValidExtensions, ';
173- $SQL .= ' ImageUri ';
174+ $SQL .= ' ImageUri, ';
175+ $SQL .= ' PreviewEnabled ';
176 $SQL .= ' FROM `module` ';
177 $SQL .= ' ORDER BY Name ';
178
179@@ -142,6 +143,7 @@
180 $output .= ' <th>' . __('Library Media') .'</th>';
181 $output .= ' <th>' . __('Valid Extensions') .'</th>';
182 $output .= ' <th>' . __('Image Uri') .'</th>';
183+ $output .= ' <th>' . __('Preview Enabled') .'</th>';
184 $output .= ' <th>' . __('Enabled') .'</th>';
185 $output .= ' <th>' . __('Actions') .'</th>';
186 $output .= ' </tr>';
187@@ -156,6 +158,7 @@
188 $isRegionSpecific = Kit::ValidateParam($module['RegionSpecific'], _INT);
189 $validExtensions = Kit::ValidateParam($module['ValidExtensions'], _STRING);
190 $imageUri = Kit::ValidateParam($module['ImageUri'], _STRING);
191+ $previewEnabled = Kit::ValidateParam($module['PreviewEnabled'], _INT);
192 $enabled = Kit::ValidateParam($module['Enabled'], _INT);
193
194 $output .= '<tr>';
195@@ -164,6 +167,7 @@
196 $output .= '<td>' . (($isRegionSpecific == 0) ? '<img src="img/act.gif" />' : '') . '</td>';
197 $output .= '<td>' . $validExtensions . '</td>';
198 $output .= '<td>' . $imageUri . '</td>';
199+ $output .= '<td>' . (($previewEnabled == 1) ? '<img src="img/act.gif" />' : '<img src="img/disact.gif" />') . '</td>';
200 $output .= '<td>' . (($enabled == 1) ? '<img src="img/act.gif" />' : '<img src="img/disact.gif" />') . '</td>';
201 $output .= '<td>' . ((Config::GetSetting($db, 'MODULE_CONFIG_LOCKED_CHECKB') == 'Checked') ? __('Modufle Config Locked') : '<button class="XiboFormButton" href="index.php?p=module&q=EditForm&ModuleID=' . $moduleId . '"><span>' . __('Edit') . '</span></button>') . '</td>';
202 $output .= '</tr>';
203@@ -196,7 +200,8 @@
204 $SQL .= ' Description, ';
205 $SQL .= ' RegionSpecific, ';
206 $SQL .= ' ValidExtensions, ';
207- $SQL .= ' ImageUri ';
208+ $SQL .= ' ImageUri, ';
209+ $SQL .= ' PreviewEnabled ';
210 $SQL .= ' FROM `module` ';
211 $SQL .= ' WHERE ModuleID = %d ';
212
213@@ -213,24 +218,28 @@
214 $isRegionSpecific = Kit::ValidateParam($row['RegionSpecific'], _INT);
215 $enabled = Kit::ValidateParam($row['Enabled'], _INT);
216 $enabledChecked = ($enabled) ? 'checked' : '';
217+ $previewEnabled = Kit::ValidateParam($row['PreviewEnabled'], _INT);
218+ $previewEnabledChecked = ($previewEnabled) ? 'checked' : '';
219
220 // Help UI
221 $iconModuleExtensions = $helpManager->HelpIcon(__('The Extensions allowed on files uploaded using this module. Comma Seperated.'), true);
222 $iconModuleImage = $helpManager->HelpIcon(__('The Image to display for this module'), true);
223 $iconModuleEnabled = $helpManager->HelpIcon(__('When Enabled users will be able to add media using this module'), true);
224+ $iconModulePreviewEnabled = $helpManager->HelpIcon(__('When Enabled users will be able to see a preview in the layout designer'), true);
225
226 $msgSave = __('Save');
227 $msgCancel = __('Cancel');
228
229 $msgModuleExtensions = __('Valid Extensions');
230 $msgModuleImage = __('Image');
231+ $msgModulePreviewEnabled = __('Preview Enabled');
232 $msgModuleEnabled = __('Enabled');
233
234 // The valid extensions field is only for library media
235 $validExtensionsField = <<<END
236 <tr>
237 <td>$msgModuleExtensions</td>
238- <td>$iconModuleExtensions <input class="required" type="text" name="ValidExtensions" value="$validExtensions" maxlength="254"></td>
239+ <td>$iconModuleExtensions <input type="text" name="ValidExtensions" value="$validExtensions" maxlength="254"></td>
240 </tr>
241 END;
242
243@@ -246,6 +255,10 @@
244 <td>$iconModuleImage <input class="required" type="text" name="ImageUri" value="$imageUri" maxlength="254"></td>
245 </tr>
246 <tr>
247+ <td>$msgModulePreviewEnabled</span></td>
248+ <td>$iconModulePreviewEnabled <input type="checkbox" name="PreviewEnabled" $previewEnabledChecked></td>
249+ </tr>
250+ <tr>
251 <td>$msgModuleEnabled</span></td>
252 <td>$iconModuleEnabled <input type="checkbox" name="Enabled" $enabledChecked></td>
253 </tr>
254@@ -272,6 +285,7 @@
255 $moduleId = Kit::GetParam('ModuleID', _POST, _INT);
256 $validExtensions = Kit::GetParam('ValidExtensions', _POST, _STRING, '');
257 $imageUri = Kit::GetParam('ImageUri', _POST, _STRING);
258+ $previewEnabled = Kit::GetParam('PreviewEnabled', _POST, _CHECKBOX);
259 $enabled = Kit::GetParam('Enabled', _POST, _CHECKBOX);
260
261 // Validation
262@@ -282,8 +296,8 @@
263 trigger_error(__('Image Uri is a required field.'), E_USER_ERROR);
264
265 // Deal with the Edit
266- $SQL = "UPDATE `module` SET ImageUri = '%s', ValidExtensions = '%s', Enabled = %d WHERE ModuleID = %d";
267- $SQL = sprintf($SQL, $db->escape_string($imageUri), $db->escape_string($validExtensions), $enabled, $moduleId);
268+ $SQL = "UPDATE `module` SET ImageUri = '%s', ValidExtensions = '%s', PreviewEnabled = %d, Enabled = %d WHERE ModuleID = %d";
269+ $SQL = sprintf($SQL, $db->escape_string($imageUri), $db->escape_string($validExtensions), $previewEnabled, $enabled, $moduleId);
270
271 if (!$db->query($SQL))
272 {
273
274=== modified file 'server/modules/counter.module.php'
275--- server/modules/counter.module.php 2011-08-09 20:48:36 +0000
276+++ server/modules/counter.module.php 2012-12-02 17:37:34 +0000
277@@ -307,6 +307,9 @@
278
279 public function Preview($width, $height)
280 {
281+ if ($this->previewEnabled == 0)
282+ return parent::Preview ($width, $height);
283+
284 $regionid = $this->regionid;
285
286 // Get the text out of RAW
287
288=== modified file 'server/modules/datasetview.module.php'
289--- server/modules/datasetview.module.php 2012-06-09 18:25:50 +0000
290+++ server/modules/datasetview.module.php 2012-12-02 17:37:34 +0000
291@@ -398,8 +398,9 @@
292
293 public function Preview($width, $height)
294 {
295- $db =& $this->db;
296-
297+ if ($this->previewEnabled == 0)
298+ return parent::Preview ($width, $height);
299+
300 // Show a preview of the data set table output.
301 return $this->DataSetTableHtml();
302 }
303
304=== modified file 'server/modules/image.module.php'
305--- server/modules/image.module.php 2012-04-14 13:28:20 +0000
306+++ server/modules/image.module.php 2012-12-02 17:37:34 +0000
307@@ -111,6 +111,9 @@
308
309 public function Preview($width, $height)
310 {
311+ if ($this->previewEnabled == 0)
312+ return parent::Preview ($width, $height);
313+
314 // Show the image - scaled to the aspect ratio of this region (get from GET)
315 return sprintf('<div style="text-align:center;"><img src="index.php?p=module&q=GetImage&id=%d&width=%d&height=%d&dynamic" /></div>', $this->mediaid, $width, $height);
316 }
317
318=== modified file 'server/modules/shellcommand.module.php'
319--- server/modules/shellcommand.module.php 2012-06-02 10:23:52 +0000
320+++ server/modules/shellcommand.module.php 2012-12-02 17:37:34 +0000
321@@ -245,6 +245,9 @@
322
323 public function Preview($width, $height)
324 {
325+ if ($this->previewEnabled == 0)
326+ return parent::Preview ($width, $height);
327+
328 $msgWindows = __('Windows Command');
329 $msgLinux = __('Linux Command');
330
331
332=== modified file 'server/modules/text.module.php'
333--- server/modules/text.module.php 2012-07-06 07:15:39 +0000
334+++ server/modules/text.module.php 2012-12-02 17:37:34 +0000
335@@ -325,6 +325,9 @@
336 */
337 public function Preview($width, $height)
338 {
339+ if ($this->previewEnabled == 0)
340+ return parent::Preview ($width, $height);
341+
342 $layoutId = $this->layoutid;
343 $regionId = $this->regionid;
344
345
346=== modified file 'server/modules/ticker.module.php'
347--- server/modules/ticker.module.php 2012-07-06 07:15:39 +0000
348+++ server/modules/ticker.module.php 2012-12-02 17:37:34 +0000
349@@ -468,6 +468,9 @@
350 */
351 public function Preview($width, $height)
352 {
353+ if ($this->previewEnabled == 0)
354+ return parent::Preview ($width, $height);
355+
356 $layoutId = $this->layoutid;
357 $regionId = $this->regionid;
358
359
360=== modified file 'server/modules/webpage.module.php'
361--- server/modules/webpage.module.php 2012-07-07 10:40:43 +0000
362+++ server/modules/webpage.module.php 2012-12-02 17:37:34 +0000
363@@ -337,6 +337,9 @@
364 */
365 public function Preview($width, $height)
366 {
367+ if ($this->previewEnabled == 0)
368+ return parent::Preview ($width, $height);
369+
370 $layoutId = $this->layoutid;
371 $regionId = $this->regionid;
372

Subscribers

People subscribed via source and target branches

to all changes: