Skip to content
Snippets Groups Projects
Commit 78251494 authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

Merge remote-tracking branch 'refs/remotes/origin/master' into...

Merge remote-tracking branch 'refs/remotes/origin/master' into origin-dev#53936_bonus_parametrage_notice_appliquer_a_d_autres_profilstype_de_doc
parents 7dbb7cff 7bb72d8a
4 merge requests!2080Sandbox detach zf from storm,!2061Master,!2018Dev#53936 bonus parametrage notice appliquer a d autres profilstype de doc,!2017Dev#53936 bonus parametrage notice appliquer a d autres profilstype de doc
Pipeline #384 passed with stage
in 20 minutes and 48 seconds
- ticket #14141 : correction de l'affichage de la disponibilité calculé par la facette dans les listes de documents.
\ No newline at end of file
- ticket #53250 : vignettes sitothèques: adaptation aux modifications d'API de Bluga.net
\ No newline at end of file
......@@ -43,9 +43,9 @@
* Fix all the bugs and make things work with any PEAR2 adapter
*
* 1.7 - 02/09/2009 - Josh
* Lots of bug fixes since the last changelog entry, added failedJobs array for tracking jobs
* Lots of bug fixes since the last changelog entry, added failedJobs array for tracking jobs
* that don't submit properly
*
*
* 1.8 - 09/09/2009 - Josh
* Bug fixes and bring PEAR2 code back in the Bluga namespace
*/
......@@ -178,7 +178,7 @@ class Bluga_Webthumb {
$request->apikey = $this->apiKey;
$request->jobs = $this->jobs;
$request->apiversion = $this->apiVersion;
$payload = $request->asXml();
$response = $this->_transmitRequest($payload);
......@@ -389,7 +389,7 @@ class Bluga_Webthumb {
if (!isset($response->headers['Content-Type'])) {
throw new Exception('No Content-Type in response.');
}
if ($response->headers['Content-Type'] != 'text/xml') {
if (false === strpos($response->headers['Content-Type'], 'text/xml')) {
throw new Exception('There was an error. Content-Type returned was '.$response->headers['Content-Type']."\n".$response);
}
......@@ -479,7 +479,7 @@ class Bluga_Webthumb {
$ext = 'png';
}
$filename .= '.'.$ext;
}
}
if (!is_null($outDir)) {
$filename = "$outDir/$filename";
......
......@@ -32,7 +32,7 @@ abstract class ZendAfi_View_Helper_ListeNotices_Abstract extends ZendAfi_View_He
protected function _getDataAvailability($record) {
if(!$this->_isAllowedToDisplayAvailabilty($record))
if(!$this->_isAllowedToDisplayAvailabiltyFromFacet($record))
return [];
return ['data-availability' => $record->getAvailabilityFromFacet()];
......
<?php
if(!isset($argv[1])) {
echo "\nFatal Error : Missing Bokeh folder name to inject.\n\n";
exit;
}
require_once 'console.php';
$injector = function($value) use($argv) {
if(false === strpos($value, '/userfiles/'))
return $value;
if (false === strpos($value, $argv[1]))
$value = str_replace('//', '/', '/' . $argv[1] . '/' . $value);
if ('//' == substr($value, 0, 2))
$value = substr($value, 1);
return $value;
};
// profils
echo "\nStarting inject : " . $argv[1];
echo "\n\nPhase profil\n";
foreach (Class_Profil::findAll() as $profile) {
echo '.';
$config = $profile->getCfgSiteAsArray();
$changed = false;
foreach(['header_img',
'favicon',
'logo_gauche_img',
'logo_droite_img',
'header_css',
'header_js',
'page_css'] as $name) {
if((!isset($config[$name])) || (!$config[$name]))
continue;
$old_value = $config[$name];
$config[$name] = $injector($old_value);
if($old_value != $config[$name])
$changed = true;
}
if ($changed)
$profile->setCfgSite($config)->save();
}
Class_Profil::clearCache();
//domains
echo "\n\nPhase domain\n";
foreach(Class_Catalogue::findAllBy(['where' => 'url_img like "%/userfiles/%"']) as $domain) {
echo '.';
$old_value = $domain->getUrlImg();
$new_url = $injector($old_value);
if($old_value != $new_url)
$domain->setUrlImg($new_url)->save();
}
Class_Catalogue::clearCache();
// articles
echo "\n\nPhase article\n";
$injector = function($value) use ($argv) {
$pattern = '/=(["\'])[^"\']*\/userfiles\/([^"\']*)/i';
return str_replace('/userfiles/userfiles/',
'/userfiles/',
preg_replace($pattern, '=$1/' . $argv[1] . '/userfiles/$2', $value));
};
foreach(Class_Article::findAllBy(['where' => 'concat(description,contenu) like "%/userfiles/%"'])
as $article) {
echo '.';
$article->setDescription($injector($article->getDescription()))
->setContenu($injector($article->getContenu()))
->save();
}
Class_Article::clearCache();
echo "\n\nInjection terminated\n";
\ No newline at end of file
......@@ -26,7 +26,7 @@ class VignettesRGAATest extends ViewHelperTestCase {
public function setUp() {
parent::setUp();
$this->fixture('Class_AdminVar', ['id'=>'AFFICHER_DISPONIBILITE_SUR_RECHERCHE_MODE_FACETTE', 'valeur'=>1] );
$this->fixture('Class_AdminVar', ['id'=>'AFFICHER_DISPONIBILITE_SUR_RECHERCHE', 'valeur'=>1] );
$this->fixture('Class_AdminVar', ['id'=>'AFFICHER_DISPONIBILITE_SUR_RECHERCHE', 'valeur'=>0] );
defineConstant('PATH_SKIN', './public/opac/skins/original/');
$helper = new ZendAfi_View_Helper_ListeNotices_Vignettes();
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment