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

(-)a/catalogue/detail.pl (+5 lines)
Lines 90-95 if (C4::Context->preference("XSLTDetailsDisplay") ) { Link Here
90
}
90
}
91
91
92
$template->param( 'SpineLabelShowPrintOnBibDetails' => C4::Context->preference("SpineLabelShowPrintOnBibDetails") );
92
$template->param( 'SpineLabelShowPrintOnBibDetails' => C4::Context->preference("SpineLabelShowPrintOnBibDetails") );
93
$template->param( 'ShowRecallButton' => C4::Context->preference("ShowRecallButton") );
93
$template->param( ocoins => GetCOinSBiblio($record) );
94
$template->param( ocoins => GetCOinSBiblio($record) );
94
95
95
# some useful variables for enhanced content;
96
# some useful variables for enhanced content;
Lines 176-181 my $shelflocations = GetKohaAuthorisedValues('items.location', $fw); Link Here
176
my $collections    = GetKohaAuthorisedValues('items.ccode'   , $fw);
177
my $collections    = GetKohaAuthorisedValues('items.ccode'   , $fw);
177
my $copynumbers    = GetKohaAuthorisedValues('items.copynumber', $fw);
178
my $copynumbers    = GetKohaAuthorisedValues('items.copynumber', $fw);
178
my (@itemloop, @otheritemloop, %itemfields);
179
my (@itemloop, @otheritemloop, %itemfields);
180
my $items_checked_out = 0;
179
my $norequests = 1;
181
my $norequests = 1;
180
my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw);
182
my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw);
181
my $authvalcode_items_damaged  = GetAuthValCode('items.damaged', $fw);
183
my $authvalcode_items_damaged  = GetAuthValCode('items.damaged', $fw);
Lines 191-196 foreach my $item (@items) { Link Here
191
    my $itembranchcode = $item->{$separatebranch};
193
    my $itembranchcode = $item->{$separatebranch};
192
    $item->{homebranch}        = GetBranchName($item->{homebranch});
194
    $item->{homebranch}        = GetBranchName($item->{homebranch});
193
195
196
    $items_checked_out++ if $item->{'onloan'};
197
194
    # can place holds defaults to yes
198
    # can place holds defaults to yes
195
    $norequests = 0 unless ( ( $item->{'notforloan'} > 0 ) || ( $item->{'itemnotforloan'} > 0 ) );
199
    $norequests = 0 unless ( ( $item->{'notforloan'} > 0 ) || ( $item->{'itemnotforloan'} > 0 ) );
196
200
Lines 349-354 foreach ( keys %{$dat} ) { Link Here
349
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
353
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
350
$template->param(
354
$template->param(
351
    itemloop        => \@itemloop,
355
    itemloop        => \@itemloop,
356
    items_checked_out   => $items_checked_out,
352
    otheritemloop   => \@otheritemloop,
357
    otheritemloop   => \@otheritemloop,
353
    biblionumber        => $biblionumber,
358
    biblionumber        => $biblionumber,
354
    ($analyze? 'analyze':'detailview') =>1,
359
    ($analyze? 'analyze':'detailview') =>1,
(-)a/circ/send_recall_notice.pl (+64 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 => 'circulate_remaining_permissions'});
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
}
(-)a/installer/data/mysql/en/mandatory/sample_notices.sql (+1 lines)
Lines 16-21 VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f Link Here
16
('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
16
('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
17
('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
17
('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
18
('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <<branches.branchemail>>\n\nThank you,\n\n<<branches.branchname>>'),
18
('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <<branches.branchemail>>\n\nThank you,\n\n<<branches.branchname>>'),
19
('circulation','RECALL','Item recall','Item recall','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nA recall was made on an item in your possession. Please return the item to the library as soon as possible.\r\n\r\n<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>> <<branches.branchaddress3>>\r\nPhone: <<branches.branchphone>>\r\nFax: <<branches.branchfax>>\r\nEmail: <<branches.branchemail>>\r\n\r\nThe following item must be returned to the library as soon as possible :\r\n\r\n\"<<biblio.title>>\" by <<biblio.author>>, <<items.itemcallnumber>>, Barcode: <<items.barcode>>\r\n\r\nThank you.\r\n\r\n<<branches.branchname>> \r\n'),
19
('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>');
20
('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>');
20
INSERT INTO `letter` (module, code, name, title, content, is_html)
21
INSERT INTO `letter` (module, code, name, title, content, is_html)
21
VALUES ('circulation','ISSUESLIP','Issue Slip','Issue Slip', '<h3><<branches.branchname>></h3>
22
VALUES ('circulation','ISSUESLIP','Issue Slip','Issue Slip', '<h3><<branches.branchname>></h3>
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 422-425 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' Link Here
422
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('TimeFormat','24hr','12hr|24hr','Defines the global time format for visual output.','Choice');
422
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('TimeFormat','24hr','12hr|24hr','Defines the global time format for visual output.','Choice');
423
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('DisplayIconsXSLT', '1', '', 'If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.', 'YesNo');
423
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('DisplayIconsXSLT', '1', '', 'If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.', 'YesNo');
424
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPAC','0','','If on, and a patron is logged into the OPAC, items from his or her home library will be emphasized and shown first in search results and item details.','YesNo');
424
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPAC','0','','If on, and a patron is logged into the OPAC, items from his or her home library will be emphasized and shown first in search results and item details.','YesNo');
425
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ShowRecallButton','0','','If on, show a button to recall a checked out item in the holdings list of the biblio record details page.','YesNo');
425
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPACWhich','PatronBranch','PatronBranch|OpacURLBranch','Decides which branch''s items to emphasize. If PatronBranch, emphasize the logged in user''s library''s items. If OpacURLBranch, highlight the items of the Apache var BRANCHCODE defined in Koha''s Apache configuration file.','Choice')
426
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPACWhich','PatronBranch','PatronBranch|OpacURLBranch','Decides which branch''s items to emphasize. If PatronBranch, emphasize the logged in user''s library''s items. If OpacURLBranch, highlight the items of the Apache var BRANCHCODE defined in Koha''s Apache configuration file.','Choice')
(-)a/installer/data/mysql/updatedatabase.pl (+10 lines)
Lines 6771-6776 if ( CheckVersion($DBversion) ) { Link Here
6771
   SetVersion ($DBversion);
6771
   SetVersion ($DBversion);
6772
}
6772
}
6773
6773
6774
$DBversion = 'XXX';
6775
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
6776
    $dbh->do("INSERT INTO `letter` (`module`, `code`, `name`, `title`, `content`) VALUES
6777
('circulation','RECALL','Item recall','Item recall','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nA recall was made on an item in your possession. Please return the item to the library as soon as possible.\r\n\r\n<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>> <<branches.branchaddress3>>\r\nPhone: <<branches.branchphone>>\r\nFax: <<branches.branchfax>>\r\nEmail: <<branches.branchemail>>\r\n\r\nThe following item must be returned to the library as soon as possible :\r\n\r\n\"<<biblio.title>>\" by <<biblio.author>>, <<items.itemcallnumber>>, Barcode: <<items.barcode>>\r\n\r\nThank you.\r\n\r\n<<branches.branchname>> \r\n');
6778
");
6779
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ShowRecallButton','0','','If on, show a button to recall a checked out item in the holdings list of the biblio record details page.','YesNo')");
6780
    print "Upgrade to $DBversion done ( Add the 'RECALL' letter )\n";
6781
    SetVersion ($DBversion);
6782
}
6783
6774
6784
6775
=head1 FUNCTIONS
6785
=head1 FUNCTIONS
6776
6786
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+6 lines)
Lines 123-128 Circulation: Link Here
123
            - The following fields should be excluded from the patron checkout history CSV or iso2709 export
123
            - The following fields should be excluded from the patron checkout history CSV or iso2709 export
124
            - pref: ExportRemoveFields
124
            - pref: ExportRemoveFields
125
            - (separate fields with space, e.g. 100a 200b 300c)
125
            - (separate fields with space, e.g. 100a 200b 300c)
126
        -
127
            - pref: ShowRecallButton
128
              choices:
129
                  yes: Show
130
                  no: "Don't show"
131
            - a button to recall a checked out item in the holdings list of the biblio record details page.
126
132
127
    Checkout Policy:
133
    Checkout Policy:
128
        -
134
        -
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-1 / +41 lines)
Lines 43-48 function verify_images() { Link Here
43
     [% IF ( AmazonCoverImages ) %]$(window).load(function() {
43
     [% IF ( AmazonCoverImages ) %]$(window).load(function() {
44
        verify_images();
44
        verify_images();
45
     });[% END %]
45
     });[% END %]
46
47
48
//AJAX call to send a recall notice to the user who currently has the item.
49
function recall_item(itemnumber) {
50
    var button = $("#recall_"+itemnumber);
51
52
    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?'))) {
53
        return;
54
    }
55
56
    //Disable the button to prevent spamming
57
    button.attr("disabled",true);
58
59
    $.ajax({
60
        url: '/cgi-bin/koha/circ/send_recall_notice.pl',
61
        type: 'POST',
62
        dataType: 'text',
63
        data: {itemnumber: itemnumber},
64
        success: function(msg){
65
            if(msg == "SUCCESS") {
66
                button.attr("value",_("Recall sent"));
67
            }
68
            else if(msg == "UNAUTHORIZED") {
69
                alert(_("Failed to send the recall notice:")+"\n"+_("You do not have the required permissions to do this action.")+" (circulate_remaining_permissions)");
70
                button.attr("disabled",false);
71
            }
72
            else {
73
                alert(_("Failed to send the recall notice:")+"\n"+msg);
74
                button.attr("disabled",false);
75
            }
76
        },
77
        error: function(request,status){
78
            alert(_("Failed to send the recall notice:")+"\n"+status);
79
            button.attr("disabled",false);
80
        }
81
    });
82
}
83
46
//]]>
84
//]]>
47
</script>
85
</script>
48
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
86
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
Lines 401-406 function verify_images() { Link Here
401
                                    </a>
439
                                    </a>
402
                                [% END %]
440
                                [% END %]
403
                                : due [% item.datedue %]
441
                                : due [% item.datedue %]
442
                                [% IF ( ShowRecallButton ) %]
443
                                    <input type="button" id="recall_[% item.itemnumber %]" name="recall_[% item.itemnumber %]" value="Recall" onclick="recall_item([% item.itemnumber %]);" />
444
                                [% END %]
404
                            </span>
445
                            </span>
405
                        [% ELSIF ( item.transfertwhen ) %]
446
                        [% ELSIF ( item.transfertwhen ) %]
406
                            In transit from [% item.transfertfrom %],
447
                            In transit from [% item.transfertfrom %],
407
- 

Return to bug 8688