Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (12)
Showing
with 193 additions and 120 deletions
......@@ -98,7 +98,7 @@
- correctif #181912 : Module Activités - Les effectifs maximum définis globalement sont pris en compte même quand des effectifs maximums sont définis pour les adultes et/ou enfants.
- correctif #196501 : Mails suggestions d'achat bloqués.
- correctif #196501 : ajout de la variable NOREPLY_EMAIL qui permet de spécifier l'adresse From: à utiliser pour les emails dont on ne veut pas de réponse (suggestions d'achat, réservations, etc...)
- correctif #185072 : RGAA : Correction de la construction du HTML de la description des boîtes avec l'option "Authorisé les balises HTML" activée, l'élément <p> est remplacé par l'élément <div>.
......@@ -120,7 +120,7 @@
- correctif #183266 : Server : Fatal errors in logs files.
- correctif #182795 : Espace disque sur bokeh-mutu.
- correctif #182795 : Dilicom : supprime automatiquement les fichiers de commandes datant de plus de 120 jours
18/01/2024 - v8.0.192
......@@ -10020,4 +10020,4 @@ ex: http://web.afi-sa.net/pergame-enligne.net/recherche/viewnotice/clef/TINTINET
- on peut définir des filtres multiples sur les sections et annexes au niveau profil.
- le rendu des kiosques flash est maintenant mis en cache, ce qui améliore la rapidité d'affichage. Pour rappel, ce cache est présent pour toutes les boîtes et mis à jour toutes les 15mn. Il est automatiquement désactivé lorsqu'on est connecté en tant que modérateur ou administrateur pour que les modifications des boîtes soient automatiquement visibles sur son poste.
- la mise à jour se base maintenant sur la version communautaire et libre de l'OPAC, sous license AGPL. Les sources sont disponibles ici: http://afi-forge.afi-sa.fr/projects/opacce .
\ No newline at end of file
- la mise à jour se base maintenant sur la version communautaire et libre de l'OPAC, sous license AGPL. Les sources sont disponibles ici: http://afi-forge.afi-sa.fr/projects/opacce .
- correctif #191487 : Cosmogramme : Les contenus des colonnes du journal d'intégration ne se chevauchent plus.
\ No newline at end of file
- correctif #200721 : Sécurité : ajout des paramètres "secure" et "httponly" aux cookies de session.
\ No newline at end of file
- correctif #200846 : L'email de notification d'une nouvelle réservation est de nouveau adressé à la Bibliothèque, et plus à l'usager.
\ No newline at end of file
- correctif #201428 : Ressource Numérique: CVS : Suppression des notices CVS qui ne sont plus moissonnées
\ No newline at end of file
- correctif : Développement : Correction des builds d'intégration continue.
\ No newline at end of file
......@@ -36,8 +36,8 @@ class Cosmo_RunLogController extends Zend_Controller_Action {
public function syntheseAction() {
if (!$run = Class_Cosmogramme_Integration::find((int)$this->_getParam('id')))
$this->_redirect($this->cosmoPath->getCosmoBaseUrl() . 'php/integre_log.php',
['prependBase' => false]);
$this->_redirect($this->cosmoPath->getCosmoBaseUrl() . 'php/integre_log.php',
['prependBase' => false]);
$this->view->date = $run->getTraite();
$this->view->run = $run;
}
......
<h1>Journal des intégrations du <?php echo $this->getHumanDate($this->date, 'EEEE d MMMM yyyy');?></h1>
<div align="center">
<table style="width:800px;margin-left:20px">
<tr>
<th width="15%" colspan="2" align="left">Date</th>
<th width="30%" align="left">Bibliothèque</th>
<th width="20%" align="left">Type de fichier</th>
<th width="20%" align="left">Type de transaction</th>
<th width="20%" align="left">Fichier</th>
<th width="9%" align="left">Taille</th>
<th width="9%" align="left">Fiches traitées</th>
<th width="9%" align="left">Erreurs</th>
<th width="9%" align="left">Anomalies</th>
</tr>
<?php foreach($this->runs as $run) { ?>
<tr>
<td align="center"><?php
echo $this->tagAnchor(
$this->url(['module' => 'cosmo',
'controller' => 'run-log',
'action' => 'synthese',
'id' => $run->getId(),
'date' => $this->date], null, true),
$this->tagImg($this->cosmoPath->getCosmoBaseUrl() . 'images/loupe.png',
['alt' => 'Afficher le détail']));?></td>
<td align="center" style="white-space:nowrap">
<?php echo $this->getHumanDate($run->getTraite(), 'EEEE d MMMM yyyy');?></td>
<td>(<?php echo $run->getBib()->getId();?>)&nbsp;<?php echo $run->getBib()->getNomCourt();?></td>
<td><?php
echo Class_CosmoVar::getLabelInList(
<?php
$description = (new Class_TableDescription('run-logs'));
$description->addColumn($this->_('Date'),
['callback' => function($element)
{return $this
->tagAnchor(
$this->url(['module' => 'cosmo',
'controller' => 'run-log',
'action' => 'synthese',
'id' => $element->getId(),
'date' => $this->date], null, true),
$this->tagImg($this->cosmoPath->getCosmoBaseUrl() . 'images/loupe.png',
['alt' => 'Afficher le détail']))
.' '. $this->getHumanDate($element->getTraite(), 'EEEE d MMMM yyyy');
}])
->addColumn($this->_('Bibliothèque'),
['callback' => function($element)
{ return $this->_('%s &nbsp; %s',
$element->getBib()->getId(),
$element->getBib()->getNomCourt());
}])
->addColumn($this->_('Type de fichier'),
['callback' => function($element)
{ return Class_CosmoVar::getLabelInList(
'type_fichier',
$run->getProfilDonnees()->getTypeFichier())?></td>
<td><?php
echo Class_CosmoVar::getLabelInList('import_type_operation',
$run->getTypeOperation());?></td>
<td><?php echo $run->getFichier();?></td>
<td align="right" style="white-space:nowrap">
<?php echo number_format((int)$run->getFileSize()/1024, 0, '', ' ');?>&nbsp;ko
<?php if (0 < $run->getFileSize())
echo $this->tagAnchor(
$this->url(['module' => 'cosmo',
'controller' => 'run-log',
'action' => 'download',
'id' => $run->getId(),
'date' => $this->date], null, true),
$this->tagImg($this->cosmoPath->getCosmoBaseUrl() . 'images/plus.gif',
['alt' => 'Télécharger le fichier']));?>
</td>
<td align="right"><?php echo number_format($run->getPointeurReprise(), 0, ',', ' ');?></td>
<td align="right"><?php echo $run->getNbErreurs();?></td>
<td align="right"><?php echo $run->getNbWarnings();?></td>
</tr>
<?php } ?>
</table>
<br>
$element->getProfilDonnees()->getTypeFichier());
}])
->addColumn($this->_('Type de transaction'),
['callback' => function($element)
{ return Class_CosmoVar::getLabelInList('import_type_operation',
$element->getTypeOperation());
}])
->addColumn($this->_('Fichier'),
['callback' => function($element)
{ $download_url_file = (0 < $element->getFileSize())
? ' '.$this
->tagAnchor(
$this->url(['module' => 'cosmo',
'controller' => 'run-log',
'action' => 'download',
'id' => $element->getId(),
'date' => $this->date], null, true),
$this->tagImg($this->cosmoPath->getCosmoBaseUrl() . 'images/plus.gif',
['alt' => 'Télécharger le fichier']))
: '';
return $element->getFichier().$download_url_file;
}])
->addColumn($this->_('Taille'),
['callback' => function($element)
{ return number_format((int)$element->getFileSize()/1024, 0, '', ' ')
.'&nbsp;ko';
}])
->addColumn($this->_('Fiches traitées'),
['callback' => function($element)
{ return number_format($element->getPointeurReprise(), 0, ',', ' ');
}])
->addColumn($this->_('Erreurs'),
['callback' => function($element)
{ return $element->getNbErreurs();
}])
->addColumn($this->_('Anomalies'),
['callback' => function($element)
{ return $element->getNbWarnings();
}]);
echo $this->renderTable($description, $this->runs);
?>
<input type="button" class="bouton" value="Retour"
onclick="document.location.replace('<?php echo $this->url(['module' => 'cosmo', 'controller' => 'logs'], null, true); ?>')" style="margin-left:20px">
<br>
......
......@@ -52,7 +52,7 @@ class RunLogControllerByDateTest extends CosmoControllerTestCase {
;
Class_Cosmogramme_Integration::setFileSystem($filesystem);
$this->dispatch('/cosmo/run-log/by-date/date/2018-11-06', true);
$this->dispatch('/cosmo/run-log/by-date/date/2018-11-06');
}
......@@ -74,6 +74,24 @@ class RunLogControllerByDateTest extends CosmoControllerTestCase {
}
/** @test */
public function firstColumnTitleShouldBeDate() {
$this->assertXPathContentContains('(//th)[1]', 'Date');
}
/** @test */
public function secondColumnTitleShouldBeBibliotheque() {
$this->assertXPathContentContains('(//th)[2]', 'Bibliothèque');
}
/** @test */
public function thirdColumnTitleShouldBeTypeDeFichier() {
$this->assertXPathContentContains('(//th)[3]', 'Type de fichier');
}
/** @test */
public function dateShouldBePresent() {
$this->assertXPathContentContains('//td', 'mardi 6 novembre 2018');
......@@ -100,7 +118,8 @@ class RunLogControllerByDateTest extends CosmoControllerTestCase {
/** @test */
public function fileShouldBeIntegre1212DotPan() {
$this->assertXPathContentContains('//td', 'integre1212.pan');
$this->assertXPathContentContains('//td',
'integre1212.pan');
}
......
......@@ -53,10 +53,14 @@ class Class_Cnil {
protected function _setConsentCookie() {
$this->_getCookieJar()
->setcookie($this->_key,
'1',
$this->getTimeSource()->time() + (3600 * 24 * 30 *13));
$result = $this->_getCookieJar()
->setcookie($this->_key,
'1',
$this->getTimeSource()->time() + (3600 * 24 * 30 *13),
'',
'',
Class_Url::isSecure(),
true);
}
......@@ -81,7 +85,8 @@ class Class_Cnil {
class Class_Cnil_CookieJar {
public function setcookie() {
call_user_func_array('setcookie', func_get_args());
public function setcookie(): bool
{
return call_user_func_array('setcookie', func_get_args());
}
}
\ No newline at end of file
}
......@@ -55,6 +55,7 @@ class Class_DigitalResource_Service extends Class_WebService_BibNumerique_Abstra
protected function _deleteNonHarvestedAlbums() : self {
if ( ! $harvested_ids = $this->getHarvestedIds())
return $this;
......
......@@ -65,7 +65,7 @@ abstract class Class_Hold_AbstractNotify{
public function setMailTo(string $mailto = '') :Class_Hold_AbstractNotify {
$this->_mail_to = $mailto ?: $this->_user->getMail();
$this->_mail_to = $mailto ?: $this->_user->getMail() ?: $this->_user->getLibraryMail();
return $this;
}
......
......@@ -36,4 +36,9 @@ class Class_Hold_Notify_User
);
return $this;
}
protected function _getDefaultMailTo(){
return $this->_user->getMail() ?: $this->_user->getLibraryMail();
}
}
......@@ -41,7 +41,7 @@ class Class_Hold_NotifyUser extends Class_Hold_AbstractNotify {
if (!$bib = $this->_user->getBib())
return $this->addError($this->_('Pas de Bibliothèques'));
$this->setMailTo($this->_user->getMail() ?: $this->_user->getLibraryMail());
$this->setMailTo($this->_user->getLibraryMail());
return
($bib->getNotifyOnNewResa())
......
......@@ -109,6 +109,12 @@ class Class_Url {
}
public static function isSecure(): bool
{
return static::_isSecure();
}
public static function secureIfNeeded($url) {
if (!static::_isSecure())
return $url;
......
......@@ -1783,6 +1783,9 @@ class Class_Users extends Storm_Model_Abstract {
? $sigb_com->suggestionsOf($this)
: parent::_get('suggestion_achat');
if ( $error = ($suggestions['erreur'] ?? ''))
$this->addError($error);
return ($suggestions['erreur'] ?? '') ? [] : $suggestions;
}
......
......@@ -19,40 +19,39 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class Class_WebService_Fnac extends Class_WebService_Abstract {
private $url = 'http://www3.fnac.com/advanced/book.do?isbn=';
class Class_WebService_Fnac extends Class_WebService_Abstract
{
protected $_search_url = 'http://recherche.fnac.com/r/';
protected string $_search_url = 'https://recherche.fnac.com/r/';
protected string $_record_url = 'https://www.fnac.com/';
public function getResumes($notice) {
if (!$service = $notice->getIsbnOrEan())
public function getResumes(Class_Notice $notice): array
{
if (! $isbn_or_ean = $notice->getIsbnOrEan())
return [];
if ($resume = $this->getResume($service))
return [ ['source' => 'Editeur',
'texte' => $resume]];
return [];
return ($resume = $this->getResume($isbn_or_ean))
? [['source' => 'Editeur',
'texte' => $resume]]
: [];
}
public function getResume($isbn) {
if(!$isbn)
return false;
public function getResume(string $isbn_or_ean): string
{
$isbn_or_ean = trim(str_replace("-", "", $isbn_or_ean));
$fnac_record_search_html = $this->httpGet($this->_search_url . $isbn_or_ean);
$isbn = trim(str_replace("-","",$isbn));
$url = $this->_search_url . $isbn;
$data = $this->httpGet($url);
if(!$url_lire_la_suite = $this->getUrlLireLaSuite($data))
if( ! $url_to_resume = $this->getUrlToResume($fnac_record_search_html))
return '';
if (!($url_lire_la_suite && (new ZendAfi_Validate_Url())->isValid($url_lire_la_suite)))
if (! (new ZendAfi_Validate_Url())->isValid($url_to_resume))
return '';
$suite = $this->httpGet($url_lire_la_suite);
return trim(strip_tags($this->extractResumeFromHTML($suite)));
$full_page = $this->httpGet($url_to_resume);
return trim(strip_tags($this->extractResumeFromHTML($full_page)));
}
......@@ -67,15 +66,23 @@ class Class_WebService_Fnac extends Class_WebService_Abstract {
}
public function getUrlLireLaSuite($data) {
$pos = ($pos = striPos($data,"summary")) ? $pos : striPos($data, 'resume');
public function getUrlToResume(string $html): string
{
$doc = new DOMDocument();
$doc->recover = true;
$doc->preserveWhiteSpace = false;
if( ! $doc->loadHTML($html, LIBXML_NOERROR))
return '';
$xpath = new DOMXPath($doc);
if(!$pos)
if ( ! $anchor = $xpath->query('//p[@class="Article-desc"]/a[contains(@class, "Article-title")]'))
return '';
$pos = strPos($data,"a href=\"",$pos)+8;
$posfin = strPos($data,"\"",$pos);
return substr($data,$pos,($posfin-$pos));
return ($url = $anchor->item(0))
? $url->getAttribute('href')
: '';
}
......@@ -157,4 +164,4 @@ class Class_WebService_Fnac extends Class_WebService_Abstract {
return trim($resume);
}
}
\ No newline at end of file
}
......@@ -20,44 +20,46 @@
*/
class Class_WebService_Premiere {
function __construct() {
$url_base="http://www.premiere.fr";
$this->url_base["root"]=$url_base;
$this->url_base["resume"]=$url_base."/film/@TITRE@/";
$this->url_base["image"]=$url_base."/film/@TITRE@/";
class Class_WebService_Premiere extends Class_WebService_Abstract
{
public function __construct()
{
$url_base = "https://www.premiere.fr";
$this->url_base["root"] = $url_base;
$this->url_base["resume"] = $url_base."/film/@TITRE@/";
$this->url_base["image"] = $url_base."/film/@TITRE@/";
}
public function getResumes($notice) {
if (!$notice->isDVD())
return array();
public function getResumes(Class_Notice $notice): array
{
if (! $notice->isDVD())
return [];
if ($resume = $this->get_resume($notice->getTitrePrincipal()))
return array(array('source' => 'Premiere.fr',
'texte' => $resume));
return array();
return [['source' => 'Premiere.fr',
'texte' => $resume]];
return [];
}
function get_resume($titre) {
public function get_resume(string $titre):string
{
$titre=$this->encoder_titre($titre);
$url=str_replace("@TITRE@",$titre,$this->url_base["resume"]);
$url = str_replace("@TITRE@",
$titre,
$this->url_base["resume"]);
try{
$httpClient = Class_HttpClientFactory::getInstance()->newHttpClient();
$httpClient->setUri($url);
$response = $httpClient->request();
$data = $response->getBody();
if(!$data) return false;
}catch (Exception $e){
return false;
}
if ( ! $data = $this->httpGet($url))
return '';
// Recherche du bon bloc
$start = 'Synopsis : ';
if (!$pos = strPos($data, $start))
return '';
$pos = $pos + strlen($start);
$posfin=strPos($data,'/>',$pos);
......
......@@ -48,6 +48,6 @@ class Class_WebService_SIGB_Decalog_ResponseReader {
public function getMessage() : string {
return $this->_message;
return (string) $this->_message;
}
}
......@@ -49,7 +49,8 @@ class Class_WebService_SIGB_Decalog_Service extends Class_WebService_SIGB_Abstra
'path' => '/user/lostpassword']];
public static function getService($server_root, $key = null,
public static function getService($server_root,
$key = null,
$institution_code = null,
$record_id_prefix = null) {
return self::newInstance()
......