summaryrefslogtreecommitdiffstats
path: root/modules-available
diff options
context:
space:
mode:
authorDirk Riestere2017-02-11 05:18:52 +0100
committerDirk Riestere2017-02-11 05:18:52 +0100
commitf42183951baa8b147c4861b3e1c9649f07d004dc (patch)
tree9a6f5ef37ef03969064c4f20cebb06a9bc7de1a4 /modules-available
parentMerge branch 'location-info-panel' of git.openslx.org:openslx-ng/slx-admin in... (diff)
downloadslx-admin-f42183951baa8b147c4861b3e1c9649f07d004dc.tar.gz
slx-admin-f42183951baa8b147c4861b3e1c9649f07d004dc.tar.xz
slx-admin-f42183951baa8b147c4861b3e1c9649f07d004dc.zip
Letzte Version war leider nicht vollständig was zu Fehlern führt
Diffstat (limited to 'modules-available')
-rw-r--r--modules-available/locationinfo/HisInOneAPI.php32
-rw-r--r--modules-available/locationinfo/timetablerequest.php4
2 files changed, 24 insertions, 12 deletions
diff --git a/modules-available/locationinfo/HisInOneAPI.php b/modules-available/locationinfo/HisInOneAPI.php
index 6593db4b..756b7d2b 100644
--- a/modules-available/locationinfo/HisInOneAPI.php
+++ b/modules-available/locationinfo/HisInOneAPI.php
@@ -2,7 +2,7 @@
interface iTimetableRequest
{
public function getJson($param);
- public function getJsonsl($param);
+ public function getJsons($param);
}
class HisInOneSoapClient implements iTimetableRequest
@@ -146,6 +146,14 @@ class HisInOneSoapClient implements iTimetableRequest
}
return json_encode($timetable);
}
+
+ public function toArray($response){
+ $response = preg_replace("/(<\/?)(\w+):([^>]*>)/", "$1$2$3", $response);
+ $xml = new SimpleXMLElement($response);
+ $array = json_decode(json_encode((array)$xml), TRUE);
+ return $array;
+ }
+
//Request for a timetable with roomids as array
public function getJsons($param){
//get all eventIDs in a given room
@@ -193,19 +201,23 @@ class HisInOneSoapClient implements iTimetableRequest
}
function getCurrentWeekDates()
{
- $startdate = date('Y-m-d');
- $enddate = date('+1 week');
-
-
$DateArray = array();
- $timestamp = strtotime($startdate);
- while ($startdate <= $enddate) {
- $startdate = date('Y-m-d', $timestamp);
- $DateArray[] = $startdate;
- $timestamp = strtotime('+1 days', strtotime($startdate));
+ $startdate = strtotime('Now');
+ for($i=0 ;$i<=7; $i++) {
+ $DateArray[] = date('Y-m-d', strtotime("+ {$i} day", $startdate));
+
}
return $DateArray;
}
}
+
+
+$params = array("planelementId"=>42);
+ try {
+
+ }
+ catch (Exception $ex) {
+ var_dump($ex);
+ }
?>
diff --git a/modules-available/locationinfo/timetablerequest.php b/modules-available/locationinfo/timetablerequest.php
index fb759904..bb65aad9 100644
--- a/modules-available/locationinfo/timetablerequest.php
+++ b/modules-available/locationinfo/timetablerequest.php
@@ -1,5 +1,5 @@
<?php
-
+require 'HisInOneAPI.php';
function fetchNewTimeTable($locationID){
//Get room information
$dbquery1 = Database::simpleQuery("SELECT serverid, serverroomid, lastcalenderupdate FROM location_info WHERE locationid = :id", array('id' => $locationID));
@@ -35,7 +35,7 @@ function fetchNewTimeTable($locationID){
function HisInOneRequest($url,$roomID,$lname,$passwd){
$url = $url."/qisserver/services2/CourseService";
$client = new HisInOneSoapClient($url, $lname, $passwd);
- return $client->giveBackJson($roomID);
+ return $client->getJson($roomID);
} \ No newline at end of file