View | Details | Raw Unified | Return to bug 6933
Collapse All | Expand All

(-)a/catalogue/detail.pl (+13 lines)
Lines 35-40 use C4::Serials; Link Here
35
use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn);
35
use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn);
36
use C4::External::Amazon;
36
use C4::External::Amazon;
37
use C4::Search;		# enabled_staff_search_views
37
use C4::Search;		# enabled_staff_search_views
38
use C4::Tags qw(get_tags);
38
use C4::VirtualShelves;
39
use C4::VirtualShelves;
39
use C4::XSLT;
40
use C4::XSLT;
40
41
Lines 384-387 if (C4::Context->preference('OPACBaseURL')){ Link Here
384
     $template->param( OpacUrl => C4::Context->preference('OPACBaseURL') );
385
     $template->param( OpacUrl => C4::Context->preference('OPACBaseURL') );
385
}
386
}
386
387
388
# Displaying tags
389
390
my $tag_quantity;
391
if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->preference('TagsShowOnDetail')) {
392
    $template->param(
393
        TagsEnabled => 1,
394
        TagsShowOnDetail => $tag_quantity
395
    );
396
    $template->param(TagLoop => get_tags({biblionumber=>$biblionumber, approved=>1,
397
                                'sort'=>'-weight', limit=>$tag_quantity}));
398
}
399
387
output_html_with_http_headers $query, $cookie, $template->output;
400
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (+19 lines)
Lines 215-223 function verify_images() { Link Here
215
	        </ul>
215
	        </ul>
216
	        </li>
216
	        </li>
217
        [% END %]
217
        [% END %]
218
        [% IF ( TagsEnabled ) %]
219
            [% IF ( TagsShowOnDetail ) %]
220
                [% IF ( TagLoop ) %]
221
                <li><strong>Tags:</strong>
222
                    <ul id="tagslist">
223
                    [% FOREACH TagLoo IN TagLoop %]
224
                        <li>
225
                        [% IF ( CAN_user_tools_moderate_tags ) %]
226
                        <a href="/cgi-bin/koha/tags/list.pl?tag=[% TagLoo.term |url %]">[% TagLoo.term |html %]</a>
227
                        [% ELSE %]
228
                        [% TagLoo.term |html %]
229
                        [% END %]
230
                        <span class="weight">([% TagLoo.weight_total %])</span>[% IF ( loop.last ) %][% ELSE %], [% END %]</li>
231
                    [% END %]
232
                    </ul></li>
233
                [% END %]
234
            [% END %]
235
        [% END %]
218
            [% IF ( holdcount ) %]<li><strong>Holds:</strong> <span class="holdcount"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">[% holdcount %]</a></span></li>[% ELSE %][% END %]
236
            [% IF ( holdcount ) %]<li><strong>Holds:</strong> <span class="holdcount"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">[% holdcount %]</a></span></li>[% ELSE %][% END %]
219
        </ul>
237
        </ul>
220
		[% END %]
238
		[% END %]
239
221
</div>
240
</div>
222
</div>
241
</div>
223
<div id="bibliodetails" class="toptabs">
242
<div id="bibliodetails" class="toptabs">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/list.tt (+103 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Tools &rsaquo; Tags &rsaquo; [% IF ( do_it ) %]Review &rsaquo; [% ELSE %]Review Tags[% END %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
5
<script type="text/javascript">
6
//<![CDATA[
7
    $.tablesorter.addParser({
8
        id: 'articles',
9
        is: function(s) {return false;  },
10
        format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); },
11
        type: 'text'
12
    });
13
    $(document).ready(function() {
14
        $(".delete").click(function (event) {
15
            $(this).parent().parent().parent().addClass("selected");
16
            var answer = confirm(_("Are you sure you want to remove the tag from this title?"));
17
                if (!answer){
18
                    $("tr").removeClass("selected");
19
                    event.preventDefault();
20
                }
21
        });
22
        $("#itemst").tablesorter({
23
            sortList: [[0,0]],
24
            headers: { 0: { sorter: 'articles' },1: { sorter: false },2:{sorter:false}}
25
        });
26
    });
27
//]]>
28
</script>
29
<style type="text/css">
30
tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent; }</style>
31
</head>
32
<body>
33
[% INCLUDE 'header.inc' %]
34
[% INCLUDE 'cat-search.inc' %]
35
36
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; <a href="/cgi-bin/koha/tags/review.pl">Tags</a> &rsaquo; Results for tag <i>[% tag %]</i></div>
37
38
<div id="doc3" class="yui-t2">
39
 <div id="bd">
40
  <div id="yui-main">
41
  <div class="yui-b">
42
[% IF ( titles ) %] 
43
<h3>Titles tagged with the term <i>[% tag %]</i></h3>
44
<table id="itemst">
45
	<thead><tr>
46
	    <th>Title</th>
47
	    <th>Location</th>
48
	    <th>&nbsp;</th>
49
        </tr></thead>
50
51
        [% FOREACH title IN titles %]
52
            [% IF ( title.even ) %]
53
                <tr class="highlight">
54
            [% ELSE %]
55
                <tr>
56
            [% END %]
57
            <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = title.biblionumber %][% title.title |html %][% FOREACH subtitl IN title.subtitle %] [% subtitl.subfield %][% END %]</a>
58
            [% title.author %]
59
            <p>[% IF ( title.publishercode ) %]- [% title.publishercode|html %]
60
            [% IF ( title.place ) %] [% title.place %][% END %][% END %]
61
            [% IF ( title.pages ) %] - [% title.pages %][% IF ( title.size ) %] [% title.size %]
