Commit 28d7455b authored by Ghislain Loas's avatar Ghislain Loas

Merge branch 'origin-master' into origin-dev#75244_connecteur_les_yeux_du_doc_les_yeux_du_doc

Conflicts:
	library/Class/DigitalResource/Config.php
parents 97586890 924fe6b0
- ticket #73297 : Assimil : Prise en charge de la nouvelle version (v2)
\ No newline at end of file
- ticket #75606 : Cnil : amélioration de l'affichage du consetement CNIL.
\ No newline at end of file
......@@ -163,7 +163,7 @@ class Admin_HarvestController extends ZendAfi_Controller_Action {
return;
$service = new Class_WebService_BibNumerique_Orphea();
$response = $service->harvestPage($this->_getParam('unid'),
$response = $service->harvestOrpheaPage($this->_getParam('unid'),
$this->_getParam('page', 1), $this->_getParam('total_count'));
echo json_encode($response);
}
......
......@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
//include_once(ROOT_PATH.'library/BookGluttonEpub/BookGluttonEpub.php');
class ParseEpubController extends Zend_Controller_Action {
......@@ -26,7 +26,8 @@ class ParseEpubController extends Zend_Controller_Action {
$url =$this->view->url();
$filepath=substr($url,strpos($url,'/file')+6);
if (substr($filepath,-1)=='/')
$filepath=substr($filepath,0,-1;)
$filepath=substr($filepath,0,-1);
return $filepath;
}
......@@ -51,7 +52,7 @@ class ParseEpubController extends Zend_Controller_Action {
// on va devoir modifier les entetes HTTP
$response = Zend_Controller_Front::getInstance()->getResponse();
$response->canSendHeaders(true);
$ext = explode('.', $filepath);
$ext = end($ext);
......@@ -60,12 +61,12 @@ class ParseEpubController extends Zend_Controller_Action {
$fileInfos['size'] = sizeof($content);
$parts = pathinfo($filepath);
if (strlen($content)>0) {
$this->getResponse()->setHeader('Content-Type',$mime);
}
else {
}
$this->getResponse()->setBody($content);
}
......
<?php
/**
* Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved.
*
* AFI-OPAC 2.0 is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* AFI-OPAC 2.0 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 AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with AFI-OPAC 2.0; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Rest_IndexController extends Restful_Controller {
public function catalogAction() {
parent::catalogAction();
$this->_helper->getHelper('ViewRenderer')->setNoRender();
$this->_response->setBody($this->view->catalog());
}
}
?>
\ No newline at end of file
<?php
(new Class_Migration_DigitalResource_Assimil)->migrateToV2();
\ No newline at end of file
......@@ -1295,10 +1295,6 @@ class Class_Album extends Storm_Model_Abstract {
}
/**
* Return arteVOD trailer video list
* @return array
*/
public function getTrailers() {
$trailers = [];
$trailers_url = $this->getUnimarc856Values('trailer');
......@@ -1308,10 +1304,6 @@ class Class_Album extends Storm_Model_Abstract {
}
/**
* Return arteVOD poster url
* @return string
*/
public function getPoster() {
if (!$posters_url = $this->getUnimarc856Values('poster'))
return '';
......
......@@ -16,19 +16,19 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_Autocomplete_IndexNull extends Class_Autocomplete_Index {
public function index($params) {
public function index($params=[]) {
return;
}
public function indexPage($done) {
$response->done = 0;
$response->total= 0;
return $response;
return $response;
}
}
?>
\ No newline at end of file
......@@ -65,7 +65,10 @@ class Class_Cnil {
'action' => 'cookies']);
Class_ScriptLoader::getInstance()
->notify($this->_('En poursuivant votre navigation sur ce site, vous acceptez l\'utilisation de cookies. <a href="'.$read_more.'">En savoir plus</a>'),
false);
false,
10,
'cnil_consent'
);
}
......
......@@ -22,6 +22,53 @@
class Class_Migration_DigitalResource_Assimil extends Class_Migration_DigitalResource_Abstract {
public function migrateToV2() {
Class_AdminVar::init();
if(!$this->_getConfig()->isEnabled())
return $this;
Class_AdminVar::set($this->_getConfig()->withNameSpace('SSO_URL'), 'https://biblio.assimil.online/assimilweb');
$this->_upgradeAlbums();
return $this;
}
protected function _upgradeAlbums() {
$xml = (new Class_WebService_Abstract)->httpGet($this->_getConfig()->getAdminVar('HARVEST_URL'));
$catalog = new SimpleXMLElement($xml);
$map = [];
foreach($catalog->item as $item)
$map[(string) $item->Identifier] = (string) $item->PrimaryDocUrl;
foreach(Class_Album::findAllBy(['type_doc_id' => $this->_getConfig()->getDocType()]) as $album)
$this->_upgradeAlbum($album, $map);
return $this;
}
protected function _upgradeAlbum($album, $map) {
$id_origine = $album->getIdOrigine();
if(!array_key_exists($id_origine, $map))
return $this;
$url = $map[$id_origine];
$album->getMarc()->clearZone('856');
$album
->setExternalUri($url)
->setUrlOrigine($url)
->addPosterURI(sprintf('https://biblio.assimil.online/extraits/facing/%s_TL.jpg',
$id_origine))
->save();
}
protected function _getOldRightToken() {
return 30;
}
......
......@@ -24,9 +24,9 @@ class Class_WebService_Analytics_GoogleTracker extends Class_WebService_Analyti
public function __construct($config) {
require_once('php-ga-1.1.1/src/autoload.php');
$this->_tracker = new UnitedPrototype\GoogleAnalytics\Tracker($config->getTrackerid(),
$config->getDomainName(),
new UnitedPrototype\GoogleAnalytics\Config(['fireAndForget' => true]));
$this->_tracker = new UnitedPrototype\GoogleAnalytics\Tracker($config->getTrackerid(),
$config->getDomainName(),
new UnitedPrototype\GoogleAnalytics\Config(['fireAndForget' => true]));
}
......@@ -41,13 +41,12 @@ class Class_WebService_Analytics_GoogleTracker extends Class_WebService_Analyti
public function trackEvent($category, $action, $label, $value) {
$event = new UnitedPrototype\GoogleAnalytics\Event($category, $action, $label, $value, true);
$event = new UnitedPrototype\GoogleAnalytics\Event($category, $action, $label, $value, true);
$visitor = $this->_getOrCreateVisitor();
$this->_tracker->trackEvent($event, new UnitedPrototype\GoogleAnalytics\Session(), $visitor);
$this->_tracker->trackEvent($event, new UnitedPrototype\GoogleAnalytics\Session(), $visitor);
}
protected function _getOrCreateVisitor() {
// cf: https://code.google.com/p/php-ga/issues/detail?id=18
$session = new Zend_Session_Namespace('analyticsClient');
......@@ -55,7 +54,7 @@ class Class_WebService_Analytics_GoogleTracker extends Class_WebService_Analyti
// Assemble Visitor information
// (could also get unserialized from database)
if( !isset($session->uniqueID) || !isset($session->visitor) ) {
$visitor = new UnitedPrototype\GoogleAnalytics\Visitor();
$visitor = new UnitedPrototype\GoogleAnalytics\Visitor();
} else {
$visitor = unserialize($session->visitor);
}
......@@ -73,7 +72,4 @@ class Class_WebService_Analytics_GoogleTracker extends Class_WebService_Analyti
$session->visitor = serialize($visitor);
return $visitor;
}
}
?>
\ No newline at end of file
......@@ -26,8 +26,5 @@ class Class_WebService_Analytics_NullTracker {
public function getDomainName() {return '';}
public function trackEvent($event,$session, $visitor) {
}
public function trackEvent($category, $action, $label, $value) {}
}
?>
\ No newline at end of file
......@@ -90,7 +90,10 @@ abstract class Class_WebService_BibNumerique_Abstract extends Class_WebService_A
* @return array of harvested ids
*/
protected function _importRessources($ressources) {
$harvestedIds = array();
if(!$ressources)
return [];
$harvestedIds = [];
foreach ($ressources as $ressource) {
$harvestedIds[] = $ressource->getId();
if ($ressource->isAlreadyHarvested())
......
......@@ -56,7 +56,7 @@ class Class_WebService_BibNumerique_Orphea extends Class_WebService_BibNumerique
protected function loadPage($page_number = 1) {
$this->harvestPage('', $page_number, '' );
$this->harvestOrpheaPage('', $page_number, '');
return $this;
}
......@@ -81,7 +81,12 @@ class Class_WebService_BibNumerique_Orphea extends Class_WebService_BibNumerique
}
public function harvestPage($unid, $page = 1, $total_records = '') {
public function harvestPage($page_number=1) {
return $this->harvestOrpheaPage('', $page_number, '');
}
public function harvestOrpheaPage($unid, $page = 1, $total_records = '') {
if (!$this->getUNID($unid)) {
return ['error' => $this->unid_parser->getFullMessage()];
}
......
......@@ -184,22 +184,22 @@ abstract class Class_WebService_SIGB_AbstractService {
}
public function getAvailableItems() {
public function getAvailableItems($id) {
return [];
}
public function placeConsultationRequest() {
public function placeConsultationRequest($id, $barcode, $service_point, $borrower_id) {
return [];
}
public function cancelConsultationRequest() {
public function cancelConsultationRequest($borrower_id, $request_id) {
return [];
}
public function getConsultationRequests() {
public function getConsultationRequests($borrower_id) {
return [];
}
......
......@@ -100,7 +100,7 @@ class Class_WebService_SIGB_PreRegistrationAbstract {
public function getForm() {}
public function send() {}
public function send($data) {}
public function getBranchCode($data) {}
......
......@@ -46,7 +46,7 @@ class ZendAfi_Controller_Action_Helper_RenderIcal
protected function _render($articles=[]) {
$this->_ensureAutoload();
static::ensureAutoload();
$vCalendar = new \Eluceo\iCal\Component\Calendar(static::PRODID);
......@@ -68,7 +68,7 @@ class ZendAfi_Controller_Action_Helper_RenderIcal
}
protected function _ensureAutoload() {
public static function ensureAutoload() {
if (static::$_autoloaded)
return;
......
......@@ -32,7 +32,7 @@ class ZendAfi_Controller_Plugin_ResourceDefinition_DocType extends ZendAfi_Contr
'index' => ['title' => 'Types de documents']
],
'after_edit' => function($model) {$this->_redirect('/admin/type-docs');},
'form' => ZendAfi_Form_TypeDocs_Edit::newWith($this->_getParam('id'))];
'form' => ZendAfi_Form_TypeDocs_Edit::newWithId($this->_getParam('id'))];
}
}
?>
\ No newline at end of file
......@@ -86,11 +86,10 @@ class ZendAfi_Form_Admin_Ouverture extends ZendAfi_Form {
}
public function populate($values) {
public function populate(array $values) {
$this->getElement('validity_range')
->setStartValue(isset($values['validity_start']) ? $values['validity_start'] : '')
->setEndValue(isset($values['validity_end']) ? $values['validity_end'] : '');
return parent::populate($values);
}
}
?>
\ No newline at end of file
......@@ -31,7 +31,7 @@ class ZendAfi_Form_Admin_User extends ZendAfi_Form {
: new Class_Users();
$form->setUser($user);
$form->addElements();
$form->buildElements();
$form->addValidity($datas['date_debut'],$datas['date_fin']);
return $form->populate($datas)
->setCustomForm($custom_form);
......@@ -44,7 +44,7 @@ class ZendAfi_Form_Admin_User extends ZendAfi_Form {
}
public function addElements() {
public function buildElements() {
$this
->addBasicUserInfo()
->addAdminUserInfo()
......
......@@ -90,7 +90,7 @@ class ZendAfi_Form_AdvancedSearch extends ZendAfi_Form {
}
public function populate($datas) {
public function populate(array $datas) {
parent::populate($datas);
foreach(array_keys($this->_axes) as $type)
......
......@@ -111,8 +111,8 @@ class ZendAfi_Form_Configuration_AuthRegister extends ZendAfi_Form {
}
public function getValues() {
$values = parent::getValues();
public function getValues($suppressArrayNotation=false) {
$values = parent::getValues($suppressArrayNotation);
$field_values = [];
foreach(['library', 'card_number', 'lastname', 'firstname'] as $opt_field) {
......
......@@ -21,7 +21,7 @@
class ZendAfi_Form_Configuration_Menu_Album extends ZendAfi_Form_Configuration_Menu_Entry {
public function populate($datas) {
public function populate(array $datas) {
$albums = (new Storm_Model_Collection(Class_Album::getItemsOf(0)))
->injectInto([], function($albums, $album)
{
......
......@@ -39,7 +39,7 @@ class ZendAfi_Form_Configuration_Menu_Link extends ZendAfi_Form_Configuration_Me
$this->removeElement('use_profil');
}
public function populate($datas) {
public function populate(array $datas) {
parent::populate($datas);
$this->addToHeadGroup(['url']);
$this->addToStyleGroup(['target']);
......
......@@ -34,7 +34,7 @@ class ZendAfi_Form_Configuration_Menu_LinkToProfile extends ZendAfi_Form_Configu
}
public function populate($datas) {
public function populate(array $datas) {
parent::populate($datas);
$this->addToHeadGroup(['clef_profil']);
return $this;
......
......@@ -21,7 +21,7 @@
class ZendAfi_Form_Configuration_Menu_ListOfSites extends ZendAfi_Form_Configuration_Menu_Entry {
public function populate($datas) {
public function populate(array $datas) {
$this
->addElement('treeSelect',
'listOfSites_source',
......
......@@ -21,7 +21,7 @@
class ZendAfi_Form_Configuration_Menu_Rss extends ZendAfi_Form_Configuration_Menu_Entry {
public function populate($datas) {
public function populate(array $datas) {
$this
->addElement('treeSelect',
'feed_source',
......
......@@ -55,7 +55,7 @@ class ZendAfi_Form_Configuration_Menu_SearchResult extends ZendAfi_Form_Configur
}
public function populate($datas) {
public function populate(array $datas) {
$this
->addElement('treeSelect',
'data_source',
......
......@@ -73,7 +73,7 @@ class ZendAfi_Form_Configuration_Record extends ZendAfi_Form {
}
public function populate($datas) {
public function populate(array $datas) {
$this->getElement('record_tabs')
->setSettings($datas['onglets']);
......
......@@ -94,7 +94,7 @@ formSelectToggleVisibilityForElement("#type_aff", $("#id_categorie, #nb_aff_by_p
}
public function populate($datas) {
public function populate(array $datas) {
$selected_categories = array_key_exists('id_categorie', $datas)
? $datas['id_categorie']
: '';
......
......@@ -67,7 +67,7 @@ class ZendAfi_Form_Configuration_Widget_Articles extends ZendAfi_Form_Configurat
}
public function populate($datas) {
public function populate(array $datas) {
$this->getElement('style_liste')
->setPreferences($datas);
......
......@@ -94,7 +94,7 @@ class ZendAfi_Form_Configuration_Widget_Calendar extends ZendAfi_Form_Configurat
}
public function populate($datas) {
public function populate(array $datas) {
$this->getElement('mode-affichage')->setSettings($datas);
$this->addElement('treeSelect',
......
......@@ -20,7 +20,7 @@
*/
class ZendAfi_Form_Configuration_Widget_Carousel extends ZendAfi_Form_Configuration_Widget_Base {
public function populate($datas) {
public function populate(array $datas) {
$this->getElement('style_liste')
->setSettings($datas)
->setMultiOptions(Class_Systeme_ModulesAccueil::moduleByCode('KIOSQUE')
......
......@@ -21,7 +21,7 @@
class ZendAfi_Form_Configuration_Widget_ChangeCarouselDatas extends ZendAfi_Form {
public function populate($datas) {
public function populate(array $datas) {
$this->addElement('treeSelect',
'data_source',
['UrlDataSource' => Class_Url::assemble(['module' => 'admin',
......
......@@ -109,7 +109,7 @@ class ZendAfi_Form_Configuration_Widget_Libraries extends ZendAfi_Form_Configura
}
public function populate($datas) {
public function populate(array $datas) {
$this
->addToSelectionGroup(['libraries'])
......
......@@ -47,7 +47,7 @@ class ZendAfi_Form_Configuration_Widget_ListOfSites extends ZendAfi_Form_Configu
}
public function populate($datas) {
public function populate(array $datas) {
$this
->addElement('treeSelect',
'listOfSites_source',
......
......@@ -102,7 +102,7 @@ class ZendAfi_Form_Configuration_Widget_Login extends ZendAfi_Form_Configuration
}
public function populate($datas) {
public function populate(array $datas) {
parent::populate($datas);
return $this
->addToStyleGroup(['autocomplete_off'])
......
......@@ -54,7 +54,7 @@ class ZendAfi_Form_Configuration_Widget_PremierChapitre extends ZendAfi_Form_Con
}
public function populate($datas) {
public function populate(array $datas) {
$this
->addElement('domainePanier',
'data_source',
......