Skip to content
Snippets Groups Projects
Commit 98b73d26 authored by Gregor Gawol's avatar Gregor Gawol
Browse files

modified ui

parent 31380ee3
Branches
Tags
No related merge requests found
Pipeline #1781 passed with stage
in 13 seconds
<!-- dbis-module: ajax - dbis -->
<div>
<? if (!empty($this->results)): ?>
<?=print_r($this->results);?>
<div class="openurls">
<ul>
<? /*foreach ($this->results as $result): ?>
<li>
<h3><?=$result['name']?></h3>
</li>
<? unset($result['name']); ?>
<? foreach ($result as $db): ?>
<li>
<a href="<?=$db[0]->getUrl()?>" target="_blank"><?=$db[0]->getHeadline()?></a>
</li>
<? endforeach; ?>
<? endforeach;*/ ?>
</ul>
</div>
<? if (!empty($this->isISIL)): ?>
<?=$this->transEsc('Exemplar in Ihrer Heimatbibliothek vorhanden.');?>
<? else: ?>
<?=$this->transEsc('Nicht in Ihrer Heimatbibliothek vorhanden.');?>
<? endif; ?>
<a href="<?=$this->url?>" target="_blank"><?=$this->transEsc('Mehr Informationen');?></a>
</div>
<!-- dbis-module: ajax - dbis - END -->
\ No newline at end of file
......@@ -119,6 +119,12 @@ class GetBoss extends \VuFind\AjaxHandler\AbstractBase
*/
public function handleRequest(Params $params)
{
if (!isset($this->config->Search)) {
return $this->formatResponse(
'Configuration file boss.ini not found',
self::STATUS_HTTP_BAD_REQUEST
);
}
// if ($patron = $this->ils->patronLogin()) {
//
// // Stop now if the user does not have valid catalog credentials available:
......@@ -129,10 +135,15 @@ class GetBoss extends \VuFind\AjaxHandler\AbstractBase
// $profile['homeLibrary'] : 'AAAAA';
// $this->rlm->checkLibConfig($bibId);
// }
// } else {
// $this->rlm->checkLibConfig('AAAAA');
// }
// Sample BibId
$this->rlm->checkLibConfig('UBL');
$networks = isset($this->config->Network->networks) ?
$this->config->Network->networks->toArray() : [];
$network = $this->rlm->getLibValue('network');
$driver = $this->recordLoader->load(
$params->fromQuery('id'),
......@@ -149,7 +160,7 @@ class GetBoss extends \VuFind\AjaxHandler\AbstractBase
$methodName = "getRequest" . strtoupper($data);
// TODO library network value of configuration
$results = $this->bossClient->$methodName(
$value, $this->rlm->getNetworkValueUpper()
$value, strtoupper($this->rlm->getLibValue('network'))
);
if (!empty($results['data'])) {
break;
......@@ -158,29 +169,35 @@ class GetBoss extends \VuFind\AjaxHandler\AbstractBase
}
// default search of boss
if (empty($results)) {
$author = $driver->tryMethod('getAuthor');
$author = $driver->tryMethod('getCombinedAuthors');
$author = count($author) > 0 ? $author[0] : '';
$title = $driver->tryMethod('getTitle');
$year = $driver->tryMethod('getYear');
$this->bossClient->getRequestQuery(
$year = $driver->tryMethod('getPublishDateSort');
$results = $this->bossClient->getRequestQuery(
$author, $title, $year,
$this->rlm->getNetworkValueUpper()
strtoupper($this->rlm->getLibValue('network'))
);
}
$isilCallNumber = $this->getISILCallNumber($results);
$network = $this->rlm->getNetworkValueLower();
$isilCallNumber = $this->getISILCallNumber($results['data']);
$inArray = in_array($network, $networks);
$isbns = $driver->tryMethod('getISBNs');
$isbns = count($isbns) > 0 ? $isbns[0] : '';
$view = [
'isISIL' => $this->isISIL($isilCallNumber['isils'], $this->rlm->getBossValue()),
'url' => sprintf($this->config->Search->$network, $results['param'])
'isISIL' => ($inArray ?
$this->isISIL($isilCallNumber['isils'], $this->rlm->getLibValue('boss')) : false),
'url' => sprintf($this->config->SearchUrls->$network, ($inArray ?
$results['param'] : $isbns))
];
$html = $this->renderer->render('ajax/boss.phtml', $view);
return $this->formatResponse(compact('html'));
}
private function getISILCallNumber($results)
{
$tmp = [];
$retval = [];
$results = is_null($results) ? [] : $results;
foreach ($results as $result) {
foreach ($result as $holding) {
$tmp[] = $holding['isil'];
......@@ -191,6 +208,10 @@ class GetBoss extends \VuFind\AjaxHandler\AbstractBase
$retval['isils'] = !empty($tmp) ? $tmp : [];
if (empty($results)) {
$retval['isils'] = [];
}
return $retval;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment