summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJannik Schönartz2016-11-26 20:33:20 +0100
committerJannik Schönartz2016-11-26 20:33:20 +0100
commitebe2b84fa451bb1e72b5618879a5495d4dc1e4ed (patch)
treef9bf4307e75537c7616647fd3279e8116fcda6a9
parentMerge branch 'location-info-panel' of git.openslx.org:openslx-ng/slx-admin in... (diff)
downloadslx-admin-ebe2b84fa451bb1e72b5618879a5495d4dc1e4ed.tar.gz
slx-admin-ebe2b84fa451bb1e72b5618879a5495d4dc1e4ed.tar.xz
slx-admin-ebe2b84fa451bb1e72b5618879a5495d4dc1e4ed.zip
Fixed a coordination bug which caused rotation bugs. Deleted the locationinfo db and added a setting_location_info all in the install.php
-rw-r--r--modules-available/locationinfo/api.inc.php6
-rw-r--r--modules-available/locationinfo/install.inc.php17
-rw-r--r--modules-available/locationinfo/lang/de/template-tags.json8
-rw-r--r--modules-available/locationinfo/lang/en/template-tags.json8
-rw-r--r--modules-available/locationinfo/templates/config.html2
5 files changed, 30 insertions, 11 deletions
diff --git a/modules-available/locationinfo/api.inc.php b/modules-available/locationinfo/api.inc.php
index e103905f..1e765be0 100644
--- a/modules-available/locationinfo/api.inc.php
+++ b/modules-available/locationinfo/api.inc.php
@@ -66,6 +66,8 @@ function getConfig($locationID) {
while($dbresult=$dbquery->fetch(PDO::FETCH_ASSOC)) {
$config = json_decode($dbresult['config'], true);
$config['room'] = $dbresult['locationname'];
+ $date = getdate();
+ $config['time'] = $date['year'] . "-" . $date['mon'] . "-" . $date['mday'] . " " . $date['hours'] . ":" . $date['minutes'] . ":" . $date['seconds'];
}
if (empty($config)) {
echo json_encode(array());
@@ -181,8 +183,8 @@ function getPcInfos($locationID, $coords) {
if ($coords == '1') {
$position = json_decode($pc['position'], true);
- $computer['x'] = $position['gridRow'];
- $computer['y'] = $position['gridCol'];
+ $computer['x'] = $position['gridCol'];
+ $computer['y'] = $position['gridRow'];
}
$computer['inUse'] = 0;
diff --git a/modules-available/locationinfo/install.inc.php b/modules-available/locationinfo/install.inc.php
index f4eaee1f..f94c725e 100644
--- a/modules-available/locationinfo/install.inc.php
+++ b/modules-available/locationinfo/install.inc.php
@@ -11,8 +11,25 @@ $res[] = tableCreate('location_info', '
PRIMARY KEY (`locationid`)
');
+$res[] = tableCreate('setting_location_info', '
+ `serverid` int(10) NOT NULL AUTO_INCREMENT,
+ `serverurl` VARCHAR(2000) NOT NULL,
+ `servertype` VARCHAR(100) NOT NULL,
+ `login` VARCHAR(100) NOT NULL,
+ `passwd` VARCHAR(150) NOT NULL,
+ PRIMARY KEY (`serverid`)
+');
+
// Create response for browser
+if(tableExists('locationinfo')) {
+ $ret = Database::exec("DROP TABLE `locationinfo`");
+ if ($ret === false) {
+ finalResponse(UPDATE_FAILED, 'Droping table locationinfo failed: ' . Database::lastError());
+ }
+ $res[] = UPDATE_DONE;
+}
+
if (!tableHasColumn('location_info', 'config')) {
$ret = Database::exec("ALTER TABLE `location_info` ADD `config` VARCHAR(2000) NOT NULL DEFAULT '' AFTER `openingtime`");
if ($ret === false) {
diff --git a/modules-available/locationinfo/lang/de/template-tags.json b/modules-available/locationinfo/lang/de/template-tags.json
index eb5121ae..7bf7d7aa 100644
--- a/modules-available/locationinfo/lang/de/template-tags.json
+++ b/modules-available/locationinfo/lang/de/template-tags.json
@@ -44,10 +44,10 @@
"lang_switchTime": "Wechsel Zeit",
"lang_switchTimeTooltip": "[1-120] Die Zeit die vergeht bis ein wechsel erfolgt in modus 4 (in sekunden)",
"lang_rotation": "Rotation",
- "lang_rotation1": "0°",
- "lang_rotation2": "+90°",
- "lang_rotation3": "+180°",
- "lang_rotation4": "-90°",
+ "lang_rotation0": "0°",
+ "lang_rotation1": "+90°",
+ "lang_rotation2": "+180°",
+ "lang_rotation3": "-90°",
"lang_vertical": "Vertikal",
"lang_calupdate": "Kalender update rate",
"lang_calupdateTooltip": "Zeit nachdem der Kalender geupdated wird (in minutes)",
diff --git a/modules-available/locationinfo/lang/en/template-tags.json b/modules-available/locationinfo/lang/en/template-tags.json
index dc8b2920..a9837717 100644
--- a/modules-available/locationinfo/lang/en/template-tags.json
+++ b/modules-available/locationinfo/lang/en/template-tags.json
@@ -44,10 +44,10 @@
"lang_switchTime": "Switchtime",
"lang_switchTimeTooltip": "[1-120] Sets the time between switching in mode 4 (in seconds)",
"lang_rotation": "Rotation",
- "lang_rotation1": "0°",
- "lang_rotation2": "+90°",
- "lang_rotation3": "+180°",
- "lang_rotation4": "-90°",
+ "lang_rotation0": "0°",
+ "lang_rotation1": "+90°",
+ "lang_rotation2": "+180°",
+ "lang_rotation3": "-90°",
"lang_vertical": "Vertical",
"lang_calupdate": "Calendar update rate",
"lang_calupdateTooltip": "Time the calender querys for updates (in minutes)",
diff --git a/modules-available/locationinfo/templates/config.html b/modules-available/locationinfo/templates/config.html
index 0fac50fa..ee30dee3 100644
--- a/modules-available/locationinfo/templates/config.html
+++ b/modules-available/locationinfo/templates/config.html
@@ -42,10 +42,10 @@
<div style="float: left; margin-left: 15px;">
<Label>{{lang_rotation}}</Label><br>
<select name="rotation">
+ <option value="0" id="rotation0">{{lang_rotation0}}</option>
<option value="1" id="rotation1">{{lang_rotation1}}</option>
<option value="2" id="rotation2">{{lang_rotation2}}</option>
<option value="3" id="rotation3">{{lang_rotation3}}</option>
- <option value="4" id="rotation4">{{lang_rotation4}}</option>
</select>
</div>