From b7594946eb1ae20eafce1fc6b3de4ffb98b040d5 Mon Sep 17 00:00:00 2001 From: Johannes Schultze Date: Sat, 7 Mar 2020 17:06:25 +0100 Subject: [PATCH 01/44] Added old CaLief-module for LG. --- module/CaLief/Module.php | 142 +++ module/CaLief/config/module.config.php | 42 + .../CaLief/src/CaLief/CaLief/CaLiefHelper.php | 136 +++ module/CaLief/src/CaLief/Classes/DodOrder.php | 114 +++ module/CaLief/src/CaLief/Classes/config.xml | 21 + .../CaLief/src/CaLief/Classes/ordermail.xml | 79 ++ .../AbstractBaseWithConfigFactory.php | 67 ++ .../CaLief/Controller/CaLiefController.php | 857 ++++++++++++++++++ .../CaLief/src/CaLief/Db/Row/CaliefAdmin.php | 71 ++ .../src/CaLief/Db/Row/PluginManager.php | 90 ++ .../CaLief/src/CaLief/Db/Row/UserCalief.php | 70 ++ .../src/CaLief/Db/Row/UserCaliefLog.php | 70 ++ .../src/CaLief/Db/Table/CaliefAdmin.php | 73 ++ .../src/CaLief/Db/Table/PluginManager.php | 90 ++ .../CaLief/src/CaLief/Db/Table/UserCalief.php | 79 ++ .../src/CaLief/Db/Table/UserCaliefLog.php | 59 ++ .../src/CaLief/Model/CaliefAdminModel.php | 13 + .../src/CaLief/Model/UserCaliefModel.php | 13 + module/CaLief/src/CaLief/Order/Available.php | 154 ++++ module/CaLief/src/CaLief/Order/DodOrder.php | 133 +++ module/CaLief/src/CaLief/Order/config.xml | 21 + module/CaLief/src/CaLief/Order/config_20.xml | 10 + module/CaLief/src/CaLief/Order/ordermail.xml | 79 ++ .../CaLief/src/CaLief/Order/ordermail_lg.txt | 17 + 24 files changed, 2500 insertions(+) create mode 100644 module/CaLief/Module.php create mode 100644 module/CaLief/config/module.config.php create mode 100644 module/CaLief/src/CaLief/CaLief/CaLiefHelper.php create mode 100644 module/CaLief/src/CaLief/Classes/DodOrder.php create mode 100644 module/CaLief/src/CaLief/Classes/config.xml create mode 100644 module/CaLief/src/CaLief/Classes/ordermail.xml create mode 100644 module/CaLief/src/CaLief/Controller/AbstractBaseWithConfigFactory.php create mode 100644 module/CaLief/src/CaLief/Controller/CaLiefController.php create mode 100644 module/CaLief/src/CaLief/Db/Row/CaliefAdmin.php create mode 100644 module/CaLief/src/CaLief/Db/Row/PluginManager.php create mode 100644 module/CaLief/src/CaLief/Db/Row/UserCalief.php create mode 100644 module/CaLief/src/CaLief/Db/Row/UserCaliefLog.php create mode 100644 module/CaLief/src/CaLief/Db/Table/CaliefAdmin.php create mode 100644 module/CaLief/src/CaLief/Db/Table/PluginManager.php create mode 100644 module/CaLief/src/CaLief/Db/Table/UserCalief.php create mode 100644 module/CaLief/src/CaLief/Db/Table/UserCaliefLog.php create mode 100644 module/CaLief/src/CaLief/Model/CaliefAdminModel.php create mode 100644 module/CaLief/src/CaLief/Model/UserCaliefModel.php create mode 100644 module/CaLief/src/CaLief/Order/Available.php create mode 100644 module/CaLief/src/CaLief/Order/DodOrder.php create mode 100644 module/CaLief/src/CaLief/Order/config.xml create mode 100644 module/CaLief/src/CaLief/Order/config_20.xml create mode 100644 module/CaLief/src/CaLief/Order/ordermail.xml create mode 100644 module/CaLief/src/CaLief/Order/ordermail_lg.txt diff --git a/module/CaLief/Module.php b/module/CaLief/Module.php new file mode 100644 index 0000000000..ad9a42d03e --- /dev/null +++ b/module/CaLief/Module.php @@ -0,0 +1,142 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://github.com/dmj/vf2-proxy + */ +namespace CaLief; +use Zend\ModuleManager\ModuleManager, + Zend\Mvc\MvcEvent, + Zend\ModuleManager\Feature\ConfigProviderInterface, + Zend\Db\ResultSet\ResultSet, + Zend\Db\TableGateway\TableGateway; +use CaLief\CaLief\CaLiefHelper; +use CaLief\Db\Table\UserCalief; +use CaLief\Model\UserCaliefModel; +use CaLief\Db\Table\CaliefAdmin; +use CaLief\Model\CaliefAdminModel; +use VuFind\Db\Table\Gateway; + +/** + * Template for ZF2 module for storing local overrides. + * + * @category VuFind2 + * @package Module + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://github.com/dmj/vf2-proxy + */ +class Module implements ConfigProviderInterface +{ + /** + * Get module configuration + * + * @return array + */ + public function getConfig() + { + return include __DIR__ . '/config/module.config.php'; + } + + /** + * Get autoloader configuration + * + * @return array + */ + public function getAutoloaderConfig() + { + return array( + 'Zend\Loader\StandardAutoloader' => array( + 'namespaces' => array( + __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, + ), + ), + ); + } + + /** + * Initialize the module + * + * @param ModuleManager $m Module manager + * + * @return void + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function init(ModuleManager $m) + { + } + + /** + * Bootstrap the module + * + * @param MvcEvent $e Event + * + * @return void + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function onBootstrap(MvcEvent $e) + { + } + + public function getViewHelperConfig() + { + return array( + 'factories' => array( + 'calief' => function($sm) { + return new CaLiefHelper($sm); + }, + ), + ); + } + + public function getServiceConfig() + { + return array( + 'factories' => array( + 'CaLief\DB\Table\UserCalief' => function($sm) { + $tableGateway = $sm->get('UserCaliefGateway'); + $table = new UserCalief($tableGateway); + return $table; + }, + 'UserCaliefGateway' => function ($sm) { + $dbAdapter = $sm->get('VuFind\DbAdapter'); + $resultSetPrototype = new ResultSet(); + $resultSetPrototype->setArrayObjectPrototype(new UserCaliefModel()); + return new TableGateway('usercalief', $dbAdapter, null, $resultSetPrototype); + }, + 'CaLief\DB\Table\CaliefAdmin' => function($sm) { + $tableGateway = $sm->get('CaliefAdminGateway'); + $table = new CaliefAdmin($tableGateway); + return $table; + }, + 'CaliefAdminGateway' => function ($sm) { + $dbAdapter = $sm->get('VuFind\DbAdapter'); + $resultSetPrototype = new ResultSet(); + $resultSetPrototype->setArrayObjectPrototype(new CaliefAdminModel()); + return new TableGateway('caliefadmin', $dbAdapter, null, $resultSetPrototype); + }, + ), + ); + } +} diff --git a/module/CaLief/config/module.config.php b/module/CaLief/config/module.config.php new file mode 100644 index 0000000000..19781677f9 --- /dev/null +++ b/module/CaLief/config/module.config.php @@ -0,0 +1,42 @@ + [ + 'factories' => [ + 'CaLief\Controller\CaLiefController' => 'CaLief\Controller\AbstractBaseWithConfigFactory', + ], + 'aliases' => [ + 'calief' => 'CaLief\Controller\CaLiefController', + 'Calief' => 'CaLief\Controller\CaLiefController', + 'CaLief' => 'CaLief\Controller\CaLiefController', + ], + ], + 'view_helpers' => array( + 'invokables' => array( + //'calief' => 'CaLief\CaLief\CaLiefHelper', + ) + ), + 'service_manager' => [ + 'allow_override' => true, + 'factories' => [ + 'CaLief\Db\Table\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', + 'CaLief\Db\Row\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', + ], + 'aliases' => [ + 'VuFind\Db\Table\PluginManager' => 'CaLief\Db\Table\PluginManager', + 'VuFind\Db\Row\PluginManager' => 'CaLief\Db\Row\PluginManager', + ], + ], + +); + +// Define static routes -- Controller/Action strings +$staticRoutes = [ + 'CaLief/Index' +]; + +$routeGenerator = new \VuFind\Route\RouteGenerator(); +$routeGenerator->addStaticRoutes($config, $staticRoutes); + +return $config; diff --git a/module/CaLief/src/CaLief/CaLief/CaLiefHelper.php b/module/CaLief/src/CaLief/CaLief/CaLiefHelper.php new file mode 100644 index 0000000000..bd0d237bbd --- /dev/null +++ b/module/CaLief/src/CaLief/CaLief/CaLiefHelper.php @@ -0,0 +1,136 @@ +caliefConfig = parse_ini_file(realpath(APPLICATION_PATH . '/local/config/vufind/CaLief.ini'), true); + + $sl = $sm->getServiceLocator(); + $auth = $sl->get('VuFind\AuthManager'); + $user = $auth->isLoggedIn(); + if ($user) { + $table = $sl->get('CaLief\DB\Table\UserCalief'); + $tableAdmin = $sl->get('CaLief\DB\Table\CaliefAdmin'); + if (!$this->caliefConfig['global']['useCaliefForVufindUsers']) { + $this->caliefUser = $table->getByUserId($user->id); + } else { + $this->caliefUser = new \stdClass; + $this->caliefUser->library = $this->caliefConfig['global']['useCaliefForVufindUsersLibrary']; + $this->caliefUser->authorized = 1; + $this->caliefUser->firstname = $user->firstname; + $this->caliefUser->name = $user->lastname; + $this->caliefUser->card_number = $user->cat_username; + $patron = $auth->storedCatalogLogin(); + $paia = new PAIA(); + $profile = $paia->getMyProfile($patron); + $this->caliefUser->email = $profile['email']; + } + $this->caliefAdmin = $tableAdmin->getByUserId($user->id); + } + } + + public function link ($home = false) { + $style = ''; + if ($home) { + $style = ' style="display:none"'; + } + $iln = $this->caliefConfig[$this->caliefUser->library]['iln']; + $result = ''; + if (strip_tags($_GET['institution']) == 'GBV_ILN_'.$iln || $home) { + $result = ''; + } + return $result; + + } + + public function button ($driver, $mobile = false) { + $result = ''; + if ($driver) { + $format = ''; + $formats = $driver->getFormats(); + if (!empty($formats)) { + $format = $formats[0]; + } + + if (get_class($driver) != 'VuFind\RecordDriver\Missing') { + if ($this->caliefUser->authorized == '1' && $this->foundSignatures($driver) && $this->checkFormat($format, $this->caliefUser)) { + $institution = ''; + if ($mobile) { + $result .= '
  • '; + } + $result .= ''; + if (!$mobile) { + $result .= 'Liefern'.$this->view->translate('Aufsätze und Buchkapitel per Campuslieferdienst zusenden lassen').''; + } + $result .= ''; + if ($mobile) { + $result .= '
  • '; + } + } + } + } + return $result; + } + + public function myBeluga () { + $result = ''; + if (!$this->caliefConfig['global']['useCaliefForVufindUsers']) { + $result .= '
  • ' . $this->view->translate('Campuslieferdienst') . '
  • '; + if ($this->caliefAdmin) { + $result .= '
  • ' . $this->view->translate('Campuslieferdienst') . ' Admin
  • '; + } + } + return $result; + } + + public function myBelugaRightColumn () { + $result = ''; + if (!$this->caliefConfig['global']['useCaliefForVufindUsers']) { + $result .= '
    ' . $this->view->translate('Campuslieferdienst') . '
    '; + if ($this->caliefAdmin) { + $result .= '
    ' . $this->view->translate('Campuslieferdienst') . ' Admin
    '; + } + } + return $result; + } + + private function foundSignatures($driver) { + $format = ''; + $formats = $driver->getFormats(); + if (!empty($formats)) { + $format = $formats[0]; + } else { + return false; + } + + $iln = $this->caliefConfig[$this->caliefUser->library]['iln']; + if (!in_array('GBV_ILN_'.$iln, $driver->getCollectionDetails())) { + return false; + } + $available = new Available($driver, $this->caliefConfig[$this->caliefUser->library]); + $signature = $available->getSignature($format); + + return (empty($signature) == false); + } + + private function checkFormat($format, $userCalief) { + return in_array($format, $this->caliefConfig[$userCalief->library]['formats']); + } +} + +?> \ No newline at end of file diff --git a/module/CaLief/src/CaLief/Classes/DodOrder.php b/module/CaLief/src/CaLief/Classes/DodOrder.php new file mode 100644 index 0000000000..a65ffad07a --- /dev/null +++ b/module/CaLief/src/CaLief/Classes/DodOrder.php @@ -0,0 +1,114 @@ +cfgxml = simplexml_load_file(dirname(__FILE__).'/'.$ConfigFile); + } else { + exit('Konnte ' . $ConfigFile . ' nicht ffnen.'); + } + if (file_exists(dirname(__FILE__).'/'.$OrdermailFile)) { + $this->mailxml = simplexml_load_file(dirname(__FILE__).'/'.$OrdermailFile); + } else { + exit('Konnte ' . $OrdermailFile . ' nicht ffnen.'); + } + $this->errMsg = ""; + } + + public function getError() { + return $this->errMsg; + } + + public function setVars($varArr) { + if (count($varArr) > 2) { + $this->arrVars = $varArr; + foreach ($this->mailxml->children() as $child) { + $elemName = $child->getName(); + if ($this->arrVars[$elemName]) { + $this->mailbody .= $elemName . ": " . $this->replaceChars($this->arrVars[$elemName]) . "\r\n"; + } else { + $this->mailbody .= $elemName . ": " . $this->replaceChars($this->mailxml->$elemName) . "\r\n"; + } + } + } else { + $this->errMsg = "Fehler beim setzen der Variablen!"; + return FALSE; + } + + return TRUE; + } + + function checkEmailAddress($email_address) { + $s = '/^[A-Z0-9._-]+@[A-Z0-9][A-Z0-9.-]{0,61}[A-Z0-9]\.[A-Z.]{2,6}$/i'; + if (preg_match($s, $email_address)) { + return TRUE; + } + $this->errMsg = "Bitte überprüfen Sie die angegebene E-Mailadresse!"; + return FALSE; + } + + function sendOrderMail() { + if ($this->mailbody != "") { + $empfaenger = $this->cfgxml->MAIL->EMPFAENGER; + $betreff = $this->cfgxml->MAIL->SUBJECT; + $header = 'From: ' . $this->cfgxml->MAIL->ABSENDER . "\r\n" . + 'Reply-To: ' . $this->cfgxml->MAIL->ABSENDER . "\r\n" . + 'X-Mailer: PHP/' . phpversion() . "\r\n" . + 'Content-Type: text/plain; charset=utf-8' . "\r\n" . + 'Content-Transfer-Encoding: 7bit'; + + mail($empfaenger, $betreff, $this->mailbody, $header); + $this->errMsg = "Bestellung erfolgreich versendet!"; + return TRUE; + } else { + $this->errMsg .= "E-Mail leer !?"; + return FALSE; + } + } + + function getValue($tag) { + $value = FALSE; + $value = $this->mailxml->$tag; + return $value; + } + + private function prepareData($data) { + $searchArray = array('/A\xcc\x88/', '/A\xcc\x8a/', '/O\xcc\x88/', '/U\xcc\x88/', '/a\xcc\x88/', '/a\xcc\x8a/', '/c\xcc\xa6/', '/e\xcc\x82/', '/o\xcc\x88/', '/u\xcc\x88/', '/\xc2\x98/', '/\xc2\x9c/'); + $translateArray = array('', '', '' ,'' ,'' ,'', '', '', '' ,'' ,'' ,'' ); + return preg_replace($searchArray, $translateArray, $data); + } + + function replaceChars($string) { + $string = utf8_decode($this->prepareData($string)); + $string = str_ireplace('', 'ss', $string); + $string = str_ireplace('', 'ae', $string); + $string = str_ireplace('', 'oe', $string); + $string = str_ireplace('', 'ue', $string); + $string = str_ireplace('', 'Ae', $string); + $string = str_ireplace('', 'Oe', $string); + $string = str_ireplace('', 'Ue', $string); + return $string; + } +} diff --git a/module/CaLief/src/CaLief/Classes/config.xml b/module/CaLief/src/CaLief/Classes/config.xml new file mode 100644 index 0000000000..10d4c65dc2 --- /dev/null +++ b/module/CaLief/src/CaLief/Classes/config.xml @@ -0,0 +1,21 @@ + + + + 127.0.0.1 + dod25 + glubsch + chiefreader + + + /opt/dod/ + /opt/dod/www/ + /opt/dod/dod_files/scandateien/ + + + christen@leuphana.de + Bestellung aus LUX + Artikelbestellung LUX + christen@leuphana.de + LUX + + diff --git a/module/CaLief/src/CaLief/Classes/ordermail.xml b/module/CaLief/src/CaLief/Classes/ordermail.xml new file mode 100644 index 0000000000..9d31ef925e --- /dev/null +++ b/module/CaLief/src/CaLief/Classes/ordermail.xml @@ -0,0 +1,79 @@ + + + + + + REQUEST + + + + 1 + + CaLief + bestellcap@dodtest.sub.uni-hamburg.de + calief + abrechnung@dodtest.sub.uni-hamburg.de + USER-GROUP-0 + DE + + 0018 + + + + SIMPLE + + . + . + . + . + . + + ALL + NONE + NONE + Y + EMAIL + PDF + N + + + + INVOICE + EMAIL + abrechnung@dodtest.sub.uni-hamburg.de + . + . + . + . + . + COLLECTIVE + N + COPY + + PRINTED + Y + + SERIAL + PRINTED + + + + + + + + + + + + + + + + FORWARD=N + N + diff --git a/module/CaLief/src/CaLief/Controller/AbstractBaseWithConfigFactory.php b/module/CaLief/src/CaLief/Controller/AbstractBaseWithConfigFactory.php new file mode 100644 index 0000000000..4afb2c131a --- /dev/null +++ b/module/CaLief/src/CaLief/Controller/AbstractBaseWithConfigFactory.php @@ -0,0 +1,67 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development Wiki + */ +namespace CaLief\Controller; + +use Interop\Container\ContainerInterface; +use Zend\ServiceManager\Factory\FactoryInterface; + +/** + * Generic controller factory (with config injection). + * + * @category VuFind + * @package Controller + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development Wiki + */ +class AbstractBaseWithConfigFactory implements FactoryInterface +{ + /** + * Create an object + * + * @param ContainerInterface $container Service manager + * @param string $requestedName Service being created + * @param null|array $options Extra options (optional) + * + * @return object + * + * @throws ServiceNotFoundException if unable to resolve the service. + * @throws ServiceNotCreatedException if an exception is raised when + * creating a service. + * @throws ContainerException if any other error occurs + */ + public function __invoke(ContainerInterface $container, $requestedName, + array $options = null + ) { + if (!empty($options)) { + throw new \Exception('Unexpected options sent to factory.'); + } + $config = $container->get('VuFind\Config\PluginManager')->get('config'); + return new $requestedName($container, $config); + } +} diff --git a/module/CaLief/src/CaLief/Controller/CaLiefController.php b/module/CaLief/src/CaLief/Controller/CaLiefController.php new file mode 100644 index 0000000000..57397d2f9d --- /dev/null +++ b/module/CaLief/src/CaLief/Controller/CaLiefController.php @@ -0,0 +1,857 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org Main Site + */ +namespace CaLief\Controller; +//use VuFindSearch\Query\Query; +//use VuFind\Search\Factory\SolrDefaultBackendFactory; +//use Zend\ServiceManager\ServiceLocatorAwareInterface; +use Zend\ServiceManager\ServiceLocatorInterface; +use VuFind\Controller\AbstractBase; +use VuFind\Controller\AbstractSearch; +use CaLief\Order\DodOrder; +use CaLief\Order\Available; +use PAIA\ILS\Driver\PAIA; + +/** + * Controller for the user account area. + * + * @category VuFind2 + * @package Controller + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org Main Site + */ +class CaLiefController extends AbstractBase +{ + protected $caliefConfig; + protected $serviceLocator; + protected $serviceLocatorAwareInterface; + + + /** + * Constructor + */ + public function __construct($serviceLocator) + { + $this->caliefConfig = parse_ini_file(realpath(getenv('VUFIND_LOCAL_DIR') . '/config/vufind/CaLief.ini'), true); + //$config = $this->serviceLocator->get('VuFind\Config')->get('CaLief'); + $this->serviceLocator = $serviceLocator; + } + + + + /** + * CaLief action + * + * @return mixed + */ + public function indexAction() + { + // First make sure user is logged in to VuFind: + $account = $this->getAuthManager(); + if ($account->isLoggedIn() == false) { + return $this->forceLogin(); + } + + // Make view + $view = $this->createViewModel(); + + $user = $this->getUser(); + $table = $this->getTable('usercalief'); + //$userCalief = $table->getByUserId($user->id); + $userCalief = $this->getCaliefUser($user); + + if (!$userCalief) { + return $this->forwardTo('CaLief', 'Register'); + } else { + $this->caliefCheckAuthorize($userCalief); + //$userCalief = $table->getByUserId($user->id); + $userCalief = $this->getCaliefUser($user); + } + + $view->userCalief = $userCalief; + + $table = $this->getTable('calief_admin'); + $adminCalief = $table->getByUserId($user->id); + $view->adminCalief = $adminCalief; + + if (!$this->caliefConfig['global']['useCaliefForVufindUsers']) { + $view->showEdit = true; + } else { + $view->showEdit = false; + } + + return $view; + } + + /** + * CaLief action + * + * @return mixed + */ + public function editAction() + { + // First make sure user is logged in to VuFind: + $account = $this->getAuthManager(); + if ($account->isLoggedIn() == false) { + return $this->forceLogin(); + } + + // Make view + $view = $this->createViewModel(); + + $user = $this->getUser(); + $table = $this->getTable('usercalief'); + //$userCalief = $table->getByUserId($user->id); + $userCalief = $this->getCaliefUser($user); + + $view->userCalief = $userCalief; + $view->libraries = $this->caliefLibraryKeys(); + + $view->submittedLibrary = $userCalief->library; + $view->submittedCard_number = $userCalief->card_number; + $view->submittedGender = $userCalief->gender; + $view->submittedTitle = $userCalief->title; + $view->submittedName = $userCalief->name; + $view->submittedLastname = $userCalief->lastname; + $view->submittedEmail = $userCalief->email; + + if (isset($_POST['edit_calief_update'])) { + $emailCorrect = true; + if (!preg_match('/^(([a-zA-Z]|[0-9])|([-]|[_]|[.]))+[@]((([a-zA-Z0-9])|([-])){2,63}[.])*(([a-zA-Z0-9])|([-])){2,63}[.](([a-zA-Z0-9]){2,63})+$/', $_POST['email']) ) { + $emailCorrect = false; + } + if ($emailCorrect) { + $table->update(array('email' => $_POST['email']), array('id' => $userCalief->id)); + $this->caliefLog($user->id, 'edit'); + return $this->forwardTo('CaLief', 'Index'); + } else { + $view->submittedEmail = $_POST['email']; + if (!$emailCorrect) { + $view->checkEmail = 'check'; + } + } + } + + return $view; + } + + /** + * CaLief register action + * + * @return mixed + */ + public function registerAction() + { + // First make sure user is logged in to VuFind: + $account = $this->getAuthManager(); + if ($account->isLoggedIn() == false) { + return $this->forceLogin(); + } + + // Make view + $view = $this->createViewModel($result); + $view->libraries = $this->caliefLibraryKeys(); + + $user = $this->getUser(); + $table = $this->getTable('usercalief'); + + if (!isset($_POST['calief_register'])) { + $view->acceptedAGB = true; + if (!isset($_POST['accept_agb'])) { + //$view->acceptedAGB = false; + } + } else { + $view->acceptedAGB = true; + $emailCorrect = true; + if (!preg_match('/^(([a-zA-Z]|[0-9])|([-]|[_]|[.]))+[@]((([a-zA-Z0-9])|([-])){2,63}[.])*(([a-zA-Z0-9])|([-])){2,63}[.](([a-zA-Z0-9]){2,63})+$/', $_POST['email']) ) { + $emailCorrect = false; + } + $cardNumberCorrect = true; + if (strlen($_POST['card_number']) != $this->caliefConfig[$_POST['library']]['lengthCardNumber']) { + $cardNumberCorrect = false; + } + if ($emailCorrect && $cardNumberCorrect) { + $table->insert(array('user_id' => $user->id, 'library' => $_POST['library'], 'card_number' => $_POST['card_number'], 'gender' => $_POST['gender'], 'title' => $_POST['title'], 'name' => $_POST['name'], 'lastname' => $_POST['lastname'], 'email' => $_POST['email'], 'authorized' => -1)); + $this->caliefLog($user->id, 'request'); + $this->caliefMail('request'); + return $this->forwardTo('CaLief', 'Index'); + } else { + $view->submittedLibrary = $_POST['library']; + $view->submittedCard_number = $_POST['card_number']; + if (!$cardNumberCorrect) { + $view->checkCardNumber = 'check'; + } + $view->submittedGender = $_POST['gender']; + $view->submittedTitle = $_POST['title']; + $view->submittedName = $_POST['name']; + $view->submittedLastname = $_POST['lastname']; + $view->submittedEmail = $_POST['email']; + if (!$emailCorrect) { + $view->checkEmail = 'check'; + } + } + } + return $view; + } + + public function adminAction() { + $account = $this->getAuthManager(); + if ($account->isLoggedIn() == false) { + return $this->forceLogin(); + } + + $view = $this->createViewModel(); + + $user = $this->getUser(); + $table = $this->getTable('caliefadmin'); + $adminCalief = $table->getByUserId($user->id); + + if ($adminCalief) { + $view->adminCalief = $adminCalief; + + $tableCaliefUsers = $this->getTable('usercalief'); + + if (isset($_POST['id'])) { + if (isset($_POST['revoke']) || isset($_POST['refuse'])) { + $tableCaliefUsers->update(array('authorized' => 0), array('id' => $_POST['id'])); + if (isset($_POST['revoke'])) { + $this->caliefLog($_POST['id'], 'revoke'); + $this->caliefMail('revoke', $_POST['id']); + } else if (isset($_POST['refuse'])) { + $this->caliefLog($_POST['id'], 'refuse'); + $this->caliefMail('refuse', $_POST['id']); + } + } else if (isset($_POST['authorize'])) { + $tableCaliefUsers->update(array('authorized' => 1, 'lastorder' => NULL), array('id' => $_POST['id'])); + $this->caliefLog($_POST['id'], 'authorize'); + $this->caliefMail('authorize', $_POST['id']); + } + } + + $caliefUsers = $tableCaliefUsers->select(function (\Zend\Db\Sql\Select $select) { + $select->order('authorized ASC'); + }); + + $caliefUsersArray = array(); + foreach ($caliefUsers as $key => $value) { + $addUser = true; + if ($adminCalief->library != '*') { + if ($value->library != $adminCalief->library) { + $addUser = false; + } + } + if ($addUser) { + $caliefUsersArray[] = $value; + } + } + $view->usersCalief = $caliefUsersArray; + } else { + return $this->forwardTo('CaLief', 'Index'); + } + + return $view; + } + + /* public function logsAction() { + $account = $this->getAuthManager(); + if ($account->isLoggedIn() == false) { + return $this->forceLogin(); + } + + $view = $this->createViewModel(); + + $user = $this->getUser(); + $table = $this->getTable('caliefadmin'); + $adminCalief = $table->getByUserId($user->id); + + if ($adminCalief) { + $view->adminCalief = $adminCalief; + $tableCaliefLogs = $this->getTable('usercalieflog'); + $caliefLogs = $tableCaliefLogs->select(array()); + $view->caliefLogs = $caliefLogs; + } else { + return $this->forwardTo('CaLief', 'Index'); + } + + return $view; + } */ +/* + private function checkPpnLink($ppn, $electronicArticle = false) { + $user = $this->getUser(); + $table = $this->getTable('usercalief'); + $userCalief = $table->getByUserId($user->id); + + $request = 'id:'.$ppn.' AND collection_details:GBV_ILN_22 -format:Article'; + $query = new Query(); + $query->setHandler('AllFields'); + $query->setString($request); + $solr_backend_factory = new SolrDefaultBackendFactory(); + $service = $solr_backend_factory->createService($this->serviceLocatorAwareInterface->getServiceLocator()); + $result = $service->search($query, 0, 10); + $resultArray = $result->getResponse(); + $sigelList = $resultArray['docs'][0]['standort_str_mv']; + $ilnList = $resultArray['docs'][0]['collection_details']; + $ppnValid = false; + foreach ($ilnList as $iln) { + if ($iln == 'GBV_ILN_'.$this->caliefConfig[$userCalief->library]['signature_980_2']) { + $ppnValid = true; + break; + } + } + if ($ppnValid) { + if ($electronicArticle) { + return true; + } else { + foreach ($this->caliefConfig[$userCalief->library]['signature_980_f'] as $signatureRegex) { + foreach ($sigelList as $sigel) { + if (preg_match('/'.$signatureRegex.'$/', $sigel)) { + return true; + } + } + } + } + } + return false; + } +*/ + public function orderAction() { + $account = $this->getAuthManager(); + if ($account->isLoggedIn() == false) { + return $this->forceLogin(); + } + + $view = $this->createViewModel(); + + $user = $this->getUser(); + $table = $this->getTable('usercalief'); + //$userCalief = $table->getByUserId($user->id); + $userCalief = $this->getCaliefUser($user); + + $driver = $this->serviceLocator->get('VuFind\RecordLoader')->load($_GET['id'], 'Solr'); + $available = new Available($driver, $this->caliefConfig[$userCalief->library]); + + $format = ''; + $formats = $driver->getFormats(); + if (!empty($formats)) { + $format = $formats[0]; + } + $view->format = $format; + + $signature = $available->getSignature($format); + + if (!$this->caliefConfig['global']['useCaliefForVufindUsers']) { + if (!$this->caliefCheckAuthorize($userCalief) || empty($signature) ) { + return $this->forwardTo('CaLief', 'Index'); + } + } + + $view->userCalief = $userCalief; + + $sendOrder = false; + + if (isset($_POST['calief_order'])) { + $checkForm = true; + $errors = array(); + foreach ($_POST as $key => $value) { + if (stristr($key, 'mandantory')) { + $checkKey = str_ireplace('mandantory_', '', $key); + if ($_POST[$checkKey] == '') { + $checkForm = false; + $errors[] = $checkKey; + } + } + } + if ($checkForm) { + $orderNumber = 'CaLief:'.date('ymdHis').rand(0, 9); + $this->caliefMail('order', $orderNumber, $driver); + $this->caliefFileOrder($orderNumber, $driver); + $this->caliefAuthorize($userCalief->id, 'renew'); + $sendOrder = true; + } else { + $view->errors = $errors; + } + } + + $mandantoryFields = $this->caliefConfig[$userCalief->library]['mandantoryFields']; + + if (!$sendOrder) { + $view->driver = $driver; + + $formTitle = ''; + $formFields = array(); + + $infoTitle = ''; + $infoFields = array(); + + //PPN + $ppn = (isset($_POST['ppn'])) ? $_POST['ppn'] : $driver->getUniqueID(); + $infoFields['PPN'] = array('display' => 'PPN', 'name' => 'ppn', 'value' => $ppn, 'mandantory' => false, 'error' => ''); + $formFields['PPN'] = array('display' => 'PPN', 'type' => 'hidden', 'name' => 'ppn', 'value' => $ppn, 'mandantory' => false, 'error' => ''); + + //ISSN + $issns = $driver->getISSNs(); + $tempIssn = ''; + if (isset($issns[0])) { + $tempIssn = $issns[0]; + } + $issn = (isset($_POST['issn'])) ? $_POST['issn'] : $tempIssn; + $formFields['ISSN'] = array('display' => 'ISSN', 'type' => 'hidden', 'name' => 'issn', 'value' => $issn, 'mandantory' => false, 'error' => ''); + + // Format + $infoFields['Format'] = array('display' => '', 'name' => 'format', 'value' => $format, 'mandantory' => false, 'error' => ''); + + if ($format == 'Article' || $format == 'electronic Article') { + $formTitle = 'Aufsatz'; + $infoTitle = 'Zeitschrift'; + + $containingWorks = $driver->getContainingWork(); + $containingWork = $containingWorks[0]; + + // PPN + $formFields['Article-PPN'] = array('display' => 'PPN des Aufsatzes', 'name' => 'article_ppn', 'value' => $ppn, 'error' => ''); + + // Autor + $author = (!empty($_POST['article_author'])) ? $_POST['article_author'] : $driver->getTitleStatement(); + $formFields['Author'] = array('display' => 'Autor des Aufsatzes', 'name' => 'article_author', 'value' => implode(' ; ', $author), 'mandantory' => in_array('article_author', $mandantoryFields), 'error' => ''); + + // Titel des Aufsatzes + $title = (!empty($_POST['article_title'])) ? $_POST['article_title'] : $driver->getTitle(); + $formFields['Article-Title'] = array('display' => 'Titel des Aufsatzes', 'name' => 'article_title', 'value' => $title, 'mandantory' => in_array('article_title', $mandantoryFields), 'error' => ''); + + // Band/Heft/Jahr/Seiten + $yearNumberIssuePages = (isset($_POST['volume_issue'])) ? $_POST['volume_issue'] : $containingWork['issue']; + $formFields['NumberIssueYearPages'] = array('display' => 'Band/Heft/Jahr/Seiten', 'name' => 'volume_issue', 'value' => $yearNumberIssuePages, 'mandantory' => false, 'error' => ''); + + // PPN + $infoFields['PPN'] = array('display' => 'PPN', 'name' => 'ppn', 'value' => $containingWork['ppn']); + $formFields['PPN'] = array('hidden' => true, 'name' => 'ppn', 'value' => $containingWork['ppn']); + if (!$available->checkPpnLink($this->serviceLocator, $infoFields['PPN']['value'])) { + //return $this->forwardTo('CaLief', 'Index'); + $view->error = 'CaLief Article not available'; + } + + // Zeitschriftentitel + $infoFields['Title'] = array('display' => 'Zeitschriftentitel', 'name' => 'title', 'value' => $containingWork['title']); + $formFields['Title'] = array('hidden' => true, 'name' => 'title', 'value' => $containingWork['title']); + + // Erscheinungsort + $infoFields['Published'] = array('display' => 'Erscheinungsort', 'name' => 'publication_place', 'value' => $containingWork['location']); + $formFields['Published'] = array('hidden' => true, 'name' => 'publication_place', 'value' => $containingWork['location']); + } else { + + // Autor + $formFields['Author'] = array('display' => 'Autor des Aufsatzes', 'name' => 'article_author', 'value' => $_POST['author'], 'mandantory' => in_array('article_author', $mandantoryFields), 'error' => ''); + + if ($format == 'Journal' || $format == 'eJournal' || $format == 'Serial Volume') { + $formTitle = 'Aufsatz'; + $infoTitle = 'Zeitschrift'; + + // Titel + $formFields['Title'] = array('display' => 'Titel des Aufsatzes', 'name' => 'article_title', 'value' => $_POST['article_title'], 'mandantory' => in_array('article_title', $mandantoryFields), 'error' => ''); + + // Zeitschriftentitel + $titleSection = $driver->getTitleSection(); + $title = (empty($titleSection)) ? $driver->getTitle() : $driver->getTitle().' / '.$titleSection; + //$title = $driver->prepareData($title); + $infoFields['TitleSubtitle'] = array('display' => 'Zeitschriftentitel', 'name' => 'title', 'value' => $title); + $formFields['TitleSubtitle'] = array('hidden' => true, 'name' => 'title', 'value' => $title); + + // Ausgabe + + if ($format == 'Serial Volume') { + $containingWorks = $driver->getContainingWork(); + $containingWork = $containingWorks[0]; + + // Jahr/Band + $yearnumber = (isset($_POST['volume_issue'])) ? $_POST['volume_issue'] : $driver->getVolumeTitle(); + $formFields['YearNumber'] = array('display' => 'Band', 'name' => 'volume_issue', 'value' => $yearnumber, 'mandantory' => false, 'error' => ''); + + // Erscheinungsort + $publicationPlace = $containingWork['location']; + $infoFields['Published'] = array('display' => 'Erscheinungsort', 'name' => 'publication_place', 'value' => $publicationPlace, 'details' => '502 | a, 260 | a'); + $formFields['Published'] = array('hidden' => true, 'name' => 'publication_place', 'value' => $publicationPlace); + + } else { + // Band + $formFields['NumberIssue'] = array('display' => 'Band / Heft', 'name' => 'volume_issue', 'value' => $_POST['number_issue'], 'mandantory' => true, 'error' => ''); + + // Heft + $formFields['Year'] = array('display' => 'Jahr', 'name' => 'publication_date', 'value' => $_POST['publication_date'], 'mandantory' => true, 'error' => ''); + + // Erscheinungsort + /* + $publicationDetails = $driver->getPublicationDetailsFromMarc(); + $publicationPlace = $publicationDetails[0]['location']; + $infoFields['Published'] = array('display' => 'Erscheinungsort', 'name' => 'publication_place', 'value' => $publicationPlace); + $formFields['Published'] = array('hidden' => true, 'name' => 'publication_place', 'value' => $publicationPlace); + */ + + } + + } else { + $formTitle = 'Teilkopie'; + $infoTitle = 'Buch'; + + // Titel + $formFields['Title'] = array('display' => 'Titel des Aufsatzes', 'name' => 'article_title', 'value' => $_POST['article_title'], 'mandantory' => in_array('article_title', $mandantoryFields), 'error' => ''); + + // Title/Autor + $titleStatement = $driver->getTitleStatement(); + $title = (empty($titleStatement)) ? $driver->getTitle() : $driver->getTitle().' / '.implode(', ', $titleStatement); + //$title = $driver->prepareData($title); + $infoFields['TitleAuthor'] = array('display' => 'Titel / Autor', 'name' => 'title', 'value' => $title); + $formFields['TitleAuthor'] = array('hidden' => true, 'name' => 'title', 'value' => $title); + + // Ausgabe + $infoFields['Issue'] = array('display' => 'Ausgabe', 'name' => 'volume_issue', 'value' => $driver->getEdition()); + $formFields['Issue'] = array('hidden' => true, 'name' => 'volume_issue', 'value' => $driver->getEdition()); + + // Erscheinungsort + $publicationPlace = $driver->getUniversityNotes(); + if (empty($publicationPlace)) { + /* + $publicationDetails = $driver->getPublicationDetailsFromMarc(); + $publicationPlace = $publicationDetails[0]['location']; + $infoFields['Published'] = array('display' => 'Erscheinungsort', 'name' => 'publication_place', 'value' => $publicationPlace); + $formFields['Published'] = array('hidden' => true, 'name' => 'publication_place', 'value' => $publicationPlace); + */ + } else { + $infoFields['University'] = array('display' => 'Hochschule', 'name' => 'university', 'value' => $publicationPlace); + $formFields['University'] = array('hidden' => true, 'name' => 'university', 'value' => $publicationPlace); + } + } + + // Seitenangabe + $formFields['Pages'] = array('display' => 'Seitenangabe', 'name' => 'pages', 'value' => $_POST['pages'], 'mandantory' => true, 'error' => ''); + + // Signatur + $signature = ($signature == '!! ') ? '!!' : $signature; + $infoFields['marcTitleSignature'] = array('display' => 'Signatur', 'name' => 'signature', 'value' => $signature, 'details' => ''); + $formFields['marcTitleSignature'] = array('display' => 'Signatur', 'type' => 'hidden', 'name' => 'signature', 'value' => $signature, 'details' => ''); + } + + // Bemerkung + $formFields['Comment'] = array('display' => 'Bemerkung', 'name' => 'comment', 'value' => $_POST['comment'], 'mandantory' => false, 'error' => ''); + + foreach ($this->caliefConfig[$userCalief->library]['additionalFields'] as $field) { + $fieldArray = explode('|', $field); + $fieldValues = array_slice($fieldArray, 2); + $formFields[$field] = array('display' => $fieldArray[0], 'name' => str_ireplace(' ', '_', $fieldArray[0]), 'value' => $_POST[$fieldArray[0]], 'mandantory' => in_array($fieldArray[0], $mandantoryFields), 'error' => '', 'type' => $fieldArray[1], 'values' => $fieldValues); + } + + foreach ($formFields as $key => $values) { + if (isset($_POST[$values['name']])) { + $formFields[$key]['value'] = $_POST[$values['name']]; + } + } + + $view->id = $_GET['id']; + $view->institution = strip_tags($_GET['institution']); + + $view->formTitle = $formTitle; + $view->formFields = $formFields; + + $view->infoTitle = $infoTitle; + $view->infoFields = $infoFields; + } + return $view; + } + + private function caliefLog($user_id, $info, $extra = array()) { + $date = new \DateTime(); + $table = $this->getTable('usercalief'); + + if ($info != 'order') { + $userCalief = $table->getByCaliefId($user_id); + } else { + $userCalief = $table->getByUserId($user_id); + } + + $logger = new \VuFind\Log\Logger(); + $logger->setServiceLocator($this->serviceLocator); + $loggerConfig = new \Zend\Config\Config(array('Logging' => array('file' => $this->caliefConfig['global']['log_dir'].'/'.$this->caliefConfig['global']['log_file'].':notice'))); + $logger->setConfig($loggerConfig); + $extraArray = array($userCalief->name.' '.$userCalief->lastname.' ('.$userCalief->card_number.')'); + $extraArray[] = $extra['transaction-group-qualifier']; + $logger->log(5, $info, $extraArray); + + if ($info == 'order') { + $loggerEmail = new \Vufind\Log\Logger(); + $loggerEmail->setServiceLocator($this->serviceLocator); + $filename = str_ireplace(':', '_', $extra['transaction-group-qualifier']) . '.log'; + $loggerEmailConfig = new \Zend\Config\Config(array('Logging' => array('file' => $this->caliefConfig['global']['log_dir'].'/'.$filename.':notice'))); + $loggerEmail->setConfig($loggerEmailConfig); + $loggerEmail->log(5, $info, $extra); + } + } + + private function caliefMail($info, $data = NULL, $driver = NULL) { + $user = $this->getUser(); + $table = $this->getTable('usercalief'); + //$userCalief = $table->getByUserId($user->id); + $userCalief = $this->getCaliefUser($user); + + if ($info != 'order') { + if ($data) { + $userCalief = $table->getByCaliefId($data); + } + $header = 'From: ' . $this->caliefConfig['global']['admin_email'] . "\r\n" . + 'Reply-To: ' . $this->caliefConfig['global']['admin_email'] . "\r\n" . + 'X-Mailer: PHP/' . phpversion(); + if ($info == 'request') { + //mail($userCalief->email, $this->caliefConfig[$userCalief->library]['text']['emailRequestSubject'], $this->caliefConfig[$userCalief->library]['text']['emailRequestBody'], $header); + //mail($this->caliefConfig['global']['admin_email'], $this->caliefConfig[$userCalief->library]['text']['emailRequestAdminSubject'], $this->caliefConfig[$userCalief->library]['text']['emailRequestAdminBody'], $header); + } else if ($info == 'revoke') { + //mail($userCalief->email, $this->caliefConfig[$userCalief->library]['text']['emailRevokeSubject'], $this->caliefConfig[$userCalief->library]['text']['emailRevokeBody'], $header); + //mail($this->caliefConfig['global']['admin_email'], $this->caliefConfig[$userCalief->library]['text']['emailRevokeAdminSubject'], $this->caliefConfig[$userCalief->library]['text']['emailRevokeAdminBody'], $header); + } else if ($info == 'refuse') { + //mail($userCalief->email, $this->caliefConfig[$userCalief->library]['text']['emailRefuseSubject'], $this->caliefConfig[$userCalief->library]['text']['emailRefuseBody'], $header); + } else if ($info == 'authorize') { + $header .= 'MIME-Version: 1.0' . "\r\n"; + $header .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; + mail($userCalief->email, $this->caliefConfig[$userCalief->library]['text']['emailAuthorizeSubject'], $this->caliefConfig[$userCalief->library]['text']['emailAuthorizeBody'], $header); + } + } else { + + if (!isset($this->caliefConfig[$userCalief->library]['config_file'])) { + $ConfigFile = 'config.xml'; + } else { + $ConfigFile = $this->caliefConfig[$userCalief->library]['config_file']; + } + + if (!isset($this->caliefConfig[$userCalief->library]['ordermail_file'])) { + $OrdermailFile = 'ordermail.xml'; + } else { + $OrdermailFile = $this->caliefConfig[$userCalief->library]['ordermail_file']; + } + + + + if (!isset($this->caliefConfig[$userCalief->library]['ordermail_file'])) { + $OrdermailFile = 'ordermail.xml'; + } else { + $OrdermailFile = $this->caliefConfig[$userCalief->library]['ordermail_file']; + } + + $dodOrder = new dodOrder($ConfigFile, $OrdermailFile, $userCalief); + + //if ($dodOrder->checkEmailAddress($_POST['email'])) { + + $dataEmail = array(); + + $dataEmail['client-name'] = $userCalief->name.' '.$userCalief->lastname; // Nachname Nutzer + $dataEmail['contact-person-name'] = $userCalief->name.' '.$userCalief->lastname; // Name des Bestellers + $dataEmail['client-identifier'] = $userCalief->card_number; // Ausweisnummer + + if (isset($_POST['email'])) { + $dataEmail['del-email-address'] = $_POST['email']; // E-Mail aus Formular + } else { + $dataEmail['del-email-address'] = " "; + } + + $dataEmail['item-system-no'] = (isset($_POST['ppn'])) ? $_POST['ppn'] : ''; + $dataEmail['item-title-of-article'] = (isset($_POST['article_title'])) ? substr($_POST['article_title'], 0, 100) : ''; + $dataEmail['item-author-of-article'] = (isset($_POST['article_author'])) ? substr($_POST['article_author'], 0, 80) : ''; + $dataEmail['item-title'] = (isset($_POST['title'])) ? substr($_POST['title'], 0, 100) : ''; + $dataEmail['item-author'] = (isset($_POST['author'])) ? substr($_POST['author'], 0, 80) : ''; + $dataEmail['item-publication-date'] = (isset($_POST['publication_date'])) ? $_POST['publication_date'] : ''; + $dataEmail['item-place-of-publication'] = (isset($_POST['publication_place'])) ? $_POST['publication_place'] : ''; + $dataEmail['item-pagination'] = (isset($_POST['pages'])) ? $_POST['pages'] : ''; + $dataEmail['item-volume-issue'] = (isset($_POST['volume_issue'])) ? $_POST['volume_issue'] : ''; + $dataEmail['item-held-medium-type'] = (isset($_POST['format'])) ? $_POST['format'] : ''; + $dataEmail['item-call-number'] = (isset($_POST['signature'])) ? $_POST['signature'] : '!!'; + if (isset($_POST['containing_ppn'])) { + $dataEmail['item-additional-no-letters'] = 'PPN (Werk): '.$_POST['containing_ppn']; + } + if (isset($_POST['article_ppn'])) { + $dataEmail['item-additional-no-letters'] = 'PPN (Artikel): '.$_POST['article_ppn']; + } + if (isset($_POST['university'])) { + $dataEmail['item-additional-no-letters'] = 'Hochschule: '.substr($_POST['university'], 0, 80); + } + $dataEmail['requester-note'] = (isset($_POST['comment'])) ? $_POST['comment'] : ''; + + $dataEmail['transaction-initial-req-id-symbol'] = 'CaLief' . '.ORDER'; + $dataEmail['service-date-time'] = date('YmdHis'); + $dataEmail['transaction-group-qualifier'] = $data; + + foreach ($this->caliefConfig[$userCalief->library]['additionalFields'] as $field) { + $fieldArray = explode('|', $field); + $fieldName = str_ireplace(' ', '_', $fieldArray[0]); + $dataEmail[$fieldName] = (isset($_POST[$fieldName])) ? $_POST[$fieldName] : ''; + } + + if ($this->caliefConfig['global']['useCaliefForVufindUsersLibrary']) { + $account = $this->getAuthManager(); + //$patron = $account->storedCatalogLogin(); + //$paia = new PAIA(); + //$profile = $paia->getMyProfile($patron); + $patron = $account->getIdentity(); + + if ($dataEmail['del-email-address'] == '') { + $dataEmail['del-email-address'] = $patron->email; + } + + //preg_match("/(?<=user-type:)\d*/", $patron->type, $output_array); + //if (isset($output_array[0])) { + // $dataEmail['user_type'] = $output_array[0]; + //} + $dataEmail['user_type'] = 'USER_TYPE'; + + $dataEmail['ppn'] = (isset($_POST['ppn'])) ? $_POST['ppn'] : ''; + $dataEmail['issn'] = (isset($_POST['issn'])) ? $_POST['issn'] : ''; + $dataEmail['signature'] = (isset($_POST['signature'])) ? $_POST['signature'] : ''; + } + + if ($dodOrder->setVars($dataEmail)) { + $dodOrder->sendOrderMail(); + } + //} + } + } + + private function caliefFileOrder($data = NULL, $driver = NULL) { + $user = $this->getUser(); + $table = $this->getTable('usercalief'); + //$userCalief = $table->getByUserId($user->id); + $userCalief = $this->getCaliefUser($user); + + // Titel|Nutzernummer|Vorname|Nachname|Mailadresse|Nutzertyp|Signatur|Autor|ISSN|Jahrgang|Band|PPN|EPN + $fileContentArray = array(); + $fileContentArray[] = (isset($_POST['title'])) ? $_POST['title'] : 'TITLE'; + $fileContentArray[] = $userCalief->card_number; + $fileContentArray[] = $userCalief->name; + $fileContentArray[] = $userCalief->lastname; + + $account = $this->getAuthManager(); + //$patron = $account->storedCatalogLogin(); + //$paia = new PAIA(); + //$profile = $paia->getMyProfile($patron); + $patron = $account->getIdentity(); + + if (isset($_POST['email'])) { + $fileContentArray[] = $_POST['email']; + } else { + $fileContentArray[] = $patron->email; + } + + //preg_match("/(?<=user-type:)\d*/", $patron->type, $output_array); + //if (isset($output_array[0])) { + // $fileContentArray[] = $output_array[0]; + //} else { + $fileContentArray[] = 'USER_TYPE'; + //} + + $fileContentArray[] = (isset($_POST['signature'])) ? $_POST['signature'] : 'SIGNATUR'; + $fileContentArray[] = (isset($_POST['article_author'])) ? $_POST['article_author'] : 'AUTHOR'; + $fileContentArray[] = (isset($_POST['issn'])) ? $_POST['issn'] : 'ISSN'; + $fileContentArray[] = (isset($_POST['publication_date'])) ? $_POST['publication_date'] : 'PUBLICATION_DATE'; + $fileContentArray[] = (isset($_POST['volume_issue'])) ? $_POST['volume_issue'] : 'VOLUME_ISSUE'; + $fileContentArray[] = (isset($_POST['ppn'])) ? $_POST['ppn'] : 'PPN'; + + /* if (isset($driver)) { + // get epn from driver + } else { + $fileContentArray[] = (isset($_POST['ppn'])) ? $_POST['ppn'] : 'EPN'; + } */ + $fileContentArray[] = 'EPN'; + $fileContentArray[] = (isset($_POST['article_title'])) ? $_POST['article_title'] : 'ARTICLE_TITLE'; + $fileContentArray[] = (isset($_POST['pages'])) ? $_POST['pages'] : 'PAGES'; + + // lux_import_.asc + $filename = $this->caliefConfig['global']['file_order_dir'].'lux_import_'.time().'.asc'; + + + error_log(print_r('*********************************** '.$filename, true)); + + if (file_put_contents($filename, implode('|', $fileContentArray)) === true) { + chmod($filename, 0775); + } + } + + private function caliefAuthorize($id, $info) { + $tableCaliefUsers = $this->getTable('usercalief'); + if ($info == 'renew') { + $date = new \DateTime(); + $tableCaliefUsers->update(array('lastorder' => $date->format('Y-m-d H:i:s')), array('id' => $id)); + } else if ($info == 'revoke') { + $tableCaliefUsers->update(array('authorized' => 0), array('id' => $id)); + } + } + + private function caliefCheckAuthorize($userCalief) { + if (!$this->caliefConfig['global']['useCaliefForVufindUsers']) { + $date = new \DateTime(); + $lastOrder = new \DateTime($userCalief->lastorder); + $timeDiff = $date->diff($lastOrder); + if ($timeDiff->y >= 1) { + $this->caliefAuthorize($userCalief->id, 'revoke'); + return false; + } else { + if ($userCalief->authorized != '1') { + return false; + } + return true; + } + } else { + return true; + } + } + + private function caliefLibraryKeys() { + $result = array_keys($this->caliefConfig); + foreach ($result as $key => $value) { + if ($value == 'global') { + unset($result[$key]); + } + } + return $result; + } + + private function getCaliefUser($user) { + $table = $this->getTable('usercalief'); + if (!$this->caliefConfig['global']['useCaliefForVufindUsers']) { + return $table->getByUserId($user->id); + } else { + $caliefUser = new \stdClass; + $caliefUser->library = $this->caliefConfig['global']['useCaliefForVufindUsersLibrary']; + $caliefUser->authorized = 1; + $caliefUser->firstname = $user->firstname; + $caliefUser->name = $user->lastname; + $caliefUser->card_number = $user->cat_username; + $account = $this->getAuthManager(); + $patron = $account->getIdentity(); + //$paia = new PAIA(); + //$profile = $paia->getMyProfile($patron); + $caliefUser->email = $patron->email; + return $caliefUser; + } + return false; + } + +} diff --git a/module/CaLief/src/CaLief/Db/Row/CaliefAdmin.php b/module/CaLief/src/CaLief/Db/Row/CaliefAdmin.php new file mode 100644 index 0000000000..2bb3e38d7a --- /dev/null +++ b/module/CaLief/src/CaLief/Db/Row/CaliefAdmin.php @@ -0,0 +1,71 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org Main Site + */ +namespace CaLief\Db\Row; +use VuFind\Db\Row\RowGateway; +use Zend\Db\Adapter\Adapter; +use Zend\Db\Sql\Expression, + Zend\Db\Sql\Predicate\Predicate, + Zend\Db\Sql\Sql, + Zend\Crypt\Symmetric\Mcrypt, + Zend\Crypt\Password\Bcrypt, + Zend\Crypt\BlockCipher as BlockCipher; + +/** + * Row Definition for user + * + * @category VuFind2 + * @package Db_Row + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org Main Site + */ +class CaliefAdmin extends RowGateway implements \VuFind\Db\Table\DbTableAwareInterface, + \ZfcRbac\Identity\IdentityInterface +{ + use \VuFind\Db\Table\DbTableAwareTrait; + + /** + * Constructor + * + * @param \Zend\Db\Adapter\Adapter $adapter Database adapter + */ + public function __construct($adapter) + { + parent::__construct('id', 'calief_admin', $adapter); + } + + /** + * Get the list of roles of this identity + * + * @return string[]|\Rbac\Role\RoleInterface[] + */ + public function getRoles() + { + return ['loggedin']; + } +} diff --git a/module/CaLief/src/CaLief/Db/Row/PluginManager.php b/module/CaLief/src/CaLief/Db/Row/PluginManager.php new file mode 100644 index 0000000000..5d77d6aafa --- /dev/null +++ b/module/CaLief/src/CaLief/Db/Row/PluginManager.php @@ -0,0 +1,90 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +namespace CaLief\Db\Row; + +/** + * Database row plugin manager + * + * @category VuFind + * @package Db_Row + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +class PluginManager extends \VuFind\Db\Row\PluginManager +{ + /** + * Default plugin aliases. + * + * @var array + */ + protected $aliases = [ + 'changetracker' => 'VuFind\Db\Row\ChangeTracker', + 'comments' => 'VuFind\Db\Row\Comments', + 'caliefadmin' => 'CaLief\Db\Row\CaliefAdmin', + 'externalsession' => 'VuFind\Db\Row\ExternalSession', + 'oairesumption' => 'VuFind\Db\Row\OaiResumption', + 'record' => 'VuFind\Db\Row\Record', + 'resource' => 'VuFind\Db\Row\Resource', + 'resourcetags' => 'VuFind\Db\Row\ResourceTags', + 'search' => 'VuFind\Db\Row\Search', + 'session' => 'VuFind\Db\Row\Session', + 'tags' => 'VuFind\Db\Row\Tags', + 'user' => 'VuFind\Db\Row\User', + 'usercard' => 'VuFind\Db\Row\UserCard', + 'usercalief' => 'CaLief\Db\Row\UserCalief', + 'usercalieflog' => 'CaLief\Db\Row\UserCaliefLog', + 'userlist' => 'VuFind\Db\Row\UserList', + 'userresource' => 'VuFind\Db\Row\UserResource', + ]; + + /** + * Default plugin factories. + * + * @var array + */ + protected $factories = [ + 'CaLief\Db\Row\CaliefAdmin' => 'VuFind\Db\Row\RowGatewayFactory', + 'CaLief\Db\Row\UserCalief' => 'VuFind\Db\Row\RowGatewayFactory', + 'CaLief\Db\Row\UserCaliefLog' => 'VuFind\Db\Row\RowGatewayFactory', + 'VuFind\Db\Row\ChangeTracker' => 'VuFind\Db\Row\RowGatewayFactory', + 'VuFind\Db\Row\Comments' => 'VuFind\Db\Row\RowGatewayFactory', + 'VuFind\Db\Row\ExternalSession' => 'VuFind\Db\Row\RowGatewayFactory', + 'VuFind\Db\Row\OaiResumption' => 'VuFind\Db\Row\RowGatewayFactory', + 'VuFind\Db\Row\Record' => 'VuFind\Db\Row\RowGatewayFactory', + 'VuFind\Db\Row\Resource' => 'VuFind\Db\Row\RowGatewayFactory', + 'VuFind\Db\Row\ResourceTags' => 'VuFind\Db\Row\RowGatewayFactory', + 'VuFind\Db\Row\Search' => 'VuFind\Db\Row\RowGatewayFactory', + 'VuFind\Db\Row\Session' => 'VuFind\Db\Row\RowGatewayFactory', + 'VuFind\Db\Row\Tags' => 'VuFind\Db\Row\RowGatewayFactory', + 'VuFind\Db\Row\User' => 'VuFind\Db\Row\UserFactory', + 'VuFind\Db\Row\UserCard' => 'VuFind\Db\Row\RowGatewayFactory', + 'VuFind\Db\Row\UserList' => 'VuFind\Db\Row\UserListFactory', + 'VuFind\Db\Row\UserResource' => 'VuFind\Db\Row\RowGatewayFactory', + ]; +} diff --git a/module/CaLief/src/CaLief/Db/Row/UserCalief.php b/module/CaLief/src/CaLief/Db/Row/UserCalief.php new file mode 100644 index 0000000000..dde19413ff --- /dev/null +++ b/module/CaLief/src/CaLief/Db/Row/UserCalief.php @@ -0,0 +1,70 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org Main Site + */ +namespace CaLief\Db\Row; +use VuFind\Db\Row\RowGateway; +use Zend\Db\Sql\Expression, + Zend\Db\Sql\Predicate\Predicate, + Zend\Db\Sql\Sql, + Zend\Crypt\Symmetric\Mcrypt, + Zend\Crypt\Password\Bcrypt, + Zend\Crypt\BlockCipher as BlockCipher; + +/** + * Row Definition for user + * + * @category VuFind2 + * @package Db_Row + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org Main Site + */ +class UserCalief extends RowGateway implements \VuFind\Db\Table\DbTableAwareInterface, + \ZfcRbac\Identity\IdentityInterface +{ + use \VuFind\Db\Table\DbTableAwareTrait; + + /** + * Constructor + * + * @param \Zend\Db\Adapter\Adapter $adapter Database adapter + */ + public function __construct($adapter) + { + parent::__construct('id', 'user_calief', $adapter); + } + + /** + * Get the list of roles of this identity + * + * @return string[]|\Rbac\Role\RoleInterface[] + */ + public function getRoles() + { + return ['loggedin']; + } +} diff --git a/module/CaLief/src/CaLief/Db/Row/UserCaliefLog.php b/module/CaLief/src/CaLief/Db/Row/UserCaliefLog.php new file mode 100644 index 0000000000..4f3f3929f0 --- /dev/null +++ b/module/CaLief/src/CaLief/Db/Row/UserCaliefLog.php @@ -0,0 +1,70 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org Main Site + */ +namespace CaLief\Db\Row; +use VuFind\Db\Row\RowGateway; +use Zend\Db\Sql\Expression, + Zend\Db\Sql\Predicate\Predicate, + Zend\Db\Sql\Sql, + Zend\Crypt\Symmetric\Mcrypt, + Zend\Crypt\Password\Bcrypt, + Zend\Crypt\BlockCipher as BlockCipher; + +/** + * Row Definition for user + * + * @category VuFind2 + * @package Db_Row + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org Main Site + */ +class UserCaliefLog extends RowGateway implements \VuFind\Db\Table\DbTableAwareInterface, + \ZfcRbac\Identity\IdentityInterface +{ + use \VuFind\Db\Table\DbTableAwareTrait; + + /** + * Constructor + * + * @param \Zend\Db\Adapter\Adapter $adapter Database adapter + */ + public function __construct($adapter) + { + parent::__construct('id', 'user_calief_log', $adapter); + } + + /** + * Get the list of roles of this identity + * + * @return string[]|\Rbac\Role\RoleInterface[] + */ + public function getRoles() + { + return ['loggedin']; + } +} diff --git a/module/CaLief/src/CaLief/Db/Table/CaliefAdmin.php b/module/CaLief/src/CaLief/Db/Table/CaliefAdmin.php new file mode 100644 index 0000000000..4a29045ba4 --- /dev/null +++ b/module/CaLief/src/CaLief/Db/Table/CaliefAdmin.php @@ -0,0 +1,73 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org Main Site + */ +namespace CaLief\Db\Table; + +use CaLief\Db\Table\PluginManager; +use VuFind\Db\Row\RowGateway; +use Zend\Db\Adapter\Adapter; + +/** + * Table Definition for user + * + * @category VuFind2 + * @package Db_Table + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org Main Site + */ +class CaliefAdmin extends \VuFind\Db\Table\Gateway +{ + /** + * Constructor + * + * @param Adapter $adapter Database adapter + * @param PluginManager $tm Table manager + * @param array $cfg Zend Framework configuration + * @param RowGateway $rowObj Row prototype object (null for default) + * @param string $table Name of database table to interface with + */ + public function __construct(Adapter $adapter, PluginManager $tm, $cfg, + RowGateway $rowObj, $table = 'calief_admin' + ) { + parent::__construct($adapter, $tm, $cfg, $rowObj, $table); + } + + /** + * Retrieve a user object from the database based on email. + * + * @param string $email email to use for retrieval. + * + * @return UserRow + */ + public function getByUserId($user_id) + { + $row = $this->select(array('user_id' => $user_id))->current(); + return $row; + } + +} diff --git a/module/CaLief/src/CaLief/Db/Table/PluginManager.php b/module/CaLief/src/CaLief/Db/Table/PluginManager.php new file mode 100644 index 0000000000..3cd25d58aa --- /dev/null +++ b/module/CaLief/src/CaLief/Db/Table/PluginManager.php @@ -0,0 +1,90 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +namespace CaLief\Db\Table; + +/** + * Database table plugin manager + * + * @category VuFind + * @package Db_Table + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki + */ +class PluginManager extends \VuFind\Db\Table\PluginManager +{ + /** + * Default plugin aliases. + * + * @var array + */ + protected $aliases = [ + 'changetracker' => 'VuFind\Db\Table\ChangeTracker', + 'comments' => 'VuFind\Db\Table\Comments', + 'caliefadmin' => 'CaLief\Db\Table\CaliefAdmin', + 'externalsession' => 'VuFind\Db\Table\ExternalSession', + 'oairesumption' => 'VuFind\Db\Table\OaiResumption', + 'record' => 'VuFind\Db\Table\Record', + 'resource' => 'VuFind\Db\Table\Resource', + 'resourcetags' => 'VuFind\Db\Table\ResourceTags', + 'search' => 'VuFind\Db\Table\Search', + 'session' => 'VuFind\Db\Table\Session', + 'tags' => 'VuFind\Db\Table\Tags', + 'user' => 'VuFind\Db\Table\User', + 'usercard' => 'VuFind\Db\Table\UserCard', + 'usercalief' => 'CaLief\Db\Table\UserCalief', + 'usercalieflog' => 'CaLief\Db\Table\UserCaliefLog', + 'userlist' => 'VuFind\Db\Table\UserList', + 'userresource' => 'VuFind\Db\Table\UserResource', + ]; + + /** + * Default plugin factories. + * + * @var array + */ + protected $factories = [ + 'CaLief\Db\Table\CaliefAdmin' => 'VuFind\Db\Table\GatewayFactory', + 'CaLief\Db\Table\UserCalief' => 'VuFind\Db\Table\GatewayFactory', + 'CaLief\Db\Table\UserCaliefLog' => 'VuFind\Db\Table\GatewayFactory', + 'VuFind\Db\Table\ChangeTracker' => 'VuFind\Db\Table\GatewayFactory', + 'VuFind\Db\Table\Comments' => 'VuFind\Db\Table\GatewayFactory', + 'VuFind\Db\Table\ExternalSession' => 'VuFind\Db\Table\GatewayFactory', + 'VuFind\Db\Table\OaiResumption' => 'VuFind\Db\Table\GatewayFactory', + 'VuFind\Db\Table\Record' => 'VuFind\Db\Table\GatewayFactory', + 'VuFind\Db\Table\Resource' => 'VuFind\Db\Table\ResourceFactory', + 'VuFind\Db\Table\ResourceTags' => 'VuFind\Db\Table\CaseSensitiveTagsFactory', + 'VuFind\Db\Table\Search' => 'VuFind\Db\Table\GatewayFactory', + 'VuFind\Db\Table\Session' => 'VuFind\Db\Table\GatewayFactory', + 'VuFind\Db\Table\Tags' => 'VuFind\Db\Table\CaseSensitiveTagsFactory', + 'VuFind\Db\Table\User' => 'VuFind\Db\Table\UserFactory', + 'VuFind\Db\Table\UserCard' => 'VuFind\Db\Table\GatewayFactory', + 'VuFind\Db\Table\UserList' => 'VuFind\Db\Table\UserListFactory', + 'VuFind\Db\Table\UserResource' => 'VuFind\Db\Table\GatewayFactory', + ]; +} diff --git a/module/CaLief/src/CaLief/Db/Table/UserCalief.php b/module/CaLief/src/CaLief/Db/Table/UserCalief.php new file mode 100644 index 0000000000..a3baf5e61e --- /dev/null +++ b/module/CaLief/src/CaLief/Db/Table/UserCalief.php @@ -0,0 +1,79 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org Main Site + */ +namespace CaLief\Db\Table; + +use CaLief\Db\Table\PluginManager; +use VuFind\Db\Row\RowGateway; +use Zend\Db\Adapter\Adapter; + +/** + * Table Definition for user + * + * @category VuFind2 + * @package Db_Table + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org Main Site + */ +class UserCalief extends \VuFind\Db\Table\Gateway +{ + /** + * Constructor + * + * @param Adapter $adapter Database adapter + * @param PluginManager $tm Table manager + * @param array $cfg Zend Framework configuration + * @param RowGateway $rowObj Row prototype object (null for default) + * @param string $table Name of database table to interface with + */ + public function __construct(Adapter $adapter, PluginManager $tm, $cfg, + RowGateway $rowObj, $table = 'user_calief' + ) { + parent::__construct($adapter, $tm, $cfg, $rowObj, $table); + } + + /** + * Retrieve a user object from the database based on email. + * + * @param string $email email to use for retrieval. + * + * @return UserRow + */ + public function getByUserId($user_id) + { + $row = $this->select(array('user_id' => $user_id))->current(); + return $row; + } + + public function getByCaliefId($user_id) + { + $row = $this->select(array('id' => $user_id))->current(); + return $row; + } + +} diff --git a/module/CaLief/src/CaLief/Db/Table/UserCaliefLog.php b/module/CaLief/src/CaLief/Db/Table/UserCaliefLog.php new file mode 100644 index 0000000000..d23528caa9 --- /dev/null +++ b/module/CaLief/src/CaLief/Db/Table/UserCaliefLog.php @@ -0,0 +1,59 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org Main Site + */ +namespace CaLief\Db\Table; + +use CaLief\Db\Table\PluginManager; +use VuFind\Db\Row\RowGateway; +use Zend\Db\Adapter\Adapter; + +/** + * Table Definition for user + * + * @category VuFind2 + * @package Db_Table + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org Main Site + */ +class UserCaliefLog extends \VuFind\Db\Table\Gateway +{ + /** + * Constructor + * + * @param Adapter $adapter Database adapter + * @param PluginManager $tm Table manager + * @param array $cfg Zend Framework configuration + * @param RowGateway $rowObj Row prototype object (null for default) + * @param string $table Name of database table to interface with + */ + public function __construct(Adapter $adapter, PluginManager $tm, $cfg, + RowGateway $rowObj, $table = 'user_calief_log' + ) { + parent::__construct($adapter, $tm, $cfg, $rowObj, $table); + } +} diff --git a/module/CaLief/src/CaLief/Model/CaliefAdminModel.php b/module/CaLief/src/CaLief/Model/CaliefAdminModel.php new file mode 100644 index 0000000000..12856852b8 --- /dev/null +++ b/module/CaLief/src/CaLief/Model/CaliefAdminModel.php @@ -0,0 +1,13 @@ +id = (!empty($data['id'])) ? $data['id'] : null; + } + } \ No newline at end of file diff --git a/module/CaLief/src/CaLief/Model/UserCaliefModel.php b/module/CaLief/src/CaLief/Model/UserCaliefModel.php new file mode 100644 index 0000000000..0ad19732ac --- /dev/null +++ b/module/CaLief/src/CaLief/Model/UserCaliefModel.php @@ -0,0 +1,13 @@ +id = (!empty($data['id'])) ? $data['id'] : null; + } + } \ No newline at end of file diff --git a/module/CaLief/src/CaLief/Order/Available.php b/module/CaLief/src/CaLief/Order/Available.php new file mode 100644 index 0000000000..2b63f93fad --- /dev/null +++ b/module/CaLief/src/CaLief/Order/Available.php @@ -0,0 +1,154 @@ +solrDriver = $solrDriver; + $this->caliefConfig = $caliefConfig; + } + + public function getSignature($format) { + $caliefConfig = $this->caliefConfig; + $iln = $caliefConfig['iln']; + $signatureData = ''; //$this->solrDriver->getSignatureData($iln); + $licenceData = ''; //$this->solrDriver->getLicenceData($iln); + + $sigel = ''; + $signature = ''; + $available = false; + + if (in_array($format, $caliefConfig['formats'])) { + if (empty($signatureData) && $this->checkSigel(array(), $format)) { + return '!'.$sigel.'! '.$signature; + } + foreach ($signatureData as $signatureDate) { + $sigel = $signatureDate['sigel']; + $signature = $signatureDate['signature']; + if ($this->checkSigel($signatureDate, $format)) { + if (empty($licenceData)) { + return '!'.$sigel.'! '.$signature; + } else { + foreach ($licenceData as $licenceDate) { + if (!$this->checkLicence($licenceDate, $format)) { + return ''; + } + } + return '!'.$sigel.'! '.$signature; + } + } + } + } + return ''; + } + + private function checkSigel($signatureDate, $format, $sigelOnly = false) { + $format = str_replace(' ', '_', $format); + $sigelOk = false; + $caliefConfig = $this->caliefConfig; + if (!empty($caliefConfig['sigel_'.$format])) { + foreach ($caliefConfig['sigel_'.$format] as $regex) { + if ($regex == 'ppnlink' || preg_match('#'.$regex.'$#', $signatureDate['sigel'])) { + $sigelOk = true; + break; + } + } + } else { + foreach ($caliefConfig['sigel_all'] as $regex ) { + if (preg_match('#'.$regex.'$#', $signatureDate['sigel'])) { + $sigelOk = true; + break; + } + } + } + if ($sigelOk) { + if ($sigelOnly) { + return true; + } elseif (!empty($caliefConfig['licencenote_'.$format])) { + foreach ($caliefConfig['licencenote_'.$format] as $regex) { + if (preg_match('#'.$regex.'$#', $signatureDate['licence_note'])) { + return true; + } + } + } else { + foreach ($caliefConfig['licencenote_all'] as $regex ) { + if (preg_match('#'.$regex.'$#', $signatureDate['licence_note'])) { + return true; + } + } + } + } + return false; + } + + private function checkLicence($licenceDate, $format) { + $caliefConfig = $this->caliefConfig; + if (!empty($caliefConfig['licence_'.$format])) { + foreach ($caliefConfig['licence_'.$format] as $regex) { + if (empty($licenceDate['licence_type']) || preg_match('#'.$regex.'$#', $licenceDate['licence_type'])) { + return true; + } + } + } else { + foreach ($caliefConfig['licence_all'] as $regex ) { + if (empty($licenceDate['licence_type']) || preg_match('#'.$regex.'$#', $licenceDate['licence_type'])) { + return true; + } + } + } + return false; + } + + public function checkPpnLink($serviceLocator, $ppn) { + $caliefConfig = $this->caliefConfig; + $request = 'id:'.$ppn.' AND collection_details:GBV_ILN_'.$caliefConfig['iln'].' -format:Article'; + + $query = new Query(); + $query->setHandler('AllFields'); + $query->setString($request); + $solr_backend_factory = new SolrDefaultBackendFactory(); + $service = $solr_backend_factory->createService($serviceLocator); + $result = $service->search($query, 0, 10); + $resultArray = $result->getResponse(); + $sigelList = $resultArray['docs'][0]['standort_str_mv']; + $ilnList = $resultArray['docs'][0]['collection_details']; + $format = $resultArray['docs'][0]['format'][0]; + + $ppnValid = false; + foreach ($ilnList as $iln) { + if ($iln == 'GBV_ILN_'.$caliefConfig['iln']) { + $ppnValid = true; + break; + } + } + if ($ppnValid) { + foreach ($sigelList as $sigel) { + if ($this->checkSigel(array('sigel' => $sigel), $format, true) ) { + return true; + } + } + } + return false; + } + +} + +?> \ No newline at end of file diff --git a/module/CaLief/src/CaLief/Order/DodOrder.php b/module/CaLief/src/CaLief/Order/DodOrder.php new file mode 100644 index 0000000000..b710082b3f --- /dev/null +++ b/module/CaLief/src/CaLief/Order/DodOrder.php @@ -0,0 +1,133 @@ +cfgxml = simplexml_load_file(dirname(__FILE__).'/'.$ConfigFile); + } else { + exit('Konnte ' . $ConfigFile . ' nicht ffnen.'); + } + if (file_exists(dirname(__FILE__).'/'.$OrdermailFile)) { + if (stristr($OrdermailFile, '.xml')) { + $this->mailxml = simplexml_load_file(dirname(__FILE__).'/'.$OrdermailFile); + } else { + $this->mailbody = file_get_contents(dirname(__FILE__).'/'.$OrdermailFile); + $this->isXML = false; + } + } else { + exit('Konnte ' . $OrdermailFile . ' nicht ffnen.'); + } + $this->user = $user; + } + + public function getError() { + return $this->errMsg; + } + + public function setVars($varArr) { + if (count($varArr) > 2) { + $this->arrVars = $varArr; + if ($this->isXML) { + foreach ($this->mailxml->children() as $child) { + $elemName = $child->getName(); + if ($this->arrVars[$elemName]) { + $this->mailbody .= $elemName . ": " . $this->replaceChars($this->arrVars[$elemName]) . "\r\n"; + } else { + $this->mailbody .= $elemName . ": " . $this->replaceChars($this->mailxml->$elemName) . "\r\n"; + } + } + } else { + // ... replace values in mailbody + /* error_log(print_r($varArr, true)); + if ($this->user) { + $varArr + } */ + + foreach ($varArr as $key => $var) { + $this->mailbody = str_ireplace('['.$key.']', $var, $this->mailbody); + } + } + } else { + $this->errMsg = "Fehler beim setzen der Variablen!"; + return FALSE; + } + + return TRUE; + } + + function checkEmailAddress($email_address) { + $s = '/^[A-Z0-9._-]+@[A-Z0-9][A-Z0-9.-]{0,61}[A-Z0-9]\.[A-Z.]{2,6}$/i'; + if (preg_match($s, $email_address)) { + return TRUE; + } + $this->errMsg = "Bitte überprüfen Sie die angegebene E-Mailadresse!"; + return FALSE; + } + + function sendOrderMail() { + if ($this->mailbody != "") { + $empfaenger = $this->cfgxml->MAIL->EMPFAENGER; + $betreff = $this->cfgxml->MAIL->SUBJECT; + $header = 'From: ' . $this->cfgxml->MAIL->ABSENDER . "\r\n" . + 'Reply-To: ' . $this->cfgxml->MAIL->ABSENDER . "\r\n" . + 'X-Mailer: PHP/' . phpversion() . "\r\n" . + 'Content-Type: text/plain; charset=utf-8' . "\r\n" . + 'Content-Transfer-Encoding: 7bit'; + + mail($empfaenger, $betreff, $this->mailbody, $header); + $this->errMsg = "Bestellung erfolgreich versendet!"; + return TRUE; + } else { + $this->errMsg .= "E-Mail leer !?"; + return FALSE; + } + } + + function getValue($tag) { + $value = FALSE; + $value = $this->mailxml->$tag; + return $value; + } + + private function prepareData($data) { + $searchArray = array('/A\xcc\x88/', '/A\xcc\x8a/', '/O\xcc\x88/', '/U\xcc\x88/', '/a\xcc\x88/', '/a\xcc\x8a/', '/c\xcc\xa6/', '/e\xcc\x82/', '/o\xcc\x88/', '/u\xcc\x88/', '/\xc2\x98/', '/\xc2\x9c/'); + $translateArray = array('', '', '' ,'' ,'' ,'', '', '', '' ,'' ,'' ,'' ); + return preg_replace($searchArray, $translateArray, $data); + } + + function replaceChars($string) { + $string = utf8_decode($this->prepareData($string)); + $string = str_ireplace('', 'ss', $string); + $string = str_ireplace('', 'ae', $string); + $string = str_ireplace('', 'oe', $string); + $string = str_ireplace('', 'ue', $string); + $string = str_ireplace('', 'Ae', $string); + $string = str_ireplace('', 'Oe', $string); + $string = str_ireplace('', 'Ue', $string); + return $string; + } +} diff --git a/module/CaLief/src/CaLief/Order/config.xml b/module/CaLief/src/CaLief/Order/config.xml new file mode 100644 index 0000000000..813730421d --- /dev/null +++ b/module/CaLief/src/CaLief/Order/config.xml @@ -0,0 +1,21 @@ + + + + 127.0.0.1 + dod25 + glubsch + chiefreader + + + /opt/dod/ + /opt/dod/www/ + /opt/dod/dod_files/scandateien/ + + + lieferdienste@leuphana.de + LUX Artikelbestellung + LUX Artikelbestellung + christen@leuphana.de + LUX Artikelbestellung + + diff --git a/module/CaLief/src/CaLief/Order/config_20.xml b/module/CaLief/src/CaLief/Order/config_20.xml new file mode 100644 index 0000000000..64b6dac62d --- /dev/null +++ b/module/CaLief/src/CaLief/Order/config_20.xml @@ -0,0 +1,10 @@ + + + + chemiebibliothek@biblio.tu-bs.de + chemiebibliothek@biblio.tu-bs.de + Artikelbestellung + chemiebibliothek@biblio.tu-bs.de + Artikelbestellung + + diff --git a/module/CaLief/src/CaLief/Order/ordermail.xml b/module/CaLief/src/CaLief/Order/ordermail.xml new file mode 100644 index 0000000000..9d31ef925e --- /dev/null +++ b/module/CaLief/src/CaLief/Order/ordermail.xml @@ -0,0 +1,79 @@ + + + + + + REQUEST + + + + 1 + + CaLief + bestellcap@dodtest.sub.uni-hamburg.de + calief + abrechnung@dodtest.sub.uni-hamburg.de + USER-GROUP-0 + DE + + 0018 + + + + SIMPLE + + . + . + . + . + . + + ALL + NONE + NONE + Y + EMAIL + PDF + N + + + + INVOICE + EMAIL + abrechnung@dodtest.sub.uni-hamburg.de + . + . + . + . + . + COLLECTIVE + N + COPY + + PRINTED + Y + + SERIAL + PRINTED + + + + + + + + + + + + + + + + FORWARD=N + N + diff --git a/module/CaLief/src/CaLief/Order/ordermail_lg.txt b/module/CaLief/src/CaLief/Order/ordermail_lg.txt new file mode 100644 index 0000000000..3eae6e4118 --- /dev/null +++ b/module/CaLief/src/CaLief/Order/ordermail_lg.txt @@ -0,0 +1,17 @@ +Ich bestelle folgende/n Zeitschriftenartikel: + +Benutzernummer: [client-identifier] +E‐Mailadresse: [del-email-address] +Nutzertyp: [user_type] +Lieferung an: [Lieferung_an] +Titel der Zeitschrift: [item-title] +ISSN: [issn] +Signatur: [signature] +PPN: [ppn] +Jahr: [item-publication-date] +Band/Heft: [item-volume-issue] +Titel des Aufsatzes: [item-title-of-article] +Autor des Aufsatzes: [item-author-of-article] +Seitenangabe: [item-pagination] + +[requester-note] \ No newline at end of file From 879191b19b33c6ca56d165659da60cdfcfb929c1 Mon Sep 17 00:00:00 2001 From: VZG 124 Date: Sat, 7 Mar 2020 18:11:28 +0100 Subject: [PATCH 02/44] Update VZG 124. --- module/CaLief/src/CaLief/Order/config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/CaLief/src/CaLief/Order/config.xml b/module/CaLief/src/CaLief/Order/config.xml index 813730421d..60605b2700 100644 --- a/module/CaLief/src/CaLief/Order/config.xml +++ b/module/CaLief/src/CaLief/Order/config.xml @@ -12,7 +12,7 @@ /opt/dod/dod_files/scandateien/ - lieferdienste@leuphana.de + christensen@effective-webwork.de LUX Artikelbestellung LUX Artikelbestellung christen@leuphana.de From f1252492d1661af469495fccdb86eabbbef217e8 Mon Sep 17 00:00:00 2001 From: Johannes Schultze Date: Fri, 3 Apr 2020 14:30:22 +0200 Subject: [PATCH 03/44] LG #3 - Ergebnisliste: Facette Medienart nicht korrekt eingestellt. --- .../ExtendedFacets/Recommend/SideFacets.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php b/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php index 7fe71aa9fd..6535362116 100644 --- a/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php +++ b/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php @@ -130,6 +130,35 @@ protected function showFacetValue($facetSet) return $facetSet; } + /** + * getFacetHierarchies + * + * Return dependency informations on facets. + * + * @param array $oldFacetList list of facets, $label filterlabel. + * + * @return array list of facets + */ + public function getFacetHierarchies($oldFacetList, $label) + { + $facetLength = count($oldFacetList); + $newFacetList = array(); + for ($i = 0; $i < $facetLength; $i++) { + if (isset($oldFacetList[$i])) { + $newFacetList[] = $oldFacetList[$i]; + } + $value = $oldFacetList[$i]['value']; + for ($j = $i+1; $j < $facetLength; $j++) { + if (strpos($oldFacetList[$j]['value'], $value) > 0) { + $oldFacetList[$j]['parent'] = $value; + $newFacetList[] = $oldFacetList[$j]; + unset($oldFacetList[$j]); + } + } + } + return $newFacetList; + } + /** * Get facet information from the search results. * @@ -141,6 +170,9 @@ public function getFacetSet() if (isset($facetSet['publishDate'])) { $facetSet['publishDate']['list'] = $this->getYearFacets($facetSet['publishDate']['list'], $facetSet['publishDate']['label']); } + if (isset($facetSet['format_facet'])) { + $facetSet['format_facet']['list'] = $this->getFacetHierarchies($facetSet['format_facet']['list'], $facetSet['format_facet']['label']); + } $facetSet = $this->showFacetValue($facetSet); From a86ccdf7076f1c6045675160d372b62210bcc952 Mon Sep 17 00:00:00 2001 From: Johannes Schultze Date: Mon, 6 Apr 2020 20:50:30 +0200 Subject: [PATCH 04/44] Added new module "BeluginoCover". --- composer.json | 3 +- module/BeluginoCover/Module.php | 92 +++ module/BeluginoCover/config/module.config.php | 23 + .../Controller/CoverController.php | 84 +++ .../Controller/CoverControllerFactory.php | 70 ++ .../src/BeluginoCover/Cover/Loader.php | 180 +++++ .../src/BeluginoCover/Cover/Loader.php.backup | 700 ++++++++++++++++++ .../src/BeluginoCover/Cover/LoaderFactory.php | 80 ++ 8 files changed, 1231 insertions(+), 1 deletion(-) create mode 100644 module/BeluginoCover/Module.php create mode 100644 module/BeluginoCover/config/module.config.php create mode 100644 module/BeluginoCover/src/BeluginoCover/Controller/CoverController.php create mode 100644 module/BeluginoCover/src/BeluginoCover/Controller/CoverControllerFactory.php create mode 100644 module/BeluginoCover/src/BeluginoCover/Cover/Loader.php create mode 100644 module/BeluginoCover/src/BeluginoCover/Cover/Loader.php.backup create mode 100644 module/BeluginoCover/src/BeluginoCover/Cover/LoaderFactory.php diff --git a/composer.json b/composer.json index 305ec2026c..b989563322 100644 --- a/composer.json +++ b/composer.json @@ -71,7 +71,8 @@ "zendframework/zendservice-amazon": "2.3.0", "zendframework/zendservice-recaptcha": "3.1.0", "zf-commons/zfc-rbac": "2.6.3", - "picqer/php-barcode-generator": "^0.3.0" + "picqer/php-barcode-generator": "^0.3.0", + "sabberworm/php-css-parser": "*" }, "require-dev": { "behat/mink": "1.7.1", diff --git a/module/BeluginoCover/Module.php b/module/BeluginoCover/Module.php new file mode 100644 index 0000000000..f3312aed5d --- /dev/null +++ b/module/BeluginoCover/Module.php @@ -0,0 +1,92 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://github.com/dmj/vf2-proxy + */ +namespace BeluginoCover; +use Zend\ModuleManager\ModuleManager, + Zend\Mvc\MvcEvent; + +/** + * Template for ZF2 module for storing local overrides. + * + * @category VuFind2 + * @package Module + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://github.com/dmj/vf2-proxy + */ +class Module +{ + /** + * Get module configuration + * + * @return array + */ + public function getConfig() + { + return include __DIR__ . '/config/module.config.php'; + } + + /** + * Get autoloader configuration + * + * @return array + */ + public function getAutoloaderConfig() + { + return array( + 'Zend\Loader\StandardAutoloader' => array( + 'namespaces' => array( + __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, + ), + ), + ); + } + + /** + * Initialize the module + * + * @param ModuleManager $m Module manager + * + * @return void + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function init(ModuleManager $m) + { + } + + /** + * Bootstrap the module + * + * @param MvcEvent $e Event + * + * @return void + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function onBootstrap(MvcEvent $e) + { + } +} diff --git a/module/BeluginoCover/config/module.config.php b/module/BeluginoCover/config/module.config.php new file mode 100644 index 0000000000..61d4b2bf86 --- /dev/null +++ b/module/BeluginoCover/config/module.config.php @@ -0,0 +1,23 @@ + [ + 'factories' => [ + 'BeluginoCover\Controller\CoverController' => 'BeluginoCover\Controller\CoverControllerFactory', + ], + 'aliases' => [ + 'cover' => 'BeluginoCover\Controller\CoverController', + 'Cover' => 'BeluginoCover\Controller\CoverController', + ], + ], + 'service_manager' => [ + 'allow_override' => true, + 'factories' => [ + 'BeluginoCover\Cover\Loader' => 'BeluginoCover\Cover\LoaderFactory', + ], + ], +]; + +return $config; + diff --git a/module/BeluginoCover/src/BeluginoCover/Controller/CoverController.php b/module/BeluginoCover/src/BeluginoCover/Controller/CoverController.php new file mode 100644 index 0000000000..9e678ec714 --- /dev/null +++ b/module/BeluginoCover/src/BeluginoCover/Controller/CoverController.php @@ -0,0 +1,84 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Page + */ +namespace BeluginoCover\Controller; + +use VuFind\Cover\CachingProxy; +use BeluginoCover\Cover\Loader; +use VuFind\Session\Settings as SessionSettings; + +/** + * Generates covers for book entries + * + * @category VuFind + * @package Controller + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Page + */ +class CoverController extends \VuFind\Controller\CoverController +{ + /** + * Constructor + * + * @param Loader $loader Cover loader + * @param CachingProxy $proxy Proxy loader + * @param SessionSettings $ss Session settings + */ + public function __construct(Loader $loader, CachingProxy $proxy, + SessionSettings $ss + ) { + $this->loader = $loader; + $this->proxy = $proxy; + $this->sessionSettings = $ss; + } + + /** + * Convert image parameters into an array for use by the image loader. + * + * @return array + */ + protected function getImageParams() + { + $params = $this->params(); // shortcut for readability + return [ + // Legacy support for "isn" param which has been superseded by isbn: + 'isbn' => $params()->fromQuery('isbn') ?: $params()->fromQuery('isn'), + 'size' => $params()->fromQuery('size'), + 'type' => $params()->fromQuery('contenttype'), + 'title' => $params()->fromQuery('title'), + 'author' => $params()->fromQuery('author'), + 'callnumber' => $params()->fromQuery('callnumber'), + 'issn' => $params()->fromQuery('issn'), + 'oclc' => $params()->fromQuery('oclc'), + 'upc' => $params()->fromQuery('upc'), + 'recordid' => $params()->fromQuery('recordid'), + 'source' => $params()->fromQuery('source'), + 'format' => $params()->fromQuery('format'), + ]; + } +} diff --git a/module/BeluginoCover/src/BeluginoCover/Controller/CoverControllerFactory.php b/module/BeluginoCover/src/BeluginoCover/Controller/CoverControllerFactory.php new file mode 100644 index 0000000000..8d23114f32 --- /dev/null +++ b/module/BeluginoCover/src/BeluginoCover/Controller/CoverControllerFactory.php @@ -0,0 +1,70 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development Wiki + */ +namespace BeluginoCover\Controller; + +use Interop\Container\ContainerInterface; +use Zend\ServiceManager\Factory\FactoryInterface; + +/** + * Cover controller factory. + * + * @category VuFind + * @package Controller + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development Wiki + */ +class CoverControllerFactory implements FactoryInterface +{ + /** + * Create an object + * + * @param ContainerInterface $container Service manager + * @param string $requestedName Service being created + * @param null|array $options Extra options (optional) + * + * @return object + * + * @throws ServiceNotFoundException if unable to resolve the service. + * @throws ServiceNotCreatedException if an exception is raised when + * creating a service. + * @throws ContainerException if any other error occurs + */ + public function __invoke(ContainerInterface $container, $requestedName, + array $options = null + ) { + if (!empty($options)) { + throw new \Exception('Unexpected options sent to factory.'); + } + return new $requestedName( + $container->get('BeluginoCover\Cover\Loader'), + $container->get('VuFind\Cover\CachingProxy'), + $container->get('VuFind\Session\Settings') + ); + } +} diff --git a/module/BeluginoCover/src/BeluginoCover/Cover/Loader.php b/module/BeluginoCover/src/BeluginoCover/Cover/Loader.php new file mode 100644 index 0000000000..cf29784f80 --- /dev/null +++ b/module/BeluginoCover/src/BeluginoCover/Cover/Loader.php @@ -0,0 +1,180 @@ + + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/configuration:external_content Wiki + */ +namespace BeluginoCover\Cover; + +use VuFind\Content\Covers\PluginManager as ApiManager; +use VuFindCode\ISBN; + +/** + * Book Cover Generator + * + * @category VuFind + * @package Cover_Generator + * @author Andrew S. Nagy + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/configuration:external_content Wiki + */ +class Loader extends \VuFind\Cover\Loader +{ + /** + * belugino configuration + */ + protected $belugaConfig; + + /** + * Constructor + * + * @param \Zend\Config\Config $config VuFind configuration + * @param ApiManager $manager Plugin manager for API handlers + * @param \VuFindTheme\ThemeInfo $theme VuFind theme tools + * @param \VuFindHttp\HttpService $httpService HTTP client factory + * @param string $baseDir Directory to store downloaded + * images (set to system temp dir if not otherwise specified) + */ + public function __construct($config, ApiManager $manager, + \VuFindTheme\ThemeInfo $theme, \VuFindHttp\HttpService $httpService, + $baseDir = null + ) { + $this->setThemeInfo($theme); + $this->config = $config; + $this->configuredFailImage = isset($config->Content->noCoverAvailableImage) + ? $config->Content->noCoverAvailableImage : null; + $this->apiManager = $manager; + $this->httpService = $httpService; + $this->baseDir = (null === $baseDir) + ? rtrim(sys_get_temp_dir(), '\\/') . '/covers' + : rtrim($baseDir, '\\/'); + + $this->belugaConfig = parse_ini_file(realpath(getenv('VUFIND_LOCAL_DIR') . '/config/vufind/BelugaConfig.ini'), true); + } + + + /** + * Load an image given an ISBN and/or content type. + * + * @param array $settings Array of settings used to calculate a cover; may + * contain any or all of these keys: 'isbn' (ISBN), 'size' (requested size), + * 'type' (content type), 'title' (title of book, for dynamic covers), 'author' + * (author of book, for dynamic covers), 'callnumber' (unique ID, for dynamic + * covers), 'issn' (ISSN), 'oclc' (OCLC number), 'upc' (UPC number). + * + * @return void + */ + public function loadImage($settings = []) + { + // Load settings from legacy function parameters if they are not passed + // in as an array: + $settings = is_array($settings) + ? array_merge($this->getDefaultSettings(), $settings) + : $this->getImageSettingsFromLegacyArgs(func_get_args()); + + // Store sanitized versions of some parameters for future reference: + $this->storeSanitizedSettings($settings); + + // Display a fail image unless our parameters pass inspection and we + // are able to display an ISBN or content-type-based image. + if (!in_array($this->size, $this->validSizes)) { + $this->loadUnavailable(); + } elseif (!$this->fetchFromAPI() + && !$this->fetchFromContentType() + ) { + if (isset($this->belugaConfig['belugino'])) { + if (isset($settings['format'])) { + $format = str_ireplace(' ', '', $settings['format']); + $format = strtolower($format); + if ($im = imagecreate(64, 64)) { + $beluginoParser = new \Sabberworm\CSS\Parser(file_get_contents(APPLICATION_PATH . '/themes/belugax/css/belugino.css')); + $beluginoCss = $beluginoParser->parse(); + + $belugino = []; + if (is_array($this->belugaConfig)) { + foreach ($this->belugaConfig['belugino'] as $key => $value) { + $key = str_ireplace(' ', '', $key); + $key = strtolower($key); + $belugino[$key] = $value; + } + } + + error_log(print_r($belugino, true)); + error_log(print_r($format, true)); + error_log(print_r($belugino[$format], true)); + + $formatString = ''; + foreach ($beluginoCss->getAllDeclarationBlocks() as $declarationBlock) { + $foundBeluginoClass = false; + foreach ($declarationBlock->getSelectors() as $selector) { + if ($selector->getSelector() == '.'.$belugino[$format].':before') { + $foundBeluginoClass = true; + } + } + if ($foundBeluginoClass) { + foreach ($declarationBlock->getRules() as $rule) { + if ($rule->getRule() == 'content') { + $formatString = $rule->getValue()->getString().""; + $formatString = str_ireplace("\e", "0xe", $formatString); + } + } + } + } + + $bg = imagecolorallocate($im, 255, 255, 255); + $textcolor = imagecolorallocate($im, 0, 0, 255); + + imagettftext($im, 5,0,0,0, $textcolor, APPLICATION_PATH . '/themes/belugax/css/fonts/belugino.ttf', $formatString); + + imageAlphaBlending($im, true); + imageSaveAlpha($im, true); + + ob_start(); + imagepng($im); + $img = ob_get_contents(); + ob_end_clean(); + + imagedestroy($im); + $this->image = $img; + $this->contentType = 'image/png'; + } else { + $this->loadUnavailable(); + } + } + } else { + if ($this->generator) { + $this->generator->setOptions($this->getCoverGeneratorSettings()); + $this->image = $this->generator->generate( + $settings['title'], $settings['author'], $settings['callnumber'] + ); + $this->contentType = 'image/png'; + } else { + $this->loadUnavailable(); + } + } + } + } +} diff --git a/module/BeluginoCover/src/BeluginoCover/Cover/Loader.php.backup b/module/BeluginoCover/src/BeluginoCover/Cover/Loader.php.backup new file mode 100644 index 0000000000..6a3011bdc8 --- /dev/null +++ b/module/BeluginoCover/src/BeluginoCover/Cover/Loader.php.backup @@ -0,0 +1,700 @@ + + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/use_of_external_content Wiki + */ +namespace BeluginoCover\Cover; +use VuFind\Code\ISBN, + VuFind\Content\Covers\PluginManager as ApiManager, + Zend\Log\LoggerInterface; + +/** + * Book Cover Generator + * + * @category VuFind2 + * @package Cover_Generator + * @author Andrew S. Nagy + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link http://vufind.org/wiki/use_of_external_content Wiki + */ +class Loader implements \Zend\Log\LoggerAwareInterface +{ + /** + * filename constructed from ISBN + * + * @var string + */ + protected $localFile = ''; + + /** + * valid image sizes to request + * + * @var array + */ + protected $validSizes = array('small', 'medium', 'large'); + + /** + * property to hold VuFind configuration settings + * + * @var \Zend\Config\Config + */ + protected $config; + + /** + * Plugin manager for API handlers + * + * @var ApiManager + */ + protected $apiManager; + + /** + * HTTP client + * + * @var \Zend\Http\Client + */ + protected $client; + + /** + * directory to store downloaded images + * + * @var string + */ + protected $baseDir; + + /** + * User ISBN parameter + * + * @var ISBN + */ + protected $isbn = null; + + /** + * User ISSN parameter + * + * @var string + */ + protected $issn = null; + + /** + * User OCLC number parameter + * + * @var string + */ + protected $oclc = null; + + /** + * User UPC number parameter + * + * @var string + */ + protected $upc = null; + + /** + * User size parameter + * + * @var string + */ + protected $size; + + /** + * User type parameter + * + * @var string + */ + protected $type; + + /** + * Property for storing raw image data; may be null if image is unavailable + * + * @var string + */ + protected $image = null; + + /** + * Content type of data in $image property + * + * @var string + */ + protected $contentType = null; + + /** + * Logger (or false for none) + * + * @var LoggerInterface|bool + */ + protected $logger = false; + + /** + * Theme tools + * + * @var \VuFindTheme\ThemeInfo + */ + protected $themeTools; + + /** + * beluga configuration + */ + protected $belugaConfig; + + /** + * Constructor + * + * @param \Zend\Config\Config $config VuFind configuration + * @param ApiManager $manager Plugin manager for API handlers + * @param \VuFindTheme\ThemeInfo $theme VuFind theme tools + * @param \Zend\Http\Client $client HTTP client + * @param string $baseDir Directory to store downloaded images + * (set to system temp dir if not otherwise specified) + */ + public function __construct($config, ApiManager $manager, + \VuFindTheme\ThemeInfo $theme, \Zend\Http\Client $client, $baseDir = null + ) { + $this->config = $config; + $this->apiManager = $manager; + $this->themeTools = $theme; + $this->client = $client; + $this->baseDir = rtrim( + is_null($baseDir) ? sys_get_temp_dir() : $baseDir, '\\/' + ); + + $this->belugaConfig = parse_ini_file(realpath(APPLICATION_PATH . '/local/config/vufind/Beluga.ini'), true); + } + + /** + * Set the logger + * + * @param LoggerInterface $logger Logger to use. + * + * @return void + */ + public function setLogger(LoggerInterface $logger) + { + $this->logger = $logger; + } + + /** + * Log a debug message. + * + * @param string $msg Message to log. + * + * @return void + */ + protected function debug($msg) + { + if ($this->logger) { + $this->logger->debug($msg); + } + } + + /** + * Get the image data (usually called after loadImage) + * + * @return string + */ + public function getImage() + { + // No image loaded? Use "unavailable" as default: + if (is_null($this->image)) { + $this->loadUnavailable(); + } + return $this->image; + } + + /** + * Get the content type of the current image (usually called after loadImage) + * + * @return string + */ + public function getContentType() + { + // No content type loaded? Use "unavailable" as default: + if (is_null($this->contentType)) { + $this->loadUnavailable(); + } + return $this->contentType; + } + + /** + * Get Cover Generator Object + * + * @return VuFind\Cover\Generator + */ + public function getCoverGenerator() + { + return new \VuFind\Cover\Generator($this->themeTools, array('mode' => $this->config->Content->makeDynamicCovers)); + } + /** + * Load an image given an ISBN and/or content type. + * + * @param string $isbn ISBN + * @param string $size Requested size + * @param string $type Content type + * @param string $title Title of book (for dynamic covers) + * @param string $author Author of the book (for dynamic covers) + * @param string $callnumber Callnumber (unique id for dynamic covers) + * @param string $issn ISSN + * @param string $oclc OCLC number + * @param string $upc UPC number + * + * @return void + */ + public function loadImage($isbn = null, $size = 'small', $type = null, + $title = null, $author = null, $callnumber = null, $issn = null, + $oclc = null, $upc = null, $formats = null + ) { + // Sanitize parameters: + $this->isbn = new ISBN($isbn); + $this->issn = empty($issn) + ? null + : substr(preg_replace('/[^0-9X]/', '', strtoupper($issn)), 0, 8); + $this->oclc = $oclc; + $this->upc = $upc; + $this->type = preg_replace("/[^a-zA-Z]/", "", $type); + $this->size = $size; + + // Display a fail image unless our parameters pass inspection and we + // are able to display an ISBN or content-type-based image. + if (!in_array($this->size, $this->validSizes)) { + $this->loadUnavailable(); + } else if (!$this->fetchFromAPI() + && !$this->fetchFromContentType() + ) { + if (isset($this->config->Content->makeDynamicCovers) + && true == $this->config->Content->makeDynamicCovers + ) { + if ($this->belugaConfig['Global']['useIconsAsStandardCovers']) { + if (isset($formats[0])) { + $format = str_ireplace(' ', '', $formats[0]); + $format = strtolower($format); + if ($im = imagecreatefrompng(realpath(APPLICATION_PATH . '/themes/belugax/images/cover_icons/icon_big_'.$format.'.png'))) { + imageAlphaBlending($im, true); + imageSaveAlpha($im, true); + + // Output png CHECK THE PARAM + ob_start(); + imagepng($im); + $img = ob_get_contents(); + ob_end_clean(); + + // Clear memory + imagedestroy($im); + // GTFO + $this->image = $img; + } else { + $this->loadUnavailable(); + } + } + } else { + $this->image = $this->getCoverGenerator()->generate($title, $author, $callnumber); + } + $this->contentType = 'image/png'; + } else { + $this->loadUnavailable(); + } + } + } + + /** + * Support method for fetchFromAPI() -- set the localFile property. + * + * @param array $ids IDs returned by getIdentifiers() method + * + * @return void + */ + protected function determineLocalFile($ids) + { + // We should check whether we have cached images for the 13- or 10-digit + // ISBNs. If no file exists, we'll favor the 10-digit number if + // available for the sake of brevity. + if (isset($ids['isbn'])) { + $file = $this->getCachePath($this->size, $ids['isbn']->get13()); + if (!is_readable($file) && $ids['isbn']->get10()) { + return $this->getCachePath($this->size, $ids['isbn']->get10()); + } + return $file; + } else if (isset($ids['issn'])) { + return $this->getCachePath($this->size, $ids['issn']); + } else if (isset($ids['oclc'])) { + return $this->getCachePath($this->size, 'OCLC' . $ids['oclc']); + } else if (isset($ids['upc'])) { + return $this->getCachePath($this->size, 'UPC' . $ids['upc']); + } + throw new \Exception('Unexpected code path reached!'); + } + + /** + * Get all valid identifiers as an associative array. + * + * @return array + */ + protected function getIdentifiers() + { + $ids = array(); + if ($this->isbn && $this->isbn->isValid()) { + $ids['isbn'] = $this->isbn; + } + if ($this->issn && strlen($this->issn) == 8) { + $ids['issn'] = $this->issn; + } + if ($this->oclc && strlen($this->oclc) > 0) { + $ids['oclc'] = $this->oclc; + } + if ($this->upc && strlen($this->upc) > 0) { + $ids['upc'] = $this->upc; + } + return $ids; + } + + /** + * Load bookcover from cache or remote provider and display if possible. + * + * @return bool True if image loaded, false on failure. + */ + protected function fetchFromAPI() + { + // Check that we have at least one valid identifier: + $ids = $this->getIdentifiers(); + if (empty($ids)) { + return false; + } + + // Set up local file path: + $this->localFile = $this->determineLocalFile($ids); + if (is_readable($this->localFile)) { + // Load local cache if available + $this->contentType = 'image/jpeg'; + $this->image = file_get_contents($this->localFile); + return true; + } else if (isset($this->config->Content->coverimages)) { + $providers = explode(',', $this->config->Content->coverimages); + foreach ($providers as $provider) { + $provider = explode(':', trim($provider)); + $apiName = strtolower(trim($provider[0])); + $key = isset($provider[1]) ? trim($provider[1]) : null; + try { + $handler = $this->apiManager->get($apiName); + + // Is the current provider appropriate for the available data? + if ($handler->supports($ids)) { + if ($url = $handler->getUrl($key, $this->size, $ids)) { + $success = $this->processImageURLForSource( + $url, $handler->isCacheAllowed(), $apiName + ); + if ($success) { + return true; + } + } + } + } catch (\Exception $e) { + $this->debug( + get_class($e) . ' during processing of ' . $apiName + . ': ' . $e->getMessage() + ); + } + } + } + return false; + } + + /** + * Return a path to the image cache for the given size and ID; ensure that + * directories are created as needed. + * + * @param string $size Size category + * @param string $id Unique identifier (ISBN / ISSN) + * @param string $extension File extension to use (default = jpg) + * + * @return string Cache path + */ + protected function getCachePath($size, $id, $extension = 'jpg') + { + $base = $this->baseDir . '/covers'; + if (!is_dir($base)) { + mkdir($base); + } + $base .= '/' . $size; + if (!is_dir($base)) { + mkdir($base); + } + return $base . '/' . $id . '.' . $extension; + } + + /** + * Load content type icon image from URL from theme images and display if + * possible. + * + * @return bool True if image loaded, false on failure. + */ + protected function fetchFromContentType() + { + // Give up if no content type was passed in: + if (empty($this->type)) { + return false; + } + + // Try to find an icon: + $iconFile = $this->searchTheme( + 'images/' . $this->size . '/' . $this->type, + array('.png', '.gif', '.jpg') + ); + if ($iconFile !== false) { + // Most content-type headers match file extensions... but + // include a special case for jpg vs. jpeg: + $format = substr($iconFile, -3); + $this->contentType + = 'image/' . ($format == 'jpg' ? 'jpeg' : $format); + $this->image = file_get_contents($iconFile); + return true; + } + + // If we got this far, no icon was found: + return false; + } + + /** + * Find a file in the themes (return false if no file exists). + * + * @param string $path Relative path of file to find. + * @param array $formats Optional array of suffixes to add to $path while + * searching theme (used to check multiple extensions in each theme). + * + * @return string|bool + */ + protected function searchTheme($path, $formats = array('')) + { + // Check all supported image formats: + $filenames = array(); + foreach ($formats as $format) { + $filenames[] = $path . $format; + } + $fileMatch = $this->themeTools->findContainingTheme($filenames, true); + return empty($fileMatch) ? false : $fileMatch; + } + + /** + * Load the user-specified "cover unavailable" graphic (or default if none + * specified). + * + * @return void + * @author Thomas Schwaerzler + */ + public function loadUnavailable() + { + // Get "no cover" image from config.ini: + $noCoverImage = isset($this->config->Content->noCoverAvailableImage) + ? $this->searchTheme($this->config->Content->noCoverAvailableImage) + : null; + + // No setting -- use default, and don't log anything: + if (empty($noCoverImage)) { + // log? + return $this->loadDefaultFailImage(); + } + + // If file defined but does not exist, log error and display default: + if (!file_exists($noCoverImage) || !is_readable($noCoverImage)) { + $this->debug("Cannot access file: '$noCoverImage'"); + return $this->loadDefaultFailImage(); + } + + // Array containing map of allowed file extensions to mimetypes + // (to be extended) + $allowedFileExtensions = array( + "gif" => "image/gif", + "jpeg" => "image/jpeg", "jpg" => "image/jpeg", + "png" => "image/png", + "tiff" => "image/tiff", "tif" => "image/tiff" + ); + + // Log error and bail out if file lacks a known image extension: + $parts = explode('.', $noCoverImage); + $fileExtension = strtolower(end($parts)); + if (!array_key_exists($fileExtension, $allowedFileExtensions)) { + $this->debug( + "Illegal file-extension '$fileExtension' for image '$noCoverImage'" + ); + return $this->loadDefaultFailImage(); + } + + // Get mime type from file extension: + $this->contentType = $allowedFileExtensions[$fileExtension]; + + // Load the image data: + $this->image = file_get_contents($noCoverImage); + } + + /** + * Display the default "cover unavailable" graphic and terminate execution. + * + * @return void + */ + protected function loadDefaultFailImage() + { + $this->contentType = 'image/gif'; + $this->image = file_get_contents($this->searchTheme('images/noCover2.gif')); + } + + /** + * Support method for validateAndMoveTempFile -- convert non-JPEG image data to a + * JPEG file. + * + * @param string $imageData Raw image data + * @param string $jpeg JPEG file (output) + * + * @return bool Did we succeed? + */ + protected function convertNonJpeg($imageData, $jpeg) + { + // We can't proceed if we don't have image conversion functions: + if (!is_callable('imagecreatefromstring')) { + return false; + } + + // Try to create a GD image and rewrite as JPEG, fail if we can't: + if (!($imageGD = @imagecreatefromstring($imageData))) { + return false; + } + if (!@imagejpeg($imageGD, $jpeg)) { + return false; + } + + return true; + } + + /** + * This method either moves the temporary file to its final location (true) + * or detects an error and deletes it (false). + * + * @param string $image Raw image data + * @param string $tempFile Temporary file + * @param string $finalFile Final file location + * + * @return bool + */ + protected function validateAndMoveTempFile($image, $tempFile, $finalFile) + { + list($width, $height, $type) = @getimagesize($tempFile); + + // File too small -- delete it and report failure. + if ($width < 2 && $height < 2) { + @unlink($tempFile); + return false; + } + + // Conversion needed -- do some normalization for non-JPEG images: + if ($type != IMAGETYPE_JPEG) { + // We no longer need the temp file: + @unlink($tempFile); + return $this->convertNonJpeg($image, $finalFile); + } + + // If $tempFile is already a JPEG, let's store it in the cache. + return @rename($tempFile, $finalFile); + } + + /** + * Wrapper around processImageURL to determine cache setting based on + * image source. + * + * @param string $url URL to load image from + * @param bool $allowCache Is caching allowed by the service? + * @param string $source Service being used for image loading + * + * @return bool True if image loaded, false on failure. + */ + protected function processImageURLForSource($url, $allowCache, $source) + { + // If caching is allowed at the source level, let's see if it's locally + // configured.... + if ($allowCache) { + // All other services cache based on configuration: + $conf = isset($this->config->Content->coverimagesCache) + ? trim(strtolower($this->config->Content->coverimagesCache)) : true; + if ($conf === true || $conf === 1 || $conf === '1' || $conf === 'true') { + $cache = true; + } else if ($conf === false || $conf === 0 || $conf === '0' + || $conf === 'false' + ) { + $cache = false; + } else { + $conf = array_map('trim', explode(',', $conf)); + $source = strtolower($source); + $cache = in_array($source, $conf); + } + } else { + $cache = false; + } + return $this->processImageURL($url, $cache); + } + + /** + * Load image from URL, store in cache if requested, display if possible. + * + * @param string $url URL to load image from + * @param string $cache Boolean -- should we store in local cache? + * + * @return bool True if image loaded, false on failure. + */ + protected function processImageURL($url, $cache = true) + { + // Attempt to pull down the image: + $result = $this->client->setUri($url)->send(); + if (!$result->isSuccess()) { + $this->debug("Failed to retrieve image from " + $url); + return false; + } + + $image = $result->getBody(); + + // Figure out file paths -- $tempFile will be used to store the + // image for analysis. $finalFile will be used for long-term storage if + // $cache is true or for temporary display purposes if $cache is false. + $tempFile = str_replace('.jpg', uniqid(), $this->localFile); + $finalFile = $cache ? $this->localFile : $tempFile . '.jpg'; + + // Write image data to disk: + if (!@file_put_contents($tempFile, $image)) { + throw new \Exception("Unable to write to image directory."); + } + + // Move temporary file to final location: + if (!$this->validateAndMoveTempFile($image, $tempFile, $finalFile)) { + return false; + } + + // Display the image: + $this->contentType = 'image/jpeg'; + $this->image = file_get_contents($finalFile); + + // If we don't want to cache the image, delete it now that we're done. + if (!$cache) { + @unlink($finalFile); + } + + return true; + } +} diff --git a/module/BeluginoCover/src/BeluginoCover/Cover/LoaderFactory.php b/module/BeluginoCover/src/BeluginoCover/Cover/LoaderFactory.php new file mode 100644 index 0000000000..0b4860d5e6 --- /dev/null +++ b/module/BeluginoCover/src/BeluginoCover/Cover/LoaderFactory.php @@ -0,0 +1,80 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development Wiki + */ +namespace BeluginoCover\Cover; + +use Interop\Container\ContainerInterface; +use Zend\ServiceManager\Factory\FactoryInterface; + +/** + * Cover loader factory. + * + * @category VuFind + * @package Cover_Generator + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development Wiki + */ +class LoaderFactory implements FactoryInterface +{ + /** + * Create an object + * + * @param ContainerInterface $container Service manager + * @param string $requestedName Service being created + * @param null|array $options Extra options (optional) + * + * @return object + * + * @throws ServiceNotFoundException if unable to resolve the service. + * @throws ServiceNotCreatedException if an exception is raised when + * creating a service. + * @throws ContainerException if any other error occurs + */ + public function __invoke(ContainerInterface $container, $requestedName, + array $options = null + ) { + if (!empty($options)) { + throw new \Exception('Unexpected options sent to factory.'); + } + $cacheDir = $container->get('VuFind\Cache\Manager') + ->getCache('cover')->getOptions()->getCacheDir(); + $config = $container->get('VuFind\Config\PluginManager')->get('config'); + $loader = new $requestedName( + $config, + $container->get('VuFind\Content\Covers\PluginManager'), + $container->get('VuFindTheme\ThemeInfo'), + $container->get('VuFindHttp\HttpService'), + $cacheDir + ); + // Add cover generator if enabled: + if ($config->Content->makeDynamicCovers ?? false) { + $loader->setCoverGenerator($container->get('VuFind\Cover\Generator')); + } + return $loader; + } +} From f1398ec64d4eaad2eaf83638748fcaa2bb6eff4b Mon Sep 17 00:00:00 2001 From: Johannes Schultze Date: Tue, 7 Apr 2020 15:37:26 +0200 Subject: [PATCH 05/44] Added belugino icon gerenation to module "BeluginoCover". --- .../src/BeluginoCover/Cover/Loader.php | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/module/BeluginoCover/src/BeluginoCover/Cover/Loader.php b/module/BeluginoCover/src/BeluginoCover/Cover/Loader.php index cf29784f80..57273433f7 100644 --- a/module/BeluginoCover/src/BeluginoCover/Cover/Loader.php +++ b/module/BeluginoCover/src/BeluginoCover/Cover/Loader.php @@ -110,7 +110,8 @@ public function loadImage($settings = []) $format = str_ireplace(' ', '', $settings['format']); $format = strtolower($format); if ($im = imagecreate(64, 64)) { - $beluginoParser = new \Sabberworm\CSS\Parser(file_get_contents(APPLICATION_PATH . '/themes/belugax/css/belugino.css')); + $beluginoFile = APPLICATION_PATH . '/themes/belugax/css/belugino.css'; + $beluginoParser = new \Sabberworm\CSS\Parser(file_get_contents($beluginoFile)); $beluginoCss = $beluginoParser->parse(); $belugino = []; @@ -122,10 +123,6 @@ public function loadImage($settings = []) } } - error_log(print_r($belugino, true)); - error_log(print_r($format, true)); - error_log(print_r($belugino[$format], true)); - $formatString = ''; foreach ($beluginoCss->getAllDeclarationBlocks() as $declarationBlock) { $foundBeluginoClass = false; @@ -137,17 +134,23 @@ public function loadImage($settings = []) if ($foundBeluginoClass) { foreach ($declarationBlock->getRules() as $rule) { if ($rule->getRule() == 'content') { - $formatString = $rule->getValue()->getString().""; - $formatString = str_ireplace("\e", "0xe", $formatString); + $lines = file($beluginoFile); + $formatString = $lines[$rule->getLineNo()-1]; + $formatString = preg_match("/\"([^\"]+)\"/", $formatString, $matches); + if (isset($matches[1])) { + $formatString = $matches[1]; + } + $formatString = str_ireplace('\e', "", $formatString).';'; + $formatString = json_decode('"'.$formatString.'"'); } } } } $bg = imagecolorallocate($im, 255, 255, 255); - $textcolor = imagecolorallocate($im, 0, 0, 255); + $textcolor = imagecolorallocate($im, 0, 0, 0); - imagettftext($im, 5,0,0,0, $textcolor, APPLICATION_PATH . '/themes/belugax/css/fonts/belugino.ttf', $formatString); + imagettftext($im, 64,0,-10,72, $textcolor, APPLICATION_PATH . '/themes/belugax/css/fonts/belugino.ttf', $formatString); imageAlphaBlending($im, true); imageSaveAlpha($im, true); From ff6432dc4f6edbf38629ebd03aa3d3779cd743d8 Mon Sep 17 00:00:00 2001 From: Johannes Schultze Date: Tue, 7 Apr 2020 15:55:41 +0200 Subject: [PATCH 06/44] Reduced code to get belugino icon. --- module/BeluginoCover/src/BeluginoCover/Cover/Loader.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/module/BeluginoCover/src/BeluginoCover/Cover/Loader.php b/module/BeluginoCover/src/BeluginoCover/Cover/Loader.php index 57273433f7..c2572eeb6c 100644 --- a/module/BeluginoCover/src/BeluginoCover/Cover/Loader.php +++ b/module/BeluginoCover/src/BeluginoCover/Cover/Loader.php @@ -134,14 +134,7 @@ public function loadImage($settings = []) if ($foundBeluginoClass) { foreach ($declarationBlock->getRules() as $rule) { if ($rule->getRule() == 'content') { - $lines = file($beluginoFile); - $formatString = $lines[$rule->getLineNo()-1]; - $formatString = preg_match("/\"([^\"]+)\"/", $formatString, $matches); - if (isset($matches[1])) { - $formatString = $matches[1]; - } - $formatString = str_ireplace('\e', "", $formatString).';'; - $formatString = json_decode('"'.$formatString.'"'); + $formatString = $rule->getValue()->getString(); } } } From 3f006bf262adb78720a49ef22b3fc24f48bf0b8f Mon Sep 17 00:00:00 2001 From: Johannes Schultze Date: Tue, 7 Apr 2020 18:01:27 +0200 Subject: [PATCH 07/44] LG #21 - Facetten. --- .../ExtendedFacets/Recommend/SideFacets.php | 83 ++++++++++++++++++- 1 file changed, 82 insertions(+), 1 deletion(-) diff --git a/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php b/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php index 6535362116..e2f7464d6b 100644 --- a/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php +++ b/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php @@ -27,6 +27,9 @@ */ namespace ExtendedFacets\Recommend; +use VuFind\I18n\Translator\TranslatorAwareInterface; +use Zend\I18n\Translator\TranslatorInterface; + /** * SideFacets Recommendations Module * @@ -38,8 +41,28 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:recommendation_modules Wiki */ -class SideFacets extends \VuFind\Recommend\SideFacets +class SideFacets extends \VuFind\Recommend\SideFacets implements TranslatorAwareInterface { + /** + * Translator + * + * @var \Zend\I18n\Translator\Translator + */ + protected $translator = null; + + /** + * Set a translator + * + * @param \Zend\I18n\Translator\Translator $translator Translator + * + * @return $translator + */ + public function setTranslator(TranslatorInterface $translator) + { + $this->translator = $translator; + return $this; + } + /** * getYearFacets * @@ -159,6 +182,61 @@ public function getFacetHierarchies($oldFacetList, $label) return $newFacetList; } + /** + * getLocationFacets + * + * Return location facet information in a format processed for use in the view. + * + * @param array $oldFacetList list of facets, $label filterlabel. + * + * @return array list of facets + */ + public function getLocationFacets($sigelFacetList, $sigelLabel) { + $filters = $this->results->getParams()->getFilterList(); + + $tmpFacetList = array(); + $filterList = array(); + $isAppliedGlobal = false; + foreach ($sigelFacetList as $sigelFacetItem) { + $displayText = $this->translator->translate($sigelFacetItem['displayText']); + + $sigelFacetItemCropped = preg_replace('/-[A-z]+$/', '', $sigelFacetItem['displayText']); + if ($displayText == $sigelFacetItem['displayText']) { + $displayText = $this->translator->translate($sigelFacetItemCropped); + } + if ($displayText != $sigelFacetItem['displayText'] && $displayText != $sigelFacetItemCropped) { + if (isset($tmpFacetList[$displayText])) { + $tmpFacetList[$displayText]['sort'] += $sigelFacetItem['count']; + $tmpFacetList[$displayText]['count'] += $sigelFacetItem['count']; + } else { + $isApplied = (strpos($filters[$sigelLabel][0]['value'], $sigelFacetItem['value']) !== false); + $tmpFacetList[$displayText] = array('sort' => $sigelFacetItem['count'], 'value' => $sigelFacetItem['value'], 'displayText' => $displayText, 'count' => $sigelFacetItem['count'], 'operator' => 'AND', 'isApplied' => $isApplied); + if ($isApplied) { + $isAppliedGlobal = true; + } + } + if (isset($filterList[$displayText])) { + $filterList[$displayText]['value'] .= ' OR standort_iln_str_mv:"'.$sigelFacetItem['value'].'"'; + } else { + $filterList[$displayText]['value'] = 'complex:standort_iln_str_mv:"'.$sigelFacetItem['value'].'"'; + } + } + } + foreach ($tmpFacetList as $name => $data) { + if (isset($filterList[$name]['value'])) { + $tmpFacetList[$name]['value'] = $filterList[$name]['value']; + } + } + array_multisort($tmpFacetList, SORT_DESC); + $newFacetList = array(); + foreach ($tmpFacetList as $tmpFacetItem) { + if (!$isAppliedGlobal || $tmpFacetItem['isApplied']) { + $newFacetList[] = $tmpFacetItem; + } + } + return $newFacetList; + } + /** * Get facet information from the search results. * @@ -173,6 +251,9 @@ public function getFacetSet() if (isset($facetSet['format_facet'])) { $facetSet['format_facet']['list'] = $this->getFacetHierarchies($facetSet['format_facet']['list'], $facetSet['format_facet']['label']); } + if (isset($facetSet['standort_iln_str_mv'])) { + $facetSet['standort_iln_str_mv']['list'] = $this->getLocationFacets($facetSet['standort_iln_str_mv']['list'], $facetSet['standort_iln_str_mv']['label']); + } $facetSet = $this->showFacetValue($facetSet); From ab9b28f24a798b26c64017e1bda10a6fa2f2241e Mon Sep 17 00:00:00 2001 From: Johannes Schultze Date: Wed, 8 Apr 2020 08:37:21 +0200 Subject: [PATCH 08/44] LG #21 - Facetten. --- .../ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php b/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php index e2f7464d6b..c5ff2c5191 100644 --- a/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php +++ b/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php @@ -251,9 +251,11 @@ public function getFacetSet() if (isset($facetSet['format_facet'])) { $facetSet['format_facet']['list'] = $this->getFacetHierarchies($facetSet['format_facet']['list'], $facetSet['format_facet']['label']); } + /* if (isset($facetSet['standort_iln_str_mv'])) { $facetSet['standort_iln_str_mv']['list'] = $this->getLocationFacets($facetSet['standort_iln_str_mv']['list'], $facetSet['standort_iln_str_mv']['label']); } + */ $facetSet = $this->showFacetValue($facetSet); From 1c22bcf7992e91721b0e1160929180dc9cbbd362 Mon Sep 17 00:00:00 2001 From: Johannes Schultze Date: Wed, 8 Apr 2020 20:55:53 +0200 Subject: [PATCH 09/44] =?UTF-8?q?LG=20#20=20-=20Verf=C3=BCgbarkeiten.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DAIAplus/src/DAIAplus/AjaxHandler/GetItemStatuses.php | 3 +++ themes/daiaplus/js/check_item_statuses.js | 5 ++++- themes/daiaplus/templates/record/daiaplus-view.phtml | 8 +++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/module/DAIAplus/src/DAIAplus/AjaxHandler/GetItemStatuses.php b/module/DAIAplus/src/DAIAplus/AjaxHandler/GetItemStatuses.php index 36b8ff6e6e..7221eb62e9 100644 --- a/module/DAIAplus/src/DAIAplus/AjaxHandler/GetItemStatuses.php +++ b/module/DAIAplus/src/DAIAplus/AjaxHandler/GetItemStatuses.php @@ -89,6 +89,8 @@ public function handleRequest(Params $params) $list = $params->fromPost('list', $params->fromQuery('list', [])); $hideLink = $params->fromPost('hideLink', $params->fromQuery('hideLink', [])); $hmacKeys = explode(':', $this->config['StorageRetrievalRequests']['HMACKeys']); + + $mediatype = $params->fromPost('list', $params->fromQuery('mediatype', [])); //neu A try { if (method_exists($this->ils, 'getDriver')) { @@ -214,6 +216,7 @@ public function handleRequest(Params $params) 'list' => $list === 'true'? true: false, 'ppn' => $current['id'], 'hideLink' => $hideLink, + 'mediatype' => $mediatype, ] ); //neu A diff --git a/themes/daiaplus/js/check_item_statuses.js b/themes/daiaplus/js/check_item_statuses.js index 17424917ae..e606181db8 100644 --- a/themes/daiaplus/js/check_item_statuses.js +++ b/themes/daiaplus/js/check_item_statuses.js @@ -117,6 +117,7 @@ var itemStatusList = false; var itemStatusSource = ''; var itemStatusHideLink = ''; var itemStatusType = ''; +var itemStatusMediatype = ''; function runItemAjaxForQueue() { // Only run one item status AJAX request at a time: @@ -136,7 +137,7 @@ function runItemAjaxForQueue() { url: VuFind.path + '/AJAX/JSON?method=' + method, dataType: 'json', method: 'get', - data: {id:[itemStatusIds[i]], list:itemStatusList, source:itemStatusSource, hideLink:itemStatusHideLink} + data: {id:[itemStatusIds[i]], list:itemStatusList, source:itemStatusSource, hideLink:itemStatusHideLink, mediatype:itemStatusMediatype} }) .done(function checkItemStatusDone(response) { for (var j = 0; j < response.data.statuses.length; j++) { @@ -179,6 +180,7 @@ function checkItemStatus(el) { itemStatusList = ($item.attr('data-list') == 1); itemStatusHideLink = $item.attr('data-hide-link'); itemStatusType = $item.attr('data-type'); + itemStatusMediatype = $item.attr('data-mediatype'); itemQueueAjax(id + '', $item); } @@ -196,6 +198,7 @@ function checkItemStatuses(_container) { itemStatusList = ($(availabilityItems[i]).attr('data-list') == 1); itemStatusHideLink = $(availabilityItems[i]).attr('data-hide-link'); itemStatusType = $(availabilityItems[i]).attr('data-type'); + itemStatusMediatype = $(availabilityItems[i]).attr('data-mediatype'); itemQueueAjax(id, $(availabilityItems[i])); } // Stop looking for a scroll loader diff --git a/themes/daiaplus/templates/record/daiaplus-view.phtml b/themes/daiaplus/templates/record/daiaplus-view.phtml index 1083a7ccea..aa9c728324 100644 --- a/themes/daiaplus/templates/record/daiaplus-view.phtml +++ b/themes/daiaplus/templates/record/daiaplus-view.phtml @@ -3,13 +3,19 @@ $DAIAplusProcessor = $this->DAIAplusProcessor(); $hideLink = $DAIAplusProcessor->hideAvailabilityInfo($this->driver, true); $hideDaia = $DAIAplusProcessor->hideAvailabilityInfo($this->driver); + +$formats = $this->driver->getFormats(); +$mediatype = ''; +if (isset($formats[0])) { + $mediatype = $formats[0]; +} ?>
    transEsc('see series/volume information'); ?>
    -
    +
    From 046cae9d110d3a8f122c3de007f63f0fd6452a79 Mon Sep 17 00:00:00 2001 From: Johannes Schultze Date: Wed, 8 Apr 2020 20:57:14 +0200 Subject: [PATCH 10/44] LG #21 - Facetten. --- .../src/ExtendedFacets/Recommend/SideFacets.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php b/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php index c5ff2c5191..f07021c337 100644 --- a/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php +++ b/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php @@ -215,11 +215,11 @@ public function getLocationFacets($sigelFacetList, $sigelLabel) { $isAppliedGlobal = true; } } - if (isset($filterList[$displayText])) { + //if (isset($filterList[$displayText])) { $filterList[$displayText]['value'] .= ' OR standort_iln_str_mv:"'.$sigelFacetItem['value'].'"'; - } else { - $filterList[$displayText]['value'] = 'complex:standort_iln_str_mv:"'.$sigelFacetItem['value'].'"'; - } + //} else { + // $filterList[$displayText]['value'] = 'complex:standort_iln_str_mv:"'.$sigelFacetItem['value'].'"'; + //} } } foreach ($tmpFacetList as $name => $data) { @@ -251,11 +251,9 @@ public function getFacetSet() if (isset($facetSet['format_facet'])) { $facetSet['format_facet']['list'] = $this->getFacetHierarchies($facetSet['format_facet']['list'], $facetSet['format_facet']['label']); } - /* if (isset($facetSet['standort_iln_str_mv'])) { $facetSet['standort_iln_str_mv']['list'] = $this->getLocationFacets($facetSet['standort_iln_str_mv']['list'], $facetSet['standort_iln_str_mv']['label']); } - */ $facetSet = $this->showFacetValue($facetSet); From 64db11538e3dc2489c2d7531b1708fa4f6fd2b16 Mon Sep 17 00:00:00 2001 From: Johannes Schultze Date: Wed, 8 Apr 2020 21:00:31 +0200 Subject: [PATCH 11/44] Revert "LG #21 - Facetten." This reverts commit 046cae9d110d3a8f122c3de007f63f0fd6452a79. --- .../src/ExtendedFacets/Recommend/SideFacets.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php b/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php index f07021c337..c5ff2c5191 100644 --- a/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php +++ b/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php @@ -215,11 +215,11 @@ public function getLocationFacets($sigelFacetList, $sigelLabel) { $isAppliedGlobal = true; } } - //if (isset($filterList[$displayText])) { + if (isset($filterList[$displayText])) { $filterList[$displayText]['value'] .= ' OR standort_iln_str_mv:"'.$sigelFacetItem['value'].'"'; - //} else { - // $filterList[$displayText]['value'] = 'complex:standort_iln_str_mv:"'.$sigelFacetItem['value'].'"'; - //} + } else { + $filterList[$displayText]['value'] = 'complex:standort_iln_str_mv:"'.$sigelFacetItem['value'].'"'; + } } } foreach ($tmpFacetList as $name => $data) { @@ -251,9 +251,11 @@ public function getFacetSet() if (isset($facetSet['format_facet'])) { $facetSet['format_facet']['list'] = $this->getFacetHierarchies($facetSet['format_facet']['list'], $facetSet['format_facet']['label']); } + /* if (isset($facetSet['standort_iln_str_mv'])) { $facetSet['standort_iln_str_mv']['list'] = $this->getLocationFacets($facetSet['standort_iln_str_mv']['list'], $facetSet['standort_iln_str_mv']['label']); } + */ $facetSet = $this->showFacetValue($facetSet); From e08231f5fd62bf3fd5f3c43a4102af4e38fa166b Mon Sep 17 00:00:00 2001 From: Johannes Schultze Date: Fri, 17 Apr 2020 07:55:09 +0200 Subject: [PATCH 12/44] LG #24 - Standort-Facette. --- .../ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php b/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php index c5ff2c5191..e2f7464d6b 100644 --- a/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php +++ b/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php @@ -251,11 +251,9 @@ public function getFacetSet() if (isset($facetSet['format_facet'])) { $facetSet['format_facet']['list'] = $this->getFacetHierarchies($facetSet['format_facet']['list'], $facetSet['format_facet']['label']); } - /* if (isset($facetSet['standort_iln_str_mv'])) { $facetSet['standort_iln_str_mv']['list'] = $this->getLocationFacets($facetSet['standort_iln_str_mv']['list'], $facetSet['standort_iln_str_mv']['label']); } - */ $facetSet = $this->showFacetValue($facetSet); From ad53b54a38f4aeb20f07310a4effaa638310380d Mon Sep 17 00:00:00 2001 From: VZG 124 Date: Tue, 5 May 2020 10:50:20 +0200 Subject: [PATCH 13/44] Added new base template to belugax theme. --- .../Recommend/SideFacets/filter-list.phtml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 themes/belugax/templates/Recommend/SideFacets/filter-list.phtml diff --git a/themes/belugax/templates/Recommend/SideFacets/filter-list.phtml b/themes/belugax/templates/Recommend/SideFacets/filter-list.phtml new file mode 100644 index 0000000000..b30f0e8fba --- /dev/null +++ b/themes/belugax/templates/Recommend/SideFacets/filter-list.phtml @@ -0,0 +1,30 @@ +
    +
    transEsc('Remove Filters')?>
    + $filters): ?> + $filter): ?> + currentPath() . $results->getUrlQuery()->replaceTerm($filter['value'], ''); + } else { + $removeLink = $this->currentPath() . $results->getUrlQuery()->removeFacet($filter['field'], $filter['value'], $filter['operator']); + } + if ($filter['displayText'] == '[* TO *]') { + $filter['displayText'] = $this->translate('filter_wildcard'); + } + ?> + + transEsc('clear_tag_filter') ?> + + transEsc('NOT') ?> + 0): ?>transEsc('OR') ?> + transEsc($filter['field']) ?>: escapeHtml($filter['displayText']) ?> + + + + + +
    From 82243a40a6a6f1d581bec756f67db1f8281f513f Mon Sep 17 00:00:00 2001 From: Johannes Schultze Date: Wed, 1 Jul 2020 11:22:00 +0200 Subject: [PATCH 14/44] Bugfix: added missing template. --- .../beluga-core-base/templates/myresearch/mylist-lms-export.phtml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 themes/beluga-core-base/templates/myresearch/mylist-lms-export.phtml diff --git a/themes/beluga-core-base/templates/myresearch/mylist-lms-export.phtml b/themes/beluga-core-base/templates/myresearch/mylist-lms-export.phtml new file mode 100644 index 0000000000..e69de29bb2 From a7b2ebd940a69b05f9fcb8cdf8f76e1249f5b090 Mon Sep 17 00:00:00 2001 From: Beluga VZG 25 Date: Mon, 13 Jul 2020 16:31:10 +0200 Subject: [PATCH 15/44] Bugfix CaLief. --- module/CaLief/src/CaLief/Controller/CaLiefController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/CaLief/src/CaLief/Controller/CaLiefController.php b/module/CaLief/src/CaLief/Controller/CaLiefController.php index 57397d2f9d..32c78c0d64 100644 --- a/module/CaLief/src/CaLief/Controller/CaLiefController.php +++ b/module/CaLief/src/CaLief/Controller/CaLiefController.php @@ -388,7 +388,7 @@ public function orderAction() { } if ($checkForm) { $orderNumber = 'CaLief:'.date('ymdHis').rand(0, 9); - $this->caliefMail('order', $orderNumber, $driver); + //$this->caliefMail('order', $orderNumber, $driver); $this->caliefFileOrder($orderNumber, $driver); $this->caliefAuthorize($userCalief->id, 'renew'); $sendOrder = true; From f9192446db1c004267eeba70fc40bb1808465645 Mon Sep 17 00:00:00 2001 From: Hajo Seng Date: Wed, 22 Jul 2020 10:28:28 +0200 Subject: [PATCH 16/44] Erweiterung von getOpenUrl, sodass bei Artikeln auch rft.epage dabei ist: ausgelesen aus 952|h --- .../RecordDriver/RecordDriver/SolrMarc.php | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/module/RecordDriver/src/RecordDriver/RecordDriver/SolrMarc.php b/module/RecordDriver/src/RecordDriver/RecordDriver/SolrMarc.php index 825268cf6f..03d225a492 100644 --- a/module/RecordDriver/src/RecordDriver/RecordDriver/SolrMarc.php +++ b/module/RecordDriver/src/RecordDriver/RecordDriver/SolrMarc.php @@ -559,4 +559,35 @@ public function getXML($format, $baseUrl = null, $recordLink = null) // Try the parent method: return parent::getXML($format, $baseUrl, $recordLink); } + + /** + * Get the OpenURL parameters to represent this record (useful for the + * title attribute of a COinS span tag). + * + * @param bool $overrideSupportsOpenUrl Flag to override checking + * supportsOpenUrl() (default is false) + * + * @return string OpenURL parameters. + */ + public function getOpenUrl($overrideSupportsOpenUrl = false) + { + return parent::getOpenUrl($overrideSupportsOpenUrl); + } + + /** + * Get OpenURL parameters for an article. + * + * @return array + */ + protected function getArticleOpenUrlParams() + { + $params = parent::getArticleOpenUrlParams(); + $pages = $this->getMarcData('Pages'); + if (strpos($pages, '-') !== false) { + list($spage, $epage) = explode('-', $pages[0]['pages']['data'][0]); + $params['rft.epage'] = $epage; + } + return $params; + } + } From 9b4653cfb2b8a04a7ad8921bde175120418ec1ac Mon Sep 17 00:00:00 2001 From: Hajo Seng Date: Wed, 22 Jul 2020 10:50:59 +0200 Subject: [PATCH 17/44] Erweiterung des Feeback-Controllers: Falls in der Konfiguration reply-to = user_email gesetzt ist, wird der Reply-to-Header der Email auf die Emailadresse des Nutzers gesetzt (die in dem Formular eine Plichtangabe ist). Ansonsten wird kein Reply-to-Header gesetzt - wie gehabt. --- config/vufind/config.ini | 3 + module/ExtendedFeedback/Module.php | 68 +++++++++++++ .../ExtendedFeedback/config/module.config.php | 17 ++++ .../Controller/FeedbackController.php | 99 +++++++++++++++++++ 4 files changed, 187 insertions(+) create mode 100644 module/ExtendedFeedback/Module.php create mode 100644 module/ExtendedFeedback/config/module.config.php create mode 100644 module/ExtendedFeedback/src/ExtendedFeedback/Controller/FeedbackController.php diff --git a/config/vufind/config.ini b/config/vufind/config.ini index 91ef9d3b0f..e02054eb57 100644 --- a/config/vufind/config.ini +++ b/config/vufind/config.ini @@ -1589,6 +1589,9 @@ treeSearchLimit = 100 ; This is the information for where feedback emails are sent from. ;sender_email = "noreply@vufind.org" ;sender_name = "VuFind Feedback" +; This can be set to "sender_email" (Reply-to not set = default) +; or "user_email" (Reply-to ist set to users email address) +;reply-to = sender_email ; Note: for additional details about stats (including additional notes on Google ; Analytics and Piwik), look at the wiki page: diff --git a/module/ExtendedFeedback/Module.php b/module/ExtendedFeedback/Module.php new file mode 100644 index 0000000000..831f99a45b --- /dev/null +++ b/module/ExtendedFeedback/Module.php @@ -0,0 +1,68 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org + */ +namespace ExtendedFeedback; + +use Zend\Mvc\MvcEvent; + +/** + * ZF2 module definition for the VuFind application + * + * @category VuFind + * @package Module + * @author Demian Katz + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org + */ +class Module +{ + /** + * Get module configuration + * + * @return array + */ + public function getConfig() + { + return include __DIR__ . '/config/module.config.php'; + } + + /** + * Get autoloader configuration + * + * @return array + */ + public function getAutoloaderConfig() + { + return [ + 'Zend\Loader\StandardAutoloader' => [ + 'namespaces' => [ + __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, + ], + ], + ]; + } +} diff --git a/module/ExtendedFeedback/config/module.config.php b/module/ExtendedFeedback/config/module.config.php new file mode 100644 index 0000000000..62eebfe204 --- /dev/null +++ b/module/ExtendedFeedback/config/module.config.php @@ -0,0 +1,17 @@ + [ + 'factories' => [ + 'ExtendedFeedback\Controller\FeedbackController' => 'VuFind\Controller\AbstractBaseFactory', + ], + 'aliases' => [ + 'Feedback' => 'ExtendedFeedback\Controller\FeedbackController', + 'feedback' => 'ExtendedFeedback\Controller\FeedbackController', + 'VuFind\Controller\FeedbackController' => 'ExtendedFeedback\Controller\FeedbackController', + ], + ], +]; + +return $config; diff --git a/module/ExtendedFeedback/src/ExtendedFeedback/Controller/FeedbackController.php b/module/ExtendedFeedback/src/ExtendedFeedback/Controller/FeedbackController.php new file mode 100644 index 0000000000..817a967204 --- /dev/null +++ b/module/ExtendedFeedback/src/ExtendedFeedback/Controller/FeedbackController.php @@ -0,0 +1,99 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Site + */ +namespace ExtendedFeedback\Controller; + +use VuFind\Exception\Mail as MailException; +use Zend\Mail\Address; +use VuFind\Controller\FeedbackController as BasicFeedbackController; + +/** + * Feedback Class + * + * Controls the Feedback + * + * @category VuFind + * @package Controller + * @author Josiah Knoll + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org/wiki/development Wiki + */ +class FeedbackController extends BasicFeedbackController +{ + /** + * Receives input from the user and sends an email to the recipient set in + * the config.ini + * + * @return void + */ + public function emailAction() + { + $view = $this->createViewModel(); + $view->useRecaptcha = $this->recaptcha()->active('feedback'); + $view->name = $this->params()->fromPost('name'); + $view->email = $this->params()->fromPost('email'); + $view->comments = $this->params()->fromPost('comments'); + + // Process form submission: + if ($this->formWasSubmitted('submit', $view->useRecaptcha)) { + if (empty($view->email) || empty($view->comments)) { + $this->flashMessenger()->addMessage('bulk_error_missing', 'error'); + return; + } + + // These settings are set in the feedback settion of your config.ini + $config = $this->serviceLocator->get('VuFind\Config\PluginManager') + ->get('config'); + $feedback = isset($config->Feedback) ? $config->Feedback : null; + $recipient_email = isset($feedback->recipient_email) + ? $feedback->recipient_email : null; + $recipient_name = isset($feedback->recipient_name) + ? $feedback->recipient_name : 'Your Library'; + $email_subject = isset($feedback->email_subject) + ? $feedback->email_subject : 'VuFind Feedback'; + $sender_email = isset($feedback->sender_email) + ? $feedback->sender_email : 'noreply@vufind.org'; + $sender_name = isset($feedback->sender_name) + ? $feedback->sender_name : 'VuFind Feedback'; + $reply_to = (isset($feedback->reply-to) && $feedback->reply-to == 'user_email') + ? $view->email : null; + if ($recipient_email == null) { + throw new \Exception( + 'Feedback Module Error: Recipient Email Unset (see config.ini)' + ); + } + + $email_message = empty($view->name) ? '' : 'Name: ' . $view->name . "\n"; + $email_message .= 'Email: ' . $view->email . "\n"; + $email_message .= 'Comments: ' . $view->comments . "\n\n"; + + // This sets up the email to be sent + // Attempt to send the email and show an appropriate flash message: + try { + $mailer = $this->serviceLocator->get('VuFind\Mailer\Mailer'); + $mailer->send( + new Address($recipient_email, $recipient_name), + new Address($sender_email, $sender_name), + $email_subject, $email_message, + null, + $reply_to + ); + $this->flashMessenger()->addMessage( + 'Thank you for your feedback.', 'success' + ); + } catch (MailException $e) { + $this->flashMessenger()->addMessage($e->getMessage(), 'error'); + } + } + return $view; + } +} From ef384dc810ff148ea496e3edd5190b32803e3cef Mon Sep 17 00:00:00 2001 From: Hajo Seng Date: Wed, 22 Jul 2020 11:54:05 +0200 Subject: [PATCH 18/44] Korrektur des Parameternamens: reply-to -> reply_to --- config/vufind/config.ini | 2 +- .../src/ExtendedFeedback/Controller/FeedbackController.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/vufind/config.ini b/config/vufind/config.ini index e02054eb57..2d6c83fa6c 100644 --- a/config/vufind/config.ini +++ b/config/vufind/config.ini @@ -1591,7 +1591,7 @@ treeSearchLimit = 100 ;sender_name = "VuFind Feedback" ; This can be set to "sender_email" (Reply-to not set = default) ; or "user_email" (Reply-to ist set to users email address) -;reply-to = sender_email +;reply_to = sender_email ; Note: for additional details about stats (including additional notes on Google ; Analytics and Piwik), look at the wiki page: diff --git a/module/ExtendedFeedback/src/ExtendedFeedback/Controller/FeedbackController.php b/module/ExtendedFeedback/src/ExtendedFeedback/Controller/FeedbackController.php index 817a967204..d743af81b7 100644 --- a/module/ExtendedFeedback/src/ExtendedFeedback/Controller/FeedbackController.php +++ b/module/ExtendedFeedback/src/ExtendedFeedback/Controller/FeedbackController.php @@ -64,7 +64,7 @@ public function emailAction() ? $feedback->sender_email : 'noreply@vufind.org'; $sender_name = isset($feedback->sender_name) ? $feedback->sender_name : 'VuFind Feedback'; - $reply_to = (isset($feedback->reply-to) && $feedback->reply-to == 'user_email') + $reply_to = (isset($feedback->reply_to) && $feedback->reply_to == 'user_email') ? $view->email : null; if ($recipient_email == null) { throw new \Exception( From 1333dc7006538ef2d4d1ecca877530b06aea705f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristof=20Ke=C3=9Fler?= Date: Tue, 11 Aug 2020 13:17:16 +0200 Subject: [PATCH 19/44] =?UTF-8?q?Anpassung=20Vorpr=C3=BCfung=20Verf=C3=BCg?= =?UTF-8?q?barkeitslogik?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/vufind/freeaccesscheck.yaml | 35 ++++++ config/vufind/solrmarc.yaml | 2 + .../AjaxHandler/GetArticleStatuses.php | 115 +++++++----------- .../DAIAplus/AjaxHandler/GetItemStatuses.php | 2 + themes/daiaplus/css/daiaplus.css | 12 +- themes/daiaplus/images/OpenAccess_Logo.png | Bin 0 -> 787 bytes 6 files changed, 97 insertions(+), 69 deletions(-) create mode 100644 config/vufind/freeaccesscheck.yaml create mode 100644 themes/daiaplus/images/OpenAccess_Logo.png diff --git a/config/vufind/freeaccesscheck.yaml b/config/vufind/freeaccesscheck.yaml new file mode 100644 index 0000000000..678b2b4e4a --- /dev/null +++ b/config/vufind/freeaccesscheck.yaml @@ -0,0 +1,35 @@ +ArticleFulltextFree: + category: resolver + 856: + conditions: + - [field, 3, Volltext] + - [field, z, 'Kostenfrei|^OpenAccess Lizenz|Description of rights in Directory of Open Access Books'] + - [indicator, 1, 4] + - [indicator, 2, 0|1] + u: + - [name, url] +ArticleFulltextFreeUrlParts: + category: resolver + 856: + conditions: + - [field, u, 'doaj.org\/article|edocs.tib.eu\/files|tib.uni-hannover.de\/edoks\/|digibib.tu-bs.de|resolver.sub.uni-goettingen.de|resolver.staatsbibliothek-berlin.de|hdl.handle.net|lib.dr.iastate.edu|www.dzhw.eu\/pdf|www.his.de\/pdf|arxiv.org|publikationsserver.tu-braunschweig.de\/get|bib-pubdb1.desy.de\/record|inef.uni-due.de\/index.php?article_id=|kluedo.ub.uni-kl.de\/frontdoor\/index\/index\/docId\/|wiiw.ac.at|library.fes.de\/pdf-files|www.bis.org\/publ\/bppdf|www.bsu-bund.de\/SharedDocs\/pdf|www.bamf.de\/SharedDocs\/Anlagen\/DE\/Publikationen|bib-pubdb1.desy.de\/record|www.doabooks.org\/doab?func=fulltext|www.pharmazeutische-zeitung.de|clinicaltrials.gov\/show|www.jfe-steel.co.jp\/en\/research\/report\/|www.ressource-deutschland.de\/fileadmin\/|juser.fz-juelich.de\/record\/|www.qip-journal.eu\/index.php\/ams\/article\/download\/|www.ita.rwth-aachen.de\/global\/show_document.asp|opus.bibliothek.uni-wuerzburg.de\/files\/|kth.diva-portal.org\/smash\/record|www.teses.usp.br\/teses\/disponiveis\/|edoc.difu.de\/edoc.php|haab-digital.klassik-stiftung.de\/viewer|darwin-online.org.uk|www.doabooks.org|revistas.unam.mx|produccioncientificaluz.org'] + - [indicator, 1, 4] + - [indicator, 2, 0|1] + u: + - [name, url] +ArticleFulltextFreeCollection: + category: resolver + 912: + conditions: + - [field, a, 'OPENACCESS|GBV_DOAJ|Gutenberg|ZDB-94-OAB|ZDB-23-GOA'] + u: + - [name, collection] +ArticleDirectLink: + category: resolver + 856: + conditions: + - [field, 3, Volltext] + - [indicator, 1, 4] + - [indicator, 2, 0|1] + u: + - [name, url] diff --git a/config/vufind/solrmarc.yaml b/config/vufind/solrmarc.yaml index f590421036..51886ebc9f 100644 --- a/config/vufind/solrmarc.yaml +++ b/config/vufind/solrmarc.yaml @@ -26,6 +26,8 @@ # #----------------------------------------------------------------------------------- # +"@parent_yaml": "freeaccesscheck.yaml" + # -------------------------------------------------------------------------------- # eWW - Dummy configuration to prevent warnings for foreach and index access. diff --git a/module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php b/module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php index fa9568fc8d..bd4ffd744e 100644 --- a/module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php +++ b/module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php @@ -88,38 +88,23 @@ public function handleRequest(Params $params) $listView = ($params->fromPost('list', $params->fromQuery('list', 'false')) === 'true') ? 1 : 0; foreach ($ids as $id) { $driver = $this->recordLoader->load($id, $source); - $urlAccess = ''; - if (isset($resolverChecks['fulltext']) && $resolverChecks['fulltext'] == 'y') { - $urlAccess = $this->checkFulltext($driver); - if (!empty($urlAccess)) { - $urlAccessLevel = 'article_access_level'; - $urlAccessLabel = 'Fulltext'; - } - } - if (empty($urlAccess) && isset($resolverChecks['open_access']) && $resolverChecks['open_access'] == 'y') { - $urlAccess = $this->checkOpenAccess($driver); - if (!empty($urlAccess)) { - $urlAccessLevel = 'article_access_level'; - $urlAccessLabel = 'Fulltext (DOAJ)'; - } - } - if (empty($urlAccess) && isset($resolverChecks['doi']) && $resolverChecks['doi'] == 'y') { - $urlAccess = $this->checkDoi($driver); - if (!empty($urlAccess)) { - $urlAccessLevel = 'article_access_level'; - $urlAccessLabel = 'Fulltext (DOI)'; - } - } - if (empty($urlAccess) && isset($resolverChecks['journal']) && $resolverChecks['journal'] == 'y') { - $urlAccess = $this->checkParentId($driver); - if (!empty($urlAccess)) { - $urlAccessLevel = 'print_access_level'; - $urlAccessLabel = 'Journal'; - } + $daiaplus_check_bool = true; + + $urlAccessUncertain = $this->checkDirectLink($driver); + if (!empty($urlAccessUncertain)) { + $urlAccessLevel = 'uncertain_article_access_level'; + $urlAccessLabel = 'Go to Publication'; } + $urlAccess = $this->checkFreeAccess($driver, $urlAccessUncertain); if (!empty($urlAccess)) { + $urlAccessLevel = 'fa_article_access_level'; + $urlAccessLabel = 'full_text_fa_article_access_level'; + $daiaplus_check_bool = false; + } + + if ($daiaplus_check_bool == false) { $response = ['list' => ['url_access' => $urlAccess, 'url_access_level' => $urlAccessLevel, 'url_access_label' => $urlAccessLabel, @@ -132,7 +117,8 @@ public function handleRequest(Params $params) ] ]; } else { - $url = $this->prepareUrl($driver, $id, $listView); + $url = $this->prepareUrl($driver, $id, $listView, $urlAccessUncertain, $urlAccessLevel); + error_log($url); $response = json_decode($this->makeRequest($url), true); } @@ -144,33 +130,40 @@ public function handleRequest(Params $params) return $this->formatResponse(['statuses' => $responses]); } - private function checkDoi($driver) { + private function checkFreeAccess($driver, $urlAccessUncertain = '') { $urlAccess = ''; - $doiData = $driver->getMarcData('ArticleDoi'); - foreach ($doiData as $doiDate) { - if (!empty(($doiDate['doi']['data'][0]))) { - $urlAccess = 'http://dx.doi.org/' . $doiDate['doi']['data'][0]; + $data = $driver->getMarcData('ArticleFulltextFree'); + foreach ($data as $date) { + if (!empty(($date['url']['data'][0]))) { + $urlAccess = $date['url']['data'][0]; break; } } - return $urlAccess; - } - - private function checkOpenAccess($driver) { - $urlAccess = ''; - $doajData = $driver->getMarcData('ArticleDoaj'); - foreach ($doajData as $doajDate) { - if (!empty(($doajDate['url']['data'][0]))) { - $urlAccess = $doajDate['url']['data'][0]; + + $data = $driver->getMarcData('ArticleFulltextFreeUrlParts'); + foreach ($data as $date) { + if (!empty(($date['url']['data'][0]))) { + $urlAccess = $date['url']['data'][0]; break; } } + + if($urlAccessUncertain) { + $data = $driver->getMarcData('ArticleFulltextFreeCollection'); + foreach ($data as $date) { + if (!empty(($date['collection']['data'][0]))) { + $urlAccess = $urlAccessUncertain; + break; + } + } + } + return $urlAccess; } - private function checkFulltext($driver) { + private function checkDirectLink($driver) { $urlAccess = ''; - $fulltextData = $driver->getMarcData('ArticleFulltext'); + $fulltextData = $driver->getMarcData('ArticleDirectLink'); foreach ($fulltextData as $fulltextDate) { if (!empty(($fulltextDate['url']['data'][0]))) { $urlAccess = $fulltextDate['url']['data'][0]; @@ -180,29 +173,7 @@ private function checkFulltext($driver) { return $urlAccess; } - private function checkParentId($driver) { - $urlAccess = ''; - $parentData = $driver->getMarcData('ArticleParentId'); - foreach ($parentData as $parentDate) { - if (!empty(($parentDate['id']['data'][0]))) { - $parentId = $parentDate['id']['data'][0]; - break; - } - } - if (!empty($parentId)) { - try { - $parentDriver = $this->recordLoader->load($parentId, 'Solr'); - $ilnMatch = $parentDriver->getMarcData('ILN'); - if (!empty($ilnMatch[0]['iln']['data'][0])) { - $urlAccess = '/vufind/Record/' . $parentId; - } - } catch (\Exception $e) { - } - } - return $urlAccess; - } - - private function prepareUrl($driver, $id, $listView) { + private function prepareUrl($driver, $id, $listView, $urlAccess = '', $urlAccessLevel = '') { $openUrl = $driver->getOpenUrl(); $formats = $driver->getFormats(); $format = strtolower(str_ireplace('electronic ','',$formats[0])); @@ -242,6 +213,14 @@ private function prepareUrl($driver, $id, $listView) { if ($doi[0]['doi']['data'][0]) { $url .= '&doi=' . $doi[0]['doi']['data'][0]; } + + if($urlAccess) { + $url .= '&url-access=' . $urlAccess; + } + + if($urlAccessLevel) { + $url .= '&url-access-level=' . $urlAccessLevel; + } if ($sfxDomain) { $url .= '&sfx=' . $sfxLink; diff --git a/module/DAIAplus/src/DAIAplus/AjaxHandler/GetItemStatuses.php b/module/DAIAplus/src/DAIAplus/AjaxHandler/GetItemStatuses.php index 36b8ff6e6e..7a26388729 100644 --- a/module/DAIAplus/src/DAIAplus/AjaxHandler/GetItemStatuses.php +++ b/module/DAIAplus/src/DAIAplus/AjaxHandler/GetItemStatuses.php @@ -87,6 +87,7 @@ public function handleRequest(Params $params) $ids = $params->fromPost('id', $params->fromQuery('id', [])); //neu V $list = $params->fromPost('list', $params->fromQuery('list', [])); + $mediatype = $params->fromPost('mediatype', $params->fromQuery('mediatype', [])); $hideLink = $params->fromPost('hideLink', $params->fromQuery('hideLink', [])); $hmacKeys = explode(':', $this->config['StorageRetrievalRequests']['HMACKeys']); //neu A @@ -213,6 +214,7 @@ public function handleRequest(Params $params) 'callnumberHandler' => $this->getCallnumberHandler(), 'list' => $list === 'true'? true: false, 'ppn' => $current['id'], + 'mediatype' => $mediatype, 'hideLink' => $hideLink, ] ); diff --git a/themes/daiaplus/css/daiaplus.css b/themes/daiaplus/css/daiaplus.css index 9c9152d451..029cad9654 100644 --- a/themes/daiaplus/css/daiaplus.css +++ b/themes/daiaplus/css/daiaplus.css @@ -59,6 +59,7 @@ .issue_access_level, .check_ill_access_level, .oa_article_access_level, +.fa_article_access_level, .print_access_level, .uncertain_article_access_level, .uncertain_homepage_access_level, @@ -69,10 +70,19 @@ font-weight: bold; } + + +.oa_article_access_level::after, +.oa_homepage_access_level::after, +.fa_article_access_level::after, +.fa_homepage_access_level::after { + content: url("../images/checkmark_green.png") " " url("../images/OpenAccess_Logo.png"); + margin-left: 5px; +} + .article_access_level:after, .homepage_access_level:after, .issue_access_level:after, -.oa_article_access_level:after, .print_access_level:after, .volume_access_level:after { content: url("../images/checkmark_green.png"); diff --git a/themes/daiaplus/images/OpenAccess_Logo.png b/themes/daiaplus/images/OpenAccess_Logo.png new file mode 100644 index 0000000000000000000000000000000000000000..7f9184bcbfecae6bcc04a972c099946799cfa7a7 GIT binary patch literal 787 zcmeAS@N?(olHy`uVBq!ia0vp^+(0bE!3HFIOI1pN6id3JuOkD)#(wTUiL5}rLb6AY zF9SoB8UsT^3j@P1pisjL28L1t28LG&3=CE?7#PG0=Ijcz0ZMQdctjR6Fz_7#VaBQ2 ze9}Nc#w2fd7lsa2Sq~tGy~NYkmHiPHr;sJjj)IT9Kq1u<*NBpo#FA926U)GJpyg3~&%WZt9x-uAoT?mWzh1w#oBOqY zS>)fp!ogwFxv$OliheJbW4vEyPDgfsfAo94H6OK|+*VW{`fYq%rDVshbMWja9S+e$C&dEi$ zFDwl;5pzr2_vV!D0?%B39tK|dT@fzNxo>Y06blouk!t$6i~IW(g-6rX9;C4+Uc26~ zz$q@m^}(sD(i`qENBmuVB$1_W@9!y#Ung7iPR(55r%;$G=J#ub2*>BO?hh;s?YMV5 zd3M%BX7}X9VJV;AlnS!=`z^LJZ%a^9-uS_^=!35NJZZVTZ6BESPHcYVvIYRq<+;u03V*jh{F1W3 z-2Tz|&&CFEk-wz&>ll8XlOFp;V{5y6LVe!lb(5wo3!im@W$xYfi-w*y5BERizdkKv rL->aM+cP&-Jxp^Gke0|!Z`{9UQsj00>jy3a(-4EFtDnm{r-UW|g-ki6 literal 0 HcmV?d00001 From 2b88f09390ccbc3d7aa6e05ecf3fc9f3172a66ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristof=20Ke=C3=9Fler?= Date: Tue, 11 Aug 2020 13:27:31 +0200 Subject: [PATCH 20/44] Bugfix --- config/vufind/freeaccesscheck.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/vufind/freeaccesscheck.yaml b/config/vufind/freeaccesscheck.yaml index 678b2b4e4a..e75e18e21d 100644 --- a/config/vufind/freeaccesscheck.yaml +++ b/config/vufind/freeaccesscheck.yaml @@ -22,7 +22,7 @@ ArticleFulltextFreeCollection: 912: conditions: - [field, a, 'OPENACCESS|GBV_DOAJ|Gutenberg|ZDB-94-OAB|ZDB-23-GOA'] - u: + a: - [name, collection] ArticleDirectLink: category: resolver From 27c06bef099405a9591f1662d097c7f5dc500bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristof=20Ke=C3=9Fler?= Date: Wed, 12 Aug 2020 15:53:22 +0200 Subject: [PATCH 21/44] =?UTF-8?q?Erweiterung=20Vorpr=C3=BCfung=20Artikel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/vufind/freeaccesscheck.yaml | 10 ++++++++++ .../src/DAIAplus/AjaxHandler/GetArticleStatuses.php | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/config/vufind/freeaccesscheck.yaml b/config/vufind/freeaccesscheck.yaml index e75e18e21d..d432585ec8 100644 --- a/config/vufind/freeaccesscheck.yaml +++ b/config/vufind/freeaccesscheck.yaml @@ -17,6 +17,16 @@ ArticleFulltextFreeUrlParts: - [indicator, 2, 0|1] u: - [name, url] +ArticleFulltextFreeUrlParts2: + category: resolver + 856: + conditions: + - [field, u, 'doi.org|nbn-resolving.de'] + - [field, z, 'Kostenfrei|^OpenAccess Lizenz|Description of rights in Directory of Open Access Books'] + - [indicator, 1, 4] + - [indicator, 2, 0|1] + u: + - [name, url] ArticleFulltextFreeCollection: category: resolver 912: diff --git a/module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php b/module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php index bd4ffd744e..d44b8a9379 100644 --- a/module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php +++ b/module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php @@ -147,6 +147,14 @@ private function checkFreeAccess($driver, $urlAccessUncertain = '') { break; } } + + $data = $driver->getMarcData('ArticleFulltextFreeUrlParts2'); + foreach ($data as $date) { + if (!empty(($date['url']['data'][0]))) { + $urlAccess = $date['url']['data'][0]; + break; + } + } if($urlAccessUncertain) { $data = $driver->getMarcData('ArticleFulltextFreeCollection'); From 0ee350819a64ae6547af5e5baef7abde16792708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristof=20Ke=C3=9Fler?= Date: Thu, 13 Aug 2020 10:32:47 +0200 Subject: [PATCH 22/44] Generalisierung Funktion checkFreeAccess MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Damit muss die Funktion nun in der Regel nicht mehr geändert werden, wenn es neue SolrMarcKeys in der Konfigurationsdatei freeaccesscheck.yaml gibt. --- config/vufind/freeaccesscheck.yaml | 10 ++-- .../AjaxHandler/GetArticleStatuses.php | 51 ++++++++----------- 2 files changed, 25 insertions(+), 36 deletions(-) diff --git a/config/vufind/freeaccesscheck.yaml b/config/vufind/freeaccesscheck.yaml index d432585ec8..a35c24482e 100644 --- a/config/vufind/freeaccesscheck.yaml +++ b/config/vufind/freeaccesscheck.yaml @@ -1,5 +1,5 @@ ArticleFulltextFree: - category: resolver + category: marcFulltextCheckDirect 856: conditions: - [field, 3, Volltext] @@ -9,7 +9,7 @@ ArticleFulltextFree: u: - [name, url] ArticleFulltextFreeUrlParts: - category: resolver + category: marcFulltextCheckDirect 856: conditions: - [field, u, 'doaj.org\/article|edocs.tib.eu\/files|tib.uni-hannover.de\/edoks\/|digibib.tu-bs.de|resolver.sub.uni-goettingen.de|resolver.staatsbibliothek-berlin.de|hdl.handle.net|lib.dr.iastate.edu|www.dzhw.eu\/pdf|www.his.de\/pdf|arxiv.org|publikationsserver.tu-braunschweig.de\/get|bib-pubdb1.desy.de\/record|inef.uni-due.de\/index.php?article_id=|kluedo.ub.uni-kl.de\/frontdoor\/index\/index\/docId\/|wiiw.ac.at|library.fes.de\/pdf-files|www.bis.org\/publ\/bppdf|www.bsu-bund.de\/SharedDocs\/pdf|www.bamf.de\/SharedDocs\/Anlagen\/DE\/Publikationen|bib-pubdb1.desy.de\/record|www.doabooks.org\/doab?func=fulltext|www.pharmazeutische-zeitung.de|clinicaltrials.gov\/show|www.jfe-steel.co.jp\/en\/research\/report\/|www.ressource-deutschland.de\/fileadmin\/|juser.fz-juelich.de\/record\/|www.qip-journal.eu\/index.php\/ams\/article\/download\/|www.ita.rwth-aachen.de\/global\/show_document.asp|opus.bibliothek.uni-wuerzburg.de\/files\/|kth.diva-portal.org\/smash\/record|www.teses.usp.br\/teses\/disponiveis\/|edoc.difu.de\/edoc.php|haab-digital.klassik-stiftung.de\/viewer|darwin-online.org.uk|www.doabooks.org|revistas.unam.mx|produccioncientificaluz.org'] @@ -18,7 +18,7 @@ ArticleFulltextFreeUrlParts: u: - [name, url] ArticleFulltextFreeUrlParts2: - category: resolver + category: marcFulltextCheckDirect 856: conditions: - [field, u, 'doi.org|nbn-resolving.de'] @@ -28,14 +28,14 @@ ArticleFulltextFreeUrlParts2: u: - [name, url] ArticleFulltextFreeCollection: - category: resolver + category: marcFulltextCheckIndirect 912: conditions: - [field, a, 'OPENACCESS|GBV_DOAJ|Gutenberg|ZDB-94-OAB|ZDB-23-GOA'] a: - [name, collection] ArticleDirectLink: - category: resolver + category: marcFulltextCheckPrep 856: conditions: - [field, 3, Volltext] diff --git a/module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php b/module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php index d44b8a9379..18ad03902c 100644 --- a/module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php +++ b/module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php @@ -131,41 +131,30 @@ public function handleRequest(Params $params) } private function checkFreeAccess($driver, $urlAccessUncertain = '') { - $urlAccess = ''; - $data = $driver->getMarcData('ArticleFulltextFree'); - foreach ($data as $date) { - if (!empty(($date['url']['data'][0]))) { - $urlAccess = $date['url']['data'][0]; - break; - } - } - - $data = $driver->getMarcData('ArticleFulltextFreeUrlParts'); - foreach ($data as $date) { - if (!empty(($date['url']['data'][0]))) { - $urlAccess = $date['url']['data'][0]; - break; - } - } + $urlAccess = ''; + $categories = array("marcFulltextCheckDirect", "marcFulltextCheckIndirect"); - $data = $driver->getMarcData('ArticleFulltextFreeUrlParts2'); - foreach ($data as $date) { - if (!empty(($date['url']['data'][0]))) { - $urlAccess = $date['url']['data'][0]; - break; - } - } - - if($urlAccessUncertain) { - $data = $driver->getMarcData('ArticleFulltextFreeCollection'); - foreach ($data as $date) { - if (!empty(($date['collection']['data'][0]))) { - $urlAccess = $urlAccessUncertain; - break; + foreach ($categories as $category) { + error_log($category); + foreach ($driver->getSolrMarcKeys($category) as $solrMarcKey) { + error_log($solrMarcKey); + $data = $driver->getMarcData($solrMarcKey); + foreach ($data as $date) { + if ($category == "marcFulltextCheckDirect") { + if (!empty(($date['url']['data'][0]))) { + $urlAccess = $date['url']['data'][0]; + break; + } + } else if ($urlAccessUncertain && $category == "marcFulltextCheckIndirect") { + if (!empty(($date))) { + $urlAccess = $urlAccessUncertain; + break; + } + } } } } - + return $urlAccess; } From 991298e8b2e8e6618dc82e1b041fe02707091894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristof=20Ke=C3=9Fler?= Date: Thu, 13 Aug 2020 10:33:55 +0200 Subject: [PATCH 23/44] Kleine Korrektur --- module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php b/module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php index 18ad03902c..86327f6304 100644 --- a/module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php +++ b/module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php @@ -135,9 +135,7 @@ private function checkFreeAccess($driver, $urlAccessUncertain = '') { $categories = array("marcFulltextCheckDirect", "marcFulltextCheckIndirect"); foreach ($categories as $category) { - error_log($category); foreach ($driver->getSolrMarcKeys($category) as $solrMarcKey) { - error_log($solrMarcKey); $data = $driver->getMarcData($solrMarcKey); foreach ($data as $date) { if ($category == "marcFulltextCheckDirect") { From b80fafc4063937b1c3e0f7da404352f4bd321078 Mon Sep 17 00:00:00 2001 From: Kristof Kessler Date: Tue, 25 Aug 2020 09:22:20 +0200 Subject: [PATCH 24/44] Update freeaccesscheck.yaml --- config/vufind/freeaccesscheck.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/vufind/freeaccesscheck.yaml b/config/vufind/freeaccesscheck.yaml index a35c24482e..abf4493e75 100644 --- a/config/vufind/freeaccesscheck.yaml +++ b/config/vufind/freeaccesscheck.yaml @@ -3,7 +3,7 @@ ArticleFulltextFree: 856: conditions: - [field, 3, Volltext] - - [field, z, 'Kostenfrei|^OpenAccess Lizenz|Description of rights in Directory of Open Access Books'] + - [field, z, 'Kostenfrei|^OpenAccess Lizenz|Description of rights in Directory of Open Access Books|^OA$'] - [indicator, 1, 4] - [indicator, 2, 0|1] u: @@ -21,8 +21,8 @@ ArticleFulltextFreeUrlParts2: category: marcFulltextCheckDirect 856: conditions: - - [field, u, 'doi.org|nbn-resolving.de'] - - [field, z, 'Kostenfrei|^OpenAccess Lizenz|Description of rights in Directory of Open Access Books'] + - [field, u, 'doi.org|nbn-resolving.de|doaj.org\/article|www.doabooks.org\/doab\?func=fulltext'] + - [field, z, 'Kostenfrei|^OpenAccess Lizenz|Description of rights in Directory of Open Access Books|^OA$'] - [indicator, 1, 4] - [indicator, 2, 0|1] u: @@ -31,7 +31,7 @@ ArticleFulltextFreeCollection: category: marcFulltextCheckIndirect 912: conditions: - - [field, a, 'OPENACCESS|GBV_DOAJ|Gutenberg|ZDB-94-OAB|ZDB-23-GOA'] + - [field, a, 'OPENACCESS|GBV_DOAJ|Gutenberg|ZDB-94-OAB|ZDB-23-GOA|GBV_XBI|GBV_XAR|GBV_XCH'] a: - [name, collection] ArticleDirectLink: From 5e27d53c7ab80b1399b97430f93c4a2577b762c2 Mon Sep 17 00:00:00 2001 From: Kristof Kessler Date: Fri, 4 Sep 2020 16:32:45 +0200 Subject: [PATCH 25/44] =?UTF-8?q?Erm=C3=B6glichung=20Verarbeitung=20Arrays?= =?UTF-8?q?=20in=20Ergebnisliste?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../View/Helper/RecordDriver/SolrDetails.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/module/RecordDriver/src/RecordDriver/View/Helper/RecordDriver/SolrDetails.php b/module/RecordDriver/src/RecordDriver/View/Helper/RecordDriver/SolrDetails.php index 477e56e99c..2d7cf0a729 100644 --- a/module/RecordDriver/src/RecordDriver/View/Helper/RecordDriver/SolrDetails.php +++ b/module/RecordDriver/src/RecordDriver/View/Helper/RecordDriver/SolrDetails.php @@ -137,8 +137,14 @@ public function getResultListLine(RecordDriver $driver) { foreach ($resultListData as $resultListDate) { if (is_array($resultListDate)) { foreach ($resultListDate as $resultKey => $resultListArray) { - if (!isset($resultList[$resultKey]) && isset($resultListArray['data'][0])) { - $resultList[$resultKey] = $resultListArray['data'][0]; + if(strpos($resultKey,"_array") !== false) { + if (isset($resultListArray['data'][0])) { + $resultList[$resultKey][] = $resultListArray['data'][0]; + } + } else { + if (!isset($resultList[$resultKey]) && isset($resultListArray['data'][0])) { + $resultList[$resultKey] = $resultListArray['data'][0]; + } } } } From 1a9bc1f55739e26682f78e5dc70adc09d9feac84 Mon Sep 17 00:00:00 2001 From: Johannes Schultze Date: Mon, 14 Sep 2020 09:58:39 +0200 Subject: [PATCH 26/44] HAW #127 - neuer Standort 18/284-hm. --- .../src/ExtendedFacets/Recommend/Factory.php | 3 +- .../ExtendedFacets/Recommend/SideFacets.php | 125 ++++++++++++++++++ 2 files changed, 127 insertions(+), 1 deletion(-) diff --git a/module/ExtendedFacets/src/ExtendedFacets/Recommend/Factory.php b/module/ExtendedFacets/src/ExtendedFacets/Recommend/Factory.php index c9844652db..f4b2a4f940 100644 --- a/module/ExtendedFacets/src/ExtendedFacets/Recommend/Factory.php +++ b/module/ExtendedFacets/src/ExtendedFacets/Recommend/Factory.php @@ -53,7 +53,8 @@ public static function getSideFacets(ServiceManager $sm) { return new SideFacets( $sm->get('VuFind\Config\PluginManager'), - $sm->get('VuFind\Search\Solr\HierarchicalFacetHelper') + $sm->get('VuFind\Search\Solr\HierarchicalFacetHelper'), + $sm->get('Zend\Mvc\I18n\Translator') ); } } diff --git a/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php b/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php index 7fe71aa9fd..c93d5fdfc4 100644 --- a/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php +++ b/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php @@ -27,6 +27,8 @@ */ namespace ExtendedFacets\Recommend; +use VuFind\Search\Solr\HierarchicalFacetHelper; + /** * SideFacets Recommendations Module * @@ -40,6 +42,31 @@ */ class SideFacets extends \VuFind\Recommend\SideFacets { + /** + * Translator + * + * @var \Zend\I18n\Translator\Translator + */ + protected $translator = null; + + /** + * Constructor + * + * @param \VuFind\Config\PluginManager $configLoader Configuration loader + * @param HierarchicalFacetHelper $facetHelper Helper for handling + * @param \Zend\Mvc\I18n\Translator $translator Translator + * hierarchical facets + */ + public function __construct( + \VuFind\Config\PluginManager $configLoader, + HierarchicalFacetHelper $facetHelper = null, + \Zend\Mvc\I18n\Translator $translator + ) { + parent::__construct($configLoader); + $this->hierarchicalFacetHelper = $facetHelper; + $this->translator = $translator; + } + /** * getYearFacets * @@ -130,6 +157,90 @@ protected function showFacetValue($facetSet) return $facetSet; } + /** + * getFacetHierarchies + * + * Return dependency informations on facets. + * + * @param array $oldFacetList list of facets, $label filterlabel. + * + * @return array list of facets + */ + public function getFacetHierarchies($oldFacetList, $label) + { + $facetLength = count($oldFacetList); + $newFacetList = array(); + for ($i = 0; $i < $facetLength; $i++) { + if (isset($oldFacetList[$i])) { + $newFacetList[] = $oldFacetList[$i]; + } + $value = $oldFacetList[$i]['value']; + for ($j = $i+1; $j < $facetLength; $j++) { + if (strpos($oldFacetList[$j]['value'], $value) > 0) { + $oldFacetList[$j]['parent'] = $value; + $newFacetList[] = $oldFacetList[$j]; + unset($oldFacetList[$j]); + } + } + } + return $newFacetList; + } + + /** + * getLocationFacets + * + * Return location facet information in a format processed for use in the view. + * + * @param array $oldFacetList list of facets, $label filterlabel. + * + * @return array list of facets + */ + public function getLocationFacets($sigelFacetList, $sigelLabel) { + $filters = $this->results->getParams()->getFilterList(); + + $tmpFacetList = array(); + $filterList = array(); + $isAppliedGlobal = false; + foreach ($sigelFacetList as $sigelFacetItem) { + $displayText = $this->translator->translate($sigelFacetItem['displayText']); + + $sigelFacetItemCropped = preg_replace('/-[A-z]+$/', '', $sigelFacetItem['displayText']); + if ($displayText == $sigelFacetItem['displayText']) { + $displayText = $this->translator->translate($sigelFacetItemCropped); + } + if ($displayText != $sigelFacetItem['displayText'] && $displayText != $sigelFacetItemCropped) { + if (isset($tmpFacetList[$displayText])) { + $tmpFacetList[$displayText]['sort'] += $sigelFacetItem['count']; + $tmpFacetList[$displayText]['count'] += $sigelFacetItem['count']; + } else { + $isApplied = (strpos($filters[$sigelLabel][0]['value'], $sigelFacetItem['value']) !== false); + $tmpFacetList[$displayText] = array('sort' => $sigelFacetItem['count'], 'value' => $sigelFacetItem['value'], 'displayText' => $displayText, 'count' => $sigelFacetItem['count'], 'operator' => 'AND', 'isApplied' => $isApplied); + if ($isApplied) { + $isAppliedGlobal = true; + } + } + if (isset($filterList[$displayText])) { + $filterList[$displayText]['value'] .= ' OR standort_iln_str_mv:"'.$sigelFacetItem['value'].'"'; + } else { + $filterList[$displayText]['value'] = 'complex:standort_iln_str_mv:"'.$sigelFacetItem['value'].'"'; + } + } + } + foreach ($tmpFacetList as $name => $data) { + if (isset($filterList[$name]['value'])) { + $tmpFacetList[$name]['value'] = $filterList[$name]['value']; + } + } + array_multisort($tmpFacetList, SORT_DESC); + $newFacetList = array(); + foreach ($tmpFacetList as $tmpFacetItem) { + if (!$isAppliedGlobal || $tmpFacetItem['isApplied']) { + $newFacetList[] = $tmpFacetItem; + } + } + return $newFacetList; + } + /** * Get facet information from the search results. * @@ -137,11 +248,25 @@ protected function showFacetValue($facetSet) */ public function getFacetSet() { + $config = $this->configLoader->get('facets'); + $facetSet = \VuFind\Recommend\SideFacets::getFacetSet(); if (isset($facetSet['publishDate'])) { $facetSet['publishDate']['list'] = $this->getYearFacets($facetSet['publishDate']['list'], $facetSet['publishDate']['label']); } + if ($config->SideFacetsExtras->format_facet) { + if (isset($facetSet['format_facet'])) { + $facetSet['format_facet']['list'] = $this->getFacetHierarchies($facetSet['format_facet']['list'], $facetSet['format_facet']['label']); + } + } + + if ($config->SideFacetsExtras->standort_iln_str_mv) { + if (isset($facetSet['standort_iln_str_mv'])) { + $facetSet['standort_iln_str_mv']['list'] = $this->getLocationFacets($facetSet['standort_iln_str_mv']['list'], $facetSet['standort_iln_str_mv']['label']); + } + } + $facetSet = $this->showFacetValue($facetSet); return $facetSet; From a38d5b2a0131297e924ee287f3b8aa9db80fab7c Mon Sep 17 00:00:00 2001 From: Hajo Seng Date: Thu, 17 Sep 2020 11:40:51 +0200 Subject: [PATCH 27/44] kleinere Korrekturen und Erweiterungen in den Treibern --- module/Delivery/src/Delivery/Driver/Dod.php | 5 +++-- module/Delivery/src/Delivery/Driver/MyBib.php | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/module/Delivery/src/Delivery/Driver/Dod.php b/module/Delivery/src/Delivery/Driver/Dod.php index 508ee2690c..008a70c5ec 100644 --- a/module/Delivery/src/Delivery/Driver/Dod.php +++ b/module/Delivery/src/Delivery/Driver/Dod.php @@ -94,9 +94,10 @@ public function sendOrder($orderData) { $orderTemplate = $this->config['orderTemplate']; $orderData = $this->viewRenderer->render('Order/' . $orderTemplate, $orderData); $config = $this->config; - if ($this->mailer->send($config['orderMailTo'], $config['orderMailFrom'], $config['orderSubject'], $orderData)) { + try { + $this->mailer->send($config['orderMailTo'], $config['orderMailFrom'], $config['orderSubject'], $orderData); return 'per Email'; - } else { + } catch (exception $e) { return null; } } diff --git a/module/Delivery/src/Delivery/Driver/MyBib.php b/module/Delivery/src/Delivery/Driver/MyBib.php index cab09e213a..9353243b1f 100644 --- a/module/Delivery/src/Delivery/Driver/MyBib.php +++ b/module/Delivery/src/Delivery/Driver/MyBib.php @@ -101,6 +101,7 @@ public function prepareOrder($user) { $orderData['contactPersonName'] = $user->firstname . ' ' . $user->lastname; $orderData['clientIdentifier'] = $user->cat_id; $orderData['delEmailAddress'] = $user->delivery_email; + $orderData['requesterGroup'] = $user->patron_types; return $orderData; } From 4b185d96cdeb72eb0c07988c73689e521857f64f Mon Sep 17 00:00:00 2001 From: Hajo Seng Date: Thu, 17 Sep 2020 11:41:17 +0200 Subject: [PATCH 28/44] Ermittlung und Weiterreichen des Nutzertyps --- module/Delivery/src/Delivery/Auth/DeliveryAuthenticator.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/Delivery/src/Delivery/Auth/DeliveryAuthenticator.php b/module/Delivery/src/Delivery/Auth/DeliveryAuthenticator.php index 8232ad2513..5f97ac4288 100644 --- a/module/Delivery/src/Delivery/Auth/DeliveryAuthenticator.php +++ b/module/Delivery/src/Delivery/Auth/DeliveryAuthenticator.php @@ -147,6 +147,7 @@ public function authenticate($deliveryDomain = 'main', $asAdmin = false) $deliveryUser = $userDeliveryTable->get($user->id); $user->delivery_email = $deliveryUser->delivery_email; $user->user_delivery_id = $deliveryUser->id; + $user->patron_types = implode(', ', $patronTypes); if ($asAdmin) { $user->is_admin = $deliveryUser->is_admin; } From 694b12c38752533fd9c1a57f51ccc3587cb7cd19 Mon Sep 17 00:00:00 2001 From: Hajo Seng Date: Thu, 17 Sep 2020 11:42:29 +0200 Subject: [PATCH 29/44] Anpassung an dynamisch zugeladene Marc-Konfiguration --- .../AjaxHandler/CheckAvailability.php | 6 ++-- .../src/Delivery/ConfigurationManager.php | 10 ++++-- module/Delivery/src/Delivery/DataHandler.php | 33 ++++++++++++------- .../Helper/Delivery/AvailabilityChecker.php | 11 ++++--- 4 files changed, 41 insertions(+), 19 deletions(-) diff --git a/module/Delivery/src/Delivery/AjaxHandler/CheckAvailability.php b/module/Delivery/src/Delivery/AjaxHandler/CheckAvailability.php index 549b75fd08..2a238de6f2 100644 --- a/module/Delivery/src/Delivery/AjaxHandler/CheckAvailability.php +++ b/module/Delivery/src/Delivery/AjaxHandler/CheckAvailability.php @@ -85,7 +85,7 @@ public function handleRequest(Params $params) $deliveryDomain = $params->fromQuery('domain', 'main'); $configurationManager = new ConfigurationManager($this->configManager, $deliveryDomain); $availabilityConfig = $configurationManager->getAvailabilityConfig(); - $availabilityHelper = new AvailabilityHelper(null, $availabilityConfig['default']); + $mainConfig = $configurationManager->getMainConfig(); $ppn = $params->fromQuery('ppn'); $backend = $params->fromQuery('source', DEFAULT_SEARCH_BACKEND); @@ -96,7 +96,9 @@ public function handleRequest(Params $params) $records = $results->getResults(); $driver = $records[0]; - $availabilityHelper->setSolrDriver($driver); + + $availabilityHelper = new AvailabilityHelper($availabilityConfig['default']); + $availabilityHelper->setSolrDriver($driver, $mainConfig['delivery_marc_yaml']); $available = ($availabilityHelper->checkSignature()) ? 'available' : 'not available'; return $this->formatResponse(['available' => $available]); } diff --git a/module/Delivery/src/Delivery/ConfigurationManager.php b/module/Delivery/src/Delivery/ConfigurationManager.php index 05d79e9b41..0d8bd13eee 100644 --- a/module/Delivery/src/Delivery/ConfigurationManager.php +++ b/module/Delivery/src/Delivery/ConfigurationManager.php @@ -63,18 +63,24 @@ public function getMainConfig() public function getAvailabilityConfig() { $availabilityConfigIni = $this->mainConfig['availability_config']; - return $this->configManager->get($availabilityConfigIni)->toArray(); + $availabilityConfig = $this->configManager->get($availabilityConfigIni)->toArray(); + $availabilityConfig['delivery_marc_yaml'] = $this->mainConfig['delivery_marc_yaml']; + return $availabilityConfig; } public function getOrderDataConfig() { $orderDataConfigIni = $this->mainConfig['orderdata_config']; - return $this->configManager->get($orderDataConfigIni)->toArray(); + $orderDataConfig = $this->configManager->get($orderDataConfigIni)->toArray(); + return $orderDataConfig; } public function getPluginConfig() { $plugin = $this->mainConfig['plugin']; + if (!empty($this->mainConfig['orderTemplate'])) { + $this->globalConfig[$plugin]['orderTemplate'] = $this->mainConfig['orderTemplate']; + } return array_merge($this->globalConfig[$plugin], ['plugin' => $plugin]); } diff --git a/module/Delivery/src/Delivery/DataHandler.php b/module/Delivery/src/Delivery/DataHandler.php index 66be9e9174..40c307964b 100644 --- a/module/Delivery/src/Delivery/DataHandler.php +++ b/module/Delivery/src/Delivery/DataHandler.php @@ -49,13 +49,21 @@ public function __construct(PluginManager $driverManager, $params, $orderDataCon $this->params = $params; } - public function setSolrDriver($solrDriver) + public function setSolrDriver($solrDriver, $deliveryMarcYaml = null) { $this->solrDriver = $solrDriver; + if (!empty($deliveryMarcYaml)) { + $this->solrDriver->addSolrMarcYaml($deliveryMarcYaml); + } $formats = $solrDriver->getMarcData('Format'); $this->format = $formats[0][0]['data'][0]; } + public function setFormat() { + $this->format = $this->params->fromPost('format') ?? null; + return $this->format; + } + public function sendOrder($user) { if (!$this->checkData()) { @@ -149,16 +157,19 @@ private function checkData() public function collectData($presetData = []) { - $format = $this->format; - - if ($format == 'Article' || $format == 'electronic Article') { - $deliveryData = $this->solrDriver->getMarcData('DeliveryDataArticle'); - } elseif ($format == 'Journal' || $format == 'eJournal') { - $deliveryData = $this->solrDriver->getMarcData('DeliveryDataJournal'); - } elseif ($format == 'Serial Volume') { - $deliveryData = $this->solrDriver->getMarcData('DeliveryDataSerialVolume'); - } else { - $deliveryData = $this->solrDriver->getMarcData('DeliveryData'); + $deliveryData = []; + $format = $this->format; + + if (isset($this->solrDriver)) { + if ($format == 'Article' || $format == 'electronic Article') { + $deliveryData = $this->solrDriver->getMarcData('DeliveryDataArticle'); + } elseif ($format == 'Journal' || $format == 'eJournal') { + $deliveryData = $this->solrDriver->getMarcData('DeliveryDataJournal'); + } elseif ($format == 'Serial Volume') { + $deliveryData = $this->solrDriver->getMarcData('DeliveryDataSerialVolume'); + } else { + $deliveryData = $this->solrDriver->getMarcData('DeliveryData'); + } } $flatData = []; diff --git a/module/Delivery/src/Delivery/View/Helper/Delivery/AvailabilityChecker.php b/module/Delivery/src/Delivery/View/Helper/Delivery/AvailabilityChecker.php index 39ada475f1..b4532ea13e 100644 --- a/module/Delivery/src/Delivery/View/Helper/Delivery/AvailabilityChecker.php +++ b/module/Delivery/src/Delivery/View/Helper/Delivery/AvailabilityChecker.php @@ -25,8 +25,9 @@ public function check($driver, $deliveryDomain = 'main') { $configurationManager = new ConfigurationManager($this->configManager, $deliveryDomain); $availabilityConfig = $configurationManager->getAvailabilityConfig(); - $availabilityHelper = new AvailabilityHelper(null, $availabilityConfig['default']); - $availabilityHelper->setSolrDriver($driver); + $mainConfig = $configurationManager->getMainConfig(); + $availabilityHelper = new AvailabilityHelper($availabilityConfig['default']); + $availabilityHelper->setSolrDriver($driver, $mainConfig['delivery_marc_yaml']); return ($availabilityHelper->checkSignature()) ? 'available' : 'not available'; } @@ -35,7 +36,9 @@ public function check($driver, $deliveryDomain = 'main') */ public function getHierarchyTopID($driver) { - $deliveryArticleData = $driver->getMarcData('DeliveryDataArticle'); - return $deliveryArticleData[3]['ppn']['data'][0] ?? ''; + $hierarchyTopIDs = $driver->getHierarchyTopID(); + return $hierarchyTopIDs[0]; +// $deliveryArticleData = $driver->getMarcData('DeliveryDataArticle'); +// return $deliveryArticleData[3]['ppn']['data'][0] ?? ''; } } From 05fdb79ba56730d769e6dc2761359f732d157612 Mon Sep 17 00:00:00 2001 From: Hajo Seng Date: Thu, 17 Sep 2020 11:43:00 +0200 Subject: [PATCH 30/44] Erweiterung Konfiguration; Auswertung der Signatur (falls konfiguriert) --- .../src/Delivery/AvailabilityHelper.php | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/module/Delivery/src/Delivery/AvailabilityHelper.php b/module/Delivery/src/Delivery/AvailabilityHelper.php index e494e33c7a..0ac87af7b7 100644 --- a/module/Delivery/src/Delivery/AvailabilityHelper.php +++ b/module/Delivery/src/Delivery/AvailabilityHelper.php @@ -18,19 +18,16 @@ class AvailabilityHelper { - protected $deliveryConfig; + protected $availabilityConfig; protected $solrDriver; protected $signatureList; - public function __construct($solrDriver = null, $deliveryConfig = null) + public function __construct($availabilityConfig = null) { - if (!empty($solrDriver)) { - $this->setSolrDriver($solrDriver); - } - if (!empty($deliveryConfig)) { - $this->setDeliveryConfig($deliveryConfig); + if (!empty($availabilityConfig)) { + $this->setAvailabilityConfig($availabilityConfig); } } @@ -50,20 +47,23 @@ private function getMarcData($item) return $flatData; } - public function setSolrDriver($driver) + public function setSolrDriver($driver, $deliveryMarcYaml = null) { $this->solrDriver = $driver; + if (!empty($deliveryMarcYaml)) { + $this->solrDriver->addSolrMarcYaml($deliveryMarcYaml); + } } - public function setDeliveryConfig($config) + public function setAvailabilityConfig($config) { - $this->deliveryConfig = $config; + $this->availabilityConfig = $config; } public function getParentId() { $format = array_shift(array_shift($this->getMarcData('Format'))); - if (in_array($format, $this->deliveryConfig['formats'])) { + if (in_array($format, $this->availabilityConfig['formats'])) { $articleData = $this->getMarcData('DeliveryDataArticle'); foreach ($articleData as $articleDate) { if (!empty($articleDate['ppn'])) { @@ -82,7 +82,7 @@ public function getSignatureList() public function checkSignature() { - $deliveryConfig = $this->deliveryConfig; + $availabilityConfig = $this->availabilityConfig; $format = array_shift(array_shift($this->getMarcData('Format'))); $signatureData = $this->getMarcData('Signature'); $licenceData = $this->getMarcData('Licence'); @@ -91,7 +91,7 @@ public function checkSignature() $this->signatureList = []; $sortedSignatureData = []; - foreach ($deliveryConfig['sigel_all'] as $sigel) { + foreach ($availabilityConfig['sigel_all'] as $sigel) { foreach ($signatureData as $index => $signatureDate) { if (isset($signatureDate['sigel']) && preg_match('#'.$sigel.'$#', $signatureDate['sigel'])) { $sortedSignatureData[] = $signatureDate; @@ -100,7 +100,7 @@ public function checkSignature() } } } - if (in_array($format, $deliveryConfig['formats'])) { + if (in_array($format, $availabilityConfig['formats'])) { if (empty($sortedSignatureData)) { foreach ($signatureData as $signatureDate) { if ($this->checkSigel($signatureDate, $format)) { @@ -131,11 +131,11 @@ public function checkSignature() private function performCheck($item, $data, $format) { - if (empty($this->deliveryConfig[$item.'_'.$format])) { + if (empty($this->availabilityConfig[$item.'_'.$format])) { $format = 'all'; } - if (!empty($this->deliveryConfig[$item.'_'.$format])) { - foreach ($this->deliveryConfig[$item.'_'.$format] as $regex) { + if (!empty($this->availabilityConfig[$item.'_'.$format])) { + foreach ($this->availabilityConfig[$item.'_'.$format] as $regex) { $noMatch = false; if (strpos($regex, '!') === 0) { if (empty($data)) { @@ -162,6 +162,7 @@ private function checkSigel($signatureDate, $format, $sigelOnly = false) $licencenote = $signatureDate['licencenote'] ?? ''; $footnote = $signatureDate['footnote'] ?? ''; $location = $signatureDate['location'] ?? ''; + $signature = $signatureDate['signature'] ?? ''; $format = str_replace(' ', '_', $format); $sigelOk = $this->performCheck('sigel', $sigel, $format); @@ -170,6 +171,7 @@ private function checkSigel($signatureDate, $format, $sigelOnly = false) $sigelOk = $sigelOk && $this->performCheck('licencenote', $licencenote, $format); $sigelOk = $sigelOk && $this->performCheck('footnote', $footnote, $format); $sigelOk = $sigelOk && $this->performCheck('location', $location, $format); + $sigelOk = $sigelOk && $this->performCheck('signature', $signature, $format); } return $sigelOk; } From 8edad8014828066ada60c47219b9c6714072501a Mon Sep 17 00:00:00 2001 From: Hajo Seng Date: Thu, 17 Sep 2020 11:43:55 +0200 Subject: [PATCH 31/44] Formatvorauswahl bei freiem Formular --- .../delivery/templates/delivery/order.phtml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/themes/delivery/templates/delivery/order.phtml b/themes/delivery/templates/delivery/order.phtml index 8c3eebb0fb..8b3838e859 100644 --- a/themes/delivery/templates/delivery/order.phtml +++ b/themes/delivery/templates/delivery/order.phtml @@ -10,7 +10,7 @@ ?>
    - +

    @@ -26,9 +26,23 @@

    + + + selectFormats)): ?> +
    + + +
    +
    + +
    + -

    transEsc($this->formTitle) ?>

    @@ -82,6 +96,7 @@
    + From 7e97bcd320ff67dadb08ed36cefcfd89557219a7 Mon Sep 17 00:00:00 2001 From: Hajo Seng Date: Thu, 17 Sep 2020 11:45:26 +0200 Subject: [PATCH 32/44] Verlinkung freies Fromular --- .../templates/search/delivery-results.phtml | 0 themes/delivery/templates/search/delivery-results.phtml | 7 +++++++ 2 files changed, 7 insertions(+) create mode 100644 themes/beluga-core-base/templates/search/delivery-results.phtml create mode 100644 themes/delivery/templates/search/delivery-results.phtml diff --git a/themes/beluga-core-base/templates/search/delivery-results.phtml b/themes/beluga-core-base/templates/search/delivery-results.phtml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/themes/delivery/templates/search/delivery-results.phtml b/themes/delivery/templates/search/delivery-results.phtml new file mode 100644 index 0000000000..a53a73a023 --- /dev/null +++ b/themes/delivery/templates/search/delivery-results.phtml @@ -0,0 +1,7 @@ + +authenticator()->isAuthorized($domain)): ?> + + + From 4b739a1d023194dcba0dae9d934ee3c0e5b33295 Mon Sep 17 00:00:00 2001 From: Hajo Seng Date: Thu, 17 Sep 2020 11:45:52 +0200 Subject: [PATCH 33/44] Anpassung des Controllers --- .../Controller/DeliveryController.php | 89 +++++++++++-------- 1 file changed, 52 insertions(+), 37 deletions(-) diff --git a/module/Delivery/src/Delivery/Controller/DeliveryController.php b/module/Delivery/src/Delivery/Controller/DeliveryController.php index 44ba066b6e..505dc9b8c3 100644 --- a/module/Delivery/src/Delivery/Controller/DeliveryController.php +++ b/module/Delivery/src/Delivery/Controller/DeliveryController.php @@ -47,7 +47,9 @@ class DeliveryController extends AbstractBase { protected $deliveryAuthenticator; + protected $deliveryTable; + protected $configurationManager; protected $user; @@ -125,26 +127,29 @@ public function orderAction() if ($message != 'authorized') { return $this->forwardTo('MyResearch', 'Profile'); } + $this->configurationManager->setConfigurations($deliveryDomain); + $errors = $missingFields = []; $id = $this->params()->fromQuery('id') ?? $this->params()->fromPost('id'); $searchClassId = $this->params()->fromQuery('searchClassId') ?? $this->params()->fromPost('searchClassId'); - $errors = $missingFields = []; - - if (empty($id) || empty($searchClassId)) { - $errors[] = 'record id is missing'; + if (empty($searchClassId)) { + $errors[] = 'search class id is missing'; } else { - $driver = $this->getRecordLoader()->load($id, $searchClassId); + if ($error = $this->updateDeliveryMail()) { + $errors[] = $error; + } - $this->configurationManager->setConfigurations($deliveryDomain); $orderDataConfig = $this->configurationManager->getOrderDataConfig(); $pluginConfig = $this->configurationManager->getPluginConfig(); $mainConfig = $this->configurationManager->getMainConfig(); - $dataHandler = new DataHandler($this->serviceLocator->get('Delivery\Driver\PluginManager'), $this->params(), $orderDataConfig, $pluginConfig); - $dataHandler->setSolrDriver($driver); - - if ($error = $this->updateDeliveryMail()) { - $errors[] = $error; + $dataHandler = new DataHandler($this->serviceLocator->get('Delivery\Driver\PluginManager'), + $this->params(), $orderDataConfig, $pluginConfig); + if (!empty($id)) { + $driver = $this->getRecordLoader()->load($id, $searchClassId); + $dataHandler->setSolrDriver($driver, $mainConfig['delivery_marc_yaml']); + } else { + $presetFormat = $dataHandler->setFormat(); } if (!empty($this->params()->fromPost('order'))) { @@ -161,18 +166,20 @@ public function orderAction() $missingFields = ['delivery_email']; } } - - $availabilityConfig = $this->configurationManager->getAvailabilityConfig(); - $availabilityHelper = new AvailabilityHelper($driver, $availabilityConfig['checkparent']); - if ($parentId = $availabilityHelper->getParentId()) { - $parentDriver = $this->getRecordLoader()->load($parentId, DEFAULT_SEARCH_BACKEND); - $availabilityHelper->setSolrDriver($parentDriver); - } - $availabilityHelper->setDeliveryConfig($availabilityConfig['default']); - $signatureCount = $mainConfig['collectedCallnumbers'] ?: 1; - $signatureList = array_slice($availabilityHelper->getSignatureList(), 0 , $signatureCount); - $signature = implode("\n", $signatureList); + if (!empty($id)) { + $availabilityConfig = $this->configurationManager->getAvailabilityConfig(); + $availabilityHelper = new AvailabilityHelper($availabilityConfig['checkparent']); + $availabilityHelper->setSolrDriver($driver, $mainConfig['delivery_marc_yaml']); + if ($parentId = $availabilityHelper->getParentId()) { + $parentDriver = $this->getRecordLoader()->load($parentId, DEFAULT_SEARCH_BACKEND); + $availabilityHelper->setSolrDriver($parentDriver, $mainConfig['delivery_marc_yaml']); + } + $availabilityHelper->setAvailabilityConfig($availabilityConfig['default']); + $signatureCount = $mainConfig['collectedCallnumbers'] ?: 1; + $signatureList = array_slice($availabilityHelper->getSignatureList(), 0 , $signatureCount); + $signature = implode("\n", $signatureList); + } } $templateParams = $this->deliveryAuthenticator->getTemplateParams($deliveryDomain); @@ -181,31 +188,39 @@ public function orderAction() $view->title = $templateParams['title']; $view->errors = $errors; $view->missingFields = $missingFields; + $view->searchClassId = $searchClassId; + $view->domain = $deliveryDomain; + $view->catalog_id = $this->user->cat_id; + $view->delivery_email = $this->user->delivery_email; + $view->name = trim($this->user->firstname . ' ' . $this->user->lastname); if (!empty($orderId)) { $view->id = $id; - $view->searchClassId = $searchClassId; $view->orderId = $orderId; - } elseif (!empty($id) && !empty($signature)) { + } else { $preset = []; - if ($mainConfig['presetCallnumbers'] == 'y') { - $preset = ['signature' => $signature]; + if (!empty($id) && !empty($signature)) { + if ($mainConfig['presetCallnumbers'] == 'y') { + $preset = ['signature' => $signature]; + } } $dataHandler->collectData($preset); - $formData = $dataHandler->getFormData(); $infoData = $dataHandler->getInfoData(); - $view->id = $id; - $view->searchClassId = $searchClassId; - $view->formTitle = $formData['title']; - $view->formFields = $formData['fields']; - $view->checkboxFields = $formData['checkbox']; - $view->infoTitle = $infoData['title']; - $view->infoFields = $infoData['fields']; - $view->catalog_id = $this->user->cat_id; - $view->delivery_email = $this->user->delivery_email; - $view->name = trim($this->user->firstname . ' ' . $this->user->lastname); + if (!empty($id)) { + $view->formTitle = $formData['title']; + $view->id = $id; + $view->formFields = $formData['fields']; + $view->checkboxFields = $formData['checkbox']; + $view->infoTitle = $infoData['title']; + $view->infoFields = $infoData['fields']; + } elseif (!empty($presetFormat)) { + $view->formTitle = $formData['title']; + $view->formFields = array_merge($formData['fields'], $infoData['fields']); + } else { + $view->selectFormats = $mainConfig['formats_to_select']; + } } return $view; } From 7d3ae6714b78b694ae52422a6e48b438e79ab9ad Mon Sep 17 00:00:00 2001 From: Hajo Seng Date: Thu, 17 Sep 2020 11:46:18 +0200 Subject: [PATCH 34/44] Beispielkonfigurationsdateien --- config/vufind/deliveryAvailability.ini | 49 ++++++++ config/vufind/deliveryGlobal.ini | 26 +++++ config/vufind/deliveryMarc.yaml | 153 +++++++++++++++++++++++++ config/vufind/deliveryOrder.ini | 25 ++++ 4 files changed, 253 insertions(+) create mode 100644 config/vufind/deliveryAvailability.ini create mode 100644 config/vufind/deliveryMarc.yaml create mode 100644 config/vufind/deliveryOrder.ini diff --git a/config/vufind/deliveryAvailability.ini b/config/vufind/deliveryAvailability.ini new file mode 100644 index 0000000000..6a3254367e --- /dev/null +++ b/config/vufind/deliveryAvailability.ini @@ -0,0 +1,49 @@ +; example configuration for delivery:availability +; this configuration determines which items can be delivered + +; items for which parents should be checked +; parents are determined by hierarchy_top_id +[checkparent] +; items determined by format +formats[] = + +; main configuration +[default] +; iln of the libraray +iln = + +; allowed formats +formats[] = + +; allowed location sigils (identified by item Signature and field sigel in deliveryMarc.yaml) +; expressions on the right side are regular expressions; a final $ is added automatically +; a ! at the beginning marks a negation +; _all means it applies to all formats +sigel_all[] = +; _ means it applies to format , overrides _all +sigel_[] = .* + +; allowed indicators identified by field indicator in deliveryMarc.yaml +; again both _all and _ works +indicator_all[] = + +; allowed licencenote identified by field licencenote in deliveryMarc.yaml +; again both _all and _ works +licencenote_all[] = + +; allowed locationnote identified by field locationnote in deliveryMarc.yaml +; again both _all and _ works +locationnote_all[] = + +; allowed shelf mark identified by field signature in deliveryMarc.yaml +; again both _all and _ works +signature_all[] = + +; allowed footnote identified by field footnote in deliveryMarc.yaml +; again both _all and _ works +footnote_all[] = + +; allowed licencetypes identified by item Licence and field licencetype in deliveryMarc.yaml +; again both _all and _ works +licence_all[] = + diff --git a/config/vufind/deliveryGlobal.ini b/config/vufind/deliveryGlobal.ini index 639d8ea031..4f4eb785ae 100644 --- a/config/vufind/deliveryGlobal.ini +++ b/config/vufind/deliveryGlobal.ini @@ -4,6 +4,8 @@ domain = DeliveryDomain ; plugin configuration is expected below plugin = Plugin +; order template of plugin might be overridden +orderTemplate = ; how many callnumbers should be collected if several are available? collectedCallnumbers = 1 @@ -13,10 +15,15 @@ presetCallnumbers = y ; allowed usertypes allowed[] = +; formats to be preselected of no format can be determined +formats_to_select[] = + ; configuration of availability; ini-file should be there as well availability_config = deliveryAvailability ; configuration of order form; ini-file should be there as well orderdata_config = deliveryOrderData +; configuration of marc-data; yaml file should be there as well +delivery_marc_yaml = deliveryMarc.yaml ; whether to show a link to \Delivery\Home or not template_show_home = y @@ -32,3 +39,22 @@ template_belugino = [Plugin] ; plugin configuration parameter: must contain at least a template orderTemplate = +; there might be more configuration options dependent on the plugin + +; expample configuration for an email sending plugin based on dod standard +[Dod] +orderMailFrom = +orderMailTo = +orderSubject = +orderTemplate = + +; example configuration for a MyBib plugin sending xml-rpc requests +[MyBib] +; whether to register or not +rpcRegistered = +rpcUrl = +rpcUser = +rpcSystem = +orderTemplate = + + diff --git a/config/vufind/deliveryMarc.yaml b/config/vufind/deliveryMarc.yaml new file mode 100644 index 0000000000..394ce802aa --- /dev/null +++ b/config/vufind/deliveryMarc.yaml @@ -0,0 +1,153 @@ +--- +# Listing of data to be read from marc bibliographic data +# +# Format is: +# : +# category: +# title should be set; other categories are mandatory +# originalletters: whether item in original letters should be +# shown or not (see marc 880) +#
    : at least one should be set; fields with a leading 0 should be quoted +# if only parent methods are used the main field is '000' +# conditions: conditions which should be fulfilled if the data is read +# - [, , ] is either field or indicator +# is the name of the field or indicator +# is the value it should have +# parent: use a parent method (from SolrDefault driver) +# - [] the method to use +# subfields: only read the fields +# - [] list of fields to read +# : enhanced processing of a subfield +# - [name, ] name it +# - [replace, , ] replace a substring from to (using a regex) +# - [match, , ] match a substring () and use the th parantesis +# (using a regex) +# - [function, ] use th return value of a php-function +# +#----------------------------------------------------------------------------------- +# + +# example configuration + +# mandatory +Format: + category: description + '000': + parent: + - [method, getFormats] +# mandatory +Signature: + category: delivery + 980: + conditions: + - [field, 2, '^22$'] + d: + - [name, signature] + e: + - [name, indicator] + f: + - [name, sigel] + k: + - [name, footnote] + x: + - [name, licencenote] + y: + - [name, locationnote] +# only if licence criteria are set in deliveryAvailability.ini +Licence: + category: delivery + 981: + conditions: + - [field, 2, '^22$'] + y: + - [name, licencetype] +# this and the following are going to be made configurable soon +DeliveryDataArticle: + category: delivery + '000': + parent: + - [method, getUniqueId] + - [name, article-ppn] + 245: + a: + - [name, article-title] + 100: + a: + - [name, article-author] + 773: + conditions: + - [field, w, 'DE-627'] + w: + - [name, ppn] + - [replace, '\(.+\)', ''] + t: + - [name, title] + g: + - [name, volume-year-pages] + 980: + conditions: + - [field, 2, '^22$'] + d: + - [name, signature] +DeliveryDataSerialVolume: + category: delivery + '000': + parent: + - [method, getUniqueId] + - [name, ppn] + 245: + a: + - [name, title] + c: + - [name, title] + n: + - [name, title] + p: + - [name, title] + 490: + a: + - [name, title] + 980: + conditions: + - [field, 2, '^22$'] + d: + - [name, signature] +DeliveryDataJournal: + category: delivery + '000': + parent: + - [method, getUniqueId] + - [name, ppn] + 245: + a: + - [name, title] + c: + - [name, title] + n: + - [name, title] + p: + - [name, title] + 490: + a: + - [name, title] + 980: + conditions: + - [field, 2, '^22$'] + d: + - [name, signature] +DeliveryData: + category: delivery + '000': + parent: + - [method, getUniqueId] + - [name, ppn] + 245: + a: + - [name, title] + c: + - [name, title] + 980: + conditions: + - [field, 2, '^22$'] + d: + - [name, signature] diff --git a/config/vufind/deliveryOrder.ini b/config/vufind/deliveryOrder.ini new file mode 100644 index 0000000000..e7737a9997 --- /dev/null +++ b/config/vufind/deliveryOrder.ini @@ -0,0 +1,25 @@ +; example configuration of order fields + +; name of the field +[] +; type is either info (plain text) or form (form field to be altered) or checkbox +type = +; formats to which this field is applied; all applied to all formats +formats[] = +; name of the field within the form +form_name = +; name of the checkbox value (if type = checkbox) +form_value= +; name to display +display = +; name of the field within the order form +orderfield = +; prefix of the field within the order form (can be skipped) +orderfieldprefix = +; name of the field within the delivery table (can be skipped) +tablefield = +; fallbeck field within the delivery table (can be skipped) +fallbacktablefield = +; whether to field is mandatory or not; 0 or 1 +mandatory = + From 6199dc64432c8fbe39acd237fad33716014b9706 Mon Sep 17 00:00:00 2001 From: Hajo Seng Date: Thu, 17 Sep 2020 12:03:17 +0200 Subject: [PATCH 35/44] Kommentar entfernt --- module/BelugaConfig/config/module.config.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/module/BelugaConfig/config/module.config.php b/module/BelugaConfig/config/module.config.php index 0479cfabfa..0face8400f 100644 --- a/module/BelugaConfig/config/module.config.php +++ b/module/BelugaConfig/config/module.config.php @@ -2,11 +2,6 @@ namespace BelugaConfig\Module\Configuration; $config = [ - /* 'controllers' => [ - 'factories' => [ - 'VuFind\Controller\AjaxController' => 'BelugaConfig\Controller\AjaxControllerFactory', - ], - ], */ 'service_manager' => [ 'allow_override' => true, 'factories' => [ From 7e3a1c3c7a20ea1324d797088ea1418a1f711ea5 Mon Sep 17 00:00:00 2001 From: Hajo Seng Date: Thu, 17 Sep 2020 12:03:32 +0200 Subject: [PATCH 36/44] =?UTF-8?q?Korrektur=20eines=20Fehlers=20in=20dem=20?= =?UTF-8?q?regul=C3=A4ren=20Ausdruck:=20)$=20statt=20$)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/BelugaConfig/AjaxHandler/GetResultCount.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/BelugaConfig/src/BelugaConfig/AjaxHandler/GetResultCount.php b/module/BelugaConfig/src/BelugaConfig/AjaxHandler/GetResultCount.php index 5c168ef212..9764b58ca2 100644 --- a/module/BelugaConfig/src/BelugaConfig/AjaxHandler/GetResultCount.php +++ b/module/BelugaConfig/src/BelugaConfig/AjaxHandler/GetResultCount.php @@ -84,7 +84,7 @@ public function handleRequest(Params $params) foreach ($queryArray as $queryItem) { $arrayKey = false; list($key, $value) = explode('=', $queryItem, 2); - if (preg_match('/(\[\]$)/', $key, $matches)) { + if (preg_match('/(\[\])$/', $key, $matches)) { $key = str_replace($matches[1], '', $key); $arrayKey = true; } From 4637f7f20c5c2882750aac96afc725a5905cf2b5 Mon Sep 17 00:00:00 2001 From: Johannes Schultze Date: Fri, 18 Sep 2020 12:07:43 +0200 Subject: [PATCH 37/44] Bugfix. --- .../ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php b/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php index 9ec5cef7e5..6a6d21bf5a 100644 --- a/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php +++ b/module/ExtendedFacets/src/ExtendedFacets/Recommend/SideFacets.php @@ -40,7 +40,7 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:recommendation_modules Wiki */ -class SideFacets extends \VuFind\Recommend\SideFacets implements TranslatorAwareInterface +class SideFacets extends \VuFind\Recommend\SideFacets { /** * Translator From 02f8a1769c5a003efa3406fec591f29cc72a1640 Mon Sep 17 00:00:00 2001 From: Johannes Schultze Date: Fri, 18 Sep 2020 12:17:17 +0200 Subject: [PATCH 38/44] Update. --- composer.lock | 745 +++++++++++++++++++++++++++++--------------------- 1 file changed, 430 insertions(+), 315 deletions(-) diff --git a/composer.lock b/composer.lock index b4528df96c..f37b840934 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "29a1b29642ae8b7a1dbfd7950b671c67", + "content-hash": "b5392ebfaa130cf919f8b86efe9780c0", "packages": [ { "name": "ahand/mobileesp", @@ -170,6 +170,7 @@ ], "description": "Promoting the interoperability of container objects (DIC, SL, etc.)", "homepage": "https://github.com/container-interop/container-interop", + "abandoned": "psr/container", "time": "2017-02-14T19:40:03+00:00" }, { @@ -243,16 +244,16 @@ }, { "name": "filp/whoops", - "version": "2.3.1", + "version": "2.7.3", "source": { "type": "git", "url": "https://github.com/filp/whoops.git", - "reference": "bc0fd11bc455cc20ee4b5edabc63ebbf859324c7" + "reference": "5d5fe9bb3d656b514d455645b3addc5f7ba7714d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filp/whoops/zipball/bc0fd11bc455cc20ee4b5edabc63ebbf859324c7", - "reference": "bc0fd11bc455cc20ee4b5edabc63ebbf859324c7", + "url": "https://api.github.com/repos/filp/whoops/zipball/5d5fe9bb3d656b514d455645b3addc5f7ba7714d", + "reference": "5d5fe9bb3d656b514d455645b3addc5f7ba7714d", "shasum": "" }, "require": { @@ -261,8 +262,8 @@ }, "require-dev": { "mockery/mockery": "^0.9 || ^1.0", - "phpunit/phpunit": "^4.8.35 || ^5.7", - "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0", + "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0" }, "suggest": { "symfony/var-dumper": "Pretty print complex values better with var-dumper available", @@ -271,7 +272,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2-dev" + "dev-master": "2.6-dev" } }, "autoload": { @@ -300,14 +301,14 @@ "throwable", "whoops" ], - "time": "2018-10-23T09:00:00+00:00" + "time": "2020-06-14T09:00:00+00:00" }, { "name": "ghislainf/zf2-whoops", "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/ghislainf/zf2-whoops.git", + "url": "git@github.com:ghislainf/zf2-whoops.git", "reference": "2649cf7caf400409942ddc3f8fe15b89381fc74e" }, "dist": { @@ -416,16 +417,16 @@ }, { "name": "khanamiryan/qrcode-detector-decoder", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/khanamiryan/php-qrcode-detector-decoder.git", - "reference": "a75482d3bc804e3f6702332bfda6cccbb0dfaa76" + "reference": "89b57f2d9939dd57394b83f6ccbd3e1a74659e34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/khanamiryan/php-qrcode-detector-decoder/zipball/a75482d3bc804e3f6702332bfda6cccbb0dfaa76", - "reference": "a75482d3bc804e3f6702332bfda6cccbb0dfaa76", + "url": "https://api.github.com/repos/khanamiryan/php-qrcode-detector-decoder/zipball/89b57f2d9939dd57394b83f6ccbd3e1a74659e34", + "reference": "89b57f2d9939dd57394b83f6ccbd3e1a74659e34", "shasum": "" }, "require": { @@ -462,7 +463,7 @@ "qr", "zxing" ], - "time": "2018-04-26T11:41:33+00:00" + "time": "2020-04-19T16:18:51+00:00" }, { "name": "matthiasmullie/minify", @@ -526,16 +527,16 @@ }, { "name": "matthiasmullie/path-converter", - "version": "1.1.1", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/matthiasmullie/path-converter.git", - "reference": "3082a6838be02b930239a97d38b5c9da4d693aca" + "reference": "e7d13b2c7e2f2268e1424aaed02085518afa02d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/matthiasmullie/path-converter/zipball/3082a6838be02b930239a97d38b5c9da4d693aca", - "reference": "3082a6838be02b930239a97d38b5c9da4d693aca", + "url": "https://api.github.com/repos/matthiasmullie/path-converter/zipball/e7d13b2c7e2f2268e1424aaed02085518afa02d9", + "reference": "e7d13b2c7e2f2268e1424aaed02085518afa02d9", "shasum": "" }, "require": { @@ -571,23 +572,24 @@ "paths", "relative" ], - "time": "2018-02-02T11:30:10+00:00" + "time": "2019-02-05T23:41:09+00:00" }, { "name": "myclabs/php-enum", - "version": "1.6.2", + "version": "1.6.6", "source": { "type": "git", "url": "https://github.com/myclabs/php-enum.git", - "reference": "ca2f4090a7ecae6f0c67fc9bd07cfb51cdf04219" + "reference": "32c4202886c51fbe5cc3a7c34ec5c9a4a790345e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/php-enum/zipball/ca2f4090a7ecae6f0c67fc9bd07cfb51cdf04219", - "reference": "ca2f4090a7ecae6f0c67fc9bd07cfb51cdf04219", + "url": "https://api.github.com/repos/myclabs/php-enum/zipball/32c4202886c51fbe5cc3a7c34ec5c9a4a790345e", + "reference": "32c4202886c51fbe5cc3a7c34ec5c9a4a790345e", "shasum": "" }, "require": { + "ext-json": "*", "php": ">=5.4" }, "require-dev": { @@ -615,7 +617,7 @@ "keywords": [ "enum" ], - "time": "2018-08-01T21:05:54+00:00" + "time": "2019-02-04T21:18:49+00:00" }, { "name": "ocramius/package-versions", @@ -791,37 +793,34 @@ "php", "stylesheet" ], + "abandoned": true, "time": "2017-03-28T22:19:25+00:00" }, { "name": "paragonie/random_compat", - "version": "v2.0.17", + "version": "v9.99.99", "source": { "type": "git", "url": "https://github.com/paragonie/random_compat.git", - "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d" + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/29af24f25bab834fcbb38ad2a69fa93b867e070d", - "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", + "reference": "84b4dfb120c6f9b4ff7b3685f9b8f1aa365a0c95", "shasum": "" }, "require": { - "php": ">=5.2.0" + "php": "^7" }, "require-dev": { - "phpunit/phpunit": "4.*|5.*" + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" }, "suggest": { "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." }, "type": "library", - "autoload": { - "files": [ - "lib/random.php" - ] - }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" @@ -840,20 +839,20 @@ "pseudorandom", "random" ], - "time": "2018-07-04T16:31:37+00:00" + "time": "2018-07-02T15:55:56+00:00" }, { "name": "pear/archive_tar", - "version": "1.4.3", + "version": "1.4.10", "source": { "type": "git", "url": "https://github.com/pear/Archive_Tar.git", - "reference": "43455c960da70e655c6bdf8ea2bc8cc1a6034afb" + "reference": "bbb4f10f71a1da2715ec6d9a683f4f23c507a49b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/Archive_Tar/zipball/43455c960da70e655c6bdf8ea2bc8cc1a6034afb", - "reference": "43455c960da70e655c6bdf8ea2bc8cc1a6034afb", + "url": "https://api.github.com/repos/pear/Archive_Tar/zipball/bbb4f10f71a1da2715ec6d9a683f4f23c507a49b", + "reference": "bbb4f10f71a1da2715ec6d9a683f4f23c507a49b", "shasum": "" }, "require": { @@ -864,8 +863,8 @@ "phpunit/phpunit": "*" }, "suggest": { - "ext-bz2": "bz2 compression support.", - "ext-xz": "lzma2 compression support.", + "ext-bz2": "Bz2 compression support.", + "ext-xz": "Lzma2 compression support.", "ext-zlib": "Gzip compression support." }, "type": "library", @@ -900,26 +899,26 @@ "email": "mrook@php.net" } ], - "description": "Tar file management class", + "description": "Tar file management class with compression support (gzip, bzip2, lzma2)", "homepage": "https://github.com/pear/Archive_Tar", "keywords": [ "archive", "tar" ], - "time": "2017-06-11T17:28:11+00:00" + "time": "2020-09-15T14:13:23+00:00" }, { "name": "pear/console_getopt", - "version": "v1.4.1", + "version": "v1.4.3", "source": { "type": "git", "url": "https://github.com/pear/Console_Getopt.git", - "reference": "82f05cd1aa3edf34e19aa7c8ca312ce13a6a577f" + "reference": "a41f8d3e668987609178c7c4a9fe48fecac53fa0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/Console_Getopt/zipball/82f05cd1aa3edf34e19aa7c8ca312ce13a6a577f", - "reference": "82f05cd1aa3edf34e19aa7c8ca312ce13a6a577f", + "url": "https://api.github.com/repos/pear/Console_Getopt/zipball/a41f8d3e668987609178c7c4a9fe48fecac53fa0", + "reference": "a41f8d3e668987609178c7c4a9fe48fecac53fa0", "shasum": "" }, "type": "library", @@ -936,11 +935,6 @@ "BSD-2-Clause" ], "authors": [ - { - "name": "Greg Beaver", - "email": "cellog@php.net", - "role": "Helper" - }, { "name": "Andrei Zmievski", "email": "andrei@php.net", @@ -950,10 +944,15 @@ "name": "Stig Bakken", "email": "stig@php.net", "role": "Developer" + }, + { + "name": "Greg Beaver", + "email": "cellog@php.net", + "role": "Helper" } ], "description": "More info available on: http://pear.php.net/package/Console_Getopt", - "time": "2015-07-20T20:28:12+00:00" + "time": "2019-11-20T18:27:48+00:00" }, { "name": "pear/file_marc", @@ -1127,20 +1126,20 @@ }, { "name": "pear/pear-core-minimal", - "version": "v1.10.6", + "version": "v1.10.10", "source": { "type": "git", "url": "https://github.com/pear/pear-core-minimal.git", - "reference": "052868b244d31f822796e7e9981f62557eb256d4" + "reference": "625a3c429d9b2c1546438679074cac1b089116a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/052868b244d31f822796e7e9981f62557eb256d4", - "reference": "052868b244d31f822796e7e9981f62557eb256d4", + "url": "https://api.github.com/repos/pear/pear-core-minimal/zipball/625a3c429d9b2c1546438679074cac1b089116a7", + "reference": "625a3c429d9b2c1546438679074cac1b089116a7", "shasum": "" }, "require": { - "pear/console_getopt": "~1.3", + "pear/console_getopt": "~1.4", "pear/pear_exception": "~1.0" }, "replace": { @@ -1167,20 +1166,20 @@ } ], "description": "Minimal set of PEAR core files to be used as composer dependency", - "time": "2018-08-22T19:28:09+00:00" + "time": "2019-11-19T19:00:24+00:00" }, { "name": "pear/pear_exception", - "version": "v1.0.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/pear/PEAR_Exception.git", - "reference": "8c18719fdae000b690e3912be401c76e406dd13b" + "reference": "dbb42a5a0e45f3adcf99babfb2a1ba77b8ac36a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/PEAR_Exception/zipball/8c18719fdae000b690e3912be401c76e406dd13b", - "reference": "8c18719fdae000b690e3912be401c76e406dd13b", + "url": "https://api.github.com/repos/pear/PEAR_Exception/zipball/dbb42a5a0e45f3adcf99babfb2a1ba77b8ac36a7", + "reference": "dbb42a5a0e45f3adcf99babfb2a1ba77b8ac36a7", "shasum": "" }, "require": { @@ -1196,9 +1195,9 @@ } }, "autoload": { - "psr-0": { - "PEAR": "" - } + "classmap": [ + "PEAR/" + ] }, "notification-url": "https://packagist.org/downloads/", "include-path": [ @@ -1222,7 +1221,7 @@ "keywords": [ "exception" ], - "time": "2015-02-10T20:07:52+00:00" + "time": "2019-12-10T10:24:42+00:00" }, { "name": "pear/validate", @@ -1301,12 +1300,12 @@ "source": { "type": "git", "url": "https://github.com/pear/Validate_ISPN.git", - "reference": "9ea9312a0841b5d745742c737772aeffa6d06e96" + "reference": "9b06777cc7b6fea4d6d5c9469f21c4b029d58ab5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pear/Validate_ISPN/zipball/9ea9312a0841b5d745742c737772aeffa6d06e96", - "reference": "9ea9312a0841b5d745742c737772aeffa6d06e96", + "url": "https://api.github.com/repos/pear/Validate_ISPN/zipball/9b06777cc7b6fea4d6d5c9469f21c4b029d58ab5", + "reference": "9b06777cc7b6fea4d6d5c9469f21c4b029d58ab5", "shasum": "" }, "require": { @@ -1341,7 +1340,7 @@ } ], "description": "More info available on: http://pear.php.net/package/Validate_ISPN", - "time": "2015-04-14T04:17:31+00:00" + "time": "2020-04-19T19:25:23+00:00" }, { "name": "phing/phing", @@ -1602,16 +1601,16 @@ }, { "name": "psr/log", - "version": "1.0.2", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", "shasum": "" }, "require": { @@ -1620,7 +1619,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -1645,7 +1644,7 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2020-03-23T09:12:05+00:00" }, { "name": "psr/simple-cache", @@ -1695,6 +1694,51 @@ ], "time": "2017-10-23T01:57:42+00:00" }, + { + "name": "sabberworm/php-css-parser", + "version": "8.3.1", + "source": { + "type": "git", + "url": "https://github.com/sabberworm/PHP-CSS-Parser.git", + "reference": "d217848e1396ef962fb1997cf3e2421acba7f796" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/d217848e1396ef962fb1997cf3e2421acba7f796", + "reference": "d217848e1396ef962fb1997cf3e2421acba7f796", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "codacy/coverage": "^1.4", + "phpunit/phpunit": "~4.8" + }, + "type": "library", + "autoload": { + "psr-0": { + "Sabberworm\\CSS": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Raphael Schweikert" + } + ], + "description": "Parser for CSS Files written in PHP", + "homepage": "http://www.sabberworm.com/blog/2010/6/10/php-css-parser", + "keywords": [ + "css", + "parser", + "stylesheet" + ], + "time": "2020-06-01T09:10:00+00:00" + }, { "name": "serialssolutions/summon", "version": "v1.2.0", @@ -1771,16 +1815,16 @@ }, { "name": "symfony/inflector", - "version": "v3.4.17", + "version": "v3.4.44", "source": { "type": "git", "url": "https://github.com/symfony/inflector.git", - "reference": "129ac0c59e516f5fe210efe51a44f79ab9925c16" + "reference": "540e39d07cff9824eaf4fee2c9f489304e54d0c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/inflector/zipball/129ac0c59e516f5fe210efe51a44f79ab9925c16", - "reference": "129ac0c59e516f5fe210efe51a44f79ab9925c16", + "url": "https://api.github.com/repos/symfony/inflector/zipball/540e39d07cff9824eaf4fee2c9f489304e54d0c2", + "reference": "540e39d07cff9824eaf4fee2c9f489304e54d0c2", "shasum": "" }, "require": { @@ -1825,20 +1869,20 @@ "symfony", "words" ], - "time": "2018-07-26T08:45:46+00:00" + "time": "2020-05-04T07:08:14+00:00" }, { "name": "symfony/options-resolver", - "version": "v3.4.17", + "version": "v3.4.44", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "1cf7d8e704a9cc4164c92e430f2dfa3e6983661d" + "reference": "0edf31d2e34f4adb72dd4d2e4a8aa21f84b943e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/1cf7d8e704a9cc4164c92e430f2dfa3e6983661d", - "reference": "1cf7d8e704a9cc4164c92e430f2dfa3e6983661d", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/0edf31d2e34f4adb72dd4d2e4a8aa21f84b943e5", + "reference": "0edf31d2e34f4adb72dd4d2e4a8aa21f84b943e5", "shasum": "" }, "require": { @@ -1879,20 +1923,20 @@ "configuration", "options" ], - "time": "2018-09-17T17:29:18+00:00" + "time": "2020-07-08T17:07:26+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.9.0", + "version": "v1.18.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", "shasum": "" }, "require": { @@ -1904,7 +1948,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -1920,13 +1968,13 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - }, { "name": "Gert de Pagter", "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony polyfill for ctype functions", @@ -1937,20 +1985,20 @@ "polyfill", "portable" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/polyfill-php70", - "version": "v1.9.0", + "version": "v1.18.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934" + "reference": "0dd93f2c578bdc9c72697eaa5f1dd25644e618d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/1e24b0c4a56d55aaf368763a06c6d1c7d3194934", - "reference": "1e24b0c4a56d55aaf368763a06c6d1c7d3194934", + "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/0dd93f2c578bdc9c72697eaa5f1dd25644e618d3", + "reference": "0dd93f2c578bdc9c72697eaa5f1dd25644e618d3", "shasum": "" }, "require": { @@ -1960,7 +2008,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -1996,20 +2048,20 @@ "portable", "shim" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/property-access", - "version": "v3.4.17", + "version": "v3.4.44", "source": { "type": "git", "url": "https://github.com/symfony/property-access.git", - "reference": "a62b882330f24b43f4409e50a0692aa433947460" + "reference": "27360cd40ea1c22142575de949d17583b739a877" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/property-access/zipball/a62b882330f24b43f4409e50a0692aa433947460", - "reference": "a62b882330f24b43f4409e50a0692aa433947460", + "url": "https://api.github.com/repos/symfony/property-access/zipball/27360cd40ea1c22142575de949d17583b739a877", + "reference": "27360cd40ea1c22142575de949d17583b739a877", "shasum": "" }, "require": { @@ -2064,7 +2116,7 @@ "property path", "reflection" ], - "time": "2018-10-02T12:28:39+00:00" + "time": "2020-08-12T14:55:37+00:00" }, { "name": "symfony/yaml", @@ -2441,6 +2493,7 @@ "psr-6", "zf" ], + "abandoned": "laminas/laminas-cache", "time": "2018-05-01T21:58:00+00:00" }, { @@ -2499,6 +2552,7 @@ "captcha", "zf" ], + "abandoned": "laminas/laminas-captcha", "time": "2018-04-24T17:24:10+00:00" }, { @@ -2552,6 +2606,7 @@ "code", "zf2" ], + "abandoned": "laminas/laminas-code", "time": "2016-10-24T13:23:32+00:00" }, { @@ -2612,6 +2667,7 @@ "config", "zf" ], + "abandoned": "laminas/laminas-config", "time": "2018-04-24T19:26:44+00:00" }, { @@ -2665,6 +2721,7 @@ "console", "zf" ], + "abandoned": "laminas/laminas-console", "time": "2018-01-25T19:08:04+00:00" }, { @@ -2717,6 +2774,7 @@ "crypt", "zf" ], + "abandoned": "laminas/laminas-crypt", "time": "2018-04-24T22:01:58+00:00" }, { @@ -2775,6 +2833,7 @@ "db", "zf" ], + "abandoned": "laminas/laminas-db", "time": "2018-04-09T13:21:36+00:00" }, { @@ -2820,6 +2879,7 @@ "dom", "zf" ], + "abandoned": "laminas/laminas-dom", "time": "2018-04-09T20:18:00+00:00" }, { @@ -2865,6 +2925,7 @@ "escaper", "zf" ], + "abandoned": "laminas/laminas-escaper", "time": "2018-04-25T15:48:53+00:00" }, { @@ -2919,6 +2980,7 @@ "events", "zf2" ], + "abandoned": "laminas/laminas-eventmanager", "time": "2018-04-25T15:33:34+00:00" }, { @@ -2980,6 +3042,7 @@ "feed", "zf" ], + "abandoned": "laminas/laminas-feed", "time": "2018-08-01T13:53:20+00:00" }, { @@ -3043,6 +3106,7 @@ "filter", "zf" ], + "abandoned": "laminas/laminas-filter", "time": "2018-04-11T16:20:04+00:00" }, { @@ -3098,6 +3162,7 @@ "zend", "zf" ], + "abandoned": "laminas/laminas-http", "time": "2018-08-13T18:47:03+00:00" }, { @@ -3166,20 +3231,21 @@ "i18n", "zf" ], + "abandoned": "laminas/laminas-i18n", "time": "2018-05-16T16:39:13+00:00" }, { "name": "zendframework/zend-json", - "version": "3.1.0", + "version": "3.1.2", "source": { "type": "git", "url": "https://github.com/zendframework/zend-json.git", - "reference": "4dd940e8e6f32f1d36ea6b0677ea57c540c7c19c" + "reference": "e9ddb1192d93fe7fff846ac895249c39db75132b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-json/zipball/4dd940e8e6f32f1d36ea6b0677ea57c540c7c19c", - "reference": "4dd940e8e6f32f1d36ea6b0677ea57c540c7c19c", + "url": "https://api.github.com/repos/zendframework/zend-json/zipball/e9ddb1192d93fe7fff846ac895249c39db75132b", + "reference": "e9ddb1192d93fe7fff846ac895249c39db75132b", "shasum": "" }, "require": { @@ -3216,7 +3282,8 @@ "json", "zf" ], - "time": "2018-01-04T17:51:34+00:00" + "abandoned": "laminas/laminas-json", + "time": "2019-10-09T13:56:13+00:00" }, { "name": "zendframework/zend-loader", @@ -3261,6 +3328,7 @@ "loader", "zf" ], + "abandoned": "laminas/laminas-loader", "time": "2018-04-30T15:20:54+00:00" }, { @@ -3332,6 +3400,7 @@ "logging", "zf2" ], + "abandoned": "laminas/laminas-log", "time": "2018-04-09T21:59:51+00:00" }, { @@ -3394,25 +3463,26 @@ "mail", "zf2" ], + "abandoned": "laminas/laminas-mail", "time": "2017-06-08T20:03:58+00:00" }, { "name": "zendframework/zend-math", - "version": "3.1.1", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/zendframework/zend-math.git", - "reference": "0aa5ec1b3132dd7d749d4673d7bdc7ab6b2d202a" + "reference": "07e43d87fd5c7edc4f54121b9a4625eb10e4b726" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-math/zipball/0aa5ec1b3132dd7d749d4673d7bdc7ab6b2d202a", - "reference": "0aa5ec1b3132dd7d749d4673d7bdc7ab6b2d202a", + "url": "https://api.github.com/repos/zendframework/zend-math/zipball/07e43d87fd5c7edc4f54121b9a4625eb10e4b726", + "reference": "07e43d87fd5c7edc4f54121b9a4625eb10e4b726", "shasum": "" }, "require": { "ext-mbstring": "*", - "paragonie/random_compat": "^2.0.11", + "paragonie/random_compat": "^2.0.11 || 9.99.99", "php": "^5.6 || ^7.0" }, "require-dev": { @@ -3426,8 +3496,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev", - "dev-develop": "3.2.x-dev" + "dev-master": "3.2.x-dev", + "dev-develop": "3.3.x-dev" } }, "autoload": { @@ -3445,20 +3515,21 @@ "math", "zf" ], - "time": "2018-07-10T19:00:33+00:00" + "abandoned": "laminas/laminas-math", + "time": "2018-12-04T15:45:09+00:00" }, { "name": "zendframework/zend-mime", - "version": "2.7.1", + "version": "2.7.2", "source": { "type": "git", "url": "https://github.com/zendframework/zend-mime.git", - "reference": "52ae5fa9f12845cae749271034a2d594f0e4c6f2" + "reference": "c91e0350be53cc9d29be15563445eec3b269d7c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-mime/zipball/52ae5fa9f12845cae749271034a2d594f0e4c6f2", - "reference": "52ae5fa9f12845cae749271034a2d594f0e4c6f2", + "url": "https://api.github.com/repos/zendframework/zend-mime/zipball/c91e0350be53cc9d29be15563445eec3b269d7c1", + "reference": "c91e0350be53cc9d29be15563445eec3b269d7c1", "shasum": "" }, "require": { @@ -3476,8 +3547,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev", - "dev-develop": "2.8-dev" + "dev-master": "2.7.x-dev", + "dev-develop": "2.8.x-dev" } }, "autoload": { @@ -3490,13 +3561,13 @@ "BSD-3-Clause" ], "description": "Create and parse MIME messages and parts", - "homepage": "https://github.com/zendframework/zend-mime", "keywords": [ "ZendFramework", "mime", "zf" ], - "time": "2018-05-14T19:02:50+00:00" + "abandoned": "laminas/laminas-mime", + "time": "2019-10-16T19:30:37+00:00" }, { "name": "zendframework/zend-modulemanager", @@ -3556,6 +3627,7 @@ "modulemanager", "zf" ], + "abandoned": "laminas/laminas-modulemanager", "time": "2017-12-02T06:11:18+00:00" }, { @@ -3628,6 +3700,7 @@ "mvc", "zf" ], + "abandoned": "laminas/laminas-mvc", "time": "2017-11-24T06:32:07+00:00" }, { @@ -3694,6 +3767,7 @@ "mvc", "zf" ], + "abandoned": "laminas/laminas-mvc-console", "time": "2018-04-30T19:10:26+00:00" }, { @@ -3757,6 +3831,7 @@ "mvc", "zf" ], + "abandoned": "laminas/laminas-mvc-i18n", "time": "2018-05-01T15:48:40+00:00" }, { @@ -3813,6 +3888,7 @@ "mvc", "zf" ], + "abandoned": "laminas/laminas-mvc-plugin-flashmessenger", "time": "2018-04-30T18:47:56+00:00" }, { @@ -3878,20 +3954,21 @@ "paginator", "zf2" ], + "abandoned": "laminas/laminas-paginator", "time": "2018-01-30T15:52:44+00:00" }, { "name": "zendframework/zend-router", - "version": "3.2.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-router.git", - "reference": "a80a7427afb8f736b9aeeb341a78dae855849291" + "reference": "e2151a72e9d00b1962c26469bab50db66cf7ef14" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-router/zipball/a80a7427afb8f736b9aeeb341a78dae855849291", - "reference": "a80a7427afb8f736b9aeeb341a78dae855849291", + "url": "https://api.github.com/repos/zendframework/zend-router/zipball/e2151a72e9d00b1962c26469bab50db66cf7ef14", + "reference": "e2151a72e9d00b1962c26469bab50db66cf7ef14", "shasum": "" }, "require": { @@ -3940,7 +4017,8 @@ "zend", "zf" ], - "time": "2018-08-01T22:24:35+00:00" + "abandoned": "laminas/laminas-router", + "time": "2019-02-09T15:33:11+00:00" }, { "name": "zendframework/zend-serializer", @@ -3997,20 +4075,21 @@ "serializer", "zf" ], + "abandoned": "laminas/laminas-serializer", "time": "2018-05-14T18:45:18+00:00" }, { "name": "zendframework/zend-server", - "version": "2.8.0", + "version": "2.8.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-server.git", - "reference": "23a2e9a5599c83c05da831cb7c649e8a7809595e" + "reference": "d80c44700ebb92191dd9a3005316a6ab6637c0d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-server/zipball/23a2e9a5599c83c05da831cb7c649e8a7809595e", - "reference": "23a2e9a5599c83c05da831cb7c649e8a7809595e", + "url": "https://api.github.com/repos/zendframework/zend-server/zipball/d80c44700ebb92191dd9a3005316a6ab6637c0d1", + "reference": "d80c44700ebb92191dd9a3005316a6ab6637c0d1", "shasum": "" }, "require": { @@ -4044,7 +4123,8 @@ "server", "zf" ], - "time": "2018-04-30T22:21:28+00:00" + "abandoned": "laminas/laminas-server", + "time": "2019-10-16T18:27:05+00:00" }, { "name": "zendframework/zend-servicemanager", @@ -4112,6 +4192,7 @@ "servicemanager", "zf" ], + "abandoned": "laminas/laminas-servicemanager", "time": "2018-01-29T16:48:37+00:00" }, { @@ -4179,6 +4260,7 @@ "session", "zf" ], + "abandoned": "laminas/laminas-session", "time": "2018-02-22T16:33:54+00:00" }, { @@ -4232,6 +4314,7 @@ "soap", "zf2" ], + "abandoned": "laminas/laminas-soap", "time": "2018-01-29T17:51:26+00:00" }, { @@ -4278,6 +4361,7 @@ "stdlib", "zf" ], + "abandoned": "laminas/laminas-stdlib", "time": "2018-04-30T13:50:40+00:00" }, { @@ -4326,20 +4410,21 @@ "text", "zf" ], + "abandoned": "laminas/laminas-text", "time": "2018-04-30T14:55:10+00:00" }, { "name": "zendframework/zend-uri", - "version": "2.6.1", + "version": "2.7.1", "source": { "type": "git", "url": "https://github.com/zendframework/zend-uri.git", - "reference": "3b6463645c6766f78ce537c70cb4fdabee1e725f" + "reference": "bfc4a5b9a309711e968d7c72afae4ac50c650083" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-uri/zipball/3b6463645c6766f78ce537c70cb4fdabee1e725f", - "reference": "3b6463645c6766f78ce537c70cb4fdabee1e725f", + "url": "https://api.github.com/repos/zendframework/zend-uri/zipball/bfc4a5b9a309711e968d7c72afae4ac50c650083", + "reference": "bfc4a5b9a309711e968d7c72afae4ac50c650083", "shasum": "" }, "require": { @@ -4354,8 +4439,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.6.x-dev", - "dev-develop": "2.7.x-dev" + "dev-master": "2.7.x-dev", + "dev-develop": "2.8.x-dev" } }, "autoload": { @@ -4373,7 +4458,8 @@ "uri", "zf" ], - "time": "2018-04-30T13:40:08+00:00" + "abandoned": "laminas/laminas-uri", + "time": "2019-10-07T13:35:33+00:00" }, { "name": "zendframework/zend-validator", @@ -4444,6 +4530,7 @@ "validator", "zf2" ], + "abandoned": "laminas/laminas-validator", "time": "2018-02-01T17:05:33+00:00" }, { @@ -4531,6 +4618,7 @@ "view", "zf2" ], + "abandoned": "laminas/laminas-view", "time": "2018-01-17T22:21:50+00:00" }, { @@ -4568,6 +4656,7 @@ "rest", "zf2" ], + "abandoned": true, "time": "2014-03-05T22:32:09+00:00" }, { @@ -4627,6 +4716,7 @@ "sqs", "zf2" ], + "abandoned": "aws/aws-sdk-php", "time": "2017-06-22T01:59:37+00:00" }, { @@ -4679,20 +4769,21 @@ "recaptcha", "zf" ], + "abandoned": "laminas/laminas-recaptcha", "time": "2018-05-08T17:34:06+00:00" }, { "name": "zendframework/zendxml", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/zendframework/ZendXml.git", - "reference": "267db6a2c431a08a8f8ff0f1f4c302a5ba6f5b99" + "reference": "eceab37a591c9e140772a1470338258857339e00" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/ZendXml/zipball/267db6a2c431a08a8f8ff0f1f4c302a5ba6f5b99", - "reference": "267db6a2c431a08a8f8ff0f1f4c302a5ba6f5b99", + "url": "https://api.github.com/repos/zendframework/ZendXml/zipball/eceab37a591c9e140772a1470338258857339e00", + "reference": "eceab37a591c9e140772a1470338258857339e00", "shasum": "" }, "require": { @@ -4705,8 +4796,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev", - "dev-develop": "1.2.x-dev" + "dev-master": "1.2.x-dev", + "dev-develop": "1.3.x-dev" } }, "autoload": { @@ -4725,7 +4816,8 @@ "xml", "zf" ], - "time": "2018-04-30T15:11:04+00:00" + "abandoned": "laminas/laminas-xml", + "time": "2019-01-22T19:42:14+00:00" }, { "name": "zf-commons/zfc-rbac", @@ -4808,6 +4900,7 @@ "rbac", "zf2" ], + "abandoned": true, "time": "2017-05-07T08:45:27+00:00" }, { @@ -4983,24 +5076,23 @@ }, { "name": "composer/semver", - "version": "1.4.2", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573" + "reference": "114f819054a2ea7db03287f5efb757e2af6e4079" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573", - "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573", + "url": "https://api.github.com/repos/composer/semver/zipball/114f819054a2ea7db03287f5efb757e2af6e4079", + "reference": "114f819054a2ea7db03287f5efb757e2af6e4079", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.5 || ^5.0.5", - "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0" + "phpunit/phpunit": "^4.5 || ^5.0.5" }, "type": "library", "extra": { @@ -5041,7 +5133,7 @@ "validation", "versioning" ], - "time": "2016-08-30T16:08:34+00:00" + "time": "2020-09-09T09:34:06+00:00" }, { "name": "doctrine/annotations", @@ -5167,21 +5259,24 @@ }, { "name": "doctrine/lexer", - "version": "v1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/1febd6c3ef84253d7c815bed85fc622ad207a9f8", + "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8", "shasum": "" }, "require": { "php": ">=5.3.2" }, + "require-dev": { + "phpunit/phpunit": "^4.5" + }, "type": "library", "extra": { "branch-alias": { @@ -5189,8 +5284,8 @@ } }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Lexer\\": "lib/" + "psr-4": { + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" } }, "notification-url": "https://packagist.org/downloads/", @@ -5211,13 +5306,16 @@ "email": "schmittjoh@gmail.com" } ], - "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "http://www.doctrine-project.org", + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", "keywords": [ + "annotations", + "docblock", "lexer", - "parser" + "parser", + "php" ], - "time": "2014-09-09T13:34:57+00:00" + "time": "2019-06-08T11:03:04+00:00" }, { "name": "friendsofphp/php-cs-fixer", @@ -5315,16 +5413,16 @@ }, { "name": "instaclick/php-webdriver", - "version": "1.4.5", + "version": "1.4.7", "source": { "type": "git", "url": "https://github.com/instaclick/php-webdriver.git", - "reference": "6fa959452e774dcaed543faad3a9d1a37d803327" + "reference": "b5f330e900e9b3edfc18024a5ec8c07136075712" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/6fa959452e774dcaed543faad3a9d1a37d803327", - "reference": "6fa959452e774dcaed543faad3a9d1a37d803327", + "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/b5f330e900e9b3edfc18024a5ec8c07136075712", + "reference": "b5f330e900e9b3edfc18024a5ec8c07136075712", "shasum": "" }, "require": { @@ -5370,7 +5468,7 @@ "webdriver", "webtest" ], - "time": "2017-06-30T04:02:48+00:00" + "time": "2019-09-25T09:05:11+00:00" }, { "name": "myclabs/deep-copy", @@ -5419,32 +5517,39 @@ }, { "name": "pdepend/pdepend", - "version": "2.5.2", + "version": "2.8.0", "source": { "type": "git", "url": "https://github.com/pdepend/pdepend.git", - "reference": "9daf26d0368d4a12bed1cacae1a9f3a6f0adf239" + "reference": "c64472f8e76ca858c79ad9a4cf1e2734b3f8cc38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pdepend/pdepend/zipball/9daf26d0368d4a12bed1cacae1a9f3a6f0adf239", - "reference": "9daf26d0368d4a12bed1cacae1a9f3a6f0adf239", + "url": "https://api.github.com/repos/pdepend/pdepend/zipball/c64472f8e76ca858c79ad9a4cf1e2734b3f8cc38", + "reference": "c64472f8e76ca858c79ad9a4cf1e2734b3f8cc38", "shasum": "" }, "require": { "php": ">=5.3.7", - "symfony/config": "^2.3.0|^3|^4", - "symfony/dependency-injection": "^2.3.0|^3|^4", - "symfony/filesystem": "^2.3.0|^3|^4" + "symfony/config": "^2.3.0|^3|^4|^5", + "symfony/dependency-injection": "^2.3.0|^3|^4|^5", + "symfony/filesystem": "^2.3.0|^3|^4|^5" }, "require-dev": { - "phpunit/phpunit": "^4.8|^5.7", + "easy-doc/easy-doc": "0.0.0 || ^1.2.3", + "gregwar/rst": "^1.0", + "phpunit/phpunit": "^4.8.35|^5.7", "squizlabs/php_codesniffer": "^2.0.0" }, "bin": [ "src/bin/pdepend" ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, "autoload": { "psr-4": { "PDepend\\": "src/main/php/PDepend" @@ -5455,7 +5560,7 @@ "BSD-3-Clause" ], "description": "Official version of pdepend to be handled with Composer", - "time": "2017-12-13T13:21:38+00:00" + "time": "2020-06-20T10:53:13+00:00" }, { "name": "phar-io/manifest", @@ -5666,27 +5771,28 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.0", + "version": "4.3.4", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", - "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/da3fd972d6bafd628114f7e7e036f45944b62e9c", + "reference": "da3fd972d6bafd628114f7e7e036f45944b62e9c", "shasum": "" }, "require": { "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0", - "phpdocumentor/type-resolver": "^0.4.0", + "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", + "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", "webmozart/assert": "^1.0" }, "require-dev": { - "doctrine/instantiator": "~1.0.5", + "doctrine/instantiator": "^1.0.5", "mockery/mockery": "^1.0", + "phpdocumentor/type-resolver": "0.4.*", "phpunit/phpunit": "^6.4" }, "type": "library", @@ -5713,29 +5819,29 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2017-11-30T07:14:17+00:00" + "time": "2019-12-28T18:55:12+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "0.4.0", + "version": "0.5.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + "reference": "cf842904952e64e703800d094cdf34e715a8a3ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/cf842904952e64e703800d094cdf34e715a8a3ae", + "reference": "cf842904952e64e703800d094cdf34e715a8a3ae", "shasum": "" }, "require": { - "php": "^5.5 || ^7.0", + "php": "^7.0", "phpdocumentor/reflection-common": "^1.0" }, "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" }, "type": "library", "extra": { @@ -5745,9 +5851,7 @@ }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -5760,7 +5864,7 @@ "email": "me@mikevanriel.com" } ], - "time": "2017-07-14T14:27:02+00:00" + "time": "2017-12-30T13:23:38+00:00" }, { "name": "phploc/phploc", @@ -5879,38 +5983,38 @@ }, { "name": "phpspec/prophecy", - "version": "1.8.0", + "version": "v1.10.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" + "reference": "451c3cd1418cf640de218914901e51b064abb093" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", - "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", + "reference": "451c3cd1418cf640de218914901e51b064abb093", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", + "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" }, "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", + "phpspec/phpspec": "^2.5 || ^3.2", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8.x-dev" + "dev-master": "1.10.x-dev" } }, "autoload": { - "psr-0": { - "Prophecy\\": "src/" + "psr-4": { + "Prophecy\\": "src/Prophecy" } }, "notification-url": "https://packagist.org/downloads/", @@ -5938,7 +6042,7 @@ "spy", "stub" ], - "time": "2018-08-05T17:53:17+00:00" + "time": "2020-03-05T15:02:03+00:00" }, { "name": "phpunit/php-code-coverage", @@ -6330,6 +6434,7 @@ "mock", "xunit" ], + "abandoned": true, "time": "2018-08-09T05:50:03+00:00" }, { @@ -6545,16 +6650,16 @@ }, { "name": "sebastian/exporter", - "version": "3.1.0", + "version": "3.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", - "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/68609e1261d215ea5b21b7987539cbfbe156ec3e", + "reference": "68609e1261d215ea5b21b7987539cbfbe156ec3e", "shasum": "" }, "require": { @@ -6581,6 +6686,10 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" @@ -6589,17 +6698,13 @@ "name": "Volker Dusch", "email": "github@wallbash.com" }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, { "name": "Adam Harvey", "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" } ], "description": "Provides the functionality to export PHP variables for visualization", @@ -6608,7 +6713,7 @@ "export", "exporter" ], - "time": "2017-04-03T13:19:02+00:00" + "time": "2019-09-14T09:02:43+00:00" }, { "name": "sebastian/finder-facade", @@ -7033,16 +7138,16 @@ }, { "name": "symfony/config", - "version": "v3.4.17", + "version": "v3.4.44", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "e5389132dc6320682de3643091121c048ff796b3" + "reference": "801a3bbc17fb1ba44b0d7d41a6db7a0b74953595" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/e5389132dc6320682de3643091121c048ff796b3", - "reference": "e5389132dc6320682de3643091121c048ff796b3", + "url": "https://api.github.com/repos/symfony/config/zipball/801a3bbc17fb1ba44b0d7d41a6db7a0b74953595", + "reference": "801a3bbc17fb1ba44b0d7d41a6db7a0b74953595", "shasum": "" }, "require": { @@ -7093,20 +7198,20 @@ ], "description": "Symfony Config Component", "homepage": "https://symfony.com", - "time": "2018-09-08T13:15:14+00:00" + "time": "2020-08-10T07:13:15+00:00" }, { "name": "symfony/console", - "version": "v3.4.17", + "version": "v3.4.44", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b" + "reference": "71da881ad579f0cd66aef8677e4cf6217d8ecd0c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", - "reference": "3b2b415d4c48fbefca7dc742aa0a0171bfae4e0b", + "url": "https://api.github.com/repos/symfony/console/zipball/71da881ad579f0cd66aef8677e4cf6217d8ecd0c", + "reference": "71da881ad579f0cd66aef8677e4cf6217d8ecd0c", "shasum": "" }, "require": { @@ -7118,6 +7223,9 @@ "symfony/dependency-injection": "<3.4", "symfony/process": "<3.3" }, + "provide": { + "psr/log-implementation": "1.0" + }, "require-dev": { "psr/log": "~1.0", "symfony/config": "~3.3|~4.0", @@ -7127,7 +7235,7 @@ "symfony/process": "~3.3|~4.0" }, "suggest": { - "psr/log-implementation": "For using the console logger", + "psr/log": "For using the console logger", "symfony/event-dispatcher": "", "symfony/lock": "", "symfony/process": "" @@ -7162,20 +7270,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" + "time": "2020-08-09T08:16:57+00:00" }, { "name": "symfony/css-selector", - "version": "v3.4.17", + "version": "v3.4.44", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "3503415d4aafabc31cd08c3a4ebac7f43fde8feb" + "reference": "9ccf6e78077a3fc1596e6c7b5958008965a11518" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/3503415d4aafabc31cd08c3a4ebac7f43fde8feb", - "reference": "3503415d4aafabc31cd08c3a4ebac7f43fde8feb", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/9ccf6e78077a3fc1596e6c7b5958008965a11518", + "reference": "9ccf6e78077a3fc1596e6c7b5958008965a11518", "shasum": "" }, "require": { @@ -7200,14 +7308,14 @@ "MIT" ], "authors": [ - { - "name": "Jean-François Simon", - "email": "jeanfrancois.simon@sensiolabs.com" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" }, + { + "name": "Jean-François Simon", + "email": "jeanfrancois.simon@sensiolabs.com" + }, { "name": "Symfony Community", "homepage": "https://symfony.com/contributors" @@ -7215,20 +7323,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" + "time": "2020-03-16T08:31:04+00:00" }, { "name": "symfony/debug", - "version": "v3.4.17", + "version": "v3.4.44", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6" + "reference": "0893a0b07c499a1530614d65869ea6a7b1b8a164" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/0a612e9dfbd2ccce03eb174365f31ecdca930ff6", - "reference": "0a612e9dfbd2ccce03eb174365f31ecdca930ff6", + "url": "https://api.github.com/repos/symfony/debug/zipball/0893a0b07c499a1530614d65869ea6a7b1b8a164", + "reference": "0893a0b07c499a1530614d65869ea6a7b1b8a164", "shasum": "" }, "require": { @@ -7271,20 +7379,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" + "time": "2020-08-09T08:13:48+00:00" }, { "name": "symfony/dependency-injection", - "version": "v3.4.17", + "version": "v3.4.44", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "aea20fef4e92396928b5db175788b90234c0270d" + "reference": "7d15cf4294d4f3610bc741c8fdd54a6baac586d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/aea20fef4e92396928b5db175788b90234c0270d", - "reference": "aea20fef4e92396928b5db175788b90234c0270d", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/7d15cf4294d4f3610bc741c8fdd54a6baac586d4", + "reference": "7d15cf4294d4f3610bc741c8fdd54a6baac586d4", "shasum": "" }, "require": { @@ -7342,20 +7450,20 @@ ], "description": "Symfony DependencyInjection Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2020-08-10T07:13:15+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.4.17", + "version": "v3.4.44", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb" + "reference": "a0f6858fbf7a524747e87a4c336cab7d0b67c802" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", - "reference": "b2e1f19280c09a42dc64c0b72b80fe44dd6e88fb", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a0f6858fbf7a524747e87a4c336cab7d0b67c802", + "reference": "a0f6858fbf7a524747e87a4c336cab7d0b67c802", "shasum": "" }, "require": { @@ -7405,20 +7513,20 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-07-26T09:06:28+00:00" + "time": "2020-08-12T14:55:37+00:00" }, { "name": "symfony/filesystem", - "version": "v3.4.17", + "version": "v3.4.44", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "d69930fc337d767607267d57c20a7403d0a822a4" + "reference": "8e6eff546d0fe879996fa701ee2f312767e95e50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/d69930fc337d767607267d57c20a7403d0a822a4", - "reference": "d69930fc337d767607267d57c20a7403d0a822a4", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/8e6eff546d0fe879996fa701ee2f312767e95e50", + "reference": "8e6eff546d0fe879996fa701ee2f312767e95e50", "shasum": "" }, "require": { @@ -7455,20 +7563,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2020-08-21T12:53:49+00:00" }, { "name": "symfony/finder", - "version": "v3.4.17", + "version": "v3.4.44", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d" + "reference": "5ec813ccafa8164ef21757e8c725d3a57da59200" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/54ba444dddc5bd5708a34bd095ea67c6eb54644d", - "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d", + "url": "https://api.github.com/repos/symfony/finder/zipball/5ec813ccafa8164ef21757e8c725d3a57da59200", + "reference": "5ec813ccafa8164ef21757e8c725d3a57da59200", "shasum": "" }, "require": { @@ -7504,20 +7612,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-10-03T08:46:40+00:00" + "time": "2020-02-14T07:34:21+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.9.0", + "version": "v1.18.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8" + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d0cd638f4634c16d8df4508e847f14e9e43168b8", - "reference": "d0cd638f4634c16d8df4508e847f14e9e43168b8", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", "shasum": "" }, "require": { @@ -7529,7 +7637,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -7563,20 +7675,20 @@ "portable", "shim" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/polyfill-php72", - "version": "v1.9.0", + "version": "v1.18.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "95c50420b0baed23852452a7f0c7b527303ed5ae" + "reference": "639447d008615574653fb3bc60d1986d7172eaae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/95c50420b0baed23852452a7f0c7b527303ed5ae", - "reference": "95c50420b0baed23852452a7f0c7b527303ed5ae", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/639447d008615574653fb3bc60d1986d7172eaae", + "reference": "639447d008615574653fb3bc60d1986d7172eaae", "shasum": "" }, "require": { @@ -7585,7 +7697,11 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -7618,20 +7734,20 @@ "portable", "shim" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2020-07-14T12:35:20+00:00" }, { "name": "symfony/process", - "version": "v3.4.17", + "version": "v3.4.44", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e" + "reference": "af8d812d75fcdf2eae30928b42396fe17df137e4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/1dc2977afa7d70f90f3fefbcd84152813558910e", - "reference": "1dc2977afa7d70f90f3fefbcd84152813558910e", + "url": "https://api.github.com/repos/symfony/process/zipball/af8d812d75fcdf2eae30928b42396fe17df137e4", + "reference": "af8d812d75fcdf2eae30928b42396fe17df137e4", "shasum": "" }, "require": { @@ -7667,20 +7783,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2020-07-16T09:41:49+00:00" }, { "name": "symfony/stopwatch", - "version": "v3.4.17", + "version": "v3.4.44", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "05e52a39de52ba690aebaed462b2bc8a9649f0a4" + "reference": "a7a98f40dcc382a332c3729a6d04b298ffbb8f1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/05e52a39de52ba690aebaed462b2bc8a9649f0a4", - "reference": "05e52a39de52ba690aebaed462b2bc8a9649f0a4", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/a7a98f40dcc382a332c3729a6d04b298ffbb8f1f", + "reference": "a7a98f40dcc382a332c3729a6d04b298ffbb8f1f", "shasum": "" }, "require": { @@ -7716,7 +7832,7 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2018-10-02T12:28:39+00:00" + "time": "2020-03-15T09:38:08+00:00" }, { "name": "theseer/fdomdocument", @@ -7760,16 +7876,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.1.0", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", - "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/11336f6f84e16a720dae9d8e6ed5019efa85a0f9", + "reference": "11336f6f84e16a720dae9d8e6ed5019efa85a0f9", "shasum": "" }, "require": { @@ -7796,35 +7912,34 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "time": "2017-04-07T12:08:54+00:00" + "time": "2019-06-13T22:48:21+00:00" }, { "name": "webmozart/assert", - "version": "1.3.0", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "url": "https://api.github.com/repos/webmozart/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.3.3 || ^7.0 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<3.9.1" }, "require-dev": { - "phpunit/phpunit": "^4.6", - "sebastian/version": "^1.0.1" + "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -7846,7 +7961,7 @@ "check", "validate" ], - "time": "2018-01-29T19:49:41+00:00" + "time": "2020-07-08T17:02:28+00:00" } ], "aliases": [], From 3562efe297e81aa348fb7c47f3ac0969f59def69 Mon Sep 17 00:00:00 2001 From: Hajo Seng Date: Mon, 21 Sep 2020 15:39:35 +0200 Subject: [PATCH 39/44] Bugfix for batch-retrievals of records: limit of number of retrieved records is set by configuration --- config/vufind/config.ini | 6 +- .../Factory/SolrDefaultBackendFactory.php | 2 +- module/LimitBatch/Module.php | 74 ++++++++++++++ module/LimitBatch/config/.keep | 0 .../src/LimitBatch/Backend/Solr/Backend.php | 96 +++++++++++++++++++ .../Factory/AbstractSolrBackendFactory.php | 65 +++++++++++++ .../Factory/SolrDefaultBackendFactory.php | 85 ++++++++++++++++ .../Factory/SolrDefaultBackendFactory.php | 4 +- .../Factory/SolrDefaultBackendFactory.php | 2 +- 9 files changed, 327 insertions(+), 7 deletions(-) create mode 100644 module/LimitBatch/Module.php create mode 100644 module/LimitBatch/config/.keep create mode 100644 module/LimitBatch/src/LimitBatch/Backend/Solr/Backend.php create mode 100644 module/LimitBatch/src/LimitBatch/Search/Factory/AbstractSolrBackendFactory.php create mode 100644 module/LimitBatch/src/LimitBatch/Search/Factory/SolrDefaultBackendFactory.php diff --git a/config/vufind/config.ini b/config/vufind/config.ini index 2d6c83fa6c..0d7cb34737 100644 --- a/config/vufind/config.ini +++ b/config/vufind/config.ini @@ -461,9 +461,9 @@ default_dismax_handler = dismax ; This is the number of records to retrieve in a batch e.g. when building a record ; hierarchy. A higher number results in fewer round-trips but may increase Solr's ; memory usage. Default is 1000. -;cursor_batch_size = 1000 - - +;cursor_batch_size = 1000a +; Limit of records per query if it's a batch query +limit_batch_per_query = 40 ; Enable/Disable searching reserves using the "reserves" Solr core. When enabling ; this feature, you need to run the util/index_reserves.php script to populate the ; new index. diff --git a/module/DismaxMunge/src/DismaxMunge/Search/Factory/SolrDefaultBackendFactory.php b/module/DismaxMunge/src/DismaxMunge/Search/Factory/SolrDefaultBackendFactory.php index c25983ffc7..46135bf3e4 100644 --- a/module/DismaxMunge/src/DismaxMunge/Search/Factory/SolrDefaultBackendFactory.php +++ b/module/DismaxMunge/src/DismaxMunge/Search/Factory/SolrDefaultBackendFactory.php @@ -30,7 +30,7 @@ use VuFindSearch\Backend\Solr\LuceneSyntaxHelper; use DismaxMunge\Backend\Solr\QueryBuilder; -use VuFind\Search\Factory\SolrDefaultBackendFactory as BackendFactory; +use LimitBatch\Search\Factory\SolrDefaultBackendFactory as BackendFactory; /** * Factory for the default SOLR backend. diff --git a/module/LimitBatch/Module.php b/module/LimitBatch/Module.php new file mode 100644 index 0000000000..ef6d841a62 --- /dev/null +++ b/module/LimitBatch/Module.php @@ -0,0 +1,74 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org + */ +namespace LimitBatch; + +/** + * ZF2 module definition for the VF2 search service. + * + * PHP version 7 + * + * Copyright (C) Villanova University 2010. + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * @category VuFind + * @package Search + * @author David Maus + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org + */ +class Module +{ + /** + * Return autoloader configuration. + * + * @return array + */ + public function getAutoloaderConfig() + { + return [ + 'Zend\Loader\StandardAutoloader' => [ + 'namespaces' => [ + __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, + ], + ], + ]; + } +} diff --git a/module/LimitBatch/config/.keep b/module/LimitBatch/config/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/module/LimitBatch/src/LimitBatch/Backend/Solr/Backend.php b/module/LimitBatch/src/LimitBatch/Backend/Solr/Backend.php new file mode 100644 index 0000000000..7846ea6205 --- /dev/null +++ b/module/LimitBatch/src/LimitBatch/Backend/Solr/Backend.php @@ -0,0 +1,96 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org + */ +namespace LimitBatch\Backend\Solr; + +use VuFindSearch\Backend\Solr\Backend as BackendBase; +use VuFindSearch\ParamBag; + +/** + * SOLR backend. + * + * @category VuFind + * @package Search + * @author David Maus + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org + */ +class Backend extends BackendBase +{ + /** + * Maximum number of records for a batch query. + * + * @var pageSize + */ + protected $pageSize = 100; + + public function setPageSize($pageSize) + { + $this->pageSize = $pageSize; + } + + /** + * Retrieve a batch of documents. + * + * @param array $ids Array of document identifiers + * @param ParamBag $params Search backend parameters + * + * @return RecordCollectionInterface + */ + public function retrieveBatch($ids, ParamBag $params = null) + { + $params = $params ?: new ParamBag(); + + // Callback function for formatting IDs: + $formatIds = function ($i) { + return '"' . addcslashes($i, '"') . '"'; + }; + + // Retrieve records a page at a time: + $results = false; + while (count($ids) > 0) { + $currentPage = array_splice($ids, 0, $this->pageSize, []); + $currentPage = array_map($formatIds, $currentPage); + $params->set('q', 'id:(' . implode(' OR ', $currentPage) . ')'); + $params->set('start', 0); + $params->set('rows', $this->pageSize); + $this->injectResponseWriter($params); + $next = $this->createRecordCollection( + $this->connector->search($params) + ); + if (!$results) { + $results = $next; + } else { + foreach ($next->getRecords() as $record) { + $results->add($record); + } + } + } + $this->injectSourceIdentifier($results); + return $results; + } +} diff --git a/module/LimitBatch/src/LimitBatch/Search/Factory/AbstractSolrBackendFactory.php b/module/LimitBatch/src/LimitBatch/Search/Factory/AbstractSolrBackendFactory.php new file mode 100644 index 0000000000..ac13a288cf --- /dev/null +++ b/module/LimitBatch/src/LimitBatch/Search/Factory/AbstractSolrBackendFactory.php @@ -0,0 +1,65 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Site + */ +namespace LimitBatch\Search\Factory; + +use VuFind\Search\Factory\AbstractSolrBackendFactory as BackendFactory; +use LimitBatch\Backend\Solr\Backend; +use VuFindSearch\Backend\Solr\Connector; + +/** + * Abstract factory for SOLR backends. + * + * @category VuFind + * @package Search + * @author David Maus + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Site + */ +abstract class AbstractSolrBackendFactory extends BackendFactory +{ + /** + * Create the SOLR backend. + * + * @param Connector $connector Connector + * + * @return Backend + */ + protected function createBackend(Connector $connector) + { + $config = $this->config->get($this->mainConfig); + $backend = new Backend($connector); + $backend->setPageSize($config['Index']['limit_batch_per_query']); + $backend->setQueryBuilder($this->createQueryBuilder()); + $backend->setSimilarBuilder($this->createSimilarBuilder()); + if ($this->logger) { + $backend->setLogger($this->logger); + } + return $backend; + } +} diff --git a/module/LimitBatch/src/LimitBatch/Search/Factory/SolrDefaultBackendFactory.php b/module/LimitBatch/src/LimitBatch/Search/Factory/SolrDefaultBackendFactory.php new file mode 100644 index 0000000000..e58f6474fa --- /dev/null +++ b/module/LimitBatch/src/LimitBatch/Search/Factory/SolrDefaultBackendFactory.php @@ -0,0 +1,85 @@ + + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Site + */ +namespace LimitBatch\Search\Factory; + +use LimitBatch\Backend\Solr\Backend; +use VuFindSearch\Backend\Solr\Connector; +use VuFindSearch\Backend\Solr\Response\Json\RecordCollectionFactory; + + +/** + * Factory for the default SOLR backend. + * + * @category VuFind + * @package Search + * @author David Maus + * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License + * @link https://vufind.org Main Site + */ +class SolrDefaultBackendFactory extends AbstractSolrBackendFactory +{ + /** + * Constructor + */ + public function __construct() + { + parent::__construct(); + $this->searchConfig = 'searches'; + $this->searchYaml = 'searchspecs.yaml'; + $this->facetConfig = 'facets'; + } + + /** + * Get the Solr core. + * + * @return string + */ + protected function getSolrCore() + { + $config = $this->config->get($this->mainConfig); + return isset($config->Index->default_core) + ? $config->Index->default_core : 'biblio'; + } + + /** + * Create the SOLR backend. + * + * @param Connector $connector Connector + * + * @return Backend + */ + protected function createBackend(Connector $connector) + { + $backend = parent::createBackend($connector); + $manager = $this->serviceLocator->get('VuFind\RecordDriver\PluginManager'); + $factory = new RecordCollectionFactory([$manager, 'getSolrRecord']); + $backend->setRecordCollectionFactory($factory); + return $backend; + } +} diff --git a/module/RecordDriver/src/RecordDriver/Search/Factory/SolrDefaultBackendFactory.php b/module/RecordDriver/src/RecordDriver/Search/Factory/SolrDefaultBackendFactory.php index d650187db8..3e04059301 100644 --- a/module/RecordDriver/src/RecordDriver/Search/Factory/SolrDefaultBackendFactory.php +++ b/module/RecordDriver/src/RecordDriver/Search/Factory/SolrDefaultBackendFactory.php @@ -31,8 +31,8 @@ use VuFindSearch\Backend\Solr\Backend; use VuFindSearch\Backend\Solr\Connector; use VuFindSearch\Backend\Solr\Response\Json\RecordCollectionFactory; -use VuFind\Search\Factory\AbstractSolrBackendFactory; -use DismaxMunge\Search\Factory\SolrDefaultBackendFactory as BackendFactory; +use LimitBatch\Search\Factory\AbstractSolrBackendFactory; +use LuceneHelper\Search\Factory\SolrDefaultBackendFactory as BackendFactory; /** * Factory for the default SOLR backend. diff --git a/module/RelevancePicker/src/RelevancePicker/Search/Factory/SolrDefaultBackendFactory.php b/module/RelevancePicker/src/RelevancePicker/Search/Factory/SolrDefaultBackendFactory.php index 09c5417691..67424a6c2e 100644 --- a/module/RelevancePicker/src/RelevancePicker/Search/Factory/SolrDefaultBackendFactory.php +++ b/module/RelevancePicker/src/RelevancePicker/Search/Factory/SolrDefaultBackendFactory.php @@ -30,7 +30,7 @@ use RelevancePicker\Backend\Solr\Response\Json\RecordCollectionFactory; use Libraries\Backend\Solr\Connector; use Libraries\Search\Factory\SolrDefaultBackendFactory as BackendFactory; -use VuFind\Search\Factory\AbstractSolrBackendFactory; +use LimitBatch\Search\Factory\AbstractSolrBackendFactory; class SolrDefaultBackendFactory extends BackendFactory { From 4c6fb7c43249c933fae3c2ab2f0bdd3c61cf7502 Mon Sep 17 00:00:00 2001 From: Hajo Seng Date: Mon, 21 Sep 2020 16:04:32 +0200 Subject: [PATCH 40/44] Korrektur Typo in der config.ini --- config/vufind/config.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/vufind/config.ini b/config/vufind/config.ini index 0d7cb34737..285fbb83cc 100644 --- a/config/vufind/config.ini +++ b/config/vufind/config.ini @@ -461,7 +461,7 @@ default_dismax_handler = dismax ; This is the number of records to retrieve in a batch e.g. when building a record ; hierarchy. A higher number results in fewer round-trips but may increase Solr's ; memory usage. Default is 1000. -;cursor_batch_size = 1000a +;cursor_batch_size = 1000 ; Limit of records per query if it's a batch query limit_batch_per_query = 40 ; Enable/Disable searching reserves using the "reserves" Solr core. When enabling From dbeafd45151a35bc0bb9a0793b60c8e14238d3c5 Mon Sep 17 00:00:00 2001 From: Kristof Kessler Date: Fri, 25 Sep 2020 10:40:19 +0200 Subject: [PATCH 41/44] Der Printbestand aus JOP wird nun ausgegeben --- .../src/DAIAplus/AjaxHandler/GetArticleStatuses.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php b/module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php index 86327f6304..fe267320db 100644 --- a/module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php +++ b/module/DAIAplus/src/DAIAplus/AjaxHandler/GetArticleStatuses.php @@ -257,7 +257,8 @@ private function prepareData($rawData, $list) { 'href' => $urlAccess, 'level' => $rawData['list']['url_access_level'], 'label' => $this->translate($label), - 'doi' => $rawData['list']['doi'] + 'doi' => $rawData['list']['doi'], + 'holdings' => $rawData['list']['holdings'] ]; } else { if (empty($rawData['list']['url_access'])) { @@ -277,7 +278,8 @@ private function prepareData($rawData, $list) { 'level' => $item['url_access_level'], 'label' => $this->translate($label, [], $label), 'notification' => $item['access_notification'], - 'doi' => $item['doi'] + 'doi' => $item['doi'], + 'holdings' => $item['holdings'] ]; } } From aa62685e73a020ffe066a78c93ea07473262e338 Mon Sep 17 00:00:00 2001 From: Johannes Schultze Date: Fri, 25 Sep 2020 14:02:35 +0200 Subject: [PATCH 42/44] Removed beluga modules from /config/application.config.php. --- config/application.config.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/config/application.config.php b/config/application.config.php index e928b664d3..d0b3d77b57 100644 --- a/config/application.config.php +++ b/config/application.config.php @@ -4,8 +4,6 @@ $modules = [ 'Zend\Router', 'ZfcRbac', 'VuFindTheme', 'VuFindSearch', 'VuFind', 'VuFindAdmin', 'VuFindApi', - #'DismaxMunge', 'RecordDriver', 'SearchKeys', 'DependentWorks', 'Libraries', 'Delivery', 'ExtendedFacets', 'BelugaConfig', 'DAIAplus', 'PAIA', 'LMS', 'RVK', - 'DismaxMunge', 'RecordDriver', 'SearchKeys', 'DependentWorks', 'Libraries', 'Delivery', 'ExtendedFacets', 'BelugaConfig', 'DAIAplus', 'PAIA', 'RVK', ]; if (PHP_SAPI == 'cli' && !defined('VUFIND_PHPUNIT_RUNNING')) { $modules[] = 'Zend\Mvc\Console'; From c019045ea5e30580ac33d3d5b13b99dced51eeec Mon Sep 17 00:00:00 2001 From: Hajo Seng Date: Mon, 28 Sep 2020 07:42:30 +0200 Subject: [PATCH 43/44] Korrektur: Ableitung von VuFind\Search\.. nicht von LuceneHelper\Search\... --- .../RecordDriver/Search/Factory/SolrDefaultBackendFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/RecordDriver/src/RecordDriver/Search/Factory/SolrDefaultBackendFactory.php b/module/RecordDriver/src/RecordDriver/Search/Factory/SolrDefaultBackendFactory.php index 3e04059301..101dba38f0 100644 --- a/module/RecordDriver/src/RecordDriver/Search/Factory/SolrDefaultBackendFactory.php +++ b/module/RecordDriver/src/RecordDriver/Search/Factory/SolrDefaultBackendFactory.php @@ -31,8 +31,8 @@ use VuFindSearch\Backend\Solr\Backend; use VuFindSearch\Backend\Solr\Connector; use VuFindSearch\Backend\Solr\Response\Json\RecordCollectionFactory; +use VuFind\Search\Factory\SolrDefaultBackendFactory as BackendFactory; use LimitBatch\Search\Factory\AbstractSolrBackendFactory; -use LuceneHelper\Search\Factory\SolrDefaultBackendFactory as BackendFactory; /** * Factory for the default SOLR backend. From bac1ca319ec57e9b464be5e3351964122822528b Mon Sep 17 00:00:00 2001 From: Hajo Seng Date: Mon, 28 Sep 2020 14:05:16 +0200 Subject: [PATCH 44/44] Korrektur Fehler im Methodenstack (der Aufruf muss sich auf parent beziehen) --- .../Search/Factory/SolrDefaultBackendFactory.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/module/RecordDriver/src/RecordDriver/Search/Factory/SolrDefaultBackendFactory.php b/module/RecordDriver/src/RecordDriver/Search/Factory/SolrDefaultBackendFactory.php index 101dba38f0..f8f4535fe3 100644 --- a/module/RecordDriver/src/RecordDriver/Search/Factory/SolrDefaultBackendFactory.php +++ b/module/RecordDriver/src/RecordDriver/Search/Factory/SolrDefaultBackendFactory.php @@ -31,8 +31,7 @@ use VuFindSearch\Backend\Solr\Backend; use VuFindSearch\Backend\Solr\Connector; use VuFindSearch\Backend\Solr\Response\Json\RecordCollectionFactory; -use VuFind\Search\Factory\SolrDefaultBackendFactory as BackendFactory; -use LimitBatch\Search\Factory\AbstractSolrBackendFactory; +use LimitBatch\Search\Factory\SolrDefaultBackendFactory as BackendFactory; /** * Factory for the default SOLR backend. @@ -55,7 +54,7 @@ class SolrDefaultBackendFactory extends BackendFactory */ protected function createBackend(Connector $connector) { - $backend = AbstractSolrBackendFactory::createBackend($connector); + $backend = parent::createBackend($connector); $manager = $this->serviceLocator->get('RecordDriver\RecordDriver\PluginManager'); $factory = new RecordCollectionFactory([$manager, 'getSolrRecord']); $backend->setRecordCollectionFactory($factory);