Bug 28773: (bug 23302 follow-up) Fix add order from z3950 search results
For translated interface. Using 'Order' (the button text) was not a good idea as the interface can be translated :) Signed-off-by: Mark Hofstetter <koha@trust-box.at> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
a1748ae566
commit
75ab9ff8f8
|
|
@ -184,9 +184,9 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color :
|
|||
<div class="btn-group dropup">
|
||||
<a class="btn btn-default btn-xs z3950actions" href="#">MARC</a><button data-toggle="dropdown" class="btn-xs dropdown-toggle"><span class="caret"></span></button>
|
||||
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="z3950preview[% breeding_loo.breedingid | html %]">
|
||||
<li><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid | uri %]" title="MARC" class="previewData"><i class="fa fa-eye"></i> MARC</a></li>
|
||||
<li><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&importid=[% breeding_loo.breedingid | uri %]" title="Card" class="previewData"><i class="fa fa-eye"></i> Card</a></li>
|
||||
<li><a href="/cgi-bin/koha/acqui/neworderempty.pl?frameworkcode=[% frameworkcode | uri %]&breedingid=[% breeding_loo.breedingid | uri %]&booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]" class="chosen" title="Order"><i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %]</a></li>
|
||||
<li><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid | uri %]" title="MARC" class="previewData" data-action="show_marc"><i class="fa fa-eye"></i> MARC</a></li>
|
||||
<li><a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&importid=[% breeding_loo.breedingid | uri %]" title="Card" class="previewData" data-action="show_card"><i class="fa fa-eye"></i> Card</a></li>
|
||||
<li><a href="/cgi-bin/koha/acqui/neworderempty.pl?frameworkcode=[% frameworkcode | uri %]&breedingid=[% breeding_loo.breedingid | uri %]&booksellerid=[% booksellerid | uri %]&basketno=[% basketno | uri %]" class="chosen" title="Order" data-action="order"><i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %]</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -126,9 +126,9 @@ $( document ).ready( function() {
|
|||
|
||||
$( "#resultst" ).on("click", ".chosen", function(e) {
|
||||
e.preventDefault();
|
||||
var title = $(this).attr('title');
|
||||
ChangeLastAction( title, 0 );
|
||||
if( title == 'Order' ) window.location = $(this).attr('href');
|
||||
var action = $(this).data('action');
|
||||
ChangeLastAction( action, 0 );
|
||||
if( action == 'order' ) window.location = $(this).attr('href');
|
||||
else {
|
||||
opener.document.location = $(this).attr('href');
|
||||
window.close();
|
||||
|
|
@ -140,15 +140,17 @@ function InitLastAction() {
|
|||
if( $("#resultst").length == 0 ) return;
|
||||
try { last_action = localStorage.getItem('z3950search_last_action'); } catch (err) {}
|
||||
if( last_action ) {
|
||||
var linkcount = $(".z3950actions:eq(0)").siblings(".dropdown-menu").find("a[title='"+last_action+"']").length;
|
||||
if( linkcount == 0 ) return;
|
||||
if( last_action != 'MARC' ) $( ".z3950actions" ).text( last_action );
|
||||
var z3950_action_li = $(".z3950actions:eq(0)").siblings(".dropdown-menu").find("a[data-action='"+last_action+"']");
|
||||
if( z3950_action_li.length == 0 ) return;
|
||||
if( last_action != 'show_marc' ) {
|
||||
$( ".z3950actions" ).text($(z3950_action_li).text()).data('action', last_action);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ChangeLastAction(title, change_text) {
|
||||
if( last_action && last_action == title ) return;
|
||||
last_action = title;
|
||||
function ChangeLastAction(action, change_text) {
|
||||
if( last_action && last_action == action ) return;
|
||||
last_action = action;
|
||||
if( change_text ) $( ".z3950actions" ).text( last_action );
|
||||
if( previewed == 0 || change_text == 1 )
|
||||
try { localStorage.setItem('z3950search_last_action', last_action); } catch(err) {}
|
||||
|
|
|
|||
Loading…
Reference in New Issue