summaryrefslogtreecommitdiffstats
path: root/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php
diff options
context:
space:
mode:
authorDirk Riestere2017-03-02 14:13:21 +0100
committerDirk Riestere2017-03-02 14:13:21 +0100
commitb0a7bae8695d277d5cdf90f215cedb9a65d539fe (patch)
treeb6cdbf8cdf71bd23c1787ff08f8e8b154a365300 /modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php
parentKlasse extends jetzt auch wieder CourseBackend (diff)
downloadslx-admin-b0a7bae8695d277d5cdf90f215cedb9a65d539fe.tar.gz
slx-admin-b0a7bae8695d277d5cdf90f215cedb9a65d539fe.tar.xz
slx-admin-b0a7bae8695d277d5cdf90f215cedb9a65d539fe.zip
Das HisInOne Backend funktioniert nun auch mit OpenCourseService
Diffstat (limited to 'modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php')
-rw-r--r--modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php45
1 files changed, 34 insertions, 11 deletions
diff --git a/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php b/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php
index daaeacda..d126e674 100644
--- a/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php
+++ b/modules-available/locationinfo/inc/coursebackend/coursebackend_hisinone.inc.php
@@ -5,6 +5,7 @@ class CourseBackend_HisInOne extends CourseBackend
private $username;
private $password;
private $location;
+ private $open;
public $serverID;
//Sets the location and the login information of this client
@@ -13,7 +14,13 @@ class CourseBackend_HisInOne extends CourseBackend
$data = json_decode($json, TRUE);
$this->password = $data['password'];
$this->username = $data['username']."\t".$data['role'];
- $this->location = $location."/qisserver/services2/CourseService";
+ $this->open = $data['Open'];
+ if($this->open){
+ $this->location = $location."/qisserver/services2/OpenCourseService";
+ }
+ else{
+ $this->location = $location."/qisserver/services2/CourseService";
+ }
$this->serverID = $serverID;
}
@@ -36,7 +43,7 @@ class CourseBackend_HisInOne extends CourseBackend
}
public function getCredentials() {
- $credentials = ["username" => "string", "role" =>"string","password"=>"string"];
+ $credentials = ["username" => "string", "role" =>"string","password"=>"string","open"=>"boolean"];
return $credentials;
}
@@ -78,10 +85,14 @@ class CourseBackend_HisInOne extends CourseBackend
$doc->formatOutput = true;
$envelope = $doc->createElementNS('http://schemas.xmlsoap.org/soap/envelope/', 'SOAP-ENV:Envelope');
$doc->appendChild($envelope);
- $envelope->setAttributeNS('http://www.w3.org/2000/xmlns/' ,'xmlns:ns1', 'http://www.his.de/ws/courseService');
-
- $header = $this->getHeader($doc);
- $envelope->appendChild($header);
+ if($this->Open){
+ $envelope->setAttributeNS('http://www.w3.org/2000/xmlns/' ,'xmlns:ns1', 'http://www.his.de/ws/OpenCourseService');
+ }
+ else{
+ $envelope->setAttributeNS('http://www.w3.org/2000/xmlns/' ,'xmlns:ns1', 'http://www.his.de/ws/CourseService');
+ $header = $this->getHeader($doc);
+ $envelope->appendChild($header);
+ }
//Body of the request
$body = $doc->createElement('SOAP-ENV:Body');
$envelope->appendChild($body);
@@ -108,7 +119,15 @@ class CourseBackend_HisInOne extends CourseBackend
else{
$this->error = false;
}
- $id = $respons2['soapenvBody']['hisfindUnitResponse']['hisunitIds']['hisid'];
+ if($this->open){
+ $units = $respons2['soapenvBody']['hisfindUnitResponse']['hisunits'];
+ foreach ($units as $unit) {
+ $id[]= $unit['hisid'];
+ }
+ }
+ else{
+ $id = $respons2['soapenvBody']['hisfindUnitResponse']['hisunitIds']['hisid'];
+ }
return $id;
}
@@ -119,10 +138,14 @@ class CourseBackend_HisInOne extends CourseBackend
$doc->formatOutput = true;
$envelope = $doc->createElementNS('http://schemas.xmlsoap.org/soap/envelope/', 'SOAP-ENV:Envelope');
$doc->appendChild($envelope);
- $envelope->setAttributeNS('http://www.w3.org/2000/xmlns/' ,'xmlns:ns1', 'http://www.his.de/ws/courseService');
-
- $header = $this->getHeader($doc);
- $envelope->appendChild($header);
+ if($this->Open){
+ $envelope->setAttributeNS('http://www.w3.org/2000/xmlns/' ,'xmlns:ns1', 'http://www.his.de/ws/OpenCourseService');
+ }
+ else{
+ $envelope->setAttributeNS('http://www.w3.org/2000/xmlns/' ,'xmlns:ns1', 'http://www.his.de/ws/CourseService');
+ $header = $this->getHeader($doc);
+ $envelope->appendChild($header);
+ }
//body of the request
$body = $doc->createElement('SOAP-ENV:Body');
$envelope->appendChild($body);