Bug 8660: Tag status does not show on multiple tag add

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Passed-QA-by: Paul Poulain <paul.poulain@biblibre.com>
Passed-QA-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This commit is contained in:
Fridolyn SOMERS 2012-08-22 16:10:06 +02:00 committed by Jared Camins-Esakov
parent 560e2d7f67
commit 02755f6c55
8 changed files with 238 additions and 201 deletions

View file

@ -729,7 +729,7 @@ input.deleteshelf:active {
#tagslist li { display : inline; }
a.tag_results_add {
a.tag_add {
background-image: url(../../images/tag-small.png);
background-position : -1px center;
background-repeat : no-repeat;
@ -748,7 +748,6 @@ a.tag_results_add {
.tag_results_input {
background-color: #EEE;
display: none;
margin-left: 1em;
padding: 0.3em;
}
@ -1450,9 +1449,19 @@ padding-left : .4em;
padding-left:20px
}
.searchresults .tagstatus {
display: block;
color: #707070;
.tagstatus {
color: #707070;
padding: 0 4px 0 4px;
margin-left: 5px;
border: 1px solid #bcbcbc;
background-color: #ffffcc;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.results_summary.tagstatus {
display: inline;
}
.results_summary .label {
@ -1463,7 +1472,11 @@ padding-left : .4em;
font-weight: normal;
}
.actions a {
.actions a.hold,
.actions a.addtocart,
.actions a.addtoshelf,
.actions a.addtolist,
.actions a.tag_add {
margin-left : 1em;
text-decoration : none;
}

View file

@ -80,7 +80,8 @@
var MSG_TAGS_ADDED = _("Tags added: ");
var MSG_TAGS_DELETED = _("Tags added: ");
var MSG_TAGS_ERRORS = _("Errors: ");
var MSG_MULTI_ADD_TAG_FAILED = _("Unable to add one or more tags.");[% END %][% END %]
var MSG_MULTI_ADD_TAG_FAILED = _("Unable to add one or more tags.");
var MSG_NO_TAG_SPECIFIED = _("No tag was specified.");[% END %][% END %]
[% IF ( OPACAmazonCoverImages ) %]$(window).load(function() {
verify_images();
});[% END %]

View file

@ -26,12 +26,11 @@ if (typeof(readCookie) == "undefined") {
}
}
KOHA.Tags = {
add_tag_button: function(){
var mybibnum = $(this).attr("title");
var mynewtag = "newtag" + mybibnum;
add_tag_button: function(bibnum, tag){
var mynewtag = "newtag" + bibnum;
var mytagid = "#" + mynewtag;
var mydata = {CGISESSID: readCookie('CGISESSID')}; // Someday this should be OPACSESSID
mydata[mynewtag] = $(mytagid).val(); // need [bracket] for variable property id
mydata[mynewtag] = tag; // need [bracket] for variable property id
var response; // AJAX from server will assign value to response.
$.post(
"/cgi-bin/koha/opac-tags.pl",
@ -61,20 +60,23 @@ KOHA.Tags = {
},
set_tag_status : function(tagid, newstatus) {
$(tagid).html(newstatus);
$(tagid).css({display:"inline"});
$(tagid).show();
},
append_tag_status : function(tagid, newstatus) {
$(tagid).append(newstatus);
$(tagid).css({display:"inline"});
$(tagid).show();
},
clear_all_tag_status : function() {
$(".tagstatus").empty().hide();
},
tag_message: {
tagsdisabled : function(arg) {return (MSG_TAGS_DISABLED);},
scrubbed_all_bad : function(arg) {return (MSG_TAG_ALL_BAD);},
badparam : function(arg) {return (MSG_ILLEGAL_PARAMETER+" "+arg);},
scrubbed : function(arg) {return (MSG_TAG_SCRUBBED+" "+arg);},
failed_add_tag : function(arg) {return (MSG_ADD_TAG_FAILED+ " "+arg+" "+MSG_ADD_TAG_FAILED_NOTE);},
failed_delete : function(arg) {return (MSG_DELETE_TAG_FAILED+ " "+arg+" "+MSG_DELETE_TAG_FAILED_NOTE);},
failed_add_tag : function(arg) {return (MSG_ADD_TAG_FAILED+ " '"+arg+"'. \n"+MSG_ADD_TAG_FAILED_NOTE);},
failed_delete : function(arg) {return (MSG_DELETE_TAG_FAILED+ " '"+arg+"'. \n"+MSG_DELETE_TAG_FAILED_NOTE);},
login : function(arg) {return (MSG_LOGIN_REQUIRED);}
},
@ -92,7 +94,7 @@ KOHA.Tags = {
mydata,
function(data){
eval(data);
$(".tagstatus").empty();
KOHA.Tags.clear_all_tag_status();
var bibErrors = false;
// Display the status for each tagged bib

View file

@ -1,3 +1,5 @@
[% SET TagsInputEnabled = ( opacuserlogin && TagsEnabled && TagsInputOnList ) %]
[% INCLUDE 'doc-head-open.inc' %]
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your cart
[% IF ( print_basket ) %]</title>
@ -22,8 +24,6 @@
<script type="text/javascript">
//<![CDATA[
var MSG_NO_RECORD_SELECTED = _("Please select one or more items");
$.tablesorter.addParser({
// set a unique id
id: 'links',
@ -49,12 +49,11 @@ $(document).ready(function()
$(".cb").click(function(){
enableCheckboxActions();
});
enableCheckboxActions();
}
);
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]
var MSG_NO_TAG_SPECIFIED = _("No tag was specified.");
[% IF ( TagsInputEnabled && loggedinusername ) %]
function tagSelected() {
var bibs = document.getElementById('records').value;
if (bibs) {
@ -70,6 +69,8 @@ function tagCanceled() {
$("#tagsel_form").hide();
$("#tagsel_tag").show();
$("#tag_hides").show();
$("#tagsel_new").val("");
$(".tagstatus").empty().hide();
}
function tagAdded() {
@ -94,7 +95,7 @@ function tagAdded() {
KOHA.Tags.add_multitags_button(bibs, tag);
return false;
}
[% END %][% END %][% END %]
[% END %]
$(document).ready(function(){
$("#CheckAll").click(function(){
var checked = [];
@ -117,12 +118,6 @@ function tagAdded() {
return false;
});
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]
$("#tagsel_button").click(function(){
tagAdded();
return false;
});
[% END %][% END %][% END %]
});
[% IF ( opacuserlogin ) %][% IF ( RequestOnOpac ) %]
function holdSel() {
@ -166,30 +161,38 @@ function enableCheckboxActions(){
<li><a class="hide close" href="opac-basket.pl">Hide window</a></li>
</ul>
</div>
[% END %]
[% UNLESS ( print_basket ) %]
<div id="selections-toolbar">
<a id="CheckAll" href="#">Select all</a>
<a id="CheckNone" href="#">Clear all</a>
<span class="sep">|</span>
<span class="links" id="tag_hides">
<span id="selections">Select titles to: </span>
<a href="#" class="deleteshelf disabled" onclick="delSelRecords(); return false;">Remove</a>
[% IF ( opacuserlogin ) %]
[% IF ( virtualshelves ) %][% IF ( loggedinusername ) %]
<a href="#" class="newshelf disabled" onclick="addSelToShelf(); return false;">Add to a list</a>
[% END %][% END %]
[% IF ( RequestOnOpac ) %]<a href="#" class="hold disabled" onclick="holdSel(); return false;">Place hold</a>[% END %]
[% IF ( TagsInputEnabled && loggedinusername ) %]
<a href="#" id="tagsel_tag" class="disabled" onclick="tagSelected(); return false;">Tag</a>
[% END %]
[% END %]
</span>
[% IF ( TagsInputEnabled && loggedinusername ) %]
<span id="tagsel_form" style="display:none">
<label for="tagsel_new">New tag:</label>
<input name="tagsel_new" id="tagsel_new" maxlength="100" />
<input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="Add" type="submit" value="Add" onclick="tagAdded(); return false;" />
<a href="#" id="tagsel_cancel" onclick="tagCanceled(); return false;">Cancel</a>
</span>
[% END %]
</div>
[% END %]
[% IF ( verbose ) %]
[% UNLESS ( print_basket ) %]<div id="selections-toolbar"><a id="CheckAll" href="#">Select all</a> <a id="CheckNone" href="#">Clear all</a> <span class="sep">|</span> <span class="links"><span id="selections">Select titles to: </span>
<span id="tag_hides">
<a href="#" class="deleteshelf disabled" onclick="delSelRecords(); return false;">Remove</a>
[% IF ( opacuserlogin ) %]
[% IF ( virtualshelves ) %][% IF ( loggedinusername ) %]
| <a href="#" class="newshelf disabled" onclick="addSelToShelf(); return false;">Add to a list</a>
[% END %][% END %]
[% IF ( RequestOnOpac ) %]| <a href="#" class="hold disabled" onclick="holdSel(); return false;">Place hold</a>[% END %]
[% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]
| <a href="#" id="tagsel_tag" class="disabled" onclick="tagSelected(); return false;">Tag</a>[% END %][% END %]
[% END %]
</span>
<span id="tagsel_form" style="display:none">
<label for="tagsel_new" style="display:inline">New&nbsp;tag:</label>
<input name="tagsel_new" id="tagsel_new" maxlength="100" style="display:inline"/>
<input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="tagsel_button"
type="submit" value="Add" style="display:inline" />
<a href="#" id="tagsel_cancel" onclick="tagCanceled(); return false;" style="display:inline">Cancel</a>
</span>
</span>
</div>[% END %]
<form action="opac-basket.pl" method="get" name="bookbag_form" id="bookbag_form" class="checkboxed">
[% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
<h3>
@ -346,30 +349,7 @@ function enableCheckboxActions(){
</form>
[% ELSE %]
[% UNLESS ( print_basket ) %]
<form action="/cgi-bin/koha/opac-basket.pl" method="get" name="bookbag_form" id="bookbag_form" class="checkboxed">
<div id="selections-toolbar">
<a id="CheckAll" href="#">Select all</a>
<a id="CheckNone" href="#">Clear all</a>
<span class="sep">|</span> <span class="links"><span id="selections">Select titles to: </span>
<a href="#" class="deleteshelf disabled" onclick="delSelRecords(); return false;">Remove</a>
[% IF ( opacuserlogin ) %]
[% IF ( virtualshelves ) %][% IF ( loggedinusername ) %]
<a href="#" class="newshelf disabled" onclick="addSelToShelf(); return false;">Add to a list</a>
[% END %][% END %]
[% IF ( RequestOnOpac ) %] <a href="#" class="hold disabled" onclick="holdSel(); return false;">Place hold</a>[% END %]
[% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]
<a href="#" class="disabled" id="tagsel_tag" onclick="tagSelected(); return false;">Tag</a>[% END %][% END %]
[% END %]
</span>
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]<span id="tagsel_form" style="display:none">
<label for="tagsel_new" style="display:inline">New&nbsp;tag:</label>
<input name="tagsel_new" id="tagsel_new" maxlength="100" style="display:inline"/>
<input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="tagsel_button" type="submit" value="Add" style="display:inline"/>
<a href="#" id="tagsel_cancel" onclick="tagCanceled(); return false;" style="display:inline">Cancel</a>
</span>[% END %][% END %][% END %]</span>
</div>
[% END %]
<table id="itemst">
<thead>
<tr>
@ -395,7 +375,9 @@ function enableCheckboxActions(){
<a href="#" onclick="openBiblio('[% BIBLIO_RESULT.dest %]',[% BIBLIO_RESULT.biblionumber %])">[% BIBLIO_RESULT.title |html %][% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %][% subtitl.subfield |html %][% END %][% END %]</a>
<!-- COinS / Openurl -->
<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.au=[% BIBLIO_RESULT.author %]&amp;rft.btitle=[% BIBLIO_RESULT.title |url %]&amp;rft.date=[% BIBLIO_RESULT.publicationyear %]&amp;rft.tpages=[% BIBLIO_RESULT.size %]&amp;rft.isbn=[% BIBLIO_RESULT.isbn |url %]&amp;rft.aucorp=&amp;rft.place=[% BIBLIO_RESULT.place %]&amp;rft.pub=[% BIBLIO_RESULT.publisher |url %]&amp;rft.edition=[% BIBLIO_RESULT.edition %]&amp;rft.series=[% BIBLIO_RESULT.series %]&amp;rft.genre="></span>
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]<div id="newtag[% BIBLIO_RESULT.biblionumber %]_status" class="tagstatus results_summary" style="display:none">Tag status here.</div>[% END %][% END %][% END %]
[% IF ( TagsInputEnabled && loggedinusername ) %]
<span id="newtag[% BIBLIO_RESULT.biblionumber %]_status" class="tagstatus results_summary" style="display:none">Tag status here.</span>
[% END %]
</td>
<td>[% BIBLIO_RESULT.author %]</td>
<td>

View file

@ -1,4 +1,6 @@
[% USE KohaDates %]
[% SET TagsShowEnabled = ( TagsEnabled && TagsShowOnDetail ) %]
[% SET TagsInputEnabled = ( opacuserlogin && TagsEnabled && TagsInputOnDetail ) %]
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Details for: [% title |html %][% FOREACH subtitl IN subtitle %], [% subtitl.subfield |html %][% END %]
[% INCLUDE 'doc-head-close.inc' %]
@ -47,18 +49,38 @@
$(document).ready(function() {
$('#bibliodescriptions').tabs();
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]$("#tagform").hide();
$("#addtagl").show();
$("#addtagl a").click(function(){
$("#addtagl").hide();
$("#tagform, #tagform a").show();
[% IF ( TagsInputEnabled && loggedinusername ) %]
$(".tag_add").click(function(){
var thisid = $(this).attr("id");
thisid = thisid.replace("tag_add","");
$(this).hide();
$("#tagform"+thisid).show();
$("#newtag"+thisid).focus();
$("#newtag"+thisid+"_status").empty().hide();
return false;
});
$("#tagform a").click(function(){
$("#addtagl").show();
$("#tagform").hide();
$(".cancel_tag_add").click(function(){
var thisid = $(this).attr("id");
thisid = thisid.replace("cancel","");
$("#tagform"+thisid).hide();
$("#tag_add"+thisid).show();
$("#newtag"+thisid).val("");
$("#newtag"+thisid+"_status").empty().hide();
return false;
});[% END %][% END %][% END %]
});
$(".tagbutton").click(function(){
var thisid = $(this).attr("title");
var tag = $("#newtag"+thisid).val();
if (!tag || (tag == "")) {
alert(MSG_NO_TAG_SPECIFIED);
return false;
}
KOHA.Tags.add_tag_button(thisid, tag);
return false;
});
[% END %]
$("#holdingst").tablesorter({[% IF ( dateformat == 'metric' ) %]
dateFormat: 'uk',[% END %]
widgets : ['zebra'],
@ -81,9 +103,6 @@
[% IF ( NovelistSelectProfile ) %]
novSelect.loadContentForISBN('[% normalized_isbn %]','[% NovelistSelectProfile %]', '[% NovelistSelectPassword %]', function(d){});
[% END %]
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]
$(".tagbutton").click(KOHA.Tags.add_tag_button);[% END %][% END %][% END %]
[% IF ( OpacBrowseResults && busc ) %]
if (arrPagination.length > 0) {
@ -293,9 +312,6 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
});
//]]>
</script>
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]<style type="text/css">
#addtagl { display: none; }
</style>[% END %][% END %][% END %]
<style type="text/css">
.branch-info-tooltip {
display: none;
@ -503,8 +519,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
</span>
[% END %]
[% IF ( TagsEnabled ) %]
[% IF ( TagsShowOnDetail ) %]
[% IF ( TagsShowEnabled ) %]
<div class="results_summary">
[% IF ( TagLoop ) %]
<span class="label">Tags from this library:</span>
@ -515,28 +530,23 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
[% END %]
</div>
[% END %]
[% IF ( opacuserlogin ) %]
[% IF ( loggedinusername ) %]
[% IF ( TagsEnabled ) %]
[% IF ( TagsInputOnDetail ) %]
[% IF ( TagsInputEnabled ) %]
<div class="results_summary">
<span class="label" id="addtagl"><a href="#">Add</a></span>
<form name="tagform[% biblionumber %]" method="post" action="/cgi-bin/koha/opac-tags.pl" id="tagform">
<label for="newtag[% biblionumber %]">New:</label><input name="newtag[% biblionumber %]" id="newtag[% biblionumber %]" maxlength="100" />
[% IF ( loggedinusername ) %]
<a class="tag_add" id="tag_add[% biblionumber %]" href="#">Add</a>
<form id="tagform[% biblionumber %]" method="post" action="/cgi-bin/koha/opac-tags.pl" style="display:none;">
<label for="newtag[% biblionumber %]">New tag(s):</label>
<input name="newtag[% biblionumber %]" id="newtag[% biblionumber %]" maxlength="100" type="text"/>
<input name="tagbutton" class="input tagbutton" title="[% biblionumber %]" type="submit" value="Add" />
<a href="#">Cancel</a>
<a class="cancel_tag_add" id="cancel[% biblionumber %]" href="#">(done)</a>
</form>
<span id="newtag[% biblionumber %]_status" class="tagstatus" style="display:none;">
Tag status here.
</span>
<br />
[% ELSE %]
<span id="login4tags" class="tagstatus">Log in to add tags.</span>
[% END %]
[% ELSE %]
<span id="login4tags">Log in to add tags.</span>
[% END %]
</div>
[% END %]
[% END %]
[% END %]
[% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsSeries ) %][% IF ( SyndeticsSERIES1Exists ) %]

View file

@ -1,3 +1,6 @@
[% SET TagsShowEnabled = ( TagsEnabled && TagsShowOnList ) %]
[% SET TagsInputEnabled = ( opacuserlogin && TagsEnabled && TagsInputOnList ) %]
[% INCLUDE 'doc-head-open.inc' %]
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo;
[% IF ( searchdesc ) %]
@ -38,9 +41,9 @@ function holdBiblioNums(numList) {
// numList: biblio numbers separated by "/"
$("#hold_form_biblios").attr("value", numList);
$("#hold_form").submit();
}[% END %]
}[% END %][% END %]
[% IF ( TagsEnabled ) %]
[% IF ( TagsInputEnabled && loggedinusername ) %]
function tagSelected() {
var checkedBoxes = $(".searchresults :checkbox:checked");
if ($(checkedBoxes).size() == 0) {
@ -56,6 +59,8 @@ function tagCanceled() {
$("#tagsel_form").hide();
$("#tagsel_tag").show();
$("#sort_by").show();
$("#tagsel_new").val("");
$("#tagsel_status, .tagstatus").empty().hide();
}
function tagAdded() {
@ -67,6 +72,7 @@ function tagAdded() {
var tag = $("#tagsel_new").val();
if (!tag || (tag == "")) {
alert(MSG_NO_TAG_SPECIFIED);
return false;
}
@ -78,7 +84,7 @@ function tagAdded() {
KOHA.Tags.add_multitags_button(bibs, tag);
return false;
}[% END %][% END %]
}[% END %]
[% IF ( OpacHighlightedWords ) %]
var q_array = new Array(); // holds search terms if available
@ -161,7 +167,6 @@ $(document).ready(function(){
});
[% END %]
[% END %]
[% IF ( opacuserlogin ) %][% IF ( TagsEnabled ) %]$("#tagsel_span").html("<input id=\"tagsel_tag\" class=\"submit\" type=\"submit\" value=\"Tag\"/>");[% END %][% END %]
function cartList(){
if($("#addto").find("option:selected").attr("value") == "addtolist"){
@ -218,10 +223,7 @@ $(document).ready(function(){
$("#highlight_toggle_on" ).hide().click(function() {highlightOn() ;});
$("#highlight_toggle_off").show().click(function() {highlightOff();});[% END %][% END %]
[% IF ( opacuserlogin ) %] [% IF ( TagsEnabled ) %]
$(".tagbutton").click(KOHA.Tags.add_tag_button);
[% IF ( TagsInputOnList ) %]
[% IF ( loggedinusername ) %]
[% IF ( TagsInputEnabled && loggedinusername ) %]
$("#tagsel_tag").click(function(){
tagSelected();
return false;
@ -235,31 +237,35 @@ $(document).ready(function(){
return false;
});
$(".tag_results_add").click(function(){
$(".tag_add").click(function(){
var thisid = $(this).attr("id");
thisid = thisid.replace("tag_add","");
$(this).hide();
$("#tagform"+thisid).show();
$("#newtag"+thisid).focus();
$("#newtag"+thisid+"_status").empty().hide();
return false;
})
});
$(".cancel_tag_add").click(function(){
var thisid = $(this).attr("id");
thisid = thisid.replace("cancel","");
$(this).parent().hide();
$("#tagform"+thisid).hide();
$("#tag_add"+thisid).show();
return false;
})
[% ELSE %]
$("#tagsel_tag").click(function(){
window.location = "/cgi-bin/koha/opac-user.pl";
$("#newtag"+thisid).val("");
$("#newtag"+thisid+"_status").empty().hide();
return false;
});
[% END %]
[% END %]
[% END %][% END %]
$(".tagbutton").click(function(){
var thisid = $(this).attr("title");
var tag = $("#newtag"+thisid).val();
if (!tag || (tag == "")) {
alert(MSG_NO_TAG_SPECIFIED);
return false;
}
KOHA.Tags.add_tag_button(thisid, tag);
return false;
});
[% END %]
[% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %]
[% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %]
[% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
@ -395,22 +401,20 @@ $(document).ready(function(){
<span id="placehold"><!-- input class="submit" type="submit" value="Place Hold"/ --></span>
<div id="holdDetails"></div>
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]
[% IF ( TagsInputOnList ) %]
<span id="tagsel_span"></span>
[% IF ( loggedinusername ) %]
[% IF ( TagsInputEnabled && loggedinusername ) %]
<span id="tagsel_span">
<input id="tagsel_tag" class="submit" type="submit" value="Tag"/>
</span>
<span id="tagsel_form" style="display:none">
<label for="tagsel_new">New tag:</label>
<input name="tagsel_new" id="tagsel_new" maxlength="100" />
<input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="tagsel_button" type="submit" value="Add" />
<a href="#" id="tagsel_cancel">Cancel</a>
<input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="Add" type="submit" value="Add" />
<a href="#" id="tagsel_cancel">(done)</a>
</span>
<span id="tagsel_status" class="tagsel_tatus" style="display:none;">
Tag status here.
</span>
[% END %]
[% END %]
[% END %][% END %][% END %]
[% END %]
</div>
</td></tr>
@ -542,18 +546,15 @@ $(document).ready(function(){
[% END %]
[% IF ( LibraryThingForLibrariesID ) %]<div class="ltfl_reviews"></div>[% END %]
[% IF ( opacuserlogin ) %][% IF ( TagsEnabled ) %]
[% IF ( TagsShowOnList ) %]
[% IF ( TagsShowEnabled ) %]
[% IF ( SEARCH_RESULT.TagLoop.size ) %]
<div class="results_summary"><span class="label">Tags:</span>
<ul style="display: inline; list-style: none;">[% FOREACH TagLoo IN SEARCH_RESULT.TagLoop %]<li style="display: inline; list-style: none;"><a href="/cgi-bin/koha/opac-search.pl?tag=[% TagLoo.term |url %]&amp;q=[% TagLoo.term |url %]">[% TagLoo.term %]</a> <span class="weight">([% TagLoo.weight_total %])</span></li>
[% END %]
</ul>
[% END %]
[% IF ( SEARCH_RESULT.TagLoop.size ) %]
</div>[% END %]
</div>
[% END %]
[% END %][% END %]
[% END %]
[% IF ( SEARCH_RESULT.searchhighlightblob ) %]<span class="results_summary"><span class="label">Match:</span> [% SEARCH_RESULT.searchhighlightblob %]</span>[% END %]
@ -598,14 +599,18 @@ $(document).ready(function(){
[% END %]
[% END %]
[% IF ( TagsInputOnList ) %]
[% IF ( TagsInputEnabled ) %]
[% IF ( loggedinusername ) %]
<a class="tag_results_add" id="tag_add[% SEARCH_RESULT.biblionumber %]" href="#">Add tag</a>
<span id="tagform[% SEARCH_RESULT.biblionumber %]" class="tag_results_input"><label for="newtag[% SEARCH_RESULT.biblionumber %]">New tag(s):</label><input name="newtag[% SEARCH_RESULT.biblionumber %]" id="newtag[% SEARCH_RESULT.biblionumber %]" maxlength="100" />
<input name="tagbutton" class="tagbutton" title="[% SEARCH_RESULT.biblionumber %]" type="submit" value="Add" /> <a class="cancel_tag_add" id="cancel[% SEARCH_RESULT.biblionumber %]" href="#">Cancel</a>
<a class="tag_add" id="tag_add[% SEARCH_RESULT.biblionumber %]" href="#">Add tag</a>
<span id="tagform[% SEARCH_RESULT.biblionumber %]" class="tag_results_input" style="display:none;">
<label for="newtag[% SEARCH_RESULT.biblionumber %]">New tag(s):</label>
<input name="newtag[% SEARCH_RESULT.biblionumber %]" id="newtag[% SEARCH_RESULT.biblionumber %]" maxlength="100" />
<input name="tagbutton" class="tagbutton" title="[% SEARCH_RESULT.biblionumber %]" type="submit" value="Add" />
<a class="cancel_tag_add" id="cancel[% SEARCH_RESULT.biblionumber %]" href="#">(done)</a>
</span>
<span id="newtag[% SEARCH_RESULT.biblionumber %]_status" class="tagstatus" style="display:none;">
Tag status here.
</span></span>
Tag status here.
</span>
[% ELSIF ( loop.first ) %]<span id="login4tags">Log in to add tags.</span>
[% END %]
[% END %]

View file

@ -1,12 +1,13 @@
[% SET TagsShowEnabled = ( TagsEnabled && TagsShowOnList ) %]
[% SET TagsInputEnabled = ( opacuserlogin && TagsEnabled && TagsInputOnList ) %]
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; [% IF ( viewshelf ) %]Contents of [% shelfname |html %][% ELSE %]Your lists[% END %][% INCLUDE 'doc-head-close.inc' %]
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
<script type="text/javascript">
//<![CDATA[
var MSG_NO_TAG_SPECIFIED = _("No tag was specified.");
var MSG_REMOVE_FROM_LIST = _("Are you sure you want to remove these items from the list?");
var MSG_CONFIRM_DELETE_LIST = _("Are you sure you want to delete this list?");
var MSG_NO_RECORD_SELECTED = _("Please select one or more items");
[% IF ( opacuserlogin ) %][% IF ( RequestOnOpac ) %]
function holdSelections() {
@ -24,7 +25,8 @@ function holdSelections() {
}
}
[% END %][% END %]
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]function tagSelected() {
[% IF ( TagsInputEnabled && loggedinusername ) %]
function tagSelected() {
var checkedBoxes = $("input:checkbox:checked");
if ($(checkedBoxes).size()) {
$("#tagsel_tag").hide();
@ -39,6 +41,8 @@ function tagCanceled() {
$("#tagsel_form").hide();
$("#tagsel_tag").show();
$(".tag_hides").show();
$("#tagsel_new").val("");
$(".tagstatus").empty().hide();
}
function tagAdded() {
@ -62,7 +66,7 @@ function tagAdded() {
KOHA.Tags.add_multitags_button(bibs, tag);
return false;
}[% END %][% END %][% END %]
}[% END %]
function enableCheckboxActions(){
// Enable/disable controls if checkboxes are checked
@ -102,35 +106,51 @@ $(function() {
$(".cb").click(function(){
enableCheckboxActions();
});
enableCheckboxActions();
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]
$("#addtags").click(function(){
[% IF ( TagsInputEnabled && loggedinusername ) %]
$("#tagsel_tag").click(function(){
tagSelected();
return false;
});
$("#addtags").html("<a id=\"tagsel_tag\" href=\"#\" class=\"disabled\">"+_("Tag")+"<\/a> ");
});
$("#tagsel_cancel").click(function(){
tagCanceled();
return false;
});
$("#tagsel_button").click(function(){
tagAdded();
return false;
});
$(".tagbutton").click(KOHA.Tags.add_tag_button);
[% IF ( loggedinusername ) %]
$("#tagsel_tag").click(function(){
tagSelected();
return false;
});
$("#tagsel_cancel").click(function(){
tagCanceled();
return false;
});
$("#tagsel_button").click(function(){
tagAdded();
return false;
});
[% ELSE %]
$("#tagsel_tag").click(function(){
window.location = "/cgi-bin/koha/opac-user.pl";
return false;
});
[% END %]
[% END %][% END %][% END %]
$(".tag_add").click(function(){
var thisid = $(this).attr("id");
thisid = thisid.replace("tag_add","");
$(this).hide();
$("#tagform"+thisid).show();
$("#newtag"+thisid).focus();
$("#newtag"+thisid+"_status").empty().hide();
return false;
});
$(".cancel_tag_add").click(function(){
var thisid = $(this).attr("id");
thisid = thisid.replace("cancel","");
$("#tagform"+thisid).hide();
$("#tag_add"+thisid).show();
$("#newtag"+thisid).val("");
$("#newtag"+thisid+"_status").empty().hide();
return false;
});
$(".tagbutton").click(function(){
var thisid = $(this).attr("title");
var tag = $("#newtag"+thisid).val();
if (!tag || (tag == "")) {
alert(MSG_NO_TAG_SPECIFIED);
return false;
}
KOHA.Tags.add_tag_button(thisid, tag);
return false;
});
[% END %]
[% IF ( loggedinusername && allowremovingitems ) %]
$("#myform").submit(function(){
var checkedBoxes = $(".checkboxed input:checkbox:checked");
@ -285,16 +305,16 @@ $(function() {
[% IF ( RequestOnOpac ) %]
<span id="placehold"></span>
[% END %]
[% IF ( loggedinusername ) %]
[% IF ( TagsEnabled ) %]
<span id="addtags"></span>
<span id="tagsel_form" style="display:none">
<label for="tagsel_new" style="display:inline">New&nbsp;tag:</label>
<input name="tagsel_new" id="tagsel_new" maxlength="100" style="display:inline"/>
<input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="tagsel_button" type="submit" value="Add" style="display:inline" />
<a href="#" id="tagsel_cancel" onclick="tagCanceled(); return false;" style="display:inline">Cancel</a>
</span>
[% END %]
[% IF ( TagsInputEnabled && loggedinusername ) %]
<span id="addtags">
<a id="tagsel_tag" href="#" class="disabled">Tag</a>
</span>
<span id="tagsel_form" style="display:none">
<label for="tagsel_new">New tag:</label>
<input name="tagsel_new" id="tagsel_new" maxlength="100" />
<input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="tagsel_button" type="submit" value="Add" />
<a href="#" id="tagsel_cancel">Cancel</a>
</span>
[% END %]
[% IF ( loggedinusername && allowremovingitems ) %]<span id="removeitems"></span>[% END %]</span>
</div>
@ -352,8 +372,7 @@ $(function() {
[% END %]
[% END %][% ELSE %]This record has no items.[% END %]</span>
[% END %]
[% IF ( TagsEnabled ) %]
[% IF ( TagsShowOnList ) %]
[% IF ( TagsShowEnabled ) %]
[% IF ( itemsloo.TagLoop.size ) %]
<div class="results_summary">
<span class="label">Tags:</span>
@ -363,24 +382,27 @@ $(function() {
</div>
[% END %]
[% END %]
[% IF ( TagsInputOnList ) %]
[% IF ( loggedinusername ) %]
<label for="newtag[% itemsloo.biblionumber %]">New tag:</label>
<span class="results_summary actions">
<span class="label">Actions:</span>
[% IF ( TagsInputEnabled ) %]
[% IF ( loggedinusername ) %]
<a class="tag_add" id="tag_add[% itemsloo.biblionumber %]" href="#">Add tag</a>
<span id="tagform[% itemsloo.biblionumber %]" class="tag_results_input" style="display:none;">
<label for="newtag[% itemsloo.biblionumber %]">New tag(s):</label>
<input name="newtag[% itemsloo.biblionumber %]" id="newtag[% itemsloo.biblionumber %]" maxlength="100" />
<input name="tagbutton" class="tagbutton" title="[% itemsloo.biblionumber %]" type="submit" value="Add" />
<a class="cancel_tag_add" id="cancel[% itemsloo.biblionumber %]" href="#">(done)</a>
</span>
<span id="newtag[% itemsloo.biblionumber %]_status" class="tagstatus" style="display:none;">
Tag status here.
</span>
[% ELSIF ( loop.first ) %]<span class="tagstatus" id="login4tags">Log in to add tags.</span>
[% END %]
[% ELSE %]
[% IF ( loggedinusername ) %]
<span id="newtag[% itemsloo.biblionumber %]_status" class="tagstatus results_summary" style="display:none;">Tag status here.</span>
[% END %]
[% END %]
[% END %]
[% ELSIF ( loop.first ) %]
<span class="tagstatus" id="login4tags">Log in to add tags.</span>
[% END %]
[% END %]
<span class="results_summary actions"><span class="label">Actions:</span>
[% IF ( RequestOnOpac ) %]
[% UNLESS ( itemsloo.norequests ) %]
[% IF ( opacuserlogin ) %]
@ -395,7 +417,7 @@ $(function() {
[% END %]
[% END %]
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( virtualshelves ) %]<a class="addtolist" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% itemsloo.biblionumber %]" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=[% itemsloo.biblionumber %]'); return false;">Save to another list</a>
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( virtualshelves ) %]<a class="addtoshelf" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% itemsloo.biblionumber %]" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=[% itemsloo.biblionumber %]'); return false;">Save to another list</a>
[% END %][% END %][% END %]
[% IF ( opacbookbag ) %]
[% IF ( itemsloo.incart ) %]

View file

@ -63,7 +63,9 @@ $.tablesorter.addParser({
.click(function(){
$("#myform").submit();
return false;
});[% END %]
});
enableCheckboxActions();
[% END %]
});
function Check(f) {