summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2017-08-16 18:22:12 +0200
committerSimon Rettberg2017-08-16 18:22:12 +0200
commita92a7cc35115dba2c3a7cf98cb08a9ae0795da5a (patch)
treedb25ac6dacd7d7769c420af854b6a52439b4cd30
parent[sysconfig] Add support to disable fixNumeric hack in ldadp (diff)
downloadslx-admin-a92a7cc35115dba2c3a7cf98cb08a9ae0795da5a.tar.gz
slx-admin-a92a7cc35115dba2c3a7cf98cb08a9ae0795da5a.tar.xz
slx-admin-a92a7cc35115dba2c3a7cf98cb08a9ae0795da5a.zip
[locationinfo] Fix davinci backend connection test, minor tweaks to web view
-rw-r--r--modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php8
-rw-r--r--modules-available/locationinfo/install.inc.php6
-rw-r--r--modules-available/locationinfo/templates/page-panels.html2
3 files changed, 12 insertions, 4 deletions
diff --git a/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php b/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php
index 53617a61..fac3f296 100644
--- a/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php
+++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_davinci.inc.php
@@ -25,7 +25,9 @@ class CourseBackend_Davinci extends CourseBackend
if (empty($this->location)) {
$this->error = "Credentials are not set";
} else {
- $data = $this->fetchRoomRaw('someroomid123');
+ $startDate = new DateTime('today 0:00');
+ $endDate = new DateTime('+7 days 0:00');
+ $data = $this->fetchRoomRaw('someroomid123', $startDate, $endDate);
if ($data !== false && strpos($data, 'DAVINCI SERVER') === false) {
$this->error = "Unknown reply; this doesn't seem to be a DAVINCI server.";
}
@@ -58,7 +60,9 @@ class CourseBackend_Davinci extends CourseBackend
}
/**
- * @param $roomId string name of the room
+ * @param string $roomId unique name of the room, as used by davinci
+ * @param \DateTime $startDate start date to fetch
+ * @param \DateTime $endDate end date of range to fetch
* @return array|bool if successful the arrayrepresentation of the timetable
*/
private function fetchRoomRaw($roomId, $startDate, $endDate)
diff --git a/modules-available/locationinfo/install.inc.php b/modules-available/locationinfo/install.inc.php
index 10422241..7c47ac90 100644
--- a/modules-available/locationinfo/install.inc.php
+++ b/modules-available/locationinfo/install.inc.php
@@ -19,7 +19,8 @@ $t2 = $res[] = tableCreate('locationinfo_coursebackend', '
`servertype` VARCHAR(100) NOT NULL,
`credentials` BLOB,
`error` VARCHAR(500),
- PRIMARY KEY (`serverid`)
+ PRIMARY KEY (`serverid`),
+ KEY `servername` (`servername`)
');
$t3 = $res[] = tableCreate('locationinfo_panel', "
@@ -72,6 +73,9 @@ if ($t3 === UPDATE_NOOP) {
`paneltype` ENUM('DEFAULT', 'SUMMARY', 'URL') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL");
}
+// 2017-07-26 Add servername key
+Database::exec("ALTER TABLE `locationinfo_coursebackend` ADD KEY `servername` (`servername`)");
+
// Create response for browser
if (in_array(UPDATE_RETRY, $res)) {
diff --git a/modules-available/locationinfo/templates/page-panels.html b/modules-available/locationinfo/templates/page-panels.html
index 0c87a70b..f374e456 100644
--- a/modules-available/locationinfo/templates/page-panels.html
+++ b/modules-available/locationinfo/templates/page-panels.html
@@ -34,7 +34,7 @@
</td>
{{#hasRunmode}}
<td>
- <a class="btn btn-default btn-xs" href="?do=runmode&amp;module=locationinfo&amp;modeid={{paneluuid}}">
+ <a class="btn btn-default btn-xs" href="?do=runmode&amp;module=locationinfo&amp;modeid={{paneluuid}}&amp;redirect=?do=locationinfo">
<span class="glyphicon glyphicon-edit"></span>
</a>
{{assignedMachineCount}}