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

(-)a/catalogue/imageviewer.pl (-1 / +5 lines)
Lines 81-90 if ( C4::Context->preference("LocalCoverImages") ) { Link Here
81
    );
81
    );
82
}
82
}
83
$template->{VARS}->{'count'}        = $itemcount;
83
$template->{VARS}->{'count'}        = $itemcount;
84
$template->{VARS}->{'biblionumber'} = $biblionumber;
85
$template->param(C4::Search::enabled_staff_search_views);
84
$template->param(C4::Search::enabled_staff_search_views);
86
$template->{VARS}->{'biblio'} = $biblio;
85
$template->{VARS}->{'biblio'} = $biblio;
87
86
87
$template->param(
88
    biblionumber => $biblionumber,
89
    itemnumber => $itemnumber,
90
);
91
88
my $hold_count = $biblio ? $biblio->holds->count : 0;
92
my $hold_count = $biblio ? $biblio->holds->count : 0;
89
$template->param( holdcount => $hold_count );
93
$template->param( holdcount => $hold_count );
90
94
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/imageviewer.tt (-5 / +21 lines)
Lines 56-62 Link Here
56
            <div class="col-md-4">
56
            <div class="col-md-4">
57
                <ul class="thumbnails">
57
                <ul class="thumbnails">
58
                    [% FOREACH image IN images %]
58
                    [% FOREACH image IN images %]
59
                            <li id="imagenumber-[% image.imagenumber | html %]" class="thumbnail">
59
                            <li id="imagenumber-[% image.imagenumber | html %]" data-itemnumber="[% image.itemnumber %]" data-biblionumber="[% image.biblionumber %]" class="thumbnail">
60
                            <a class="show_cover" data-coverimg="[% image.imagenumber | html %]" href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | html %]&amp;imagenumber=[% image.imagenumber | html %]">
60
                            <a class="show_cover" data-coverimg="[% image.imagenumber | html %]" href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=[% biblionumber | html %]&amp;imagenumber=[% image.imagenumber | html %]">
61
                                [% IF loop.first %]
61
                                [% IF loop.first %]
62
                                    <img class="selected" id="thumbnail_[% image.imagenumber | html %]" src="/cgi-bin/koha/catalogue/image.pl?imagenumber=[% image.imagenumber | html %]&amp;thumbnail=1" alt="Thumbnail" />
62
                                    <img class="selected" id="thumbnail_[% image.imagenumber | html %]" src="/cgi-bin/koha/catalogue/image.pl?imagenumber=[% image.imagenumber | html %]&amp;thumbnail=1" alt="Thumbnail" />
Lines 73-82 Link Here
73
            </div> <!-- /.col-md-4 -->
73
            </div> <!-- /.col-md-4 -->
74
        </div> <!-- /.row -->
74
        </div> <!-- /.row -->
75
    [% ELSE %]
75
    [% ELSE %]
76
        <div class="dialog message">There are no images for this record.</div>
76
        [% IF itemnumber %]
77
            <div class="dialog message">There are no images for this item.</div>
78
        [% ELSE %]
79
            <div class="dialog message">There are no images for this record.</div>
80
        [% END %]
77
        [% IF ( CAN_user_tools_upload_local_cover_images ) %]
81
        [% IF ( CAN_user_tools_upload_local_cover_images ) %]
78
            <hr />
82
            <hr />
79
            <p>Upload an image file: <a class="btn btn-default btn-xs" href="/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber | uri %]&amp;filetype=image"><i class="fa fa-upload" aria-hidden="true"></i> Upload</a>
83
            <p>
84
                Upload an image file:
85
                [% IF itemnumber %]
86
                    <a class="btn btn-default btn-xs" href="/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=[% itemnumber | uri %]&amp;filetype=image">
87
                [% ELSE %]
88
                    <a class="btn btn-default btn-xs" href="/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber | uri %]&amp;filetype=image">
89
                [% END %]
90
                <i class="fa fa-upload" aria-hidden="true"></i> Upload</a>
80
            </p>
91
            </p>
81
        [% END %]
92
        [% END %]
82
    [% END %]
93
    [% END %]
Lines 126-131 Link Here
126
137
127
        function removeLocalImage(imagenumber) {
138
        function removeLocalImage(imagenumber) {
128
            var thumbnail = $("#imagenumber-" + imagenumber );
139
            var thumbnail = $("#imagenumber-" + imagenumber );
140
            var itemnumber = $(thumbnail).data("itemnumber");
141
            var biblionumber = $(thumbnail).data("biblionumber");
129
            var copy = thumbnail.html();
142
            var copy = thumbnail.html();
130
            thumbnail.find("img").css("opacity", ".2");
143
            thumbnail.find("img").css("opacity", ".2");
131
            thumbnail.find("a.remove").html("<img style='display:inline-block' src='" + interface + "/" + theme + "/img/spinner-small.gif' alt='' />");
144
            thumbnail.find("a.remove").html("<img style='display:inline-block' src='" + interface + "/" + theme + "/img/spinner-small.gif' alt='' />");
Lines 135-141 Link Here
135
                success: function(data) {
148
                success: function(data) {
136
                    $(data).each( function() {
149
                    $(data).each( function() {
137
                        if ( this.deleted == 1 ) {
150
                        if ( this.deleted == 1 ) {
138
                            location.href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=" + biblionumber;
151
                            if( itemnumber ) {
152
                                location.href="/cgi-bin/koha/catalogue/imageviewer.pl?itemnumber=" + itemnumber;
153
                            } else {
154
                                location.href="/cgi-bin/koha/catalogue/imageviewer.pl?biblionumber=" + biblionumber;
155
                            }
139
                        } else {
156
                        } else {
140
                            thumbnail.html( copy );
157
                            thumbnail.html( copy );
141
                            alert(_("An error occurred on deleting this image"));
158
                            alert(_("An error occurred on deleting this image"));
142
- 

Return to bug 26145