From 1d5cdf90880a4779e5dbc65504d10a57141bb0f2 Mon Sep 17 00:00:00 2001 From: gloas <gloas@afi-sa.fr> Date: Tue, 26 Sep 2017 11:40:58 +0200 Subject: [PATCH] hotline #65092 change front admin thumb actions from anchor to button --- VERSIONS_HOTLINE/65092 | 2 + .../views/scripts/recherche/viewnotice.phtml | 28 +++++------ public/opac/js/subModal.js | 46 ++++++++++--------- 3 files changed, 41 insertions(+), 35 deletions(-) create mode 100644 VERSIONS_HOTLINE/65092 diff --git a/VERSIONS_HOTLINE/65092 b/VERSIONS_HOTLINE/65092 new file mode 100644 index 00000000000..2029c2ed991 --- /dev/null +++ b/VERSIONS_HOTLINE/65092 @@ -0,0 +1,2 @@ + - ticket #65092 : Administration : correction de l'affichage des boutons de gestion de la vignette d'une notice. + \ No newline at end of file diff --git a/application/modules/opac/views/scripts/recherche/viewnotice.phtml b/application/modules/opac/views/scripts/recherche/viewnotice.phtml index 7ccc6197942..c13acd9cebf 100644 --- a/application/modules/opac/views/scripts/recherche/viewnotice.phtml +++ b/application/modules/opac/views/scripts/recherche/viewnotice.phtml @@ -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> diff --git a/public/opac/js/subModal.js b/public/opac/js/subModal.js index c6126807a88..a96e37dc0f9 100644 --- a/public/opac/js/subModal.js +++ b/public/opac/js/subModal.js @@ -6,13 +6,15 @@ window.initializePopups = function() { $('[data-popup="true"]') - .unbind('click').click(function(event){ + .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')); }); current_anchor = undefined; @@ -32,10 +34,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); }); } @@ -175,8 +177,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; @@ -184,18 +186,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)}); } }); @@ -207,19 +209,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; }; -- GitLab