Commit 294c7548 authored by Ghislain Loas's avatar Ghislain Loas

version 7.11.1

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

# Conflicts:
#	VERSIONS
#	library/startup.php
#	public/opac/js/subModal.js
parents 85c0d5a9 3c5d23d1
27/09/2017 - v7.11.1
- ticket #64357 : Correction des problèmes d'affichage sur tablette Apple des popups
- ticket #65092 : Administration : correction de l'affichage des boutons de gestion de la vignette d'une notice.
- ticket #65312 : Administration : Explorateur de fichier : les modérateurs biliothèques peuvent accéder à l'explorateur.
- ticket #63383 : Cosmogramme : correction de l'import des paniers.
25/09/2017 - v7.11.0
- ticket #61314 : Administration : mise en place d'un nouvel explorateur de fichiers.
......
- ticket #65312 : Explorateur de fichier : les modérateurs biliothèques peuvent accéder à l'explorateur.
......@@ -53,21 +53,23 @@ $script_loader = Class_ScriptLoader::getInstance()
ZendAfi_View_Helper_Notice_Vignette::MODE_VIEW);
if ($this->display_modifier_vignette_link)
echo $this->tagAnchor(['module' => 'admin', 'controller' => 'records', 'action' => 'thumbnail'],
$this->_('Modifier la vignette'),
['title' => $this->_('Modifier la vignette de la notice "%s"',
$this->notice->getTitrePrincipal()),
'data-popup' => 'true',
'class' => 'bouton']
);
echo $this->admin_button((new Class_Entity())
->setUrl($this->url(['module' => 'admin',
'controller' => 'records',
'action' => 'thumbnail']))
->setText($this->_('Modifier'))
->setAttribs(['title' => $this->_('Modifier la vignette de la notice "%s"',
$this->notice->getTitrePrincipal()),
'data-popup' => 'true']));
if ($this->show_reset_thumbnail_link)
echo $this->tagAnchor(['module' => 'admin', 'controller' => 'records', 'action' => 'reset-thumbnail'],
$this->_('Générer la vignette'),
['title' => $this->_('Supprimer et re-générer la vignette de la notice "%s"',
$this->notice->getTitrePrincipal()),
'class' => 'bouton']
);
echo $this->admin_button((new Class_Entity())
->setUrl($this->url(['module' => 'admin',
'controller' => 'records',
'action' => 'reset-thumbnail']))
->setText($this->_('Générer'))
->setAttribs(['title' => $this->_('Supprimer et re-générer la vignette de la notice "%s"',
$this->notice->getTitrePrincipal())]));
?>
<div id="reseaux-sociaux"><?php echo $this->reseauxSociaux($this->notice); ?></div>
......
<?php
try{
$adapter = Zend_Db_Table_Abstract::getDefaultAdapter();
$adapter->query('alter table integrations add column nom_fichier varchar(255) not null');
$adapter->query('alter table notices_paniers add column integration_hash varchar(255) not null');
} catch(Exception $e) {}
?>
......@@ -38,7 +38,8 @@ class Class_Cosmogramme_Integration extends Storm_Model_Abstract {
'role' => 'integration',
'referenced_in' => 'profil']],
$_default_attribute_values = ['type_doc' => ''],
$_default_attribute_values = ['type_doc' => '',
'nom_fichier' => ''],
$_data_source;
......@@ -144,4 +145,18 @@ class Class_Cosmogramme_Integration extends Storm_Model_Abstract {
$this->_data_source = $source;
return $this;
}
public function getHash() {
return md5(implode(',', $this->_getHashAttributes()));
}
protected function _getHashAttributes() {
return [$this->getIdBib(),
$this->getTypeOperation(),
$this->getProfil(),
$this->getTypeDoc(),
$this->getNomFichier()];
}
}
\ No newline at end of file
......@@ -128,13 +128,14 @@ class Class_Cosmogramme_Integration_PhasePanier extends Class_Cosmogramme_Integr
->setIdIntBib($id_int_bib)
->setUser($owner)
->setIdabon($owner->getIdabon())
->setIntegrationHash($integration->getHash())
->addNotice($exemplaire->getNotice())
->save();
}
protected function _clean($integration) {
$baskets = Class_PanierNotice::findAllBy(['id_int_bib' => $integration->getId()]);
$baskets = Class_PanierNotice::findAllBy(['integration_hash' => $integration->getHash()]);
foreach($baskets as $basket)
$basket->setNotices('')->save();
}
......@@ -151,7 +152,5 @@ class Class_Cosmogramme_Integration_PhasePanier extends Class_Cosmogramme_Integr
protected function _afterFileProcessed($integration) {
Class_PanierNotice::deleteBy(['id_int_bib' => $integration->getId(),
'notices' => '']);
}
}
......@@ -210,17 +210,13 @@ class Class_Cosmogramme_Integration_PhasePrepareIntegrations extends Class_Cosmo
public function _newIntegration($filename, $majauto) {
$id_bib = $majauto->getIdBib();
$id_profil = $majauto->getProfil();
$type_operation = $majauto->getTypeOperation();
$type_doc = $majauto->getTypeDoc();
$integration = Class_Cosmogramme_Integration::newInstance(['id_bib' => $id_bib,
'type_operation' => $type_operation,
'profil' => $id_profil,
'type_doc' => $type_doc,
$integration = Class_Cosmogramme_Integration::newInstance(['id_bib' => $majauto->getIdBib(),
'type_operation' => $majauto->getTypeOperation(),
'profil' => $majauto->getProfil(),
'type_doc' => $majauto->getTypeDoc(),
'date_transfert' => $this->getCurrentDate(),
'fichier' => $filename,
'nom_fichier' => $majauto->getNomFichier(),
'traite' => 'non']);
$integration->save();
}
......
......@@ -135,7 +135,8 @@ class Class_PanierNotice extends Storm_Model_Abstract {
'unique' => true]],
$_default_attribute_values = ['notices' => '',
'libelle' => ''];
'libelle' => '',
'integration_hash' => ''];
public function index() {
......
......@@ -82,7 +82,7 @@ class Bokeh_Engine {
function setupConstants() {
defineConstant('BOKEH_MAJOR_VERSION','7.11');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.0');
defineConstant('BOKEH_RELEASE_NUMBER', BOKEH_MAJOR_VERSION . '.1');
defineConstant('BOKEH_REMOTE_FILES', 'http://git.afi-sa.fr/afi/opacce/');
......
......@@ -6,15 +6,15 @@
window.initializePopups = function() {
$('[data-popup="true"], [data-popup="1"]')
.unbind('onclick')
.unbind('click')
.prop('onclick', null)
.off('click')
.click(function(event){
event.preventDefault();
current_anchor=$(this);
addLoadingClass();
var url = $(this).attr('data-url')
? $(this).attr('data-url')
: $(this).attr('href');
var url = $(this).attr('data-url')
? $(this).attr('data-url')
: $(this).attr('href');
opacDialogFromUrl(addPath(url, '/render/popup'));
});
......@@ -46,10 +46,10 @@
form.submit(function(event) {
event.preventDefault();
setTimeout( //wait for all bind events to be executed (ex: input manipulation events / treeselect)
function() {
window.doSubmit(form) ;
},
1);
function() {
window.doSubmit(form) ;
},
1);
});
}
......@@ -138,20 +138,21 @@
var fixWindowPositionAndWidth = function(dialog) {
var max_height = Math.round($(window).height() * 0.8);
var window_width = Math.round($(window).width());
var min_width = 400;
dialog
.css('position', 'fixed')
.css('top', '15%')
.css('left', '20%')
.css('width', '60%')
.css('left', window_width < min_width ? '0' : '20%')
.css('width', window_width < min_width ? '100%' : '60%')
.css('max-height', max_height + 'px')
.find('.ui-dialog-content')
.css('max-height', (max_height - 50) + 'px')
.css('width', 'auto')
.css('overflow-y', 'auto');
dialog.position({of: $(window)});
}
}
window.opacShowModal = function(url, width, height, returnFunc, showCloseBox, titleDialog) {
......@@ -204,8 +205,8 @@
window.opacDialog = function(container, data) {
container[0].innerHTML = data['content'];
var show_modal = (data['show_modal'] && data['show_modal']=='true')
? true
: false;
? true
: false;
var dialog = null;
......@@ -213,18 +214,18 @@
title: data['title'],
modal:show_modal,
close: function(event, ui) {
onClose(event, ui)
onClose(event, ui)
},
open: function(event, ui) {
dialog = $(event.target).closest('.ui-widget');
setTimeout(onOpen(dialog), 100);
dialog = $(event.target).closest('.ui-widget');
setTimeout(onOpen(dialog), 100);
},
resizeStart: function(event, ui) {
dialog.css('position', 'absolute');
dialog.css('position', 'absolute');
},
resizeStop: function(event, ui) {
dialog.css('position', 'fixed');
dialog.position({of: $(window)});
dialog.css('position', 'fixed');
dialog.position({of: $(window)});
}
});
......@@ -236,19 +237,19 @@
window.addLoadingClass = function () {
var initCurrentAnchor = function() {
if (current_anchor != undefined)
return current_anchor;
return current_anchor;
var dialog_form = $('#opac-dialog form');
if (!dialog_form.length)
return undefined;
return undefined;
current_anchor = undefined;
var action = dialog_form[0].getAttribute('action');
$('body').find('a[class*="edit_"], .configuration_module a').each(function() {
var href = $(this)[0].getAttribute('href');
if(action.indexOf(href) > -1 || href.indexOf(action) > -1) {
return current_anchor = $(this);
}
var href = $(this)[0].getAttribute('href');
if(action.indexOf(href) > -1 || href.indexOf(action) > -1) {
return current_anchor = $(this);
}
});
return current_anchor;
};
......
......@@ -799,7 +799,7 @@ class RechercheControllerUploadVignetteTest extends RechercheControllerNoticeTes
public function linkToUploadVignetteShouldBePresentForModoBib() {
Class_Users::getIdentity()->changeRoleTo(ZendAfi_Acl_AdminControllerRoles::MODO_BIB);
$this->dispatch(sprintf('recherche/viewnotice/id/%d', $this->notice->getId()), true);
$this->assertXPathContentContains('//a', 'Modifier la vignette');
$this->assertXPath('//button[contains(@title, "Modifier la vignette")]');
}
......@@ -820,7 +820,7 @@ class RechercheControllerUploadVignetteTest extends RechercheControllerNoticeTes
'famille_id' => Class_CodifTypeDoc::LIVRE]);
$this->dispatch(sprintf('recherche/viewnotice/id/%d', $this->notice->getId()), true);
$this->assertXPathContentContains('//a', 'Modifier la vignette');
$this->assertXPath('//button[contains(@title, "Modifier la vignette")]');
}
}
......@@ -833,7 +833,7 @@ class RechercheControllerGenerateThumbnailTest extends RechercheControllerNotice
public function linkToGenerateThumbnailShouldNotBePresentForAbonneSIGB() {
Class_Users::getIdentity()->beAbonneSIGB();
$this->dispatch(sprintf('recherche/viewnotice/id/%d', $this->notice->getId()), true);
$this->assertNotXPath('//a[contains(@href, "admin/records/reset-thumbnail")]');
$this->assertNotXPath('//button[contains(@onclick, "admin/records/reset-thumbnail")][contains(@title, "Supprimer et re-générer la vignette")]');
}
......@@ -841,8 +841,7 @@ class RechercheControllerGenerateThumbnailTest extends RechercheControllerNotice
public function linkToGenerateThumbnailShouldBePresentForModoBib() {
Class_Users::getIdentity()->changeRoleTo(ZendAfi_Acl_AdminControllerRoles::MODO_BIB);
$this->dispatch(sprintf('recherche/viewnotice/id/%d', $this->notice->getId()), true);
$this->assertXPathContentContains('//a[contains(@href, "admin/records/reset-thumbnail")]',
'Générer la vignette');
$this->assertXPath('//button[contains(@onclick, "admin/records/reset-thumbnail")][contains(@title, "Supprimer et re-générer la vignette")]');
}
}
......@@ -861,7 +860,7 @@ class RechercheControllerViewNoticeAsAdminTest extends RechercheControllerNotice
/** @test */
public function linkToUploadVignetteShouldBePresent() {
$this->assertXPathContentContains('//a', 'Modifier la vignette',$this->_response->getBody());
$this->assertXPath('//button[contains(@title, "Modifier la vignette")]');
}
......
......@@ -1733,4 +1733,28 @@ class UpgradeDB_335_Test extends UpgradeDBTestCase {
$batch = $this->fetchBatchByType($type);
$this->assertEquals($pick_day, $batch['pick_day']);
}
}
\ No newline at end of file
}
class UpgradeDB_336_Test extends UpgradeDBTestCase {
public function prepare() {
try {
$this->query('ALTER TABLE integrations DROP column nom_fichier');
$this->query('ALTER TABLE notices_paniers DROP column integration_hash');
} catch(Exception $e) {}
}
/** @test */
public function columnNomFichierShouldBePresent() {
$this->assertColumn('integrations', 'nom_fichier');
}
/** @test */
public function columnIntegrationHashShouldBePresent() {
$this->assertColumn('notices_paniers', 'integration_hash');
}
}
......@@ -44,11 +44,12 @@ abstract class PhasePanierTestCase extends Class_Cosmogramme_Integration_PhaseTe
$this->fixture('Class_Cosmogramme_Integration',
['id' => 999,
'bib' => Class_IntBib::find(2),
'profil_donnees' => Class_IntProfilDonnees::find(102),
'id_bib' => 2,
'profil' => 102,
'type_operation' => Class_Cosmogramme_Integration::TYPE_OPERATION_TOTAL,
'traite' => 'non',
'fichier' => 'baskets.txt',
'nom_fichier' => 'baskets.txt',
'pointeur_reprise' => 0]);
}
......@@ -121,6 +122,7 @@ abstract class PhasePanierKohaTestCase extends PhasePanierTestCase {
'id_user' => 3,
'id_sigb' => 1,
'id_int_bib' => 2,
'integration_hash' => '577f79a2c26968b6f5e1360df0dc17af',
'libelle' => 'will be killed',
'notices' => 'VOL714']);
......@@ -173,13 +175,23 @@ class PhasePanierKohaSameIdOrigine extends PhasePanierKohaTestCase {
/** @test */
public function firstBasketRecordsShouldContainNoticeLune() {
$this->assertEquals(['COKEENSTOCK',
'CASTAFIORE',
'LUNE'],
Class_PanierNotice::find(1)->getClesNotices());
public function fourthBasketRecordsShouldBeEmpty() {
$this->assertEmpty(Class_PanierNotice::find(4)->getClesNotices());
}
/** @test */
public function fourthBasketIntegrationHashShouldBe577f79a2c26968b6f5e1360df0dc17af() {
$this->assertEquals('577f79a2c26968b6f5e1360df0dc17af',
Class_PanierNotice::find(4)->getIntegrationHash());
}
/** @test */
public function firstBasketIntegrationHashShouldBecome577f79a2c26968b6f5e1360df0dc17af() {
$this->assertEquals('577f79a2c26968b6f5e1360df0dc17af',
Class_PanierNotice::find(1)->getIntegrationHash());
}
}
......@@ -254,7 +266,7 @@ class PhasePanierFullImportTest extends PhasePanierKohaTestCase {
/** @test */
public function basketTitiShouldBeEmpty() {
$this->assertEmpty(Class_PanierNotice::findFirstBy(['id_sigb' => '7'])->getClesNotices());
$this->assertEmpty(Class_PanierNotice::findFirstBy(['id_sigb' => 7])->getClesNotices());
}
......@@ -454,7 +466,7 @@ class PhasePanierNanookTest extends PhasePanierTestCase {
/** @test */
public function IdIntBibShouldBe2() {
$this->assertEquals('2', $this->_basket->getIdIntBib());
public function IdIntBibShouldBe999() {
$this->assertEquals(2, $this->_basket->getIdIntBib());
}
}
......@@ -188,11 +188,23 @@ class PhasePrepareIntegrationsWithOAITest extends PhasePrepareIntegrationsWithOA
/** @test */
public function firstIntegrationURIShouldBeIntegre1179DotPan() {
public function firstIntegrationFileShouldBeIntegre1179DotPan() {
$this->assertEquals('integre1179.pan', Class_Cosmogramme_Integration::find(2)->getFichier());
}
/** @test */
public function firstIntegrationFileNameShouldBeMyLibraryTotalDotTxt() {
$this->assertEquals('foo/mylibrarytotal.txt', Class_Cosmogramme_Integration::find(2)->getNomFichier());
}
/** @test */
public function firstIntegrationKeyShouldBeHash() {
$this->assertEquals('a7be1b1bbdfe70b6fec563334accab3f', Class_Cosmogramme_Integration::find(2)->getHash());
}
/** @test */
public function secondIntegrationURIShouldBeOAIRepository() {
$this->assertEquals('http://oai-repository.fr/oai', Class_Cosmogramme_Integration::find(3)->getFichier());
......
Markdown is supported
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