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 (14)
Showing
with 34 additions and 225 deletions
- ticket #122671 : Magasin de thèmes : Correction de l'affichage des derniers éléments de la liste du mode mur taille 30 et plus du résultat de recherche sur les téléphones.
\ No newline at end of file
- ticket #126111 : Courriels : Correction de l'encodage des caractères
\ No newline at end of file
- ticket #133576 : Enrichissement : lorsqu'un nouvel article Wikipedia est défini pour un auteur, l'image est toujours remise à zéro.
\ No newline at end of file
- ticket #134150 : Magasin de thèmes : Correction de l'affichage des boutons des listes.
\ No newline at end of file
- ticket #134207 : Magasin de thèmes : Ajout de classes sur les avis sans titre et critique pour faciliter la personnalisation. Les nouvelles classes sont : score_rating et score_date.
\ No newline at end of file
- ticket #134652 : Articles : Ajout d'une variable pour changer l'expéditeur utilisé dans le workflow des articles
\ No newline at end of file
......@@ -904,7 +904,7 @@ class Admin_ModoController extends ZendAfi_Controller_Action {
if($this->_request->isPost() && $formulaire = Class_Formulaire::find((int)$this->_getParam('id')) ) {
$mail = new ZendAfi_Mail('utf8');
$mail = new ZendAfi_Mail();
$mail
->setFrom($this->_request->getPost('mail_expediteur'))
->addTo($this->_request->getPost('mail_destinataire'))
......
......@@ -256,7 +256,7 @@ class Admin_SystemeController extends Zend_Controller_Action {
if ($this->_request->isPost() && $form->isValid($this->_request->getPost())) {
$mail = new ZendAfi_Mail('utf8');
$mail = new ZendAfi_Mail();
$mail
->setFrom($this->_request->getPost('sender'))
->addTo($this->_request->getPost('recipient'))
......
......@@ -53,7 +53,7 @@ class FormulaireController extends ZendAfi_Controller_Action {
protected function _sendFormEmail($address, $body, $subject) {
$mail = new ZendAfi_Mail('utf8');
$mail = new ZendAfi_Mail();
$mail->setFrom(Class_Profil::getCurrentProfil()->getMailSiteOrPortail())
->addTo($address)
->setSubject('[ '.Class_Profil::getPortail()->getLibelle().' ] '.$subject)
......
......@@ -606,7 +606,7 @@ class RechercheController extends ZendAfi_Controller_Action {
$messages []= utf8_decode($form->getValue('demande'));
$message = implode("\r\n", $messages);
(new ZendAfi_Mail('utf8'))
(new ZendAfi_Mail())
->setSubject($subject)
->setBodyText($message)
->setFrom($form->getValue('user_mail'), $form->getValue('user_name'))
......@@ -619,7 +619,7 @@ class RechercheController extends ZendAfi_Controller_Action {
$texte_mail_resa_ok = urldecode($texte_mail_resa);
$message_user = sprintf("%s\r\n\r\n", utf8_decode($texte_mail_resa_ok));
(new ZendAfi_Mail('utf8'))
(new ZendAfi_Mail())
->setSubject($subject)
->setBodyText($message_user . $message)
->setFrom('nobody@noreply.fr', $library->getLibelle())
......
- ticket #133561 : Cosmogramme : Ajout de la possibilité de lancer certains traitements uniquement
\ No newline at end of file
......@@ -28,6 +28,8 @@ require_once 'classe_profil_donnees.php';
require_once 'classe_communication.php';
class notice_integration {
use Trait_CodifProviderAware;
const
RECORD_REJECT = 0,
RECORD_INSERT = 1,
......@@ -75,8 +77,6 @@ class notice_integration {
/** @category testing */
protected $_service_runner;
protected $_codif_provider;
protected $_raw_data;
......@@ -594,7 +594,7 @@ class notice_integration {
protected function _getCodifAuteurRenvois() {
$see_also = [];
foreach($this->notice['auteurs'] as $author) {
if (($codif = $this->_getCodifAuteur($author))
if (($codif = $this->_getCodifAuthorFor($author))
&& $codif->hasMotsRenvois())
$see_also[] = $codif->getMotsRenvois();
}
......@@ -617,7 +617,7 @@ class notice_integration {
$see_also = [];
foreach($this->notice['matieres'] as $subject) {
if (($codif = $this->_getCodifSubject($subject))
if (($codif = $this->_getCodifSubjectFor($subject))
&& $codif->hasMotsRenvois())
$see_also[] = $codif->getMotsRenvois();
}
......@@ -950,7 +950,7 @@ class notice_integration {
// Matieres
if($this->notice["matieres"]) {
foreach($this->notice["matieres"] as $matiere) {
if (!$codif_matiere = $this->_getCodifSubject($matiere)) continue;
if (!$codif_matiere = $this->_getCodifSubjectFor($matiere)) continue;
$facettes[]="M".$codif_matiere->getId();
}
}
......@@ -1016,22 +1016,12 @@ class notice_integration {
public function getFacetteAuteur($auteur) {
return ($codif = $this->_getCodifAuteur($auteur))
return ($codif = $this->_getCodifAuthorFor($auteur))
? $codif->asFacet()
: '';
}
protected function _getCodifAuteur($auteur) {
return $this->getCodifProvider()->getAuthor($auteur);
}
protected function _getCodifSubject($subject) {
return $this->getCodifProvider()->getSubject($subject);
}
protected function ecrireArticlePeriodique() {
if( 1 == $this->notice["statut"])
return $this->deleteRecordArticles();
......@@ -1458,32 +1448,17 @@ class notice_integration {
}
public function getStatut() {
return $this->statut;
}
protected function getCodifProvider() {
if (null == $this->_codif_provider)
$this->_codif_provider = (new Class_Cosmogramme_Integration_CodifProvider)
->setIndexation($this->indexation);
return $this->_codif_provider;
}
protected function _isIncremental() {
return Class_Cosmogramme_Integration::TYPE_OPERATION_INCREMENT == $this->type_operation;
}
}
/** @category testing */
public function setCodifProvider($provider) {
$this->_codif_provider = $provider;
return $this;
}
}
class Service_Runner {
......
<?PHP
/**
* Copyright (c) 2012, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH 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).
*
* BOKEH 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 BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/////////////////////////////////////////////////////////////////////////
// INDEXATION DES PERIODIQUES
/////////////////////////////////////////////////////////////////////////
require_once("classe_notice_integration.php");
require_once("classe_indexation.php");
$notice=new notice_integration();
$ix = new indexation();
$notice->setParamsIntegration(0,0,1,"");
$titre="Indexation des articles de périodiques";
setVariable("traitement_phase",$titre);
if($phase=="PERIODIQUES_0")
{
$log->log("<h4>$titre</h4>");
$chrono100notices->start();
unset($phase_data);
$phase_data["nombre"]=0;
$phase_data["not_found"]=0;
$phase_data["timeStart"]=time();
$phase_data["pointeur_article"]="0";
$phase = "PERIODIQUES_1";
}
if($phase == "PERIODIQUES_1")
{
$start_periodiques=date("Y-m-d H:i:s",$phase_data["timeStart"]);
if(!$mode_cron and $phase_data["nombre"]>0) print("<h4>$titre</h4>");
$req="select * from notices_articles"
." Where id_article>". $phase_data["pointeur_article"]
." and date_maj >='".date("Y-m-d",$timeStart)."'"
." and clef_chapeau > ''"
." and unimarc > ''"
." order by id_article";
$resultat=$sql->prepareListe($req);
// Parser les articles
while($enreg=$sql->fetchNext($resultat))
{
if(!$mode_cron and $chrono->tempsPasse() > $timeout) sauveContexte();
// données article
$data=$notice->getDataArticlePeriodique($enreg["unimarc"]);
// lire la notice du numero
$numero=$sql->fetchEnreg("select id_notice,facettes,titres,auteurs,matieres,date_maj from notices where clef_chapeau='".$enreg["clef_chapeau"]."' and tome_alpha='".$enreg["clef_numero"]."'");
if($numero["id_notice"])
{
$new_enreg=array();
$facettes=$numero["facettes"];
// reset facettes
if($numero["date_maj"]<$start_periodiques)
{
$facettes="";
$controle=explode(" ",$numero["facettes"]);
for($i=0; $i < count($controle); $i++)
{
$tp=substr($controle[$i],0,1);
if($tp !="A" and $tp!="M") $facettes.=" ".$controle[$i];
}
}
// Facettes Auteurs
if($data["auteurs"])
{
foreach($data["auteurs"] as $auteur)
{
$code_alpha=$ix->alphaMaj($auteur);
$code_alpha=str_replace(" ","x",$code_alpha);
if(!$code_alpha) continue;
$enreg_auteur=$sql->fetchEnreg("Select * from codif_auteur where MATCH(formes) AGAINST('\"".$code_alpha."\"' IN BOOLEAN MODE) ");
if(!$enreg_auteur["id_auteur"])
{
$pos=strscan($auteur,"|");
$nom_prenom = trim(substr($auteur,($pos+1))." ".substr($auteur,0,$pos));
$id_auteur=$sql->insert("codif_auteur",array("libelle" => $nom_prenom,"formes" => $code_alpha));
}
else $id_auteur=$enreg_auteur["id_auteur"];
$facette=" A".$id_auteur;
if(strpos($facettes." ",$facette." ")===false) $facettes.=$facette;
}
}
// Facettes Matieres
if($data["matieres"])
{
foreach($data["matieres"] as $matiere)
{
$code_alpha=$ix->alphaMaj($matiere);
if(!$code_alpha) continue;
$enreg_matiere=$sql->fetchEnreg("Select * from codif_matiere where code_alpha='$code_alpha'");
if(!$enreg_matiere["id_matiere"]) $id_matiere=$sql->insert("codif_matiere",array("libelle" => $matiere,"code_alpha" => $code_alpha));
else $id_matiere=$enreg_matiere["id_matiere"];
$facette=" M".$id_matiere;
if(strpos($facettes." ",$facette." ")===false) $facettes.=$facette;
}
}
// index fulltext
$data["titres"][]=$numero["titres"];
$new_enreg["titres"]=$ix->getFulltext($data["titres"]);
$data["auteurs"][]=$numero["auteurs"];
$new_enreg["auteurs"]=$ix->getFulltext($data["auteurs"]);
$data["matieres"][]=$numero["matieres"];
$new_enreg["matieres"]=$ix->getFulltext($data["matieres"]);
// maj enreg
$new_enreg["date_maj"]=$start_periodiques;
$new_enreg["facettes"]=trim($facettes);
$req="update notices set @SET@ where id_notice=".$numero["id_notice"];
$sql->update($req,$new_enreg);
}
else
{
$phase_data["not_found"]++;
}
// Pointeur d'avancement et trace
$phase_data["pointeur_article"]=$enreg["id_article"];
$phase_data["nombre"]++;
traceTraitementPeriodique();
}
// recap
if($phase_data["nombre"]==0) $log->log(BR.'<span class="vert">Aucun article à traiter</span><br>');
else
{
$log->log(BR.'<span class="vert">'.$phase_data["nombre"].' articles(s) traité(s)</span>'.BR);
$chrono->timeStart=$phase_data["timeStart"];
$log->log('<span class="vert">Temps de traitement : '.$chrono->end()." (".$chrono->moyenne($phase_data["nombre"],"articles").")</span>".BR);
}
if($phase_data["not_found"]) $log->log('<span class="violet">Notices orphelines : '.$phase_data["not_found"].'</span>'.BR);
}
// ----------------------------------------------------------------
// Ecriture logs et affichage écran
// ----------------------------------------------------------------
function traceTraitementPeriodique()
{
global $log,$phase_data,$chrono100notices;
// Affichage toutes les 100
if($phase_data["nombre"] % 100 == 0)
{
$log->log("article ".$phase_data["nombre"]." (" .$chrono100notices->tempsPasse()." secondes)<br>");
$chrono100notices->start();
}
}
?>
......@@ -198,7 +198,10 @@ if (!$should_skip_records) {
// PSEUDO-NOTICES - cms rss sitotheque et albums (phase 0.1 a 0.6)
// ----------------------------------------------------------------
if ($phase > 0.1 and $phase < 1) {
include('integration/pseudo_notices.php');
startIntegrationPhase('PseudoRecordCms');
startIntegrationPhase('PseudoRecordRss');
startIntegrationPhase('PseudoRecordSitotheque');
startIntegrationPhase('PseudoRecordAlbum');
$phase = 1;
}
......@@ -215,16 +218,11 @@ if (!$should_skip_records) {
setVariable("traitement_phase", "Suppression des notices sans exemplaire");
startIntegrationPhase('DeleteRecordWithoutItem');
if ($phase == 2) $phase = "PERIODIQUES_0";
// ----------------------------------------------------------------
// INDEXATION DES ARTICLES DE PERIODIQUES
// ----------------------------------------------------------------
if (substr($phase, 0, 11) == "PERIODIQUES")
{
include("integration/periodiques.php");
$phase = 2;
}
if ($phase == 2)
startIntegrationPhase('SerialArticlesIndex');
// ----------------------------------------------------------------
......
......@@ -196,7 +196,7 @@ class NanookRecordsIntegrationInterestEsperluetteTest extends NanookRecordsInteg
/** @test */
public function deweyShouldContainsEsperluette() {
$this->assertEquals('80993352 ESPERLUETTE ESPERLUET 2014', $this->notice->getDewey());
$this->assertEquals('80993352 ESPERLUETTE ESPERLUET 2014', $this->notice->getDewey());
}
}
......
......@@ -719,7 +719,7 @@ class NoticeIntegrationBearsBeerMicrobibTest extends NoticeIntegrationTestCase {
/** @test */
public function auteursShouldContainsBEAULIEUJIMMY() {
$this->assertEquals('BEAULIEU BOLI JIMMY JIMI APOSTOLIDES APOSTOLID JEAN JAN MARIE MARI BOSSE BOS SIMON BOUCHARD BOUCHAR GREGOIRE GREGOIR PIERRE PIER BROERSMA MATTHEW MATEW DELPORTE DELPORT JULIE JULI DOYON DOION RIVEST RIVES EKEBOM EKEBON TERHI TERI FORSYTHE FORSIT GENEST CATHERINE KATERIN GIARD JIAR LUC GIRARD JIRAR PASCAL PASKAL GOLDBERG GOLDBER ELEONORE ELEONOR HUBER UB MARKUS MARKU IRIS IRI JOLY JOLI BENOIT BENOI LEMAY LEMAI SYLVAIN SILVIN MUSTURI TOMMI TOMI NYLSO NILSO OBOM OBON PISHIER PICHI RICCI RIKSI STEFANO SAMSON JACQUES JAK DIECK DIEK MARTIN TOM TRAHAN TRAN SEBASTIEN SEBASTIN TURGEON TURJON DAVID DAVI VAYRYNEN VAIRINAN MIKKO MIKO VIAU VIO MICHEL WARD OIR BARNABY BARNABI WIGGERT OUIJER GREGOR ZVIANE ZVIAN',
$this->assertEquals('BEAULIEU BOLI JIMMY JIMI APOSTOLIDES APOSTOLID JEAN JAN MARIE MARI BOSSE BOS SIMON BOUCHARD BOUCHAR GREGOIRE GREGOIR PIERRE PIER BROERSMA MATTHEW MATEW DELPORTE DELPORT JULIE JULI DOYON DOION RIVEST RIVES EKEBOM EKEBON TERHI TERI FORSYTHE FORSIT GENEST CATHERINE KATERIN GIARD JIAR LUC GIRARD JIRAR PASCAL PASKAL GOLDBERG GOLDBER ELEONORE ELEONOR HUBER UB MARKUS MARKU IRIS IRI JOLY JOLI BENOIT BENOI LEMAY LEMAI SYLVAIN SILVIN MUSTURI TOMMI TOMI NYLSO NILSO OBOM OBON PISHIER PICHI RICCI RIKSI STEFANO SAMSON JACQUES JAK DIECK DIEK MARTIN TOM TRAHAN TRAN SEBASTIEN SEBASTIN TURGEON TURJON DAVID DAVI VAYRYNEN VAIRINAN MIKKO MIKO VIAU VIO MICHEL WARD OIR BARNABY BARNABI WIGGERT OUIJER GREGOR ZVIANE ZVIAN',
$this->notice_integration->noticeToDBEnreg($this->notice_data)['auteurs']);
}
......@@ -1205,7 +1205,7 @@ class NoticeIntegrationArchivesAlsaceTest extends NoticeIntegrationTestCase {
/** @test */
public function matieresShouldAlsaceDescriptions() {
$this->assertEquals('ALSACE ALSAS FRANCE FRANS DESCRIPTIONS DESKRIPSION VOYAGES VOIAJ VUES VU 1870 1914 OUVRAGES OUVRAJ ILLUSTRES ILUSTR 1871 1918 PERIODE PERIOD ALLEMANDE ALEMAND',
$this->assertEquals('ALSACE ALSAS FRANCE FRANS DESCRIPTIONS DESKRIPSION VOYAGES VOIAJ VUES VU 1870 1914 OUVRAGES OUVRAJ ILLUSTRES ILUSTR 1871 1918 PERIODE PERIOD ALLEMANDE ALEMAND',
Class_Notice::find(1)->getMatieres());
}
......
......@@ -69,7 +69,7 @@ abstract class Class_Activity_AbstractMail {
protected function _sendMail($recipients, $subject, $body) {
if (!$recipients = array_filter($recipients))
return $this;
$mail = new ZendAfi_Mail('utf8');
$mail = new ZendAfi_Mail();
foreach($recipients as $recipient)
$mail->addTo($recipient);
......
......@@ -323,6 +323,8 @@ class Class_AdminVarLoader extends Storm_Model_Loader {
'WORKFLOW_TEXT_MAIL_ARTICLE_PENDING' => Class_AdminVar_Meta::newDefault($this->_('Contenu de l\'email de notification d\'article en attente de validation. Termes substitués: TITRE_ARTICLE, URL_ARTICLE, AUTHOR_ARTICLE, SAVED_BY_ARTICLE, STATUS_ARTICLE, NEXT_STATUS_ARTICLE')),
'WORKFLOW_TEXT_MAIL_ARTICLE_REFUSED' => Class_AdminVar_Meta::newDefault($this->_('Contenu de l\'email de notification de refus d\'un article à valider. Termes substitués: TITRE_ARTICLE, URL_ARTICLE, AUTHOR_ARTICLE, SAVED_BY_ARTICLE')),
'WORKFLOW_TEXT_MAIL_ARTICLE_VALIDATED' => Class_AdminVar_Meta::newDefault($this->_('Contenu de l\'email de notification de validation d\'un article. Termes substitués: TITRE_ARTICLE, URL_ARTICLE, AUTHOR_ARTICLE, SAVED_BY_ARTICLE')),
'WORKFLOW_MAIL_FROM' => Class_AdminVar_Meta::newDefault($this->_('Courriel à utiliser comme expéditeur des mails de notification'),
['value' => 'no-reply@afi-sa.fr']),
'CUSTOM_GENRE_ICON' => Class_AdminVar_Meta::newOnOff($this->_('Activation de l\'interface de personnalisation des icones des genres')),
'DISABLE_BLOCKS_SORTING' => Class_AdminVar_Meta::newOnOff($this->_('Désactivation de la possibilité de déplacer les boîtes par glisser/déposer en front')),
];
......
......@@ -1091,7 +1091,7 @@ class Class_Bib extends Storm_Model_Abstract {
->getContenuFusionne();
try {
(new ZendAfi_Mail('utf8'))
(new ZendAfi_Mail())
->setSubject($this->_('Nouvelle réservation pour %s sur l\'exemplaire %s',
$user->getNomComplet(),
$item->getCodeBarres()
......
......@@ -249,8 +249,8 @@ class Class_CodifAuteur_Description {
'youtube_channel_id' => '',
'ark' => '',
'isni' => '']);
if ($bio->getvignette())
$author_attribs['thumbnail_url'] = $bio->getvignette();
$author_attribs['thumbnail_url'] = $bio->getvignette();
$this->_author
->updateAttributes($author_attribs)
......