62
            [% END %]
63
            [% END %]</p>
64
            [% IF ( title.notes ) %]
65
            <p>[% title.notes |html%]</p>[% END %]
66
            [% IF ( title.TagLoop ) %]<p style="font-size:90%"><strong>Tagged with:</strong> [% FOREACH TagLoo IN title.TagLoop %]
67
            <a href="/cgi-bin/koha/tags/list.pl?tag=[% TagLoo.term %]">[% TagLoo.term |html %]</a> <span class="weight">([% TagLoo.weight_total %])</span>[% IF ( loop.last ) %][% ELSE %], [% END %]
68
            [% END %]</p>
69
            [% END %]
70
            </td>
71
            <td>[% IF ( title.items ) %]<ul style="font-size:80%">[% FOREACH item IN title.items %]
72
                <li>
73
                    [% item.branchname %] [% item.location_description %]
74
                    [% IF ( item.itemcallnumber ) %]
75
                        ([% item.itemcallnumber %])
76
                    [% END %]
77
                </li>
78
                [% END %]</ul>[% ELSE %]This record has no items.[% END %]
79
             </td>
80
             <td><form method="post" action="/cgi-bin/koha/tags/list.pl"><input type="hidden" name="op" value="del" /><input type="hidden" name="tag" value="[% tag %]" /><input type="hidden" name="tag_id" value="[% title.tag_id %]" /><input type="submit" class="delete" value="Remove tag" /></form></td>
81
            </tr>
82
        [% END %]
83
    </table>
84
[% ELSE %]
85
	<div class="dialog message">There are no titles tagged with the term <i>[% tag %]</i></div>
86
[% END %]
87
</form>
88
 </div>
89
 </div>
90
 <div class="yui-b">
91
  <ul>
92
    <li><a href="/cgi-bin/koha/tags/review.pl?approved=1">Approved tags</a>
93
    </li>
94
    <li><a href="/cgi-bin/koha/tags/review.pl?approved=-1">Rejected tags</a>
95
    </li>
96
    <li><a href="/cgi-bin/koha/tags/review.pl?approved=0">Pending tags</a>
97
    </li>
98
    <li><a href="/cgi-bin/koha/tags/review.pl?approved=all">All tags</a>
99
    </li>
100
  </ul>
101
 </div>
102
</div>
103
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tags/review.tt (-1 / +1 lines)
Lines 217-223 td input,td input[type="submit"] { font-size: 85%; padding: 1px; } Link Here
217
		[% ELSE %]<td class="pending">
217
		[% ELSE %]<td class="pending">
218
		[% END %]
218
		[% END %]
219
	    </td>
219
	    </td>
220
	    <td>[% tagloo.term %]
220
	    <td><a href="/cgi-bin/koha/tags/list.pl?tag=[% tagloo.term %]">[% tagloo.term %]</a>
221
	    </td>
221
	    </td>
222
		<td>[% tagloo.weight_total %]
222
		<td>[% tagloo.weight_total %]
223
	    </td>
223
	    </td>
(-)a/tags/list.pl (-1 / +81 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
# Copyright 2011 Athens County Public Libraries
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use warnings;
21
use strict;
22
use CGI;
23
24
use C4::Auth qw(:DEFAULT check_cookie_auth);
25
use C4::Biblio;
26
use C4::Context;
27
use C4::Dates qw(format_date);
28
use C4::Items;
29
use C4::Koha;
30
use C4::Tags 0.03 qw(get_tags remove_tag get_tag_rows);
31
use C4::Output;
32
33
my $needed_flags = { tools => 'moderate_tags' }; # FIXME: replace when more specific permission is created.
34
35
my $query        = CGI->new;
36
my $op           = $query->param('op') || '';
37
my $biblionumber = $query->param('biblionumber');
38
my $tag          = $query->param('tag');
39
my $tag_id       = $query->param('tag_id');
40
41
my ($template, $borrowernumber, $cookie) = get_template_and_user({
42
        template_name => "tags/list.tmpl",
43
        query => $query,
44
        type => "intranet",
45
        debug => 1,
46
        authnotrequired => 0,
47
        flagsrequired => $needed_flags,
48
});
49
50
if( $op eq "del" ){
51
        remove_tag($tag_id);
52
        print $query->redirect("/cgi-bin/koha/tags/list.pl?tag=$tag");
53
} else {
54
55
my $marcflavour = C4::Context->preference('marcflavour');
56
my @results;
57
58
if ($tag) {
59
        my $taglist = get_tag_rows({term=>$tag});
60
        for ( @{$taglist} ) {
61
        my $dat                 = &GetBiblioData($_->{biblionumber});
62
        my $record              = &GetMarcBiblio($_->{biblionumber});
63
        $dat->{'subtitle'}      = GetRecordValue('subtitle', $record, GetFrameworkCode($_->{biblionumber}));
64
        my @items               = GetItemsInfo( $_->{biblionumber} );
65
        $dat->{biblionumber}    = $_->{biblionumber};
66
        $dat->{tag_id}          = $_->{tag_id};
67
        $dat->{items}           = \@items;
68
        $dat->{TagLoop}         = get_tags({biblionumber=>$_->{biblionumber}, 'sort'=>'-weight',limit=>10 });
69
        push( @results, $dat );
70
    }
71
72
my $resultsarray = \@results;
73
74
$template->param(
75
    tag => $tag,
76
    titles => $resultsarray,
77
);
78
}
79
}
80
81
output_html_with_http_headers $query, $cookie, $template->output;

Return to bug 6933