diff --git a/Gruntfile.js b/Gruntfile.js index 8ba8ebea8005db00c962840329b30becbacbd992..ee5380f8e0f41163db1c67e4a1006261b37b90b0 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -169,4 +169,5 @@ module.exports = function(grunt) { grunt.config.set('sass', sassConfig); grunt.task.run('sass'); }); + grunt.registerTask('default', ['scss']); }; diff --git a/gruntfile.js b/gruntfile.js deleted file mode 100644 index 603ede32c30684c2a29a4bdd54d20f49880ad95a..0000000000000000000000000000000000000000 --- a/gruntfile.js +++ /dev/null @@ -1,173 +0,0 @@ -module.exports = function(grunt) { - require('jit-grunt')(grunt); // Just in time library loading - - var fs = require('fs'); - - function getLoadPaths(file) { - var config; - var parts = file.split('/'); - parts.pop(); // eliminate filename - - // initialize search path with directory containing LESS file - var retVal = []; - retVal.push(parts.join('/')); - - // Iterate through theme.config.php files collecting parent themes in search path: - while (config = fs.readFileSync("themes/" + parts[1] + "/theme.config.php", "UTF-8")) { - var matches = config.match(/["']extends["']\s*=>\s*['"](\w+)['"]/); - - // "extends" set to "false" or missing entirely? We've hit the end of the line: - if (matches === null || matches[1] === 'false') { - break; - } - - parts[1] = matches[1]; - retVal.push(parts.join('/') + '/'); - } - return retVal; - } - - var fontAwesomePath = '"../../bootstrap3/css/fonts"'; - - grunt.initConfig({ - // LESS compilation - less: { - compile: { - options: { - paths: getLoadPaths, - compress: true, - modifyVars: { - 'fa-font-path': fontAwesomePath - } - }, - files: [{ - expand: true, - src: "themes/*/less/compiled.less", - rename: function (dest, src) { - return src.replace('/less/', '/css/').replace('.less', '.css'); - } - }] - } - }, - // SASS compilation - scss: { - sass: { - options: { - style: 'compress' - } - } - }, - // Convert LESS to SASS, mostly for development team use - lessToSass: { - convert: { - files: [ - { - expand: true, - cwd: 'themes/bootstrap3/less', - src: ['*.less', 'components/*.less'], - ext: '.scss', - dest: 'themes/bootstrap3/scss' - }, - { - expand: true, - cwd: 'themes/bootprint3/less', - src: ['*.less'], - ext: '.scss', - dest: 'themes/bootprint3/scss' - } - ], - options: { - replacements: [ - { // Replace ; in include with , - pattern: /(\s+)@include ([^\(]+)\(([^\)]+)\);/gi, - replacement: function mixinCommas(match, space, $1, $2) { - return space + '@include ' + $1 + '(' + $2.replace(/;/g, ',') + ');'; - }, - order: 3 - }, - { // Inline &:extends converted - pattern: /&:extend\(([^\)]+)\)/gi, - replacement: '@extend $1', - order: 3 - }, - { // Inline variables not default - pattern: / !default; }/gi, - replacement: '; }', - order: 3 - }, - { // VuFind: Correct paths - pattern: 'vendor/bootstrap/bootstrap', - replacement: 'vendor/bootstrap', - order: 4 - }, - { - pattern: '$fa-font-path: "../../../fonts" !default;\n', - replacement: '', - order: 4 - }, - { - pattern: '@import "vendor/font-awesome/font-awesome";', - replacement: '$fa-font-path: ' + fontAwesomePath + ';\n@import "vendor/font-awesome/font-awesome";', - order: 4 - }, - { // VuFind: Bootprint fixes - pattern: '@import "bootstrap";\n@import "variables";', - replacement: '@import "variables", "bootstrap";', - order: 4 - }, - { - pattern: '$brand-primary: #619144 !default;', - replacement: '$brand-primary: #619144;', - order: 4 - } - ] - } - } - }, - watch: { - options: { - atBegin: true - }, - less: { - files: 'themes/*/less/**/*.less', - tasks: ['less'] - }, - scss: { - files: 'themes/*/scss/**/*.scss', - tasks: ['scss'] - } - } - }); - grunt.registerMultiTask('scss', function sassScan() { - var sassConfig = {}, - path = require('path'), - themeList = fs.readdirSync(path.resolve('themes')).filter(function (theme) { - return fs.existsSync(path.resolve('themes/' + theme + '/scss/compiled.scss')); - }); - - for (var i in themeList) { - var config = { - options: { - outputStyle: 'compressed' - }, - files: [{ - expand: true, - cwd: path.join('themes', themeList[i], 'scss'), - src: ['compiled.scss'], - dest: path.join('themes', themeList[i], 'css'), - ext: '.css' - }] - }; - for (var key in this.data.options) { - config.options[key] = this.data.options[key] + ''; - } - config.options.includePaths = getLoadPaths('themes/' + themeList[i] + '/scss/compiled.scss'); - - sassConfig[themeList[i]] = config; - } - - grunt.config.set('sass', sassConfig); - grunt.task.run('sass'); - }); - grunt.registerTask('default', ['scss']); -}; diff --git a/local/config/vufind/searches.ini b/local/config/vufind/searches.ini index 29a085d252028af711c30f2b368fe30c6b2668cb..6c7a988b6405154b6a73f301fd16ec2fad2ebd61 100644 --- a/local/config/vufind/searches.ini +++ b/local/config/vufind/searches.ini @@ -209,15 +209,19 @@ CallNumber = callnumber-sort ; a specific instituion. Default [url] is set ; to: www.bibliothek.tu-chemnitz.de/finc/%s/ebsco3.cgi ; EuropeanaResults:[url]:[requestParam]:[limit]:[unwanted data providers] -; Display search results from Europeana.eu API. [url] is the base search URL -; default "api.europeana.eu/api/opensearch.rss" [requestParam] parameter name -; for passing lookup value in url, default is "searchTerms" [limit] defaults to -; 5, is the number of result items to display [unwanted data providers] comma -; separated list of dataproviders to ignore results from; useful for excluding -; own results that are also in Europeana. An API key must be set in config.ini -; (see europeanaAPI setting in [Content] section). +; Display search results from Europeana.eu API. +; Parameters (all are optional): +; [url] = base search URL, default api.europeana.eu/api/v2/opensearch.rss +; [requestParam] = parameter name for passing lookup value in url, default is +; "searchTerms" +; [limit] = the number of result items to display (defaults to 5) +; [unwanted data providers] = comma separated list of dataproviders to ignore +; results from; useful for excluding your own results that are also in +; Europeana. +; An API key must be set in config.ini (see europeanaAPI setting in [Content] +; section). ; EuropeanaResultsDeferred: [url]:[requestParam]:[limit]:[unwanted data providers] -; See EuropeanaResults, but this version uses AJAX. +; See EuropeanaResults, but this version uses AJAX for asynchronous loading. ; ExpandFacets:[ini section]:[ini name] ; Display facets listed in the specified section of the specified ini file; ; if [ini name] is left out, it defaults to "facets." Rather than using @@ -332,6 +336,13 @@ CallNumber = callnumber-sort ; AuthorityRecommend:__resultlimit__:50 then authority recommendations will ; only display on result screens displaying fewer than 50 hits; by default, ; recommendations will always display). Filtering is optional. +; MapSelection:[ini section]:[ini name] +; Enable geographic searching capability via OpenLayers3 API by activating +; this module. Records must be indexed using the geographic search and display +; fields. See the marc_local.properties file for more information on indexing. +; Default settings and more comments may be found in the [MapSelection] +; section in this file. The section name and ini file name loaded by the +; module may be overridden through the [ini section]/[ini name] parameters. ; PubDateVisAjax:[zooming]:[facet field 1]:[facet field 2]:...:[facet field n] ; Display a visualization of publication dates for each of the specified facet ; fields. This is designed for a field containing four-digit years. Zooming @@ -564,6 +575,17 @@ topic = "Subjects" ;grid = Grid ;visual = Visual +; This section controls what happens when a record title in a search result list +; is clicked. VuFind can either embed the full result directly in the list using +; AJAX or can display it at its own separate URL as a full HTML page. +; full - separate page (default) +; tabs - embedded using tabs (see record/ajaxview-tabs.phtml) +; accordion - embedded using an accordion (see record/ajaxview-accordion.phtml) +; NOTE: This feature is incompatible with SyndeticsPlus content; please use +; regular Syndetics if necessary. +[List] +view=full + ; This section allows for adding hidden filters. Each filter will be translated ; to format 'key:"value"' and added by Solr.php as a hidden filter (a facet that ; is always applied but is not seen by the user). This is useful if you use a @@ -611,3 +633,38 @@ topic = "Subjects" ; Priority order (descending) for record sources (record ID prefixes separated ; from the actual record by period, e.g. testsrc.12345) ;sources = alli,testsrc + +; This section defines the default parameters for the geographic search +; functionality found in the MapSelection recommendation module. +; To enable this feature, uncomment the default_top_recommend[] = MapSelection +; in the default recommendations section. To set the configuration settings +; for this feature, adjust the parameters below. +[MapSelection] +; This defines the coordinates of a search region that will be highlighted when +; the user clicks the "Geographic Search" link next to the VuFind search box. +; This should ideally cover a large area of the map where most/all of your +; geographic points are located. If your dataset is not concentrated in one +; geographic area, it is advised that you pick a default area, and do not use +; the entire extent of the map for searching (otherwise the search may be slow). +; The default coordinates specified below are in decimal degrees, and are +; ordered as WENS (west, east, north, south). Ranges of valid values are: +; -180 to 180 (longitude) and -85 to 85 (latitude). Note, to search from and to +; the international date line, use west = -179 and east = -180. +default_coordinates = "-95, 30, 72, 15" +; height: Height in pixels of the map selection interface. +height = 320 + +; This section defines settings used to fetch similar records. +[MoreLikeThis] +; Boolean value indicating whether the newer MoreLikeThis query handler should be +; used instead of the traditional MoreLikeThis component (default). Only the +; MoreLikeThis query handler supports sharded indexes, but as of this writing, the +; traditional component offers more nuanced relevance ranking. Results from these +; methods may differ. +;useMoreLikeThisHandler = true +; If the MoreLikeThis handler is used, this setting can be used to adjust its +; behavior. See https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-MoreLikeThisQueryParser +; for more information regarding the possible parameters. +;params = "qf=title,title_short,callnumber-label,topic,language,author,publishDate mintf=1 mindf=1"; +; This setting can be used to limit the maximum number of suggestions. Default is 5. +;count = 5 diff --git a/module/finc/Module.php b/module/finc/Module.php index e3776ae041415722b781ee78731d54318289aeee..bca76dbfc3a16a2d451c0d2d89c7dc3584b39842 100644 --- a/module/finc/Module.php +++ b/module/finc/Module.php @@ -17,9 +17,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * @category VuFind2 + * @category VuFind * @package Module * @author André Lahmann <lahmann@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License @@ -32,7 +32,7 @@ use Zend\ModuleManager\ModuleManager, /** * Template for ZF2 module for storing local overrides. * - * @category VuFind2 + * @category VuFind * @package Module * @author André Lahmann <lahmann@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License diff --git a/module/finc/config/module.config.php b/module/finc/config/module.config.php index 73ac45c168910eaf801998bc649765b6e69f47a0..099dffef24418d267cb805cbff23878e843f827c 100644 --- a/module/finc/config/module.config.php +++ b/module/finc/config/module.config.php @@ -34,7 +34,6 @@ $config = [ 'ils_driver' => [ 'factories' => [ 'fincils' => 'finc\ILS\Driver\Factory::getFincILS', - 'daia' => 'finc\ILS\Driver\Factory::getDAIA', 'paia' => 'finc\ILS\Driver\Factory::getPAIA', ], ], diff --git a/module/finc/src/finc/Cache/Manager.php b/module/finc/src/finc/Cache/Manager.php index cddc49afe645453d779fab1c6d5a7939a5af8227..d35e79b8be1e70a019e55c71d2306a68338e5fb9 100644 --- a/module/finc/src/finc/Cache/Manager.php +++ b/module/finc/src/finc/Cache/Manager.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Cache @@ -51,6 +51,8 @@ class Manager extends \VuFind\Cache\Manager { parent::__construct($config, $searchConfig); + // Cache branches.yaml files + // Get base cache directory. $cacheBase = $this->getCacheDir(); diff --git a/module/finc/src/finc/Config/BranchesReader.php b/module/finc/src/finc/Config/BranchesReader.php index 9ed2ece3c93042f62eae062e82e8ff793c7d0b39..1b8baa887b6462aa24f0037e250c1200a64a0113 100644 --- a/module/finc/src/finc/Config/BranchesReader.php +++ b/module/finc/src/finc/Config/BranchesReader.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Config @@ -27,7 +27,8 @@ * @link https://vufind.org Main Site */ namespace finc\Config; -use Symfony\Component\Yaml\Yaml; +use VuFind\Config\Locator as Locator, + Symfony\Component\Yaml\Yaml; /** * VuFind Branches.yaml Configuration Reader @@ -39,7 +40,7 @@ use Symfony\Component\Yaml\Yaml; * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org Main Site */ -class BranchesReader +class BranchesReader extends \VuFind\Config\SearchSpecsReader { /** * Cache manager @@ -76,39 +77,49 @@ class BranchesReader { // Load data if it is not already in the object's cache: if (!isset($this->branches[$filename])) { - // Connect to branches cache: - $cache = (null !== $this->cacheManager) - ? $this->cacheManager->getCache('branches') : false; + $this->branches[$filename] = $this->getFromPaths( + Locator::getBaseConfigPath($filename), + Locator::getLocalConfigPath($filename) + ); + } - // Determine full configuration file path: - $fullpath = \VuFind\Config\Locator::getBaseConfigPath($filename); - $local = \VuFind\Config\Locator::getLocalConfigPath($filename); + return $this->branches[$filename]; + } - // Generate cache key: - $cacheKey = $filename . '-' - . (file_exists($fullpath) ? filemtime($fullpath) : 0); - if (!empty($local)) { - $cacheKey .= '-local-' . filemtime($local); - } - $cacheKey = md5($cacheKey); + /** + * Given core and local filenames, retrieve the searchspecs data. + * + * @param string $defaultFile Full path to file containing default YAML + * @param string $customFile Full path to file containing local customizations + * (may be null if no local file exists). + * + * @return array + */ + protected function getFromPaths($defaultFile, $customFile = null) + { + // Connect to searchspecs cache: + $cache = (null !== $this->cacheManager) + ? $this->cacheManager->getCache('branches') : false; + + // Generate cache key: + $cacheKey = basename($defaultFile) . '-' + . (file_exists($defaultFile) ? filemtime($defaultFile) : 0); + if (!empty($customFile)) { + $cacheKey .= '-local-' . filemtime($customFile); + } + $cacheKey = md5($cacheKey); - // Generate data if not found in cache: - if ($cache === false || !($results = $cache->getItem($cacheKey))) { - $results = file_exists($fullpath) - ? Yaml::parse(file_get_contents($fullpath)) : []; - if (!empty($local)) { - $localResults = Yaml::parse(file_get_contents($local)); - foreach ($localResults as $key => $value) { - $results[$key] = $value; - } - } - if ($cache !== false) { - $cache->setItem($cacheKey, $results); - } + // Generate data if not found in cache: + if ($cache === false || !($results = $cache->getItem($cacheKey))) { + $results = $this->parseYaml($customFile, $defaultFile); + if ($cache !== false) { + $cache->setItem($cacheKey, $results); } - $this->branches[$filename] = $results; } - return $this->branches[$filename]; + return $results; } + + + } diff --git a/module/finc/src/finc/Controller/AjaxController.php b/module/finc/src/finc/Controller/AjaxController.php index d3f3b3b9edf47d609d07dbb1ef533a81598527cd..53f551a5fe8773fd3509e4f6f8bed7649fef5fe1 100644 --- a/module/finc/src/finc/Controller/AjaxController.php +++ b/module/finc/src/finc/Controller/AjaxController.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Controller @@ -201,7 +201,10 @@ class AjaxController extends \VuFind\Controller\AjaxController // If a full status display has been requested, append the HTML: if ($showFullStatus) { $current['full_status'] = $renderer->render( - 'ajax/status-full.phtml', ['statusItems' => $record] + 'ajax/status-full.phtml', [ + 'statusItems' => $record, + 'callnumberHandler' => $this->getCallnumberHandler() + ] ); } $current['record_number'] = array_search($current['id'], $ids); @@ -342,6 +345,10 @@ class AjaxController extends \VuFind\Controller\AjaxController } } + $callnumberHandler = $this->getCallnumberHandler( + $callNumbers, $callnumberSetting + ); + // Determine call number string based on findings: $callNumber = $this->pickValue( $callNumbers, $callnumberSetting, 'Multiple Call Numbers' @@ -376,7 +383,8 @@ class AjaxController extends \VuFind\Controller\AjaxController 'reserve_message' => $record[0]['reserve'] == 'Y' ? $this->translate('on_reserve') : $this->translate('Not On Reserve'), - 'callnumber' => htmlentities($callNumber, ENT_COMPAT, 'UTF-8') + 'callnumber' => htmlentities($callNumber, ENT_COMPAT, 'UTF-8'), + 'callnumber_handler' => $callnumberHandler ]; } diff --git a/module/finc/src/finc/Controller/CustomTraits/AcquisitionTrait.php b/module/finc/src/finc/Controller/CustomTraits/AcquisitionTrait.php index ff0ca60cb790c0f37b098fa4468d3f66c5beae5a..234a16572ac7509aa2f6d2e2c4edcd737422127a 100644 --- a/module/finc/src/finc/Controller/CustomTraits/AcquisitionTrait.php +++ b/module/finc/src/finc/Controller/CustomTraits/AcquisitionTrait.php @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Controller diff --git a/module/finc/src/finc/Controller/CustomTraits/EblTrait.php b/module/finc/src/finc/Controller/CustomTraits/EblTrait.php index c1e33fbb6c08d2621f2d8795f6378a1e0f15b949..88a836eccc99ea9e9d103b70a939f38ca48766d3 100644 --- a/module/finc/src/finc/Controller/CustomTraits/EblTrait.php +++ b/module/finc/src/finc/Controller/CustomTraits/EblTrait.php @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category Vufind * @package Controller diff --git a/module/finc/src/finc/Controller/CustomTraits/EmailHoldTrait.php b/module/finc/src/finc/Controller/CustomTraits/EmailHoldTrait.php index de142a8f09de23523abe9441a58f359b51717949..e6fbbf5a0976671888a37ef72503133d04b04819 100644 --- a/module/finc/src/finc/Controller/CustomTraits/EmailHoldTrait.php +++ b/module/finc/src/finc/Controller/CustomTraits/EmailHoldTrait.php @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Controller diff --git a/module/finc/src/finc/Controller/CustomTraits/EmailProfileTrait.php b/module/finc/src/finc/Controller/CustomTraits/EmailProfileTrait.php index ec5b64159e14985a9f5e0d1d7447245f8004cb85..8456a9977b14589d989c3b8eb969e9c370b80eb7 100644 --- a/module/finc/src/finc/Controller/CustomTraits/EmailProfileTrait.php +++ b/module/finc/src/finc/Controller/CustomTraits/EmailProfileTrait.php @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Controller diff --git a/module/finc/src/finc/Controller/CustomTraits/PdaTrait.php b/module/finc/src/finc/Controller/CustomTraits/PdaTrait.php index 3b3f67e4d324493b0893946cdfe1bd5f67e384a3..900774a403fe6be84381efc04af009e702af2c40 100644 --- a/module/finc/src/finc/Controller/CustomTraits/PdaTrait.php +++ b/module/finc/src/finc/Controller/CustomTraits/PdaTrait.php @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Controller diff --git a/module/finc/src/finc/Controller/CustomTraits/ReportErrorsTrait.php b/module/finc/src/finc/Controller/CustomTraits/ReportErrorsTrait.php index b8eb0a650220a8ad5b72115ae628e644582856ab..ab7a84b143c4c373856b6474560eb6017453b49a 100644 --- a/module/finc/src/finc/Controller/CustomTraits/ReportErrorsTrait.php +++ b/module/finc/src/finc/Controller/CustomTraits/ReportErrorsTrait.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Controller diff --git a/module/finc/src/finc/Controller/CustomTraits/ResetPasswordTrait.php b/module/finc/src/finc/Controller/CustomTraits/ResetPasswordTrait.php index 36f6720c257a1ea33099176ce07c55a9915c1f2b..688184291ca3495fe5eb171eb2599eba6f48a982 100644 --- a/module/finc/src/finc/Controller/CustomTraits/ResetPasswordTrait.php +++ b/module/finc/src/finc/Controller/CustomTraits/ResetPasswordTrait.php @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Controller diff --git a/module/finc/src/finc/Controller/DocumentDeliveryServiceController.php b/module/finc/src/finc/Controller/DocumentDeliveryServiceController.php index 3868dceab8c3bd3d4f1b5c6050c321e53315f189..e9396e97dd57e1718f0df1b60685116169dcac25 100644 --- a/module/finc/src/finc/Controller/DocumentDeliveryServiceController.php +++ b/module/finc/src/finc/Controller/DocumentDeliveryServiceController.php @@ -17,9 +17,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * @category VuFind2 + * @category VuFind * @package Controller * * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> @@ -37,7 +37,7 @@ use VuFind\Exception\Mail as MailException, /** * Controller for Document Delivery Service * - * @category VuFind2 + * @category VuFind * @package Controller * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License diff --git a/module/finc/src/finc/Controller/Factory.php b/module/finc/src/finc/Controller/Factory.php index 8c157cd43d2bed158af43187ef74c7c89ff973f0..49bf39a6b8969957e38b3f68f3417701175474e1 100644 --- a/module/finc/src/finc/Controller/Factory.php +++ b/module/finc/src/finc/Controller/Factory.php @@ -17,11 +17,10 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Controller - * * @author Demian Katz <demian.katz@villanova.edu> * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License diff --git a/module/finc/src/finc/Controller/MyResearchController.php b/module/finc/src/finc/Controller/MyResearchController.php index 2ab018628ea845905a1d0a3afaa623d3c18040d8..0467320082971aca76626da43af7ecf1d43bc9e9 100644 --- a/module/finc/src/finc/Controller/MyResearchController.php +++ b/module/finc/src/finc/Controller/MyResearchController.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Controller diff --git a/module/finc/src/finc/Controller/Plugin/EmailHold.php b/module/finc/src/finc/Controller/Plugin/EmailHold.php index 672610175f7eccf940080f9e1e3447ca670486eb..069220ec3e3239ea7914543304903c040d21d0ba 100644 --- a/module/finc/src/finc/Controller/Plugin/EmailHold.php +++ b/module/finc/src/finc/Controller/Plugin/EmailHold.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Controller_Plugins diff --git a/module/finc/src/finc/Controller/Plugin/Factory.php b/module/finc/src/finc/Controller/Plugin/Factory.php index bbd86bf420d7395b99fc6e8dec351e1cf6db0e4d..2312fe4382a385a70b4f34878823e591391aff88 100644 --- a/module/finc/src/finc/Controller/Plugin/Factory.php +++ b/module/finc/src/finc/Controller/Plugin/Factory.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package View_Helpers diff --git a/module/finc/src/finc/Controller/RecordController.php b/module/finc/src/finc/Controller/RecordController.php index 29abb41cf50d33c709e59603f01fa0d59d83714e..1907a2de4d774895763c914edd993faea227b600 100644 --- a/module/finc/src/finc/Controller/RecordController.php +++ b/module/finc/src/finc/Controller/RecordController.php @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Controller diff --git a/module/finc/src/finc/Cookie/CookieManager.php b/module/finc/src/finc/Cookie/CookieManager.php index 7584ed0d6ebda3bc5e82251c662a8e025a463c47..8e3b75943f9314ac66f546c60585f596112eb339 100644 --- a/module/finc/src/finc/Cookie/CookieManager.php +++ b/module/finc/src/finc/Cookie/CookieManager.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Cookie diff --git a/module/finc/src/finc/Exception/DDS.php b/module/finc/src/finc/Exception/DDS.php index 422c9ad4b91fdbd8a3503b8825613c60b26b86ac..d69c76f08cac9fc95d30bdb4c8261dc369132a23 100644 --- a/module/finc/src/finc/Exception/DDS.php +++ b/module/finc/src/finc/Exception/DDS.php @@ -17,9 +17,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * @category VuFind2 + * @category VuFind * @package Exceptions * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License @@ -30,7 +30,7 @@ namespace finc\Exception; /** * DDS Exception * - * @category VuFind2 + * @category VuFind * @package Exceptions * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License diff --git a/module/finc/src/finc/ILS/Connection.php b/module/finc/src/finc/ILS/Connection.php index 1d6981d42024e3b45307fc7d1e764e6dbf0bace6..dd82548683956aba9f70926158e47c541d6a0b81 100644 --- a/module/finc/src/finc/ILS/Connection.php +++ b/module/finc/src/finc/ILS/Connection.php @@ -21,7 +21,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package ILS_Drivers diff --git a/module/finc/src/finc/ILS/Driver/DAIA.php b/module/finc/src/finc/ILS/Driver/DAIA.php deleted file mode 100644 index 05327be762fc2c2c1996507e66117bb1ae10dfe8..0000000000000000000000000000000000000000 --- a/module/finc/src/finc/ILS/Driver/DAIA.php +++ /dev/null @@ -1,811 +0,0 @@ -<?php -/** - * ILS Driver for VuFind to query availability information via DAIA. - * - * Based on the proof-of-concept-driver by Till Kinstler, GBV. - * Relaunch of the daia driver developed by Oliver Goldschmidt. - * - * PHP version 5 - * - * Copyright (C) Jochen Lienhard 2014. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * @category VuFind - * @package ILS_Drivers - * @author Jochen Lienhard <lienhard@ub.uni-freiburg.de> - * @author Oliver Goldschmidt <o.goldschmidt@tu-harburg.de> - * @author André Lahmann <lahmann@ub.uni-leipzig.de> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development:plugins:ils_drivers Wiki - */ -namespace finc\ILS\Driver; -use VuFind\Exception\ILS as ILSException; - -/** - * ILS Driver for VuFind to query availability information via DAIA. - * - * @category VuFind - * @package ILS_Drivers - * @author Jochen Lienhard <lienhard@ub.uni-freiburg.de> - * @author Oliver Goldschmidt <o.goldschmidt@tu-harburg.de> - * @author André Lahmann <lahmann@ub.uni-leipzig.de> - * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link https://vufind.org/wiki/development:plugins:ils_drivers Wiki - */ -class DAIA extends \VuFind\ILS\Driver\DAIA -{ - /** - * Timeout in seconds to be used for DAIA http requests - * - * @var string - */ - protected $daiaTimeout = null; - - /** - * Flag to switch on/off caching for DAIA items - * - * @var bool - */ - protected $daiaCacheEnabled = false; - - /** - * Initialize the driver. - * - * Validate configuration and perform all resource-intensive tasks needed to - * make the driver active. - * - * @throws ILSException - * @return void - */ - public function init() - { - parent::init(); - // use DAIA specific timeout setting for http requests if configured - if ((isset($this->config['DAIA']['timeout']))) { - $this->daiaTimeout = $this->config['DAIA']['timeout']; - } - if (isset($this->config['DAIA']['daiaCache'])) { - $this->daiaCacheEnabled = $this->config['DAIA']['daiaCache']; - } else { - $this->debug('Caching not enabled, disabling it by default.'); - } - if (isset($this->config['DAIA']['daiaCacheLifetime'])) { - $this->cacheLifetime = $this->config['DAIA']['daiaCacheLifetime']; - } else { - $this->debug('Cache lifetime not set, using VuFind\ILS\Driver\AbstractBase default value.'); - } - } - - /** - * Get Status - * - * This is responsible for retrieving the status information of a certain - * record. - * - * @param string $id The record id to retrieve the holdings for - * - * @return mixed On success, an associative array with the following keys: - * id, availability (boolean), status, location, reserve, callnumber. - */ - public function getStatus($id) - { - // check ids for existing availability data in cache and skip these ids - if ($this->daiaCacheEnabled && $item = $this->getCachedData($this->generateURI($id))) { - if ($item != null) { - return $item; - } - } - - // let's retrieve the DAIA document by URI - try { - $rawResult = $this->doHTTPRequest($this->generateURI($id)); - // extract the DAIA document for the current id from the - // HTTPRequest's result - $doc = $this->extractDaiaDoc($id, $rawResult); - if (!is_null($doc)) { - // parse the extracted DAIA document and return the status info - $data = $this->parseDaiaDoc($id, $doc); - // cache the status information - $this->putCachedData($this->generateURI($id), $data); - return $data; - } - } catch (ILSException $e) { - $this->debug($e->getMessage()); - } - - return []; - } - - /** - * Get Statuses - * - * This is responsible for retrieving the status information for a - * collection of records. - * As the DAIA Query API supports querying multiple ids simultaneously - * (all ids divided by "|") getStatuses(ids) would call getStatus(id) only - * once, id containing the list of ids to be retrieved. This would cause some - * trouble as the list of ids does not necessarily correspond to the VuFind - * Record-id. Therefore getStatuses(ids) has its own logic for multiQuery-support - * and performs the HTTPRequest itself, retrieving one DAIA response for all ids - * and uses helper functions to split this one response into documents - * corresponding to the queried ids. - * - * @param array $ids The array of record ids to retrieve the status for - * - * @return array An array of status information values on success. - */ - public function getStatuses($ids) - { - $status = []; - - // check cache for given ids and skip these ids if availability data is found - foreach ($ids as $key=>$id) { - if ($this->daiaCacheEnabled && $item = $this->getCachedData($this->generateURI($id))) { - if ($item != null) { - $status[] = $item; - unset($ids[$key]); - } - } - } - - // only query DAIA service if we have some ids left - if (count($ids) > 0) { - try { - if ($this->multiQuery) { - // perform one DAIA query with multiple URIs - $rawResult = $this - ->doHTTPRequest($this->generateMultiURIs($ids)); - // the id used in VuFind can differ from the document-URI - // (depending on how the URI is generated) - foreach ($ids as $id) { - // it is assumed that each DAIA document has a unique URI, - // so get the document with the corresponding id - $doc = $this->extractDaiaDoc($id, $rawResult); - if (!is_null($doc)) { - // a document with the corresponding id exists, which - // means we got status information for that record - $data = $this->parseDaiaDoc($id, $doc); - // cache the status information - $this->putCachedData($this->generateURI($id), $data); - $status[] = $data; - } - unset($doc); - } - } else { - // multiQuery is not supported, so retrieve DAIA documents one by - // one - foreach ($ids as $id) { - $rawResult = $this->doHTTPRequest($this->generateURI($id)); - // extract the DAIA document for the current id from the - // HTTPRequest's result - $doc = $this->extractDaiaDoc($id, $rawResult); - if (!is_null($doc)) { - // parse the extracted DAIA document and save the status - // info - $data = $this->parseDaiaDoc($id, $doc); - // cache the status information - $this->putCachedData($this->generateURI($id), $data); - $status[] = $data; - } - } - } - } catch (ILSException $e) { - $this->debug($e->getMessage()); - } - } - return $status; - } - - /** - * Perform an HTTP request. - * - * @param string $id id for query in daia - * - * @return xml or json object - * @throws ILSException - */ - protected function doHTTPRequest($id) - { - $http_headers = [ - 'Content-type: ' . $this->contentTypesRequest[$this->daiaResponseFormat], - 'Accept: ' . $this->contentTypesRequest[$this->daiaResponseFormat], - ]; - - $params = [ - 'id' => $id, - 'format' => $this->daiaResponseFormat, - ]; - - try { - $result = $this->httpService->get( - $this->baseUrl, - $params, $this->daiaTimeout, $http_headers - ); - } catch (\Exception $e) { - throw new ILSException( - 'HTTP request exited with Exception ' . $e->getMessage() . - ' for record: ' . $id - ); - } - - if (!$result->isSuccess()) { - throw new ILSException( - 'HTTP status ' . $result->getStatusCode() . - ' received, retrieving availability information for record: ' . $id - ); - - } - - // check if result matches daiaResponseFormat - if ($this->contentTypesResponse != null) { - if ($this->contentTypesResponse[$this->daiaResponseFormat]) { - $contentTypesResponse = array_map( - 'trim', - explode( - ',', - $this->contentTypesResponse[$this->daiaResponseFormat] - ) - ); - list($responseMediaType) = array_pad( - explode( - ';', - $result->getHeaders()->get('ContentType')->getFieldValue(), - 2 - ), - 2, - null - ); // workaround to avoid notices if encoding is not set in header - if (!in_array(trim($responseMediaType), $contentTypesResponse)) { - throw new ILSException( - 'DAIA-ResponseFormat not supported. Received: ' . - $responseMediaType . ' - ' . - 'Expected: ' . - $this->contentTypesResponse[$this->daiaResponseFormat] - ); - } - } - } - - return ($result->getBody()); - } - - /** - * Parse an array with DAIA status information. - * - * @param string $id Record id for the DAIA array. - * @param array $daiaArray Array with raw DAIA status information. - * - * @return array Array with VuFind compatible status information. - */ - protected function parseDaiaArray($id, $daiaArray) - { - $doc_id = null; - $doc_href = null; - if (isset($daiaArray['id'])) { - $doc_id = $daiaArray['id']; - } - if (isset($daiaArray['href'])) { - // url of the document (not needed for VuFind) - $doc_href = $daiaArray['href']; - } - if (isset($daiaArray['message'])) { - // log messages for debugging - $this->logMessages($daiaArray['message'], 'document'); - } - // if one or more items exist, iterate and build result-item - if (isset($daiaArray['item']) && is_array($daiaArray['item'])) { - $number = 0; - foreach ($daiaArray['item'] as $item) { - $result_item = []; - $result_item['id'] = $id; - // custom DAIA field - $result_item['doc_id'] = $doc_id; - $result_item['item_id'] = $item['id']; - // custom DAIA field used in getHoldLink() - $result_item['ilslink'] - = (isset($item['href']) ? $item['href'] : $doc_href); - // count items - $number++; - $result_item['number'] = $this->getItemNumber($item, $number); - // set default value for barcode - $result_item['barcode'] = $this->getItemBarcode($item); - // set default value for reserve - $result_item['reserve'] = $this->getItemReserveStatus($item); - // get callnumber - $result_item['callnumber'] = $this->getItemCallnumber($item); - // get location - $result_item['location'] = $this->getItemDepartment($item); - // custom DAIA field - $result_item['locationid'] = $this->getItemDepartmentId($item); - // get location link - $result_item['location_href'] = $this->getItemDepartmentLink($item); - // custom DAIA field - $result_item['storage'] = $this->getItemStorage($item); - // custom DAIA field - $result_item['storageid'] = $this->getItemStorageId($item); - // custom DAIA field - $result_item['storage_href'] = $this->getItemStorageLink($item); - // status and availability will be calculated in own function - $result_item = $this->getItemStatus($item) + $result_item; - // add result_item to the result array - $result[] = $result_item; - } // end iteration on item - } - - return $result; - } - - /** - * Returns an array with status information for provided item. - * - * @param array $item Array with DAIA item data - * - * @return array - */ - protected function getItemStatus($item) - { - $availability = false; - $status = ''; // status cannot be null as this will crash the translator - $duedate = null; - $availableLink = ''; - $queue = ''; - $item_notes = []; - $item_limitation_types = []; - $services = []; - - if (isset($item['available'])) { - // check if item is loanable or presentation - foreach ($item['available'] as $available) { - if (isset($available['service']) - && in_array($available['service'], ['loan', 'presentation']) - ) { - $services['available'][] = $available['service']; - } - // attribute service can be set once or not - if (isset($available['service']) - && in_array( - $available['service'], - ['loan', 'presentation', 'openaccess'] - ) - ) { - // set item available if service is loan, presentation or - // openaccess - $availability = true; - if ($available['service'] == 'loan' - && isset($available['service']['href']) - ) { - // save the link to the ils if we have a href for loan - // service - $availableLink = $available['service']['href']; - } - } - - // use limitation element for status string - if (isset($available['limitation'])) { - $item_notes = array_merge( - $item_notes, - $this->getItemLimitationContent($available['limitation']) - ); - $item_limitation_types = array_merge( - $item_limitation_types, - $this->getItemLimitationTypes($available['limitation']) - ); - } - - // log messages for debugging - if (isset($available['message'])) { - $this->logMessages($available['message'], 'item->available'); - } - } - } - - if (isset($item['unavailable'])) { - foreach ($item['unavailable'] as $unavailable) { - if (isset($unavailable['service']) - && in_array($unavailable['service'], ['loan', 'presentation']) - ) { - $services['unavailable'][] = $unavailable['service']; - } - // attribute service can be set once or not - if (isset($unavailable['service']) - && in_array( - $unavailable['service'], - ['loan', 'presentation', 'openaccess'] - ) - ) { - if ($unavailable['service'] == 'loan' - && isset($unavailable['service']['href']) - ) { - //save the link to the ils if we have a href for loan service - } - - // use limitation element for status string - if (isset($unavailable['limitation'])) { - $item_notes = array_merge( - $item_notes, - $this->getItemLimitationContent($unavailable['limitation']) - ); - $item_limitation_types = array_merge( - $item_limitation_types, - $this->getItemLimitationTypes($unavailable['limitation']) - ); - } - } - // attribute expected is mandatory for unavailable element - if (isset($unavailable['expected'])) { - try { - $duedate = $this->dateConverter - ->convertToDisplayDate( - 'Y-m-d', $unavailable['expected'] - ); - } catch (\Exception $e) { - $this->debug('Date conversion failed: ' . $e->getMessage()); - $duedate = null; - } - } - - // attribute queue can be set - if (isset($unavailable['queue'])) { - $queue = $unavailable['queue']; - } - - // log messages for debugging - if (isset($unavailable['message'])) { - $this->logMessages($unavailable['message'], 'item->unavailable'); - } - } - } - - /*'returnDate' => '', // false if not recently returned(?)*/ - - if (!empty($availableLink)) { - $return['ilslink'] = $availableLink; - } - - $return['item_notes'] = $item_notes; - $return['status'] = $this->getStatusString($item); - $return['availability'] = $availability; - $return['duedate'] = $duedate; - $return['requests_placed'] = $queue; - $return['services'] = $this->getAvailableItemServices($services); - - // In this DAIA driver implementation addLink and is_holdable are assumed - // Boolean as patron based availability requires either a patron-id or -type. - // This should be handled in a custom DAIA driver - $return['addLink'] = $return['is_holdable'] = $this->checkIsRecallable($item); - $return['holdtype'] = $this->getHoldType($item); - - // Check if we the item is available for storage retrieval request if it is - // not holdable. - $return['addStorageRetrievalRequestLink'] = !$return['is_holdable'] - ? $this->checkIsStorageRetrievalRequest($item) : false; - - // add a custom Field to allow passing custom DAIA data to the frontend in - // order to use it for more precise display of availability - $return['customData'] = $this->getCustomData($item); - - $return['limitation_types'] = $item_limitation_types; - - return $return; - } - - /** - * Helper function to allow custom data in status array. - * - * @param $item - * @return array - */ - protected function getCustomData($item) - { - return []; - } - - /** - * Helper function to return an appropriate status string for current item. - * - * @param $item - * @return string - */ - protected function getStatusString($item) - { - // status cannot be null as this will crash the translator - return ''; - } - - /** - * Helper function to determine if item is recallable. - * DAIA does not genuinly allow distinguishing between holdable and recallable - * items. This could be achieved by usage of limitations but this would not be - * shared functionality between different DAIA implementations (thus should be - * implemented in custom drivers). Therefore this returns whether an item - * is recallable based on unavailable services and the existence of an href. - * - * @param $item - * @return bool - */ - protected function checkIsRecallable($item) - { - // This basic implementation checks the item for being unavailable for loan - // and presentation but with an existing href (as a flag for further action). - $services = ['available'=>[], 'unavailable'=>[]]; - $href = false; - if (isset($item['available'])) { - // check if item is loanable or presentation - foreach ($item['available'] as $available) { - if (isset($available['service']) - && in_array($available['service'], ['loan', 'presentation']) - ) { - $services['available'][] = $available['service']; - } - } - } - - if (isset($item['unavailable'])) { - foreach ($item['unavailable'] as $unavailable) { - if (isset($unavailable['service']) - && in_array($unavailable['service'], ['loan', 'presentation']) - ) { - $services['unavailable'][] = $unavailable['service']; - // attribute href is used to determine whether item is recallable - // or not - $href = isset($unavailable['href']) ? true : $href; - } - } - } - - // Check if we have at least one service unavailable and a href field is set - // (either as flag or as actual value for the next action). - return ($href && count( - array_diff($services['unavailable'], $services['available']) - )); - } - - /** - * Helper function to determine if the item is available as storage retrieval. - * - * @param $item - * @return bool - */ - protected function checkIsStorageRetrievalRequest($item) - { - // This basic implementation checks the item for being available for loan - // and presentation but with an existing href (as a flag for further action). - $services = ['available'=>[], 'unavailable'=>[]]; - $href = false; - if (isset($item['available'])) { - // check if item is loanable or presentation - foreach ($item['available'] as $available) { - if (isset($available['service']) - && in_array($available['service'], ['loan', 'presentation']) - ) { - $services['available'][] = $available['service']; - // attribute href is used to determine whether item is - // requestable or not - $href = isset($available['href']) ? true : $href; - } - } - } - - if (isset($item['unavailable'])) { - foreach ($item['unavailable'] as $unavailable) { - if (isset($unavailable['service']) - && in_array($unavailable['service'], ['loan', 'presentation']) - ) { - $services['unavailable'][] = $unavailable['service']; - } - } - } - - // Check if we have at least one service unavailable and a href field is set - // (either as flag or as actual value for the next action). - return ($href && count( - array_diff($services['available'], $services['unavailable']) - )); - } - - /** - * Helper function to determine the holdtype availble for current item. - * DAIA does not genuinly allow distinguishing between holdable and recallable - * items. This could be achieved by usage of limitations but this would not be - * shared functionality between different DAIA implementations (thus should be - * implemented in custom drivers). Therefore getHoldType always returns recall. - * - * @param $item - * @return string 'recall'|null - */ - protected function getHoldType($item) - { - // return holdtype (hold, recall or block if patron is not allowed) for item - return $this->checkIsRecallable($item) ? 'recall' : null; - } - - /** - * Returns the evaluated value of the provided limitation element - * - * @param array $limitations Array with DAIA limitation data - * - * @return array - */ - protected function getItemLimitation($limitations) - { - $itemLimitation = []; - foreach ($limitations as $limitation) { - // return the first limitation with content set - if (isset($limitation['content'])) { - $itemLimitation[] = $limitation['content']; - } - } - return $itemLimitation; - } - - /** - * Returns the value of item.department.content (e.g. to be used in VuFind - * getStatus/getHolding array as location) - * - * @param array $item Array with DAIA item data - * - * @return string - */ - protected function getItemDepartment($item) - { - return isset($item['department']) && isset($item['department']['content']) - && !empty($item['department']['content']) - ? $item['department']['content'] - : 'Unknown'; - } - - /** - * Returns the value of item.department.id (e.g. to be used in VuFind - * getStatus/getHolding array as location) - * - * @param array $item Array with DAIA item data - * - * @return string - */ - protected function getItemDepartmentId($item) - { - return isset($item['department']) && isset($item['department']['id']) - ? $item['department']['id'] : ''; - } - - /** - * Returns the value of item.department.href (e.g. to be used in VuFind - * getStatus/getHolding array for linking the location) - * - * @param array $item Array with DAIA item data - * - * @return string - */ - protected function getItemDepartmentLink($item) - { - return isset($item['department']['href']) - ? $item['department']['href'] : false; - } - - /** - * Returns the value of item.storage.content (e.g. to be used in VuFind - * getStatus/getHolding array as location) - * - * @param array $item Array with DAIA item data - * - * @return string - */ - protected function getItemStorage($item) - { - return isset($item['storage']) && isset($item['storage']['content']) - && !empty($item['storage']['content']) - ? $item['storage']['content'] - : 'Unknown'; - } - - /** - * Returns the value of item.storage.id (e.g. to be used in VuFind - * getStatus/getHolding array as location) - * - * @param array $item Array with DAIA item data - * - * @return string - */ - protected function getItemStorageId($item) - { - return isset($item['storage']) && isset($item['storage']['id']) - ? $item['storage']['id'] : ''; - } - - /** - * Returns the value of item.storage.href (e.g. to be used in VuFind - * getStatus/getHolding array for linking the location) - * - * @param array $item Array with DAIA item data - * - * @return string - */ - protected function getItemStorageLink($item) - { - return isset($item['storage']) && isset($item['storage']['href']) - ? $item['storage']['href'] : ''; - } - - /** - * Returns the evaluated values of the provided limitations element - * - * @param array $limitations Array with DAIA limitation data - * - * @return array - */ - protected function getItemLimitationContent($limitations) - { - $itemLimitationContent = []; - foreach ($limitations as $limitation) { - // return the first limitation with content set - if (isset($limitation['content'])) { - $itemLimitationContent[] = $limitation['content']; - } - } - return $itemLimitationContent; - } - - /** - * Returns the evaluated values of the provided limitations element - * - * @param array $limitations Array with DAIA limitation data - * - * @return array - */ - protected function getItemLimitationTypes($limitations) - { - $itemLimitationTypes = []; - foreach ($limitations as $limitation) { - // return the first limitation with content set - if (isset($limitation['id'])) { - $itemLimitationTypes[] = $limitation['id']; - } - } - return $itemLimitationTypes; - } - - /** - * Add instance-specific context to a cache key suffix (to ensure that - * multiple drivers don't accidentally share values in the cache). - * - * @param string $key Cache key suffix - * - * @return string - */ - protected function formatCacheKey($key) - { - // Override the base class formatting with DAIA-specific URI - // to ensure proper caching in a MultiBackend environment. - return 'DAIA-' . md5($this->generateURI(($key))); - } - - /** - * Helper function for storing cached data. - * Data is cached for up to $this->cacheLifetime seconds so that it would be - * faster to process e.g. requests where multiple calls to the backend are made. - * - * @param string $key Cache entry key - * - * @return void - */ - protected function removeCachedData($key) - { - // Don't write to cache if we don't have a cache! - if (null === $this->cache) { - return; - } - $this->cache->removeItem($this->formatCacheKey($key)); - } -} diff --git a/module/finc/src/finc/ILS/Driver/Factory.php b/module/finc/src/finc/ILS/Driver/Factory.php index 376b6343ea4b907c7c573c666f6725ad554d6b32..da1a515eddef8c683a3aa5915f00a36fc6b68c1c 100644 --- a/module/finc/src/finc/ILS/Driver/Factory.php +++ b/module/finc/src/finc/ILS/Driver/Factory.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package ILS_Drivers @@ -73,26 +73,6 @@ class Factory return $fl; } - - /** - * Factory for DAIA driver. - * - * @param ServiceManager $sm Service manager. - * - * @return DAIA - */ - public static function getDAIA(ServiceManager $sm) - { - $daia = new DAIA( - $sm->getServiceLocator()->get('VuFind\DateConverter') - ); - - $daia->setCacheStorage( - $sm->getServiceLocator()->get('VuFind\CacheManager')->getCache('object') - ); - - return $daia; - } /** * Factory for PAIA driver. diff --git a/module/finc/src/finc/ILS/Driver/FincILS.php b/module/finc/src/finc/ILS/Driver/FincILS.php index 11b4a2b48efdf8a014f544f60cb6203b39402537..d8515ee37014c5da1eb48e695837943f94e75e3d 100644 --- a/module/finc/src/finc/ILS/Driver/FincILS.php +++ b/module/finc/src/finc/ILS/Driver/FincILS.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package ILS_Drivers diff --git a/module/finc/src/finc/ILS/Driver/LiberoDingTrait.php b/module/finc/src/finc/ILS/Driver/LiberoDingTrait.php index f688d4592b1db87a1cdfb9b7724501954ca4d883..a4a5d73423d85d67e98a169741fdb64c357040c5 100644 --- a/module/finc/src/finc/ILS/Driver/LiberoDingTrait.php +++ b/module/finc/src/finc/ILS/Driver/LiberoDingTrait.php @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package ILS_Drivers diff --git a/module/finc/src/finc/ILS/Driver/PAIA.php b/module/finc/src/finc/ILS/Driver/PAIA.php index 4bb7097b646b2b0af0af68a89f05184fbbf7a82d..9c5e42414f328af6355df08b80e6aae76bc64343 100644 --- a/module/finc/src/finc/ILS/Driver/PAIA.php +++ b/module/finc/src/finc/ILS/Driver/PAIA.php @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package ILS_Drivers @@ -49,57 +49,8 @@ use VuFind\Exception\Auth as AuthException, * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:ils_drivers Wiki */ -class PAIA extends DAIA +class PAIA extends \VuFind\ILS\Driver\PAIA { - /** - * URL of PAIA service - * - * @var - */ - protected $paiaURL; - - /** - * Timeout in seconds to be used for PAIA http requests - * - * @var - */ - protected $paiaTimeout = null; - - /** - * Flag to switch on/off caching for PAIA items - * - * @var bool - */ - protected $paiaCacheEnabled = false; - - /** - * Session containing PAIA login information - * - * @var Zend\Session\Container - */ - protected $session; - - /** - * SessionManager - * - * @var \VuFind\SessionManager - */ - protected $sessionManager; - - /** - * PAIA status strings - * - * @var array - */ - protected static $statusStrings = [ - '0' => 'no relation', - '1' => 'reserved', - '2' => 'ordered', - '3' => 'held', - '4' => 'provided', - '5' => 'rejected', - ]; - /** * PAIA scopes as defined in http://gbv.github.io/paia/paia.html#access-tokens-and-scopes */ @@ -117,124 +68,15 @@ class PAIA extends DAIA * Constructor * * @param \VuFind\Date\Converter $converter Date converter + * @param \Zend\Session\SessionManager $sessionManager Session Manager */ - public function __construct(\VuFind\Date\Converter $converter, \Zend\Session\SessionManager $sessionManager) - { + public function __construct(\VuFind\Date\Converter $converter, + \Zend\Session\SessionManager $sessionManager + ) { parent::__construct($converter); $this->sessionManager = $sessionManager; } - /** - * Get the session container (constructing it on demand if not already present) - * - * @return SessionContainer - */ - protected function getSession() - { - // SessionContainer not defined yet? Build it now: - if (null === $this->session) { - $this->session = new \Zend\Session\Container('PAIA', $this->sessionManager); - } - return $this->session; - } - - /** - * Initialize the driver. - * - * Validate configuration and perform all resource-intensive tasks needed to - * make the driver active. - * - * @throws ILSException - * @return void - */ - public function init() - { - parent::init(); - - if (!(isset($this->config['PAIA']['baseUrl']))) { - throw new ILSException('PAIA/baseUrl configuration needs to be set.'); - } - $this->paiaURL = $this->config['PAIA']['baseUrl']; - - // use PAIA specific timeout setting for http requests if configured - if ((isset($this->config['PAIA']['timeout']))) { - $this->paiaTimeout = $this->config['PAIA']['timeout']; - } - - // do we have caching enabled for PAIA - if (isset($this->config['PAIA']['paiaCache'])) { - $this->paiaCacheEnabled = $this->config['PAIA']['paiaCache']; - } else { - $this->debug('Caching not enabled, disabling it by default.'); - } - } - - // public functions implemented to satisfy Driver Interface - - /* - -- = previously implemented - +- = modified implementation - ?? = unclear if necessary for PAIA - !! = not necessary for PAIA - DD = implemented in DAIA - CC = should be implemented/customized for individual needs - - VuFind2 ILS-Driver methods: - - -- - cancelHolds - +- - changePassword - CC - checkRequestIsValid - !! - findReserves - -- - getCancelHoldDetails - !! - getCancelHoldLink - DD - getConfig - !! - getConsortialHoldings - !! - getCourses - -- - getDefaultPickUpLocation - !! - getDepartments - -- - getFunds - ?? - getHoldDefaultRequiredDate - +- - getHolding - +- - getHoldLink // should be customized for individual needs via getILSHoldLink - !! - getInstructors - +- - getMyFines - +- - getMyHolds - +- - getMyProfile - +- - getMyTransactions - +- - getNewItems - !! - getOfflineMode - -- - getPickUpLocations // should be customized for individual needs - DD - getPurchaseHistory - -- - getRenewDetails - DD - getStatus - DD - getStatuses - !! - getSuppressedAuthorityRecords - !! - getSuppressedRecords - !! - hasHoldings - -- - init - !! - loginIsHidden - +- - patronLogin - +- - placeHold - +- - renewMyItems - !! - renewMyItemsLink - DD - setConfig - !! - supportsMethod - - +- - getMyStorageRetrievalRequests - +- - checkStorageRetrievalRequestIsValid - +- - placeStorageRetrievalRequest - CC - cancelStorageRetrievalRequests - CC - getCancelStorageRetrievalRequestDetails - - CC - getMyILLRequests - CC - checkILLRequestIsValid - CC - getILLPickupLibraries - CC - getILLPickupLocations - CC - placeILLRequest - CC - cancelILLRequests - CC - getCancelILLRequestDetails - */ - /** * This method cancels a list of holds for a specific patron. * @@ -283,7 +125,7 @@ class PAIA extends DAIA $details = []; - if (array_key_exists('error', $array_response)) { + if (isset($array_response['error'])) { $details[] = [ 'success' => false, 'status' => $array_response['error_description'], @@ -319,7 +161,7 @@ class PAIA extends DAIA // Otherwise the changed status will not be shown before the cache // expires. if ($this->paiaCacheEnabled) { - $this->removeCachedData($patron['cat_username'] . '_items'); + $this->removeCachedData($patron['cat_username']); } } $returnArray = ['count' => $count, 'items' => $details]; @@ -393,57 +235,6 @@ class PAIA extends DAIA return $details; } - /** - * This method returns a string to use as the input form value for - * cancelling each hold item. (optional, but required if you - * implement cancelHolds). Not supported prior to VuFind 1.2 - * - * @param array $checkOutDetails One of the individual item arrays returned by - * the getMyHolds method - * - * @return string A string to use as the input form value for cancelling - * each hold item; you can pass any data that is needed - * by your ILS to identify the hold – the output of this - * method will be used as part of the input to the - * cancelHolds method. - */ - public function getCancelHoldDetails($checkOutDetails) - { - return($checkOutDetails['cancel_details']); - } - - /** - * Get Default Pick Up Location - * - * @param array $patron Patron information returned by the patronLogin - * method. - * @param array $holdDetails Optional array, only passed in when getting a list - * in the context of placing a hold; contains most of the same values passed to - * placeHold, minus the patron data. May be used to limit the pickup options - * or may be ignored. - * - * @return string The default pickup location for the patron. - */ - public function getDefaultPickUpLocation($patron = null, $holdDetails = null) - { - return false; - } - - /** - * Get Funds - * - * Return a list of funds which may be used to limit the getNewItems list. - * - * @return array An associative array with key = fund ID, value = fund name. - */ - public function getFunds() - { - // If you do not want or support such limits, just return an empty - // array here and the limit control on the new item search screen - // will disappear. - return []; - } - /** * Get Patron Fines * @@ -506,62 +297,6 @@ class PAIA extends DAIA return $results; } - /** - * Gets additional array fields for the item. - * Override this method in your custom PAIA driver if necessary. - * - * @param array $fee The fee array from PAIA - * - * @return array Additional fee data for the item - */ - protected function getAdditionalFeeData($fee, $patron = null) - { - $additionalData = []; - // Add the item title using the about field, - // but only if this fee is caused by some item - if (isset($fee['item'])) { - $additionalData['title'] = $fee['about']; - } - - // custom PAIA fields - // fee.about 0..1 string textual information about the fee - // fee.item 0..1 URI item that caused the fee - // fee.feeid 0..1 URI URI of the type of service that - // caused the fee - $additionalData['feeid'] = (isset($fee['feeid']) - ? $fee['feeid'] : null); - $additionalData['about'] = (isset($fee['about']) - ? $fee['about'] : null); - $additionalData['item'] = (isset($fee['item']) - ? $fee['item'] : null); - $additionalData['title'] = (isset($fee['title']) - ? $fee['title'] : null); - - return $additionalData; - } - - /** - * Get Patron Holds - * - * This is responsible for retrieving all holds by a specific patron. - * - * @param array $patron The patron array from patronLogin - * - * @return mixed Array of the patron's holds on success. - */ - public function getMyHolds($patron) - { - // filters for getMyHolds are: - // status = 1 - reserved (the document is not accessible for the patron yet, - // but it will be) - // 4 - provided (the document is ready to be used by the patron) - $filter = ['status' => [1, 4]]; - // get items-docs for given filters - $items = $this->paiaGetItems($patron, $filter); - - return $this->mapPaiaItems($items, 'myHoldsMapping'); - } - /** * Get Patron Profile * @@ -590,113 +325,12 @@ class PAIA extends DAIA 'expires' => isset($patron['expires']) ? $this->convertDate($patron['expires']) : null, 'statuscode' => isset($patron['status']) ? $patron['status'] : null, - 'canWrite' => in_array(self::SCOPE_WRITE_ITEMS, $this->getSession()->scope), + 'canWrite' => in_array(self::SCOPE_WRITE_ITEMS, $this->getScope()), ]; } return []; } - /** - * Get Patron Transactions - * - * This is responsible for retrieving all transactions (i.e. checked out items) - * by a specific patron. - * - * @param array $patron The patron array from patronLogin - * - * @return array Array of the patron's transactions on success, - */ - public function getMyTransactions($patron) - { - // filters for getMyTransactions are: - // status = 3 - held (the document is on loan by the patron) - $filter = ['status' => [3]]; - // get items-docs for given filters - $items = $this->paiaGetItems($patron, $filter); - - return $this->mapPaiaItems($items, 'myTransactionsMapping'); - } - - /** - * Get Patron StorageRetrievalRequests - * - * This is responsible for retrieving all storage retrieval requests - * by a specific patron. - * - * @param array $patron The patron array from patronLogin - * - * @return array Array of the patron's storage retrieval requests on success, - */ - public function getMyStorageRetrievalRequests($patron) - { - // filters for getMyStorageRetrievalRequests are: - // status = 2 - ordered (the document is ordered by the patron) - $filter = ['status' => [2]]; - // get items-docs for given filters - $items = $this->paiaGetItems($patron, $filter); - - return $this->mapPaiaItems($items, 'myStorageRetrievalRequestsMapping'); - } - - /** - * This method queries the ILS for new items - * - * @param string $page page number of results to retrieve (counting starts @1) - * @param string $limit the size of each page of results to retrieve - * @param string $daysOld the maximum age of records to retrieve in days (max 30) - * @param string $fundID optional fund ID to use for limiting results - * - * @return array An associative array with two keys: 'count' (the number of items - * in the 'results' array) and 'results' (an array of associative arrays, each - * with a single key: 'id', a record ID). - */ - public function getNewItems($page, $limit, $daysOld, $fundID) - { - return []; - } - - /** - * Get Pick Up Locations - * - * This is responsible for gettting a list of valid library locations for - * holds / recall retrieval - * - * @param array $patron Patron information returned by the patronLogin - * method. - * @param array $holdDetails Optional array, only passed in when getting a list - * in the context of placing a hold; contains most of the same values passed to - * placeHold, minus the patron data. May be used to limit the pickup options - * or may be ignored. The driver must not add new options to the return array - * based on this data or other areas of VuFind may behave incorrectly. - * - * @return array An array of associative arrays with locationID and - * locationDisplay keys - */ - public function getPickUpLocations($patron = null, $holdDetails = null) - { - // How to get valid PickupLocations for a PICA LBS? - return []; - } - - /** - * This method returns a string to use as the input form value for renewing - * each hold item. (optional, but required if you implement the - * renewMyItems method) Not supported prior to VuFind 1.2 - * - * @param array $checkOutDetails One of the individual item arrays returned by - * the getMyTransactions method - * - * @return string A string to use as the input form value for renewing - * each item; you can pass any data that is needed by your - * ILS to identify the transaction to renew – the output - * of this method will be used as part of the input to the - * renewMyItems method. - */ - public function getRenewDetails($checkOutDetails) - { - return($checkOutDetails['renew_details']); - } - /** * Patron Login * @@ -807,43 +441,6 @@ class PAIA extends DAIA } } - /** - * PAIA helper function to map session data to return value of patronLogin() - * - * @param $details Patron details returned by patronLogin - * @param $password Patron cataloge password - * @return mixed - */ - protected function enrichUserDetails($details, $password) - { - $session = $this->getSession(); - - $details['cat_username'] = $session->patron; - $details['cat_password'] = $password; - return $details; - } - - /** - * Returns an array with PAIA confirmations based on the given holdDetails which - * will be used for a request. - * Currently two condition types are supported: - * - http://purl.org/ontology/paia#StorageCondition to select a document - * location -- mapped to pickUpLocation - * - http://purl.org/ontology/paia#FeeCondition to confirm or select a document - * service causing a fee -- not mapped yet - * - * @param $details - * @return array - */ - protected function getConfirmations($holdDetails) { - $confirmations = []; - if (isset($holdDetails['pickUpLocation'])) { - $confirmations['http://purl.org/ontology/paia#StorageCondition'] - = [$holdDetails['pickUpLocation']]; - } - return $confirmations; - } - /** * Place Hold * @@ -887,7 +484,7 @@ class PAIA extends DAIA } $details = []; - if (array_key_exists('error', $array_response)) { + if (isset($array_response['error'])) { $details = [ 'success' => false, 'sysMessage' => $array_response['error_description'] @@ -895,7 +492,7 @@ class PAIA extends DAIA } else { $elements = $array_response['doc']; foreach ($elements as $element) { - if (array_key_exists('error', $element)) { + if (isset($element['error'])) { $details = [ 'success' => false, 'sysMessage' => $element['error'] @@ -917,23 +514,6 @@ class PAIA extends DAIA return $details; } - /** - * Place a Storage Retrieval Request - * - * Attempts to place a request on a particular item and returns - * an array with result details. - * - * @param array $details An array of item and patron data - * - * @return mixed An array of data on the request including - * whether or not it was successful and a system message (if available) - */ - public function placeStorageRetrievalRequest($details) - { - // Making a storage retrieval request is the same in PAIA as placing a Hold - return $this->placeHold($details); - } - /** * This method renews a list of items for a specific patron. * @@ -983,7 +563,7 @@ class PAIA extends DAIA $details = []; - if (array_key_exists('error', $array_response)) { + if (isset($array_response['error'])) { $details[] = [ 'success' => false, 'sysMessage' => $array_response['error_description'] @@ -1027,7 +607,7 @@ class PAIA extends DAIA // item renew was successfull and therefore the status changed. Otherwise // the changed status will not be shown before the cache expires. if ($this->paiaCacheEnabled) { - $this->removeCachedData($patron['cat_username'] . '_items'); + $this->removeCachedData($patron['cat_username']); } } $returnArray = ['blocks' => false, 'details' => $details]; @@ -1038,19 +618,6 @@ class PAIA extends DAIA * PAIA functions */ - /** - * PAIA support method to return strings for PAIA service status values - * - * @param string $status PAIA service status - * - * @return string Describing PAIA service status - */ - protected function paiaStatusString($status) - { - return isset(self::$statusStrings[$status]) - ? self::$statusStrings[$status] : ''; - } - /** * PAIA support method for PAIA core method 'items' returning only those * documents containing the given service status. @@ -1069,7 +636,7 @@ class PAIA extends DAIA // check for existing data in cache if ($this->paiaCacheEnabled) { - $itemsResponse = $this->getCachedData($patron['cat_username'] . '_items'); + $itemsResponse = $this->getCachedData($patron['cat_username']); } if (!isset($itemsResponse) || $itemsResponse == null) { @@ -1082,7 +649,7 @@ class PAIA extends DAIA throw $e; } if ($this->paiaCacheEnabled) { - $this->putCachedData($patron['cat_username'] . '_items', $itemsResponse); + $this->putCachedData($patron['cat_username'], $itemsResponse); } } @@ -1114,84 +681,6 @@ class PAIA extends DAIA return []; } - /** - * PAIA support method to retrieve needed ItemId in case PAIA-response does not - * contain it - * - * @param string $id itemId - * - * @return string $id - */ - protected function getAlternativeItemId($id) - { - return $id; - } - - /** - * PAIA support function to implement ILS specific parsing of user_details - * - * @param string $patron User id - * @param array $user_response Array with PAIA response data - * - * @return array - */ - protected function paiaParseUserDetails($patron, $user_response) - { - $username = trim($user_response['name']); - if (count(explode(',', $username)) == 2) { - $nameArr = explode(',', $username); - $firstname = $nameArr[1]; - $lastname = $nameArr[0]; - } else { - $nameArr = explode(' ', $username); - $firstname = $nameArr[0]; - $lastname = ''; - array_shift($nameArr); - foreach ($nameArr as $value) { - $lastname .= ' '.$value; - } - $lastname = trim($lastname); - } - - // TODO: implement parsing of user details according to types set - // (cf. https://github.com/gbv/paia/issues/29) - - $user = []; - $user['id'] = $patron; - $user['firstname'] = $firstname; - $user['lastname'] = $lastname; - $user['email'] = (isset($user_response['email']) - ? $user_response['email'] : ''); - $user['major'] = null; - $user['college'] = null; - // add other information from PAIA - we don't want anything to get lost while parsing - foreach ($user_response as $key => $value) { - if (!isset($user[$key])) { - $user[$key] = $value; - } - } - return $user; - } - - /** - * PAIA helper function to allow customization of mapping from PAIA response to - * VuFind ILS-method return values. - * - * @param array $items Array of PAIA items to be mapped - * @param string $mapping String identifying a custom mapping-method - * - * @return array - */ - protected function mapPaiaItems($items, $mapping) - { - if (is_callable([$this, $mapping])) { - return $this->$mapping($items); - } - - $this->debug('Could not call method: ' . $mapping . '() .'); - return []; - } - /** * This PAIA helper function allows custom overrides for mapping of PAIA response * to getMyHolds data structure. @@ -1211,8 +700,10 @@ class PAIA extends DAIA $result['item_id'] = (isset($doc['item']) ? $doc['item'] : ''); $result['cancel_details'] - = (isset($doc['cancancel']) && $doc['cancancel'] && $this->paiaCheckScope(self::SCOPE_WRITE_ITEMS)) - ? $result['item_id'] : ''; + = (isset($doc['cancancel']) + && $doc['cancancel'] + && $this->paiaCheckScope(self::SCOPE_WRITE_ITEMS) + ) ? $result['item_id'] : ''; // edition (0..1) URI of a the document (no particular copy) // hook for retrieving alternative ItemId in case PAIA does not @@ -1234,20 +725,28 @@ class PAIA extends DAIA // about (0..1) textual description of the document $result['title'] = (isset($doc['about']) ? $doc['about'] : null); + // PAIA custom field // label (0..1) call number, shelf mark or similar item label - $result['callnumber'] = (isset($doc['label']) ? $doc['label'] : null); // PAIA custom field + $result['callnumber'] = $this->getCallNumber($doc); /* * meaning of starttime and endtime depends on status: * - * status | starttime | endtime - * -------+--------------------------------+------------------------------------------------------- - * 0 | - | - - * 1 | when the document was reserved | when the reserved document is expected to be available - * 2 | when the document was ordered | when the ordered document is expected to be available - * 3 | when the document was lend | when the loan period ends or ended (due) - * 4 | when the document is provided | when the provision will expire - * 5 | when the request was rejected | - + * status | starttime + * | endtime + * -------+-------------------------------- + * 0 | - + * | - + * 1 | when the document was reserved + * | when the reserved document is expected to be available + * 2 | when the document was ordered + * | when the ordered document is expected to be available + * 3 | when the document was lend + * | when the loan period ends or ended (due) + * 4 | when the document is provided + * | when the provision will expire + * 5 | when the request was rejected + * | - */ $result['create'] = (isset($doc['starttime']) @@ -1300,8 +799,10 @@ class PAIA extends DAIA $result['item_id'] = (isset($doc['item']) ? $doc['item'] : ''); $result['cancel_details'] - = (isset($doc['cancancel']) && $doc['cancancel'] && $this->paiaCheckScope(self::SCOPE_WRITE_ITEMS)) - ? $result['item_id'] : ''; + = (isset($doc['cancancel']) + && $doc['cancancel'] + && $this->paiaCheckScope(self::SCOPE_WRITE_ITEMS) + ) ? $result['item_id'] : ''; // edition (0..1) URI of a the document (no particular copy) // hook for retrieving alternative ItemId in case PAIA does not @@ -1323,8 +824,9 @@ class PAIA extends DAIA // about (0..1) textual description of the document $result['title'] = (isset($doc['about']) ? $doc['about'] : null); + // PAIA custom field // label (0..1) call number, shelf mark or similar item label - $result['callnumber'] = (isset($doc['label']) ? $doc['label'] : null); // PAIA custom field + $result['callnumber'] = $this->getCallNumber($doc); $result['create'] = (isset($doc['starttime']) ? $this->convertDatetime($doc['starttime']) : ''); @@ -1361,15 +863,18 @@ class PAIA extends DAIA foreach ($items as $doc) { $result = []; // canrenew (0..1) whether a document can be renewed (bool) - $result['renewable'] = (isset($doc['canrenew']) && $this->paiaCheckScope(self::SCOPE_WRITE_ITEMS)) - ? $doc['canrenew'] : false; + $result['renewable'] = (isset($doc['canrenew']) + && $this->paiaCheckScope(self::SCOPE_WRITE_ITEMS) + ) ? $doc['canrenew'] : false; // item (0..1) URI of a particular copy $result['item_id'] = (isset($doc['item']) ? $doc['item'] : ''); $result['renew_details'] - = (isset($doc['canrenew']) && $doc['canrenew'] && $this->paiaCheckScope(self::SCOPE_WRITE_ITEMS)) - ? $result['item_id'] : ''; + = (isset($doc['canrenew']) + && $doc['canrenew'] + && $this->paiaCheckScope(self::SCOPE_WRITE_ITEMS) + ) ? $result['item_id'] : ''; // edition (0..1) URI of a the document (no particular copy) // hook for retrieving alternative ItemId in case PAIA does not @@ -1389,7 +894,9 @@ class PAIA extends DAIA $result['renew'] = (isset($doc['renewals']) ? $doc['renewals'] : null); // reminder (0..1) number of times the patron has been reminded - $result['reminder'] = (isset($doc['reminder']) ? $doc['reminder'] : null); + $result['reminder'] = ( + isset($doc['reminder']) ? $doc['reminder'] : null + ); // custom PAIA field // starttime (0..1) date and time when the status began @@ -1416,8 +923,9 @@ class PAIA extends DAIA // storageid (0..1) location URI + // PAIA custom field // label (0..1) call number, shelf mark or similar item label - $result['callnumber'] = (isset($doc['label']) ? $doc['label'] : null); // PAIA custom field + $result['callnumber'] = $this->getCallNumber($doc); // Optional VuFind fields /* @@ -1439,85 +947,6 @@ class PAIA extends DAIA return $results; } - /** - * Post something to a foreign host - * - * @param string $file POST target URL - * @param string $data_to_send POST data - * @param string $access_token PAIA access token for current session - * - * @return string POST response - * @throws ILSException - */ - protected function paiaPostRequest($file, $data_to_send, $access_token = null) - { - // json-encoding - $postData = json_encode($data_to_send); - - $http_headers = []; - if (isset($access_token)) { - $http_headers['Authorization'] = 'Bearer ' .$access_token; - } - - try { - $result = $this->httpService->post( - $this->paiaURL . $file, - $postData, - 'application/json; charset=UTF-8', - $this->paiaTimeout, - $http_headers - ); - } catch (\Exception $e) { - throw new ILSException($e->getMessage()); - } - - if (!$result->isSuccess()) { - // log error for debugging - $this->debug( - 'HTTP status ' . $result->getStatusCode() . - ' received' - ); - } - // return any result as error-handling is done elsewhere - return ($result->getBody()); - } - - /** - * GET data from foreign host - * - * @param string $file GET target URL - * @param string $access_token PAIA access token for current session - * - * @return bool|string - * @throws ILSException - */ - protected function paiaGetRequest($file, $access_token) - { - $http_headers = [ - 'Authorization' => 'Bearer ' .$access_token, - 'Content-type' => 'application/json; charset=UTF-8', - ]; - - try { - $result = $this->httpService->get( - $this->paiaURL . $file, - [], $this->paiaTimeout, $http_headers - ); - } catch (\Exception $e) { - throw new ILSException($e->getMessage()); - } - - if (!$result->isSuccess()) { - // log error for debugging - $this->debug( - 'HTTP status ' . $result->getStatusCode() . - ' received' - ); - } - // return any result as error-handling is done elsewhere - return ($result->getBody()); - } - /** * Helper function for PAIA to uniformely parse JSON * @@ -1561,7 +990,8 @@ class PAIA extends DAIA try { $responseArray = $this->paiaParseJsonAsArray($responseJson); } catch (Exception $e) { - // all error handling is done in paiaHandleErrors so pass on the excpetion + // all error handling is done in paiaHandleErrors so pass on the + // excpetion throw $e; } @@ -1588,7 +1018,8 @@ class PAIA extends DAIA try { $responseArray = $this->paiaParseJsonAsArray($responseJson); } catch (ILSException $e) { - // all error handling is done in paiaHandleErrors so pass on the excpetion + // all error handling is done in paiaHandleErrors so pass on the + // excpetion throw $e; } @@ -1623,7 +1054,8 @@ class PAIA extends DAIA try { $responseArray = $this->paiaParseJsonAsArray($responseJson); } catch (Exception $e) { - // all error handling is done in paiaHandleErrors so pass on the excpetion + // all error handling is done in paiaHandleErrors so pass on the + // excpetion throw $e; } @@ -1680,7 +1112,8 @@ class PAIA extends DAIA try { $responseArray = $this->paiaParseJsonAsArray($responseJson); } catch (ILSException $e) { - // all error handling is done in paiaHandleErrors so pass on the excpetion + // all error handling is done in paiaHandleErrors so pass on the + // excpetion throw $e; } return $this->paiaParseUserDetails($patron, $responseArray); @@ -1734,10 +1167,10 @@ class PAIA extends DAIA if ( isset($patron['status']) && $patron['status'] == 0 && isset($patron['expires']) && $patron['expires'] > date('Y-m-d') - && in_array(self::SCOPE_WRITE_ITEMS, $this->getSession()->scope) + && in_array(self::SCOPE_WRITE_ITEMS, $this->getScope()) ) { return true; } return false; } -} \ No newline at end of file +} diff --git a/module/finc/src/finc/ILS/Logic/Holds.php b/module/finc/src/finc/ILS/Logic/Holds.php index 3f2351b5d07265b521a53caa24ad54983f9c3c39..11c48d65e2adef53a77b722f108d182162fb149c 100644 --- a/module/finc/src/finc/ILS/Logic/Holds.php +++ b/module/finc/src/finc/ILS/Logic/Holds.php @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package ILS_Logic diff --git a/module/finc/src/finc/Mailer/Factory.php b/module/finc/src/finc/Mailer/Factory.php index 5079169ce17c3d80ad8055af51f3eb946a186667..77d2998a3b02d91567d7a240520718a00b1161a7 100644 --- a/module/finc/src/finc/Mailer/Factory.php +++ b/module/finc/src/finc/Mailer/Factory.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Mailer diff --git a/module/finc/src/finc/Mailer/Mailer.php b/module/finc/src/finc/Mailer/Mailer.php index bd974f0be9f30e9dd8078f2d000d66ccf270cd79..821a436efb25919431187fa8faa8dfa89139124c 100644 --- a/module/finc/src/finc/Mailer/Mailer.php +++ b/module/finc/src/finc/Mailer/Mailer.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Mailer diff --git a/module/finc/src/finc/Recommend/EbscoResults.php b/module/finc/src/finc/Recommend/EbscoResults.php index 2e4fa1a62532a21dc5e937ded6c0acb3ca94fa96..4d34f558a1af88e143de5ea4a8e66acc561c43db 100644 --- a/module/finc/src/finc/Recommend/EbscoResults.php +++ b/module/finc/src/finc/Recommend/EbscoResults.php @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Recommendations diff --git a/module/finc/src/finc/Recommend/Factory.php b/module/finc/src/finc/Recommend/Factory.php index b2d00690592524e4c87315f71efceb7f5d2d71f7..d60d0140048d162762c78130eb5cd66be668daef 100644 --- a/module/finc/src/finc/Recommend/Factory.php +++ b/module/finc/src/finc/Recommend/Factory.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Recommendations diff --git a/module/finc/src/finc/RecordDriver/Factory.php b/module/finc/src/finc/RecordDriver/Factory.php index 663b617f43c1283a59d0c5b83b8c174bc919ac25..1d289901919936af3763aef2a04ee46393a41c33 100644 --- a/module/finc/src/finc/RecordDriver/Factory.php +++ b/module/finc/src/finc/RecordDriver/Factory.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package RecordDrivers diff --git a/module/finc/src/finc/RecordDriver/SolrAI.php b/module/finc/src/finc/RecordDriver/SolrAI.php index 911aa5e9bd714917a8d013c7feac6ff761a9099c..3dba84972e538779c1cd518172edf41b74f69233 100644 --- a/module/finc/src/finc/RecordDriver/SolrAI.php +++ b/module/finc/src/finc/RecordDriver/SolrAI.php @@ -18,9 +18,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * @category VuFind2 + * @category VuFind * @package RecordDrivers * @author André Lahmann <lahmann@ub.uni-leipzig.de> * @author Gregor Gawol <gawol@ub.uni-leipzig.de> @@ -34,7 +34,7 @@ use \VuFindHttp\HttpServiceAwareInterface as HttpServiceAwareInterface; * Recorddriver for Solr records from the aggregated index of Leipzig University * Library * - * @category VuFind2 + * @category VuFind * @package RecordDrivers * @author André Lahmann <lahmann@ub.uni-leipzig.de> * @author Gregor Gawol <gawol@ub.uni-leipzig.de> diff --git a/module/finc/src/finc/RecordDriver/SolrDefault.php b/module/finc/src/finc/RecordDriver/SolrDefault.php index 4bccf950c09f70f39c9edf763d09bbb1597b45da..2d76e76412e32ed12fb4c2b9811f5c61589a1fc4 100644 --- a/module/finc/src/finc/RecordDriver/SolrDefault.php +++ b/module/finc/src/finc/RecordDriver/SolrDefault.php @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package RecordDrivers diff --git a/module/finc/src/finc/RecordDriver/SolrDefaultFincTrait.php b/module/finc/src/finc/RecordDriver/SolrDefaultFincTrait.php index 5b1274aafb1be47c57df6fbb031f1c8716c56176..a24a01bf209804782d8a421a88b27fbd54369a59 100644 --- a/module/finc/src/finc/RecordDriver/SolrDefaultFincTrait.php +++ b/module/finc/src/finc/RecordDriver/SolrDefaultFincTrait.php @@ -18,9 +18,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * @category VuFind2 + * @category VuFind * @package RecordDrivers * @author André Lahmann <lahmann@ub.uni-leipzig.de> * @author Gregor Gawol <gawol@ub.uni-leipzig.de> @@ -38,7 +38,7 @@ use VuFindSearch\ParamBag, * finc specific model for Solr records based on the stock * VuFind\RecordDriver\SolrDefault * - * @category VuFind2 + * @category VuFind * @package RecordDrivers * @author André Lahmann <lahmann@ub.uni-leipzig.de> * @author Gregor Gawol <gawol@ub.uni-leipzig.de> diff --git a/module/finc/src/finc/RecordDriver/SolrIS.php b/module/finc/src/finc/RecordDriver/SolrIS.php index acd89ad39c490a0d00b5180fac1e22a9d5f31088..bdb63c61c2b6b97c10d1477a94f0b16bd4a98809 100644 --- a/module/finc/src/finc/RecordDriver/SolrIS.php +++ b/module/finc/src/finc/RecordDriver/SolrIS.php @@ -18,9 +18,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * @category VuFind2 + * @category VuFind * @package RecordDrivers * @author André Lahmann <lahmann@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License @@ -32,7 +32,7 @@ namespace finc\RecordDriver; * Recorddriver for Solr records with intermediate schema in field fullrecord in * index of Leipzig University Library * - * @category VuFind2 + * @category VuFind * @package RecordDrivers * @author André Lahmann <lahmann@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License diff --git a/module/finc/src/finc/RecordDriver/SolrLido.php b/module/finc/src/finc/RecordDriver/SolrLido.php index 985587645160fc2adab62fe852372e41971ff42b..146e17de2c37689af9aec34b01180778977fbae0 100644 --- a/module/finc/src/finc/RecordDriver/SolrLido.php +++ b/module/finc/src/finc/RecordDriver/SolrLido.php @@ -17,9 +17,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * @category VuFind2 + * @category VuFind * @package RecordDrivers * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License @@ -30,7 +30,7 @@ namespace finc\RecordDriver; /** * finc specific model for LIDO records with a fullrecord in Solr. * - * @category VuFind2 + * @category VuFind * @package RecordDrivers * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License diff --git a/module/finc/src/finc/RecordDriver/SolrLidoFincTrait.php b/module/finc/src/finc/RecordDriver/SolrLidoFincTrait.php index 4353f8abb5d7eb215a381d12f0e693ec4b5a579d..7c4ed314e9a9cc451f2759944192fcad57aac1fd 100644 --- a/module/finc/src/finc/RecordDriver/SolrLidoFincTrait.php +++ b/module/finc/src/finc/RecordDriver/SolrLidoFincTrait.php @@ -17,9 +17,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * @category VuFind2 + * @category VuFind * @package RecordDrivers * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License @@ -30,7 +30,7 @@ namespace finc\RecordDriver; /** * finc specific model for Lido records with a fullrecord in Solr. * - * @category VuFind2 + * @category VuFind * @package RecordDrivers * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License diff --git a/module/finc/src/finc/RecordDriver/SolrLidoNdl.php b/module/finc/src/finc/RecordDriver/SolrLidoNdl.php index 71e8b0e8e39954342683f0540047a5db330a33e7..078a6b999b4a15f7fedf2f73f41ff08c7245ba8a 100644 --- a/module/finc/src/finc/RecordDriver/SolrLidoNdl.php +++ b/module/finc/src/finc/RecordDriver/SolrLidoNdl.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package RecordDrivers diff --git a/module/finc/src/finc/RecordDriver/SolrMarc.php b/module/finc/src/finc/RecordDriver/SolrMarc.php index 5e832393e9b542ae72803d0057a5d8902b4dbce5..7d2e212476a4c441d5080eeaad1b52f91a405b8e 100644 --- a/module/finc/src/finc/RecordDriver/SolrMarc.php +++ b/module/finc/src/finc/RecordDriver/SolrMarc.php @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package RecordDrivers @@ -509,7 +509,7 @@ class SolrMarc extends SolrDefault // Loop through all subfields, collecting results that match the whitelist; // note that it is important to retain the original MARC order here! $allSubfields = $currentField->getSubfields(); - if (count($allSubfields) > 0) { + if (!empty($allSubfields)) { foreach ($allSubfields as $currentSubfield) { if (in_array($currentSubfield->getCode(), $subfields)) { // Grab the current subfield value and act on it if it is @@ -523,7 +523,7 @@ class SolrMarc extends SolrDefault } // Send back the data in a different format depending on $concat mode: - return $concat ? [implode($separator, $matches)] : $matches; + return $concat && $matches ? [implode($separator, $matches)] : $matches; } /** @@ -1055,7 +1055,7 @@ class SolrMarc extends SolrDefault { if ($this->hasILS()) { $biblioLevel = strtolower($this->getBibliographicLevel()); - if ("monograph" == $biblioLevel || strstr("part", $biblioLevel)) { + if ("monograph" == $biblioLevel || strstr($biblioLevel, "part")) { if ($this->ils->getTitleHoldsMode() != "disabled") { return $this->titleHoldLogic->getHold($this->getUniqueID()); } diff --git a/module/finc/src/finc/RecordDriver/SolrMarcFinc.php b/module/finc/src/finc/RecordDriver/SolrMarcFinc.php index 13422d421147c490f817cc71441036e800facb8c..637cf41c2459c8aa3d421c01a96af9946a083088 100644 --- a/module/finc/src/finc/RecordDriver/SolrMarcFinc.php +++ b/module/finc/src/finc/RecordDriver/SolrMarcFinc.php @@ -17,9 +17,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * @category VuFind2 + * @category VuFind * @package RecordDrivers * @author André Lahmann <lahmann@ub.uni-leipzig.de> * @author Gregor Gawol <gawol@ub.uni-leipzig.de> @@ -31,7 +31,7 @@ namespace finc\RecordDriver; /** * finc specific model for MARC records with a fullrecord in Solr. * - * @category VuFind2 + * @category VuFind * @package RecordDrivers * @author André Lahmann <lahmann@ub.uni-leipzig.de> * @author Gregor Gawol <gawol@ub.uni-leipzig.de> diff --git a/module/finc/src/finc/RecordDriver/SolrMarcFincPDA.php b/module/finc/src/finc/RecordDriver/SolrMarcFincPDA.php index 940c90c786925a84fb4bb35ab6d5deb953d79cc6..2696652beb73b456d77ce49300498a3a1b05181d 100644 --- a/module/finc/src/finc/RecordDriver/SolrMarcFincPDA.php +++ b/module/finc/src/finc/RecordDriver/SolrMarcFincPDA.php @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package RecordDrivers diff --git a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php index 045a58fd0975982947af65729dcca95691886804..0c3649ee0552f9d24e59f13e845ae1d0aee9219a 100644 --- a/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php +++ b/module/finc/src/finc/RecordDriver/SolrMarcFincTrait.php @@ -17,9 +17,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * @category VuFind2 + * @category VuFind * @package RecordDrivers * @author André Lahmann <lahmann@ub.uni-leipzig.de> * @author Gregor Gawol <gawol@ub.uni-leipzig.de> @@ -32,7 +32,7 @@ use VuFindSearch\Query\Query as Query; /** * finc specific model for MARC records with a fullrecord in Solr. * - * @category VuFind2 + * @category VuFind * @package RecordDrivers * @author André Lahmann <lahmann@ub.uni-leipzig.de> * @author Gregor Gawol <gawol@ub.uni-leipzig.de> diff --git a/module/finc/src/finc/RecordDriver/SolrMarcRemote.php b/module/finc/src/finc/RecordDriver/SolrMarcRemote.php index e3ffeaa22ff87bd538729af55325bed430450eb7..47cad91a4f41256bfb76717e8dec1c6d840c5d1d 100644 --- a/module/finc/src/finc/RecordDriver/SolrMarcRemote.php +++ b/module/finc/src/finc/RecordDriver/SolrMarcRemote.php @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package RecordDrivers diff --git a/module/finc/src/finc/RecordDriver/SolrMarcRemoteFinc.php b/module/finc/src/finc/RecordDriver/SolrMarcRemoteFinc.php index 7cd6d44a6ad325740998c552ec6a5160baac5bb5..b83e619c37856f9ba5dee6bdc2431bc8d3b85ed5 100644 --- a/module/finc/src/finc/RecordDriver/SolrMarcRemoteFinc.php +++ b/module/finc/src/finc/RecordDriver/SolrMarcRemoteFinc.php @@ -18,9 +18,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * @category VuFind2 + * @category VuFind * @package RecordDrivers * @author André Lahmann <lahmann@ub.uni-leipzig.de> * @author Gregor Gawol <gawol@ub.uni-leipzig.de> @@ -33,7 +33,7 @@ namespace finc\RecordDriver; * finc specific model for MARC records without a fullrecord in Solr. The fullrecord is being * retrieved from an external source. * - * @category VuFind2 + * @category VuFind * @package RecordDrivers * @author André Lahmann <lahmann@ub.uni-leipzig.de> * @author Gregor Gawol <gawol@ub.uni-leipzig.de> diff --git a/module/finc/src/finc/RecordTab/AcquisitionPDA.php b/module/finc/src/finc/RecordTab/AcquisitionPDA.php index b4a3e96c886667e887b0e0af04dfdc69f3aa63dd..5f97c9af3bc7ee6537c90e13b12371be3c5d6da3 100644 --- a/module/finc/src/finc/RecordTab/AcquisitionPDA.php +++ b/module/finc/src/finc/RecordTab/AcquisitionPDA.php @@ -18,26 +18,26 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * @category VuFind2 + * @category VuFind * @package RecordTabs * @author Demian Katz <demian.katz@villanova.edu> * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://vufind.org/wiki/vufind2:record_tabs Wiki + * @link https://vufind.org/wiki/development:plugins:record_tabs Wiki */ namespace finc\RecordTab; /** * Holdings (ILS) tab * - * @category VuFind2 + * @category VuFind * @package RecordTabs * @author Demian Katz <demian.katz@villanova.edu> * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://vufind.org/wiki/vufind2:record_tabs Wiki + * @link https://vufind.org/wiki/development:plugins:record_tabs Wiki */ class AcquisitionPDA extends \VuFind\RecordTab\AbstractBase { diff --git a/module/finc/src/finc/RecordTab/DescriptionLido.php b/module/finc/src/finc/RecordTab/DescriptionLido.php index 0d7e26d903cc9be03a7de354aa228a331a6f013b..00b004fce28cfebe57e41717fb9202b6491b362c 100644 --- a/module/finc/src/finc/RecordTab/DescriptionLido.php +++ b/module/finc/src/finc/RecordTab/DescriptionLido.php @@ -18,26 +18,26 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * @category VuFind2 + * @category VuFind * @package RecordTabs * @author Demian Katz <demian.katz@villanova.edu> * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://vufind.org/wiki/vufind2:record_tabs Wiki + * @link https://vufind.org/wiki/development:plugins:record_tabs Wiki */ namespace finc\RecordTab; /** * Holdings (ILS) tab * - * @category VuFind2 + * @category VuFind * @package RecordTabs * @author Demian Katz <demian.katz@villanova.edu> * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://vufind.org/wiki/vufind2:record_tabs Wiki + * @link https://vufind.org/wiki/development:plugins:record_tabs Wiki */ class DescriptionLido extends \VuFind\RecordTab\AbstractBase { diff --git a/module/finc/src/finc/RecordTab/Factory.php b/module/finc/src/finc/RecordTab/Factory.php index 726d9139a06fa467f01e10fd12bb68af84b571dc..c041ed4268b8634ceb4de2da4c29e872016e9945 100644 --- a/module/finc/src/finc/RecordTab/Factory.php +++ b/module/finc/src/finc/RecordTab/Factory.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package RecordDrivers diff --git a/module/finc/src/finc/RecordTab/HierarchyTree.php b/module/finc/src/finc/RecordTab/HierarchyTree.php index d5d3e29dba0c99a5ac6a53dd5fe0afb342ed0b70..1e764d10cea6fdadb8e025556afcb183a42a88c5 100644 --- a/module/finc/src/finc/RecordTab/HierarchyTree.php +++ b/module/finc/src/finc/RecordTab/HierarchyTree.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package RecordTabs diff --git a/module/finc/src/finc/RecordTab/StaffViewAI.php b/module/finc/src/finc/RecordTab/StaffViewAI.php index 2c7063cd19ec6b32cfc33d300159c2475060c60a..e5a97c6e997aea7c7526d781d97443786a2095c9 100644 --- a/module/finc/src/finc/RecordTab/StaffViewAI.php +++ b/module/finc/src/finc/RecordTab/StaffViewAI.php @@ -17,26 +17,26 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * @category VuFind2 + * @category VuFind * @package RecordTabs * @author Demian Katz <demian.katz@villanova.edu> * @author André Lahmann <lahmann@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://vufind.org/wiki/vufind2:record_tabs Wiki + * @link https://vufind.org/wiki/development:plugins:record_tabs Wiki */ namespace finc\RecordTab; /** * Staff view tab for AI records * - * @category VuFind2 + * @category VuFind * @package RecordTabs * @author Demian Katz <demian.katz@villanova.edu> * @author André Lahmann <lahmann@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://vufind.org/wiki/vufind2:record_tabs Wiki + * @link https://vufind.org/wiki/development:plugins:record_tabs Wiki */ class StaffViewAI extends \VuFind\RecordTab\AbstractBase { diff --git a/module/finc/src/finc/RecordTab/Topics.php b/module/finc/src/finc/RecordTab/Topics.php index f74dd76a10c155e9d32acdd6617f847ddf045be8..f7ad89137da86f32102e69bb789cdec2e2aa804a 100644 --- a/module/finc/src/finc/RecordTab/Topics.php +++ b/module/finc/src/finc/RecordTab/Topics.php @@ -17,24 +17,24 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * @category VuFind2 + * @category VuFind * @package RecordTabs * @author Demian Katz <demian.katz@villanova.edu> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://vufind.org/wiki/vufind2:record_tabs Wiki + * @link https://vufind.org/wiki/development:plugins:record_tabs Wiki */ namespace finc\RecordTab; /** * Topics tab * - * @category VuFind2 + * @category VuFind * @package RecordTabs * @author Demian Katz <demian.katz@villanova.edu> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://vufind.org/wiki/vufind2:record_tabs Wiki + * @link https://vufind.org/wiki/development:plugins:record_tabs Wiki */ class Topics extends \VuFind\RecordTab\AbstractBase { diff --git a/module/finc/src/finc/Resolver/Driver/Ezb.php b/module/finc/src/finc/Resolver/Driver/Ezb.php index d8af5c33db6c17916613e8810471c505497d86c1..7dd95fbee27abd68fef907dccea412742edcc2de 100644 --- a/module/finc/src/finc/Resolver/Driver/Ezb.php +++ b/module/finc/src/finc/Resolver/Driver/Ezb.php @@ -25,7 +25,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Resolver_Drivers diff --git a/module/finc/src/finc/Resolver/Driver/Factory.php b/module/finc/src/finc/Resolver/Driver/Factory.php index 6605089946cb002e8791618f1c1bf855d2a13973..eae9b98d3875badd5bfdbbcbde1c0e24f8a7fb35 100644 --- a/module/finc/src/finc/Resolver/Driver/Factory.php +++ b/module/finc/src/finc/Resolver/Driver/Factory.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Resolver_Drivers diff --git a/module/finc/src/finc/Rewrite/EblRewrite.php b/module/finc/src/finc/Rewrite/EblRewrite.php index 7bae857e4709677f312a74544ec02d23bf7f4315..0036772ca3909590f2a2bc557512dca261e1a0ba 100644 --- a/module/finc/src/finc/Rewrite/EblRewrite.php +++ b/module/finc/src/finc/Rewrite/EblRewrite.php @@ -17,14 +17,14 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * @category VuFind2 + * @category VuFind * @package Rewrite * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> * @author Demian Katz <demian.katz@villanova.edu> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://www.vufind.org Main Page + * @link https://vufind.org Main Page */ namespace finc\Rewrite; @@ -33,12 +33,12 @@ use ZfcRbac\Service\AuthorizationServiceAwareTrait; /** * Ebl / Schweitzer Rewrite service for VuFind. * - * @category VuFind2 + * @category VuFind * @package Rewrite * @author Frank Morgner <morgnerf@ub.uni-leipzig.de> * @author Demian Katz <demian.katz@villanova.edu> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://www.vufind.org Main Page + * @link https://vufind.org Main Page */ class EblRewrite { diff --git a/module/finc/src/finc/Rewrite/Factory.php b/module/finc/src/finc/Rewrite/Factory.php index 6d982117e9ee146c74ab5d787e4db5fcd9be2c48..b11399b5421fa8d538ce1342e93ffcb59de40fdf 100644 --- a/module/finc/src/finc/Rewrite/Factory.php +++ b/module/finc/src/finc/Rewrite/Factory.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Rewrite diff --git a/module/finc/src/finc/Rewrite/PluginFactory.php b/module/finc/src/finc/Rewrite/PluginFactory.php index 67068ca5fb03540945c0ac65956ff89566c35dba..4a86a180d41be459b1214b15cb305cb70c6af795 100644 --- a/module/finc/src/finc/Rewrite/PluginFactory.php +++ b/module/finc/src/finc/Rewrite/PluginFactory.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Rewrite diff --git a/module/finc/src/finc/Role/PermissionProvider/CatUserType.php b/module/finc/src/finc/Role/PermissionProvider/CatUserType.php index bd541c2145596c0d8b2e721f0ce7dcbef326a65a..964de5d70133c933e1d8128df2b304b822724229 100644 --- a/module/finc/src/finc/Role/PermissionProvider/CatUserType.php +++ b/module/finc/src/finc/Role/PermissionProvider/CatUserType.php @@ -17,13 +17,13 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * @category VuFind2 + * @category VuFind * @package Authorization * @author Demian Katz <demian.katz@villanova.edu> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://www.vufind.org Main Page + * @link https://vufind.org Main Page */ namespace finc\Role\PermissionProvider; use VuFind\Auth\ILSAuthenticator; @@ -32,11 +32,11 @@ use ZfcRbac\Service\AuthorizationService; /** * Username permission provider for VuFind. * - * @category VuFind2 + * @category VuFind * @package Authorization * @author Demian Katz <demian.katz@villanova.edu> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://www.vufind.org Main Page + * @link https://vufind.org Main Page */ class CatUserType implements \VuFind\Role\PermissionProvider\PermissionProviderInterface { diff --git a/module/finc/src/finc/Role/PermissionProvider/Factory.php b/module/finc/src/finc/Role/PermissionProvider/Factory.php index e9278250635650a347aae7158a8e84fa929b6e6b..4c7ec08627a1c9b34f5aecf608972791a1c96389 100644 --- a/module/finc/src/finc/Role/PermissionProvider/Factory.php +++ b/module/finc/src/finc/Role/PermissionProvider/Factory.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Authorization diff --git a/module/finc/src/finc/Role/PermissionProvider/IpRangeFoFor.php b/module/finc/src/finc/Role/PermissionProvider/IpRangeFoFor.php index e68d877b659d44e9d6b2c77bf0589bfb93a3ee18..ee4ead8ba2510a601e715952e771d81612d4ef08 100644 --- a/module/finc/src/finc/Role/PermissionProvider/IpRangeFoFor.php +++ b/module/finc/src/finc/Role/PermissionProvider/IpRangeFoFor.php @@ -18,30 +18,30 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * @category VuFind2 + * @category VuFind * @package Authorization * @author Demian Katz <demian.katz@villanova.edu> * @author Jochen Lienhard <lienhard@ub.uni-freiburg.de> * @author Ere Maijala <ere.maijala@helsinki.fi> * @author Gregor Gawol <gawol@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://www.vufind.org Main Page + * @link https://vufind.org Main Page */ namespace finc\Role\PermissionProvider; /** * IpRange permission provider for VuFind. * - * @category VuFind2 + * @category VuFind * @package Authorization * @author Demian Katz <demian.katz@villanova.edu> * @author Jochen Lienhard <lienhard@ub.uni-freiburg.de> * @author Ere Maijala <ere.maijala@helsinki.fi> * @author Gregor Gawol <gawol@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://www.vufind.org Main Page + * @link https://vufind.org Main Page */ class IpRangeFoFor extends \VuFind\Role\PermissionProvider\IpRange { diff --git a/module/finc/src/finc/Role/PermissionProvider/IpRegExFoFor.php b/module/finc/src/finc/Role/PermissionProvider/IpRegExFoFor.php index d429dd21fff8ab9e05365f4323bb22c1c8300ad2..07afb30d8f1717f736087d265ef6876b677b042d 100644 --- a/module/finc/src/finc/Role/PermissionProvider/IpRegExFoFor.php +++ b/module/finc/src/finc/Role/PermissionProvider/IpRegExFoFor.php @@ -17,24 +17,24 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * @category VuFind2 + * @category VuFind * @package Authorization * @author Gregor Gawol <gawol@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://www.vufind.org Main Page + * @link https://vufind.org Main Page */ namespace finc\Role\PermissionProvider; /** * IpRegExFoFor permission provider for VuFind. * - * @category VuFind2 + * @category VuFind * @package Authorization * @author Gregor Gawol <gawol@ub.uni-leipzig.de> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License - * @link http://www.vufind.org Main Page + * @link https://vufind.org Main Page */ class IpRegExFoFor extends \VuFind\Role\PermissionProvider\IpRegEx { diff --git a/module/finc/src/finc/Service/Factory.php b/module/finc/src/finc/Service/Factory.php index 4efbc4ba42544fbe75f2fda7a4676cae6c7f349c..58c02e8b8854ff8393c5e50fd954822b140e304d 100644 --- a/module/finc/src/finc/Service/Factory.php +++ b/module/finc/src/finc/Service/Factory.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Service diff --git a/module/finc/src/finc/Session/ManagerFactory.php b/module/finc/src/finc/Session/ManagerFactory.php index 6dc0836a1e9dc23ac7b80518a708b68ab120222a..e642cbebf26f53c5500b63e8fb5b2090bebdfd0d 100644 --- a/module/finc/src/finc/Session/ManagerFactory.php +++ b/module/finc/src/finc/Session/ManagerFactory.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package Session_Handlers diff --git a/module/finc/src/finc/View/Helper/Root/BranchInfo.php b/module/finc/src/finc/View/Helper/Root/BranchInfo.php index 51fbe6fb8ff669984735fdafce4939c6af1649f5..82b7712a833d04e5474a7870de4cf17f1642574f 100644 --- a/module/finc/src/finc/View/Helper/Root/BranchInfo.php +++ b/module/finc/src/finc/View/Helper/Root/BranchInfo.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package View_Helpers diff --git a/module/finc/src/finc/View/Helper/Root/Citation.php b/module/finc/src/finc/View/Helper/Root/Citation.php index 326da2879bd83cbb94064c31842b3dffec524f77..31d98172b211d9906b516d4edb07b713aa677ee7 100644 --- a/module/finc/src/finc/View/Helper/Root/Citation.php +++ b/module/finc/src/finc/View/Helper/Root/Citation.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package View_Helpers diff --git a/module/finc/src/finc/View/Helper/Root/ExternalCatalogueLink.php b/module/finc/src/finc/View/Helper/Root/ExternalCatalogueLink.php index eb247bd784465d2ca64d5a6624048c7269df4641..e0147949814963638494a09cc65def9fda70cb6b 100644 --- a/module/finc/src/finc/View/Helper/Root/ExternalCatalogueLink.php +++ b/module/finc/src/finc/View/Helper/Root/ExternalCatalogueLink.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package View_Helpers diff --git a/module/finc/src/finc/View/Helper/Root/Factory.php b/module/finc/src/finc/View/Helper/Root/Factory.php index 8ba0fb481fcf625490e2dac135ab9940c3f0e7fa..0501b70ebb1d9c5b53c7aa119b06119e9bad6757 100644 --- a/module/finc/src/finc/View/Helper/Root/Factory.php +++ b/module/finc/src/finc/View/Helper/Root/Factory.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package View_Helpers @@ -136,15 +136,23 @@ class Factory public static function getOpenUrl(ServiceManager $sm) { $config = $sm->getServiceLocator()->get('VuFind\Config')->get('Resolver'); - $openUrlRules = json_decode( - file_get_contents( - \VuFind\Config\Locator::getConfigPath('OpenUrlRules.json') - ), - true - ); + + // check if config json exists, as fallback empty array is passed to + // constructor + if (file_exists( + \VuFind\Config\Locator::getConfigPath('OpenUrlRules.json') + )) { + $openUrlRules = json_decode( + file_get_contents( + \VuFind\Config\Locator::getConfigPath('OpenUrlRules.json') + ), + true + ); + } + return new OpenUrl( $sm->get('context'), - $openUrlRules, + empty($openUrlRules) ? [] : $openUrlRules, isset($config->General) ? $config : null ); } @@ -172,15 +180,22 @@ class Factory */ public static function getExternalCatalogueLink(ServiceManager $sm) { - $externalAccessLinks = json_decode( - file_get_contents( - \VuFind\Config\Locator::getConfigPath('ExternalCatalogue.json') - ), - true - ); + // check if config json exists, as fallback empty array is passed to + // constructor + if (file_exists( + \VuFind\Config\Locator::getConfigPath('ExternalCatalogue.json') + )) { + $externalAccessLinks = json_decode( + file_get_contents( + \VuFind\Config\Locator::getConfigPath('ExternalCatalogue.json') + ), + true + ); + } + return new ExternalCatalogueLink( $sm->getServiceLocator()->get('VuFind\Config')->get('config'), - $externalAccessLinks + empty($externalAccessLinks) ? [] : $externalAccessLinks ); } diff --git a/module/finc/src/finc/View/Helper/Root/InterlibraryLoanLink.php b/module/finc/src/finc/View/Helper/Root/InterlibraryLoanLink.php index 129856e6be6e74350025974a1ae94458f16e36d0..9896311b2adc70d881158cb4321a14f9590d3226 100644 --- a/module/finc/src/finc/View/Helper/Root/InterlibraryLoanLink.php +++ b/module/finc/src/finc/View/Helper/Root/InterlibraryLoanLink.php @@ -17,9 +17,9 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * @category VuFind2 + * @category VuFind * @package View_Helpers * @author Demian Katz <demian.katz@villanova.edu> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License @@ -32,7 +32,7 @@ use Zend\View\Helper\AbstractHelper; /** * Record link view helper * - * @category VuFind2 + * @category VuFind * @package View_Helpers * @author Demian Katz <demian.katz@villanova.edu> * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License diff --git a/module/finc/src/finc/View/Helper/Root/OpenUrl.php b/module/finc/src/finc/View/Helper/Root/OpenUrl.php index a36977e8e7919d948e19c6be3306397ad112d087..a6b47243b7833e2f7db019ea80e102011fd7b0f6 100644 --- a/module/finc/src/finc/View/Helper/Root/OpenUrl.php +++ b/module/finc/src/finc/View/Helper/Root/OpenUrl.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package View_Helpers diff --git a/module/finc/src/finc/View/Helper/Root/Permission.php b/module/finc/src/finc/View/Helper/Root/Permission.php index 0a0c043460f62c33b035e2b776b3f6c1d033ac40..bb0d10865bd79d665bd0619049def37d6e6dc929 100644 --- a/module/finc/src/finc/View/Helper/Root/Permission.php +++ b/module/finc/src/finc/View/Helper/Root/Permission.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package View_Helpers diff --git a/module/finc/src/finc/View/Helper/Root/Record.php b/module/finc/src/finc/View/Helper/Root/Record.php index 7e6936c42ca4543a631b68dd35171c12d830dc77..9f18c3912678c2ebb852c1326ad8186ede8c9bcf 100644 --- a/module/finc/src/finc/View/Helper/Root/Record.php +++ b/module/finc/src/finc/View/Helper/Root/Record.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package View_Helpers diff --git a/module/finc/src/finc/View/Helper/Root/RecordLink.php b/module/finc/src/finc/View/Helper/Root/RecordLink.php index 0d2343c816e70f1da6bc33a8071aa7d1024c1f1f..bbebc9c4169420722ac8f9bbe6148683b1b52eed 100644 --- a/module/finc/src/finc/View/Helper/Root/RecordLink.php +++ b/module/finc/src/finc/View/Helper/Root/RecordLink.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package View_Helpers diff --git a/module/finc/src/finc/View/Helper/Root/ResultFeed.php b/module/finc/src/finc/View/Helper/Root/ResultFeed.php index 64f9d2e0a5b572a6b1793733ee122b58ab91c864..65f26faa3dd7208453075049bfd374513ee94edd 100644 --- a/module/finc/src/finc/View/Helper/Root/ResultFeed.php +++ b/module/finc/src/finc/View/Helper/Root/ResultFeed.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package View_Helpers @@ -93,9 +93,9 @@ class ResultFeed extends \VuFind\View\Helper\Root\ResultFeed $entry->addDCFormat($format); } } - $date = $record->tryMethod('getPublicationDates'); - if (isset($date[0]) && !empty($date[0])) { - $entry->setDCDate($date[0]); + $dcDate = $this->getDcDate($record); + if (!empty($dcDate)) { + $entry->setDCDate($dcDate); }*/ $feed->addEntry($entry); diff --git a/module/finc/src/finc/View/Helper/Root/SideFacet.php b/module/finc/src/finc/View/Helper/Root/SideFacet.php index 83106f317b97f58ea29a6fcdf888fa513f61e4c3..d0584faa8d42699181898011ac9df0513eb6b49b 100644 --- a/module/finc/src/finc/View/Helper/Root/SideFacet.php +++ b/module/finc/src/finc/View/Helper/Root/SideFacet.php @@ -18,7 +18,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package View_Helpers diff --git a/module/finc/src/finc/XSLT/Processor.php b/module/finc/src/finc/XSLT/Processor.php index 03bda0c3a698e0d0f10bd3ed4f3af50b9e9fc2bc..be99695a4b67629c709a22fae4a82c64a7038d33 100644 --- a/module/finc/src/finc/XSLT/Processor.php +++ b/module/finc/src/finc/XSLT/Processor.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package XSLT diff --git a/module/finc/tests/bootstrap.php b/module/finc/tests/bootstrap.php index ed4eafd92da1d6eb26e70400089c2a5daa8b7dff..e450e08de7863b9ec934a9c26f35020534b041f0 100644 --- a/module/finc/tests/bootstrap.php +++ b/module/finc/tests/bootstrap.php @@ -19,7 +19,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package finc diff --git a/module/finc/tests/unit-tests/src/fincTest/RecordDriver/SolrMarcFincTestCase.php b/module/finc/tests/unit-tests/src/fincTest/RecordDriver/SolrMarcFincTestCase.php index 7595acb39e52bfd6eef1d674ea3a44c3cc907270..b6b9c07650b2a34187fac31c3c752e5876767ca6 100644 --- a/module/finc/tests/unit-tests/src/fincTest/RecordDriver/SolrMarcFincTestCase.php +++ b/module/finc/tests/unit-tests/src/fincTest/RecordDriver/SolrMarcFincTestCase.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package finc diff --git a/module/finc/tests/unit-tests/src/fincTest/RecordDriver/SolrMarcNewerPreviousTest.php b/module/finc/tests/unit-tests/src/fincTest/RecordDriver/SolrMarcNewerPreviousTest.php index 9e007bb0eb3fe73869f4bfa8229d6df7f61518a1..1956ff66922796cb56a38e18fec268a4eca84d6c 100644 --- a/module/finc/tests/unit-tests/src/fincTest/RecordDriver/SolrMarcNewerPreviousTest.php +++ b/module/finc/tests/unit-tests/src/fincTest/RecordDriver/SolrMarcNewerPreviousTest.php @@ -16,7 +16,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category VuFind * @package FincTest diff --git a/module/finc/tests/unit-tests/src/fincTest/View/Helper/Root/ExternalCatalogueLinkTest.php b/module/finc/tests/unit-tests/src/fincTest/View/Helper/Root/ExternalCatalogueLinkTest.php index 5a1d97504b7af433b80cdde1a3129146d40f2999..b00b0ec82abf63d5736d3dcff92ade4b79d83310 100644 --- a/module/finc/tests/unit-tests/src/fincTest/View/Helper/Root/ExternalCatalogueLinkTest.php +++ b/module/finc/tests/unit-tests/src/fincTest/View/Helper/Root/ExternalCatalogueLinkTest.php @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * @category Finc * @package Tests