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

(-)a/catalogue/imageviewer.pl (-1 / +5 lines)
Lines 92-102 if ( C4::Context->preference("LocalCoverImages") ) { Link Here
92
    );
92
    );
93
}
93
}
94
$template->{VARS}->{'count'}        = $itemcount;
94
$template->{VARS}->{'count'}        = $itemcount;
95
$template->{VARS}->{'biblionumber'} = $biblionumber;
96
$template->{VARS}->{'norequests'}   = $norequests;
95
$template->{VARS}->{'norequests'}   = $norequests;
97
$template->param(C4::Search::enabled_staff_search_views);
96
$template->param(C4::Search::enabled_staff_search_views);
98
$template->{VARS}->{'biblio'} = $biblio;
97
$template->{VARS}->{'biblio'} = $biblio;
99
98
99
$template->param(
100
    biblionumber => $biblionumber,
101
    itemnumber => $itemnumber,
102
);
103
100
my @allorders_using_biblio = GetOrdersByBiblionumber ($biblionumber);
104
my @allorders_using_biblio = GetOrdersByBiblionumber ($biblionumber);
101
my @deletedorders_using_biblio;
105
my @deletedorders_using_biblio;
102
my @orders_using_biblio;
106
my @orders_using_biblio;
(-)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