From ebe2b84fa451bb1e72b5618879a5495d4dc1e4ed Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Sat, 26 Nov 2016 11:33:20 -0800 Subject: Fixed a coordination bug which caused rotation bugs. Deleted the locationinfo db and added a setting_location_info all in the install.php --- modules-available/locationinfo/api.inc.php | 6 ++++-- modules-available/locationinfo/install.inc.php | 17 +++++++++++++++++ .../locationinfo/lang/de/template-tags.json | 8 ++++---- .../locationinfo/lang/en/template-tags.json | 8 ++++---- modules-available/locationinfo/templates/config.html | 2 +- 5 files changed, 30 insertions(+), 11 deletions(-) (limited to 'modules-available/locationinfo') 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 @@

-- cgit v1.2.3-55-g7522