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

(-)a/catalogue/detail.pl (+4 lines)
Lines 174-179 my $shelflocations = GetKohaAuthorisedValues('items.location', $fw); Link Here
174
my $collections    = GetKohaAuthorisedValues('items.ccode'   , $fw);
174
my $collections    = GetKohaAuthorisedValues('items.ccode'   , $fw);
175
my $copynumbers    = GetKohaAuthorisedValues('items.copynumber', $fw);
175
my $copynumbers    = GetKohaAuthorisedValues('items.copynumber', $fw);
176
my (@itemloop, %itemfields);
176
my (@itemloop, %itemfields);
177
my $items_checked_out = 0;
177
my $norequests = 1;
178
my $norequests = 1;
178
my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw);
179
my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw);
179
my $authvalcode_items_damaged  = GetAuthValCode('items.damaged', $fw);
180
my $authvalcode_items_damaged  = GetAuthValCode('items.damaged', $fw);
Lines 184-189 foreach my $item (@items) { Link Here
184
185
185
    $item->{homebranch}        = GetBranchName($item->{homebranch});
186
    $item->{homebranch}        = GetBranchName($item->{homebranch});
186
187
188
    $items_checked_out++ if $item->{'onloan'};
189
187
    # can place holds defaults to yes
190
    # can place holds defaults to yes
188
    $norequests = 0 unless ( ( $item->{'notforloan'} > 0 ) || ( $item->{'itemnotforloan'} > 0 ) );
191
    $norequests = 0 unless ( ( $item->{'notforloan'} > 0 ) || ( $item->{'itemnotforloan'} > 0 ) );
189
192
Lines 328-333 foreach ( keys %{$dat} ) { Link Here
328
331
329
$template->param(
332
$template->param(
330
    itemloop        => \@itemloop,
333
    itemloop        => \@itemloop,
334
    items_checked_out   => $items_checked_out,
331
    biblionumber        => $biblionumber,
335
    biblionumber        => $biblionumber,
332
    ($analyze? 'analyze':'detailview') =>1,
336
    ($analyze? 'analyze':'detailview') =>1,
333
    subscriptions       => \@subs,
337
    subscriptions       => \@subs,
(-)a/circ/send_recall_notice.pl (+65 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Author : Frédérick Capovilla, 2011 - SYS-TECH
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 strict;
21
use warnings;
22
23
use C4::Message;
24
use C4::Circulation;
25
use C4::Items;
26
use C4::Auth;
27
use CGI;
28
use CGI::Cookie;
29
30
my $input = new CGI;
31
my $itemnumber = $input->param('itemnumber');
32
33
# Check the user's permissions
34
my %cookies = fetch CGI::Cookie;
35
my $sessid = $cookies{'CGISESSID'}->value || $input->param('CGISESSID');
36
my ($auth_status, $auth_sessid) = C4::Auth::check_cookie_auth($sessid, {"circulate_remaining_permissions" => '1'});
37
if ($auth_status ne "ok") {
38
    print $input->header;
39
    print "UNAUTHORIZED";
40
    exit 0;
41
}
42
43
# Generate the message
44
45
my $borrower = C4::Circulation::GetItemIssue($itemnumber);
46
my $item = C4::Items::GetItem($itemnumber);
47
48
my $letter = C4::Letters::GetPreparedLetter(
49
    'module' => 'circulation',
50
    'letter_code' => 'RECALL',
51
    'tables' => {
52
        'biblio' => $item->{biblionumber},
53
        'biblioitems' => $item->{biblionumber},
54
        'items' => $itemnumber,
55
        'borrowers' => $borrower->{borrowernumber},
56
        'branches'  => $item->{homebranch},
57
    },
58
);
59
60
# Try to add the message to the message queue.
61
if( C4::Letters::EnqueueLetter({letter => $letter, borrowernumber => $borrower->{borrowernumber}, message_transport_type => 'email'}) ) {
62
    print $input->header;
63
    print "SUCCESS";
64
}
65
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-1 / +47 lines)
Lines 42-47 function verify_images() { Link Here
42
     [% IF ( AmazonEnabled ) %]$(window).load(function() {
42
     [% IF ( AmazonEnabled ) %]$(window).load(function() {
43
        verify_images();
43
        verify_images();
44
     });[% END %]
44
     });[% END %]
45
46
47
//AJAX call to send a recall notice to the user who currently has the item.
48
function recall_item(itemnumber) {
49
    var button = $("#recall_"+itemnumber);
50
51
    if(!confirm(_('A request for the immediate return of the item will be sent to the user who currently has it in its possession.\n\nAre you sure you want to send a recall notice?'))) {
52
        return;
53
    }
54
55
    //Disable the button to prevent spamming
56
    button.attr("disabled",true);
57
    
58
    $.ajax({
59
        url: '/cgi-bin/koha/circ/send_recall_notice.pl',
60
        type: 'POST',
61
        dataType: 'text',
62
        data: {itemnumber: itemnumber},
63
        success: function(msg){
64
            if(msg == "SUCCESS") {
65
                button.attr("value",_("Recall sent"));
66
            }
67
            else if(msg == "UNAUTHORIZED") {
68
                alert(_("Failed to send the recall notice:")+"\n"+_("You do not have the required permissions to do this action.")+" (circulate_remaining_permissions)");
69
                button.attr("disabled",false);
70
            }
71
            else {
72
                alert(_("Failed to send the recall notice:")+"\n"+msg);
73
                button.attr("disabled",false);
74
            }
75
        },
76
        error: function(request,status){
77
            alert(_("Failed to send the recall notice:")+"\n"+status);
78
            button.attr("disabled",false);
79
        }
80
    });
81
}
82
45
//]]>
83
//]]>
46
</script>
84
</script>
47
</head>
85
</head>
Lines 285-290 function verify_images() { Link Here
285
        [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine label</th>[% END %]
323
        [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine label</th>[% END %]
286
        [% IF ( hostrecords ) %]<th>Host records</th>[% END %]
324
        [% IF ( hostrecords ) %]<th>Host records</th>[% END %]
287
		[% IF ( analyze ) %]<th>Used in</th><th></th>[% END %]
325
		[% IF ( analyze ) %]<th>Used in</th><th></th>[% END %]
326
        [% IF ( items_checked_out ) %]<th>Recall</th>[% END %]
288
            </tr>
327
            </tr>
289
            [% FOREACH itemloo IN itemloop %]
328
            [% FOREACH itemloo IN itemloop %]
290
                <tr>
329
                <tr>
Lines 421-426 function verify_images() { Link Here
421
                        <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% itemloo.biblionumber %]&amp;hostitemnumber=[% itemloo.itemnumber %]">Create analytics</a></td>
460
                        <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% itemloo.biblionumber %]&amp;hostitemnumber=[% itemloo.itemnumber %]">Create analytics</a></td>
422
                [% END %]
461
                [% END %]
423
462
463
        [% IF ( items_checked_out ) %]
464
            <td>
465
            [% IF ( itemloo.onloan ) %]
466
                <input type="button" id="recall_[% itemloo.itemnumber %]" name="recall_[% itemloo.itemnumber %]" value="Recall" onclick="recall_item([% itemloo.itemnumber %]);" />
467
            [% END %]
468
            </td>
469
        [% END %]
470
424
                </tr>
471
                </tr>
425
            [% END %]
472
            [% END %]
426
        </table>
473
        </table>
427
- 

Return to bug 8688