summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo
diff options
context:
space:
mode:
authorSimon Rettberg2017-12-16 18:33:16 +0100
committerSimon Rettberg2017-12-16 18:33:16 +0100
commitcd55ead3e2810e209b726faca12fa749f6875d0f (patch)
tree94b2f29b023e8a0c5100e1d06c974c3c04f890fd /modules-available/locationinfo
parentMerge branch 'permission-manager' of openslx.org:openslx-ng/slx-admin into pe... (diff)
downloadslx-admin-cd55ead3e2810e209b726faca12fa749f6875d0f.tar.gz
slx-admin-cd55ead3e2810e209b726faca12fa749f6875d0f.tar.xz
slx-admin-cd55ead3e2810e209b726faca12fa749f6875d0f.zip
Fix A LOT of type problems, logic flaws, uninitialized variables etc.
Most of them were found by phpstorm, so I put in some time and went through the list, fixing quite a bunch of them.
Diffstat (limited to 'modules-available/locationinfo')
-rw-r--r--modules-available/locationinfo/frontend/frontendscript.js2
-rw-r--r--modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php2
-rw-r--r--modules-available/locationinfo/inc/locationinfo.inc.php2
-rw-r--r--modules-available/locationinfo/page.inc.php2
-rwxr-xr-xmodules-available/locationinfo/templates/frontend-default.html1
-rw-r--r--modules-available/locationinfo/templates/page-panels.html14
6 files changed, 9 insertions, 14 deletions
diff --git a/modules-available/locationinfo/frontend/frontendscript.js b/modules-available/locationinfo/frontend/frontendscript.js
index cc5c6827..bad6a8ed 100644
--- a/modules-available/locationinfo/frontend/frontendscript.js
+++ b/modules-available/locationinfo/frontend/frontendscript.js
@@ -45,7 +45,7 @@ function toInt(str) {
* @param {Array} globalConfig
* @returns {string} printable time
*/
-function GetTimeDiferenceAsString(a, b, globalConfig = null) {
+function GetTimeDiferenceAsString(a, b, globalConfig) {
if (!a || !b) {
return "";
}
diff --git a/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php b/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php
index adff8b1b..94c967de 100644
--- a/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php
+++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_dummy.inc.php
@@ -137,5 +137,3 @@ class CourseBackend_Dummy extends CourseBackend
}
}
-
-?>
diff --git a/modules-available/locationinfo/inc/locationinfo.inc.php b/modules-available/locationinfo/inc/locationinfo.inc.php
index 2ed3622d..e3d7db3d 100644
--- a/modules-available/locationinfo/inc/locationinfo.inc.php
+++ b/modules-available/locationinfo/inc/locationinfo.inc.php
@@ -11,9 +11,7 @@ class LocationInfo
*/
public static function getPcState($pc)
{
- $logintime = (int)$pc['logintime'];
$lastseen = (int)$pc['lastseen'];
- $lastboot = (int)$pc['lastboot'];
$NOW = time();
if ($pc['state'] === 'OFFLINE' && $NOW - $lastseen > 21 * 86400) {
diff --git a/modules-available/locationinfo/page.inc.php b/modules-available/locationinfo/page.inc.php
index c6aa0860..d4a2b35e 100644
--- a/modules-available/locationinfo/page.inc.php
+++ b/modules-available/locationinfo/page.inc.php
@@ -392,7 +392,7 @@ class Page_LocationInfo extends Page
$credentialsOk = $serverInstance->setCredentials($serverid, json_decode($dbresult['credentials'], true));
if ($credentialsOk) {
- $connectionOk = $serverInstance->checkConnection();
+ $serverInstance->checkConnection();
}
LocationInfo::setServerError($serverid, $serverInstance->getError());
diff --git a/modules-available/locationinfo/templates/frontend-default.html b/modules-available/locationinfo/templates/frontend-default.html
index 92cad055..e457f68d 100755
--- a/modules-available/locationinfo/templates/frontend-default.html
+++ b/modules-available/locationinfo/templates/frontend-default.html
@@ -369,6 +369,7 @@ optional:
</div>
</body>
+<!--suppress RedundantIfStatementJS -->
<script type="text/javascript">
var rooms = {};
var lastRoomUpdate = 0;
diff --git a/modules-available/locationinfo/templates/page-panels.html b/modules-available/locationinfo/templates/page-panels.html
index f374e456..e17b6584 100644
--- a/modules-available/locationinfo/templates/page-panels.html
+++ b/modules-available/locationinfo/templates/page-panels.html
@@ -11,8 +11,8 @@
{{#hasRunmode}}
<th class="slx-smallcol">{{lang_runmodeTHead}}</th>
{{/hasRunmode}}
- <th class="slx-smallcol"></th>
- <th class="slx-smallcol"></th>
+ <th class="slx-smallcol">{{lang_edit}}</th>
+ <th class="slx-smallcol">{{lang_delete}}</th>
</tr>
</thead>
<tbody>
@@ -43,13 +43,11 @@
<td>
<a class="btn btn-default btn-xs" href="?do=locationinfo&amp;show=edit-panel&amp;uuid={{paneluuid}}">
<span class="glyphicon glyphicon-cog"></span>
- {{lang_edit}}
</a>
</td>
<td>
<button type="submit" name="uuid" value="{{paneluuid}}" class="btn btn-danger btn-xs">
<span class="glyphicon glyphicon-trash"></span>
- {{lang_delete}}
</button>
</td>
</tr>
@@ -58,16 +56,16 @@
</tbody>
</table>
-<div>
- <a class="btn btn-sm btn-success" href="?do=locationinfo&amp;show=edit-panel&amp;uuid=new-default">
+<div class="buttonbar text-right">
+ <a class="btn btn-success" href="?do=locationinfo&amp;show=edit-panel&amp;uuid=new-default">
<span class="glyphicon glyphicon-plus"></span>
{{lang_defaultPanel}}
</a>
- <a class="btn btn-sm btn-success" href="?do=locationinfo&amp;show=edit-panel&amp;uuid=new-summary">
+ <a class="btn btn-success" href="?do=locationinfo&amp;show=edit-panel&amp;uuid=new-summary">
<span class="glyphicon glyphicon-plus"></span>
{{lang_summaryPanel}}
</a>
- <a class="btn btn-sm btn-success" href="?do=locationinfo&amp;show=edit-panel&amp;uuid=new-url">
+ <a class="btn btn-success" href="?do=locationinfo&amp;show=edit-panel&amp;uuid=new-url">
<span class="glyphicon glyphicon-plus"></span>
{{lang_urlPanel}}
</a>