Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved ILS availability system #768

Merged
merged 3 commits into from Oct 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions config/vufind/Demo.ini
Expand Up @@ -62,6 +62,7 @@ cancelStorageRetrievalRequests = 50
changePassword = 33
checkILLRequestBlock = 10
checkILLRequestIsValid = 10
checkIntermittentFailure = 0 ; chance of simulating low-level system failure
checkRenewBlock = 25
checkRequestBlock = 10
checkRequestIsValid = 10
Expand Down
28 changes: 28 additions & 0 deletions module/VuFind/src/VuFind/Controller/AjaxController.php
Expand Up @@ -1500,4 +1500,32 @@ protected function getResultsManager()
{
return $this->getServiceLocator()->get('VuFind\SearchResultsPluginManager');
}

/**
* Get Ils Status
*
* This will check the ILS for being online and will return the ils-offline
* template upon failure.
*
* @return \Zend\Http\Response
* @author André Lahmann <lahmann@ub.uni-leipzig.de>
*/
protected function getIlsStatusAjax()
{
$this->disableSessionWrites(); // avoid session write timing bug
if ($this->getILS()->getOfflineMode(true) == 'ils-offline') {
$offlineModeMsg = $this->params()->fromPost(
'offlineModeMsg',
$this->params()->fromQuery('offlineModeMsg')
);
return $this->output(
$this->getViewRenderer()->render(
'Helpers/ils-offline.phtml',
compact('offlineModeMsg')
),
self::STATUS_OK
);
}
return $this->output('', self::STATUS_OK);
}
}
8 changes: 1 addition & 7 deletions module/VuFind/src/VuFind/Controller/InstallController.php
Expand Up @@ -509,13 +509,7 @@ protected function checkILS()
if (in_array($config->Catalog->driver, ['Sample', 'Demo'])) {
$status = false;
} else {
try {
$catalog = $this->getILS();
$catalog->getStatus('1');
$status = true;
} catch (\Exception $e) {
$status = false;
}
$status = 'ils-offline' !== $this->getILS()->getOfflineMode(true);
}
return ['title' => 'ILS', 'status' => $status, 'fix' => 'fixils'];
}
Expand Down