Commit 9ba76db1 authored by Patrick Barroca's avatar Patrick Barroca 🐧

Merge branch 'hotline' into 'master'

Hotline

See merge request afi/opacce!3141
parents aeca35b8 bc8f5735
- ticket #88956 : Rapport système : Ajout du niveau de base de données attendu et courant pour un meilleur diagnostique des mises à jours
\ No newline at end of file
- ticket #89128 : Cosmogramme : Correction du libellé de la variable "unicite_code_barres"
\ No newline at end of file
- ticket #89508 : Babelthèque : compatibilité HTTPS
\ No newline at end of file
- ticket #89745 : SIGB Koha : Correction de la prise en compte de l'information "réservé par d'autres" lorsque plus d'une réservation est en cours
\ No newline at end of file
- ticket #91377 : Affichage boite 2 colonnes : problème de duplication des articles
\ No newline at end of file
- ticket #92511 : PMB: correction de prise en compte de la date de retour des prêts pour le statut en retard
\ No newline at end of file
- ticket #92518 : SIGB PMB : correction de l'affichage des messages d'erreur de prolongation
\ No newline at end of file
......@@ -736,10 +736,13 @@ class notice_integration {
}
if (!empty($code_barres)) {
$unicite_codes_barres = getVariable('unicite_code_barres');
$delete_duplicates_args = ($unicite_codes_barres == '1') ? [] : ['id_int_bib' => $this->id_int_bib];
$delete_duplicates_args['id_notice'] = $id_notice;
$delete_duplicates_args['code_barres'] = $code_barres;
$unicite_codes_barres = Class_CosmoVar::get(Class_Notice_DoubleFinder::VAR_BARCODE_UNIQ_MODE);
$delete_duplicates_args = ['id_notice' => $id_notice,
'code_barres' => $code_barres];
if ($unicite_codes_barres == Class_CosmoVar::UNIQ_BARCODE_WITHIN_LIBRARY)
$delete_duplicates_args['id_int_bib'] = $this->id_int_bib;
Class_Exemplaire::deleteBy($delete_duplicates_args);
}
......
<?php
$adapter = Zend_Db_Table_Abstract::getDefaultAdapter();
try {
$adapter->query("UPDATE `variables` SET liste='0:Code-barres uniquement\r\n1:Bibliothèque + codes-barres' WHERE clef='unicite_code_barres'");
} catch(Exception $e) {}
......@@ -32,7 +32,7 @@ abstract class CarthameIntegrationTestCase extends NoticeIntegrationTestCase {
'non_exportable'=> 'electre;decitre;gam;zebris',
'controle_codes_barres'=> 0,
'unimarc_zone_titre' => '200$a;461$t',
'unicite_code_barres' => 0,
'unicite_code_barres' => Class_CosmoVar::UNIQ_BARCODE_ONLY,
'champs_sup' => '',
'ean_345' => ''];
foreach($vars as $key => $value)
......
......@@ -24,7 +24,13 @@ require_once 'NoticeIntegrationTest.php';
abstract class NoticeIntegrationAloesTestCase extends NoticeIntegrationTestCase {
public function getProfilDonnees() {
public function setUp() {
parent::setUp();
Class_CosmoVar::setValueOf('unicite_code_barres', Class_CosmoVar::UNIQ_BARCODE_WITHIN_LIBRARY);
}
public function getProfilDonnees() {
return Class_IntProfilDonnees::forALOES()
->setIdProfil(111)
->getRawAttributes();
......@@ -32,6 +38,7 @@ abstract class NoticeIntegrationAloesTestCase extends NoticeIntegrationTestCase
}
class NoticeIntegrationAloes11septembre2001Test extends NoticeIntegrationAloesTestCase {
public function getProfilDonnees() {
return Class_IntProfilDonnees::forALOES()
......@@ -275,7 +282,7 @@ class NoticeIntegrationAloesDimancheALaPiscineTest extends NoticeIntegrationAloe
->setIdProfil(111)
->setItemField(Class_IntProfilDonnees::FIELD_ITEM_EMPLACEMENT, 'u')
->getRawAttributes();
}
}
public function setUp() {
......@@ -302,7 +309,7 @@ class NoticeIntegrationAloesDimancheALaPiscineTest extends NoticeIntegrationAloe
'id_bib' => 4,
'invisible' => 0]);
Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Exemplaire');
$this->onLoaderOfModel('Class_Exemplaire');
$this->loadNotice("unimarc_dimanche_a_la_piscine");
}
......
......@@ -63,7 +63,7 @@ class NoticeIntegrationDedupWithoutIsbnTest extends NoticeIntegrationTestCase {
'non_exportable'=> 'electre;decitre;gam;zebris',
'controle_codes_barres'=> 0,
'unimarc_zone_titre' => '200$a;461$t',
'unicite_code_barres' => 0,
'unicite_code_barres' => Class_CosmoVar::UNIQ_BARCODE_ONLY,
'champs_sup' => '',
'ean_345' => '']);
......@@ -96,7 +96,7 @@ class NoticeIntegrationDedupSameUnimarcLoadedTest extends NoticeIntegrationTestC
'non_exportable'=> 'electre;decitre;gam;zebris',
'controle_codes_barres'=> 0,
'unimarc_zone_titre' => '200$a;461$t',
'unicite_code_barres' => 0,
'unicite_code_barres' => Class_CosmoVar::UNIQ_BARCODE_ONLY,
'champs_sup' => '',
'ean_345' => '']);
......@@ -171,7 +171,7 @@ class NoticeIntegrationDedupCaliceWithoutIsbnTest extends NoticeIntegrationTestC
'non_exportable'=> 'electre;decitre;gam;zebris',
'controle_codes_barres' => 1,
'unimarc_zone_titre' => '200$a;461$t',
'unicite_code_barres' => 0,
'unicite_code_barres' => Class_CosmoVar::UNIQ_BARCODE_ONLY,
'champs_sup' => '',
'ean_345' => 1]);
......@@ -184,3 +184,69 @@ class NoticeIntegrationDedupCaliceWithoutIsbnTest extends NoticeIntegrationTestC
$this->assertEquals(2, Class_Notice::count());
}
}
/** @see http://forge.afi-sa.fr/issues/89128 */
class NoticeIntegrationDedupOnBarcodeWithinLibraryTest extends NoticeIntegrationTestCase {
public function getProfilDonnees() {
return Class_IntProfilDonnees::forPMB()
->setIdProfil(113)
->getRawAttributes();
}
public function setUp() {
parent::setUp();
$this->fixture('Class_Notice',
['id' => 30,
'type_doc' => 1,
'alpha_titre' => 'ACTUALITE DU VIRTUEL',
'alpha_auteur' => 'FR BNF',
'titres' => 'ACTUALITE AKTUALIT VIRTUEL',
'auteurs' => 'BNF',
'editeur' => '[Centre national d\'art et de culture Georges-Pompidou (Paris)]',
'isbn' => '978-2-7189-6666-4',
'unimarc' => '',
'ean' => null,
'id_commerciale' => '',
'id_bnf' => '',
'clef_alpha' => 'ACTUALITEDUVIRTUEL--FRB--CENTRENATIONALDARTETDECULTUREGEORGESPOMPIDOUPARIS-1997-5',
'clef_oeuvre' => 'ACTUALITEDUVIRTUEL--FRB-',
'clef_chapeau' => '',
'qualite' => 10,
'date_creation' => '2015-05-02 00:00:00',
'date_maj' => '2015-09-13 13:22:53',
'url_vignette' => Class_WebService_Vignette::NO_DATA,
'url_image' => Class_WebService_Vignette::NO_DATA]);
$this->fixture('Class_Exemplaire',
['id' => 23,
'id_notice' => 30,
'code_barres' => '18120',
'id_int_bib' => 6]);
}
/** @test */
public function withUniciteCodeBarresOnlyNumberOfRecordsShouldBeOne() {
Class_CosmoVar::set(Class_Notice_DoubleFinder::VAR_BARCODE_UNIQ_MODE,
Class_CosmoVar::UNIQ_BARCODE_ONLY);
$this->loadNotice('unimarc_pmb_pierres');
$this->assertCount(1, Class_Notice::findAll());
$this->assertCount(1, Class_Exemplaire::findAll());
}
/** @test */
public function withUniciteCodeBarresWithLibraryNumberOfRecordsShouldBeTwo() {
Class_CosmoVar::set(Class_Notice_DoubleFinder::VAR_BARCODE_UNIQ_MODE,
Class_CosmoVar::UNIQ_BARCODE_WITHIN_LIBRARY);
$this->loadNotice('unimarc_pmb_pierres');
$this->assertCount(2, Class_Notice::findAll());
$this->assertCount(2, Class_Exemplaire::findAll());
}
}
\ No newline at end of file
......@@ -33,7 +33,7 @@ class NoticeIntegrationSuccinteTest extends ModelTestCase {
'non_exportable'=> 'electre;decitre;gam;zebris',
'controle_codes_barres'=> 0,
'unimarc_zone_titre' => '200$a;461$t',
'unicite_code_barres' => 0,
'unicite_code_barres' => Class_CosmoVar::UNIQ_BARCODE_ONLY,
'champs_sup' => '',
'ean_345' => '',
'Z3950_cache_only' => '0',
......@@ -104,7 +104,7 @@ class NoticeIntegrationSuccinteTest extends ModelTestCase {
'statut_z3950' => "3",
'serveur' => "Bnf",
'erreur' => false,
'unimarc' => '01075cjm 22002893 450 001002100000009004700021020001700068021005400085071004100139073001800180100004100198101000800239102000700247126002500254200007900279210006800358215004700426306003500473608002100508608001600529608003500545686007000580700003600650716002900686801003900715930003100754FRBNF400642570000008http://catalogue.bnf.fr/ark:/12148/cb400642576 aFRb70601036 5FR-759999999:SDC 12-202181aFRbDLS-20051103-917001bInsideOutMusicaSPV 48622 CDcboite 0a0693723486222 a20051103d2005 u y0frey50 ba0 aeng aDE aaguxhxx||||||cdbbex1 a?bEnregistrement sonorefNeal Morse, chant, guit., claviers [acc. instr.] aKlevecInsideOutMusica[Paris]c[distrib. Wagram music]dP 2005 a1 disque compact (56 min 26 s)e1 brochure aProd. : InsideOutMusic, P 2005 arock, pop2frTAV arock2frTAV aedition phonographique2frTAV a1062Cadre de classement de la Bibliographie nationale francaise |314208951aMorsebNeal47214545 314032403aInsideOutMusic 0aFRbBNFc20051103gAFNOR2intermrc 5FR-759999999:SDC 12-202181'])
'unimarc' => '01075cjm 22002893 450 001002100000009004700021020001700068021005400085071004100139073001800180100004100198101000800239102000700247126002500254200007900279210006800358215004700426306003500473608002100508608001600529608003500545686007000580700003600650716002900686801003900715930003100754FRBNF400642570000008http://catalogue.bnf.fr/ark:/12148/cb400642576 aFRb70601036 5FR-759999999:SDC 12-202181aFRbDLS-20051103-917001bInsideOutMusicaSPV 48622 CDcboîte 0a0693723486222 a20051103d2005 u y0frey50 ba0 aeng aDE aaguxhxx||||||cdbbex1 a?bEnregistrement sonorefNeal Morse, chant, guit., claviers [acc. instr.] aKlevecInsideOutMusica[Paris]c[distrib. Wagram music]dP 2005 a1 disque compact (56 min 26 s)e1 brochure aProd. : InsideOutMusic, P 2005 arock, pop2frTAV arock2frTAV aÉdition phonographique2frTAV a1062Cadre de classement de la Bibliographie nationale française |314208951aMorsebNeal47214545 314032403aInsideOutMusic 0aFRbBNFc20051103gAFNOR2intermrc 5FR-759999999:SDC 12-202181'])
->beStrict())
->traiteSuccinte($succinte);
......
......@@ -92,7 +92,7 @@ abstract class NoticeIntegrationTestCase extends ModelTestCase {
'non_exportable'=> 'electre;decitre;gam;zebris',
'controle_codes_barres'=> 0,
'unimarc_zone_titre' => '200$a;461$t',
'unicite_code_barres' => 0,
'unicite_code_barres' => Class_CosmoVar::UNIQ_BARCODE_ONLY,
'champs_sup' => '',
'ean_345' => ''])
->setListeCache(['nature_docs'=> "1:Collection\r\n2:Dataset\r\n3:Event\r\n4:Image",
......
01446nam0 22002291i 450 0010005000001000035000050090015000402000087000550100031001421010008001732150018001813270010001993190028002097000028002377020043002652100040003082250039003484100039003878960186004269950085006129960519006972872 a20101012u u u0frey50  a1979-01-011 aCes pierres qui attendentePour un dialogue entre l'hindouisme et le christianisme a978-2-7189-0137-4dE 28.200 afre a268 p.d20 cm aIndex aAucun droit spécifique 1aCocagnacbA.M.9id:2149 1aDorébJoseph4080f1936-....9id:1123 aParisbPariscDescléed19799id:412 aJésus et Jésus-Christv89id:201 0tJésus et Jésus-Christv89id:201 ahttps://brieuc.bibliossimo.net/pmb/opac_css/getimage.php?url_image=http%3A%2F%2Fimages-eu.amazon.com%2Fimages%2FP%2F%21%21isbn%21%21.08.MZZZZZZZ.jpg&noticecode=9782718901374&vigurl= aMédiathèque Saint-YvescMédiathèque Saint-Yvesf18120kC274ruuqCollections f18120kC274m00000000n00000000aMédiathèque Saint-Yvesb1vSalle RuffeletxCollectionsyCollectionseLivre1Empruntable319expl_id:191029create_date:2014-03-04 10:31:219expl_cb:181209expl_cote:C2749expl_statut:19statut_libelle:Empruntable9expl_typdoc:19tdoc_libelle:Livre9expl_section:19section_libelle:Collections9sdoc_codage_import:Collections9expl_owner:19lender_libelle:Médiathèque Saint-Yves9codestat_libelle:Exemplaires9pret_flag:19location_libelle:Salle Ruffelet9locdoc_codage_import:8
\ No newline at end of file
......@@ -105,6 +105,9 @@ class Class_CosmoVar extends Storm_Model_Abstract {
const DOUBLE_SEARCH_ALPHA_KEY = 1;
const DOUBLE_SEARCH_IDS = 0;
const UNIQ_BARCODE_ONLY = 0;
const UNIQ_BARCODE_WITHIN_LIBRARY = 1;
const PICKUP_LOCATION_ITEM = 0;
const PICKUP_LOCATION_CHOICE = 1;
const PICKUP_LOCATION_PATRON = 2;
......
......@@ -21,8 +21,9 @@
class Class_Notice_DoubleFinder {
const VAR_BARCODE_UNIQ_MODE = 'unicite_code_barres';
const VAR_DOUBLE_MODE = 'mode_doublon';
const
VAR_BARCODE_UNIQ_MODE = 'unicite_code_barres',
VAR_DOUBLE_MODE = 'mode_doublon';
protected
$_barcode_uniq_mode,
......@@ -90,7 +91,7 @@ class Class_Notice_DoubleFinder {
return;
$conditions = ['code_barres' => $item['code_barres']];
if ($this->_barcode_uniq_mode == '1')
if ($this->_barcode_uniq_mode == Class_CosmoVar::UNIQ_BARCODE_WITHIN_LIBRARY)
$conditions['id_int_bib'] = (int) $this->_library->getId();
return $this->_getRecordIdByItem($conditions);
......
......@@ -2348,7 +2348,7 @@ class Class_Profil extends Storm_Model_Abstract {
foreach($modules as $key => $module) {
if( $module['type_module'] == $type_module
&& $module['parent_id'] == $id
&& $key >= 1000
&& $key >= Class_Systeme_ModulesAccueil_ConteneurDeuxColonnes::MODULE_ID_SHIFT
&& $key == $two_cols_pref['col_' . $colonne . '_module_id'])
return $key;
}
......
......@@ -21,6 +21,7 @@
class Class_Systeme_ModulesAccueil_ConteneurDeuxColonnes extends Class_Systeme_ModulesAccueil_Null {
const CODE = 'CONTENEUR_DEUX_COLONNES';
const MODULE_ID_SHIFT = 1000;
protected
$_group = Class_Systeme_ModulesAccueil::GROUP_SITE,
......@@ -77,7 +78,7 @@ class Class_Systeme_ModulesAccueil_ConteneurDeuxColonnes extends Class_Systeme_M
public static function getOrCreateModuleForCol($profil, $id, $type_module, $colonne) {
if(!$id = $profil->getModuleIdFromCol($id, $type_module, $colonne))
return $profil->createNewModuleAccueilId(1000);
return $profil->createNewModuleAccueilId(static::MODULE_ID_SHIFT);
return $id;
}
......
......@@ -81,6 +81,12 @@ class Class_Systeme_Report_Headers extends Class_Systeme_Report_Abstract {
$this->_('Base de données'),
array_at('dbname',
Zend_Db_Table::getDefaultAdapter()->getConfig()));
$visitor->visitData('patch_level',
$this->_('Niveau de patch'),
['expected' => (string)(new Class_Migration_Patchs)->getLastPatchNumber(),
'actual' => Class_CosmoVar::get('patch_level')]);
$visitor->visitData('php', $this->_('PHP'), PHP_VERSION);
}
}
......
......@@ -171,13 +171,20 @@ class Class_WebService_SIGB_Emprunt extends Class_WebService_SIGB_ExemplaireOper
if ('end_issue_date' == $key)
return $this->_isBeforeDate($this->getIssueDate(), $value);
if (!'onhold' == $key)
if ('onhold' != $key)
return true;
if ('all' == $value)
return true;
return $this->getOnhold() == (('yes' == $value) ? 1 : 0);
return ('yes' == $value)
? $this->isOnHold()
: !$this->isOnHold();
}
public function isOnHold() {
return 0 != $this->getOnHold();
}
......
......@@ -88,13 +88,13 @@ class Class_Webservice_SIGB_PMB_Service extends Class_WebService_SIGB_AbstractSe
$exemplaire->getIdOrigine()]);
$result = (array) $this->_getJsonData($json, 'result');
if(!$result)
return ['status' => false, 'erreur' => $this->_('Réservation impossible : le service de réservation PMB via webservice est indisponible')];
if (!$result)
return $this->_error($this->_('Réservation impossible : le service de réservation PMB via webservice est indisponible'));
if(isset($result['error']))
return ['status' => false, 'erreur' => $this->_('Réservation impossible : Vous avez déjà réservé cette exemplaire')];
return $this->_error($this->_('Réservation impossible : Vous avez déjà réservé cette exemplaire'));
return true;
return $this->_success();
}
......@@ -102,16 +102,23 @@ class Class_Webservice_SIGB_PMB_Service extends Class_WebService_SIGB_AbstractSe
$session_token = $this->openSessionForUser($user);
$json = $this->httpPost('pmbesOPACEmpr_delete_resa', [$session_token,
$reservation_id]);
return true;
return $this->_success();
}
public function prolongerPret($user, $pret_id) {
$session_token = $this->openSessionForUser($user);
if(!$json = $this->httpPost('pmbesSelfServices_self_renew', [$session_token, $pret_id]))
return ['statut' => false, 'erreur' => $this->_('Prolongation impossible : le service de prolongation PMB via webservice est indisponible')];
if((!$json = $this->httpPost('pmbesSelfServices_self_renew', [$session_token, $pret_id]))
|| (!$result = json_decode($json, true)))
return $this->_error($this->_('Prolongation impossible : le service de prolongation PMB via webservice est indisponible'));
return true;
if (array_key_exists('result', $result)
&& is_array($result['result'])
&& array_key_exists('message', $result['result'])
&& $message = $result['result']['message'])
return $this->_error($message);
return $this->_success();
}
......@@ -196,7 +203,7 @@ class Class_Webservice_SIGB_PMB_Service extends Class_WebService_SIGB_AbstractSe
->setId($emprunt_json['expl_id'])
->setTitre($emprunt_json['expl_libelle'])
->setCodeBarre($emprunt_json['expl_cb'])
->setDateRetour(implode('-', array_reverse(explode('/', $emprunt_json['loan_returndate']))));
->setDateRetour($emprunt_json['loan_returndate']);
return $emprunt;
}
......@@ -339,4 +346,3 @@ class JsonWebClient {
}
}
?>
\ No newline at end of file
......@@ -30,7 +30,9 @@ class ZendAfi_View_Helper_Portail extends ZendAfi_View_Helper_BaseHelper {
$ret[$division_demandee] = '';
foreach ($cfg_accueil["modules"] as $id_module => $module) {
if ($id_module === null) continue;
if ($id_module === null
|| Class_Systeme_ModulesAccueil_ConteneurDeuxColonnes::MODULE_ID_SHIFT <= $id_module)
continue;
$helper = ZendAfi_View_Helper_Accueil_Base::getModuleHelperFromParams($id_module, $module, $this->view);
if (!$helper) continue;
......
(function() {
var getJSQueryString = function(script) {
var
scripts = document.getElementsByTagName('script'),
i,
curScript;
var getJSQueryString = function(script) {
var
scripts = document.getElementsByTagName('script'),
i,
curScript;
for (i = 0; i < scripts.length; ++i) {
curScript = scripts[i];
for (i = 0; i < scripts.length; ++i) {
curScript = scripts[i];
if (curScript.src.match(script)) {
return (curScript.src.match(/\?(.*)/) || [undefined])[1];
}
}
}
if (curScript.src.match(script)) {
return (curScript.src.match(/\?(.*)/) || [undefined])[1];
}
}
}
var getJSParams = function(script) {
var
qs = getJSQueryString(script),
search = /([^&=]+)=?([^&]*)/g,
urlParams = {};
var getJSParams = function(script) {
var
qs = getJSQueryString(script),
search = /([^&=]+)=?([^&]*)/g,
urlParams = {};
while (match = search.exec(qs))
while (match = search.exec(qs))
urlParams[match[1]] = match[2];
return urlParams;
}
return urlParams;
}
var getJSParamNamed = function (script, name) {
return getJSParams(script)[name];
}
var getJSParamNamed = function (script, name) {
return getJSParams(script)[name];
}
var bwid = getJSParamNamed('babeltheque.js', 'bwid');
var bwid = getJSParamNamed('babeltheque.js', 'bwid');
window.loadBabelthequeScript = function(isbn) {
insertBabelthequeISBNTag(isbn);
$.getScript('http://www.babeltheque.com/bw_' + bwid +'.js');
}
window.loadBabelthequeScript = function(isbn) {
insertBabelthequeISBNTag(isbn);
$.getScript('https://www.babelio.com/bw_' + bwid +'.js');
}
})();
$.fn.babelthequeTag=function(info) {
return this.each(function() {
$(this).append('<div id="BW_'+info+'"></div>');
});
return this.each(function() {
$(this).append('<div id="BW_'+info+'"></div>');
});
}
var insertBabelthequeISBNTag = function(isbn) {
if (!$('input#BW_id_isbn').length)
$('body').append('<input type="hidden" id="BW_id_isbn" value="'+isbn+'"\>');
if (!$('input#BW_id_isbn').length)
$('body').append('<input type="hidden" id="BW_id_isbn" value="'+isbn+'"\>');
}
var blocNoticeAfterLoad = function (info, isbn, target) {
if ("" == isbn)
return;
if ("" == isbn)
return;
var callback = $(window).attr(info + 'NoticeAfterLoad');
if (undefined == callback)
return;
var callback = $(window).attr(info + 'NoticeAfterLoad');
if (undefined == callback)
return;
callback(target);
loadBabelthequeScript(isbn);
callback(target);
loadBabelthequeScript(isbn);
}
var tagsNoticeAfterLoad = function(target) {
target.prepend('<div id="BW_etiquettes"></div>');
target.prepend('<div id="BW_etiquettes"></div>');
}
var avisNoticeAfterLoad = function(target) {
var tr_critiques = target.find('table tr:nth-child(2)');
var tr_critiques = target.find('table tr:nth-child(2)');
if (!tr_critiques.find('ul').length)
$('<ul></ul>').appendTo(tr_critiques);
if (!tr_critiques.find('ul').length)
$('<ul></ul>').appendTo(tr_critiques);
var ul_critiques = tr_critiques.find('ul');
$('<li class="notes_avis_babeltheque"><span id="BW_notes"></span><span id="BW_critiques"></span> <span id="BW_critiques_pro"></span></li>')
.appendTo(ul_critiques);
var ul_critiques = tr_critiques.find('ul');
$('<li class="notes_avis_babeltheque"><span id="BW_notes"></span><span id="BW_critiques"></span> <span id="BW_critiques_pro"></span></li>')
.appendTo(ul_critiques);
}
var videosNoticeAfterLoad = function(target) {
target.find('td:contains("Aucune vidéo")').remove();
target.prepend('<div id="BW_videos"></div>');
target.find('td:contains("Aucune vidéo")').remove();
target.prepend('<div id="BW_videos"></div>');
}
var resumeNoticeAfterLoad = function(target) {
target.find('td:contains("Aucune information")').remove();
target.babelthequeTag('citations');
target.find('td:contains("Aucune information")').remove();
target.babelthequeTag('citations');
}
var babelthequeNoticeAfterLoad = function(target) {
target.empty().babelthequeTag('suggestions');
target.empty().babelthequeTag('suggestions');
}
......@@ -964,18 +964,15 @@ class NoticeAjaxControllerExemplairesTest extends NoticeAjaxControllerExemplaire
class NoticeAjaxControllerBabelthequeTest extends AbstractControllerTestCase {
protected $_storm_default_to_volatile = true;
public function setUp() {
parent::setUp();
Class_Notice::getLoader()
->newInstanceWithId(157675)
->setIsbn('978-2-226-21993-0');
$this->fixture('Class_Notice', ['id' => 157675,
'isbn' => '978-2-226-21993-0']);
Class_AdminVar::getLoader()
->newInstanceWithId('BABELTHEQUE_JS')
->setValeur('http://www.babeltheque.com/bw_85.js');
Class_AdminVar::set('BABELTHEQUE_JS', 'https://www.babelio.com/bw_85.js');
$this->dispatch('/opac/noticeajax/babeltheque?id_notice=N157675', true);
}
......@@ -983,7 +980,7 @@ class NoticeAjaxControllerBabelthequeTest extends AbstractControllerTestCase {
/** @test */
public function responseShouldContainsBabelthequeScript() {
$this->assertXPath('//script[@src="http://www.babeltheque.com/bw_85.js"]');
$this->assertXPath('//script[@src="https://www.babelio.com/bw_85.js"]');
}
......@@ -1008,8 +1005,6 @@ class NoticeAjaxControllerBabelthequeTest extends AbstractControllerTestCase {
class NoticeAjaxControllerBabelthequeWithoutOptionTest extends AbstractControllerTestCase {
public function setUp() {
parent::setUp();
......
......@@ -2625,6 +2625,7 @@ class UpgradeDB_371_Test extends UpgradeDBTestCase {
class UpgradeDB_372_Test extends UpgradeDBTestCase {
public function prepare() {
$this->dropTable('rendez_vous_user_notification');
......@@ -2674,4 +2675,22 @@ class UpgradeDB_372_Test extends UpgradeDBTestCase {
public function shouldHavePrimaryId() {
$this->assertPrimary('rendez_vous_user_notification', 'id');
}
}
class UpgradeDB_373_Test extends UpgradeDBTestCase {
public function prepare() {
$this->silentQuery("UPDATE `variables` SET liste='0:Bibliothèque + codes-barres\r\n1:Code-barres uniquement' WHERE clef='unicite_code_barres'");
}
/** @test */
public function firstOptionShouldBeBarcodeOnlyThenWithBib() {
$this->assertEquals(['0' => 'Code-barres uniquement',
'1' => 'Bibliothèque + codes-barres'],
Class_CosmoVar::getList('unicite_code_barres'));
}
}
\ No newline at end of file
......@@ -431,8 +431,8 @@ class ChamberyKohaFixtures {
}
public static function getPatronInfoChambelleWithOnhold() {
return '<?xml version="1.0" encoding="UTF-8" ?>
public static function getPatronInfoChambelleWithOnhold() {
return '<?xml version="1.0" encoding="UTF-8" ?>
<GetPatronInfo>
<city>Gotham City</city>
<altcontactaddress2></altcontactaddress2>
......@@ -557,11 +557,11 @@ class ChamberyKohaFixtures {
<B_phone></B_phone>
</GetPatronInfo>
';
}
}
public static function getPatronInfoChambelleWithItemonhold() {
return '<?xml version="1.0" encoding="UTF-8" ?>
public static function getPatronInfoChambelleWithItemonhold() {
return '<?xml version="1.0" encoding="UTF-8" ?>
<GetPatronInfo>
<city>Gotham City</city>
<altcontactaddress2></altcontactaddress2>
......@@ -686,5 +686,133 @@ class ChamberyKohaFixtures {
<B_phone></B_phone>
</GetPatronInfo>
';
}
}
\ No newline at end of file
}
public static function getPatronInfoChambelleWithManyItemonhold() {
return '<?xml version="1.0" encoding="UTF-8" ?>
<GetPatronInfo>
<city>Gotham City</city>
<altcontactaddress2></altcontactaddress2>
<B_address2></B_address2>
<altcontactfirstname></altcontactfirstname>
<sort2></sort2>
<borrowernumber>6871</borrowernumber>
<altcontactphone></altcontactphone>
<title></title>
<dateexpiry>2019-06-30</dateexpiry>
<mobile>06 01 02 03 04</mobile>
<cardnumber>90519000053165</cardnumber>
<B_streetnumber></B_streetnumber>
<dateenrolled>2014-04-29</dateenrolled>
<altcontactzipcode></altcontactzipcode>
<streettype></streettype>
<sort1>12</sort1>
<email>xxx@xxx.fr</email>
<contactfirstname></contactfirstname>
<B_country></B_country>
<B_email></B_email>
<phone>01 02 03 04 05</phone>
<B_address></B_address>
<branchcode>PUKA</branchcode>
<guarantorid>0</guarantorid>
<emailpro></emailpro>
<phonepro></phonepro>
<B_city></B_city>
<gonenoaddress>0</gonenoaddress>
<privacy_guarantor_checkouts>0</privacy_guarantor_checkouts>
<categorycode>J14</categorycode>
<dateofbirth>2004-11-10</dateofbirth>
<lost>0</lost>
<zipcode>1123</zipcode>
<lang>default</lang>
<altcontactaddress3></altcontactaddress3>
<checkprevcheckout>inherit</checkprevcheckout>