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

(-)a/catalogue/detail.pl (+5 lines)
Lines 91-96 if (C4::Context->preference("XSLTDetailsDisplay") ) { Link Here
91
}
91
}
92
92
93
$template->param( 'SpineLabelShowPrintOnBibDetails' => C4::Context->preference("SpineLabelShowPrintOnBibDetails") );
93
$template->param( 'SpineLabelShowPrintOnBibDetails' => C4::Context->preference("SpineLabelShowPrintOnBibDetails") );
94
$template->param( 'ShowRecallButton' => C4::Context->preference("ShowRecallButton") );
94
$template->param( ocoins => GetCOinSBiblio($record) );
95
$template->param( ocoins => GetCOinSBiblio($record) );
95
96
96
# some useful variables for enhanced content;
97
# some useful variables for enhanced content;
Lines 186-191 my $shelflocations = GetKohaAuthorisedValues('items.location', $fw); Link Here
186
my $collections    = GetKohaAuthorisedValues('items.ccode'   , $fw);
187
my $collections    = GetKohaAuthorisedValues('items.ccode'   , $fw);
187
my $copynumbers    = GetKohaAuthorisedValues('items.copynumber', $fw);
188
my $copynumbers    = GetKohaAuthorisedValues('items.copynumber', $fw);
188
my (@itemloop, @otheritemloop, %itemfields);
189
my (@itemloop, @otheritemloop, %itemfields);
190
my $items_checked_out = 0;
189
my $norequests = 1;
191
my $norequests = 1;
190
my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw);
192
my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw);
191
my $authvalcode_items_damaged  = GetAuthValCode('items.damaged', $fw);
193
my $authvalcode_items_damaged  = GetAuthValCode('items.damaged', $fw);
Lines 201-206 foreach my $item (@items) { Link Here
201
    my $itembranchcode = $item->{$separatebranch};
203
    my $itembranchcode = $item->{$separatebranch};
202
    $item->{homebranch}        = GetBranchName($item->{homebranch});
204
    $item->{homebranch}        = GetBranchName($item->{homebranch});
203
205
206
    $items_checked_out++ if $item->{'onloan'};
207
204
    # can place holds defaults to yes
208
    # can place holds defaults to yes
205
    $norequests = 0 unless ( ( $item->{'notforloan'} > 0 ) || ( $item->{'itemnotforloan'} > 0 ) );
209
    $norequests = 0 unless ( ( $item->{'notforloan'} > 0 ) || ( $item->{'itemnotforloan'} > 0 ) );
206
210
Lines 360-365 foreach ( keys %{$dat} ) { Link Here
360
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
364
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
361
$template->param(
365
$template->param(
362
    itemloop        => \@itemloop,
366
    itemloop        => \@itemloop,
367
    items_checked_out   => $items_checked_out,
363
    otheritemloop   => \@otheritemloop,
368
    otheritemloop   => \@otheritemloop,
364
    biblionumber        => $biblionumber,
369
    biblionumber        => $biblionumber,
365
    ($analyze? 'analyze':'detailview') =>1,
370
    ($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/atomicupdate/bug-8688.sql (+15 lines)
Line 0 Link Here
1
INSERT IGNORE INTO letter (module, code, name, title, content) VALUES ('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');
2
3
INSERT IGNORE 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');
4
5
-- $DBversion = '3.19.00.XXX';
6
-- if ( CheckVersion($DBversion) ) {
7
--     $dbh->do("INSERT IGNORE INTO letter (module, code, name, title, content)
8
--     VALUES
9
--     ('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');
10
-- ");
11
--     $dbh->do("INSERT IGNORE 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')");
12
--     print "Upgrade to $DBversion done (Bug 8688: Add the 'RECALL' letter)\n";
13
--     SetVersion ($DBversion);
14
-- }
15
(-)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>>', 'email'),
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>>', 'email'),
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>>', 'email'),
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>>', 'email'),
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>>', 'email'),
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>>', 'email'),
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>>', 'email'),
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>>', 'email'),
20
('members', 'DISCHARGE', 'Discharge', 'Discharge for <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Discharge</h1>\r\n\r\nThe library <<borrowers.branchcode>> certifies that the following borrower :\r\n\r\n    <<borrowers.firstname>> <<borrowers.surname>>\r\n   Cardnumber : <<borrowers.cardnumber>>\r\n\r\nreturned all his documents.', 'email');
21
('members', 'DISCHARGE', 'Discharge', 'Discharge for <<borrowers.firstname>> <<borrowers.surname>>', '<h1>Discharge</h1>\r\n\r\nThe library <<borrowers.branchcode>> certifies that the following borrower :\r\n\r\n    <<borrowers.firstname>> <<borrowers.surname>>\r\n   Cardnumber : <<borrowers.cardnumber>>\r\n\r\nreturned all his documents.', 'email');
21
22
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 383-388 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
383
('ShelfBrowserUsesHomeBranch','1','1','Use the item home branch when finding items for the shelf browser.','YesNo'),
383
('ShelfBrowserUsesHomeBranch','1','1','Use the item home branch when finding items for the shelf browser.','YesNo'),
384
('ShelfBrowserUsesLocation','1','1','Use the item location when finding items for the shelf browser.','YesNo'),
384
('ShelfBrowserUsesLocation','1','1','Use the item location when finding items for the shelf browser.','YesNo'),
385
('ShowPatronImageInWebBasedSelfCheck','0','','If ON, displays patron image when a patron uses web-based self-checkout','YesNo'),
385
('ShowPatronImageInWebBasedSelfCheck','0','','If ON, displays patron image when a patron uses web-based self-checkout','YesNo'),
386
('ShowRecallButton','0','','If on, show a button to recall a checked out item in the holdings list of the biblio record details page.','YesNo'),
386
('ShowReviewer','full','none|full|first|surname|firstandinitial|username','Choose how a commenter\'s identity is presented alongside comments in the OPAC','Choice'),
387
('ShowReviewer','full','none|full|first|surname|firstandinitial|username','Choose how a commenter\'s identity is presented alongside comments in the OPAC','Choice'),
387
('ShowReviewerPhoto','1','','If ON, photo of reviewer will be shown beside comments in OPAC','YesNo'),
388
('ShowReviewerPhoto','1','','If ON, photo of reviewer will be shown beside comments in OPAC','YesNo'),
388
('singleBranchMode','0',NULL,'Operate in Single-branch mode, hide branch selection in the OPAC','YesNo'),
389
('singleBranchMode','0',NULL,'Operate in Single-branch mode, hide branch selection in the OPAC','YesNo'),
(-)a/installer/data/mysql/updatedatabase.pl (+1 lines)
Lines 10418-10423 foreach my $file ( sort readdir $dirh ) { Link Here
10418
    }
10418
    }
10419
}
10419
}
10420
10420
10421
10421
=head1 FUNCTIONS
10422
=head1 FUNCTIONS
10422
10423
10423
=head2 TableExists($table)
10424
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+6 lines)
Lines 136-141 Circulation: Link Here
136
                  yes: Enable
136
                  yes: Enable
137
                  no: "Do not enable"
137
                  no: "Do not enable"
138
            - "offline circulation on regular circulation computers. (NOTE: This system preference does not affect the Firefox plugin or the desktop application)"
138
            - "offline circulation on regular circulation computers. (NOTE: This system preference does not affect the Firefox plugin or the desktop application)"
139
        -
140
            - pref: ShowRecallButton
141
              choices:
142
                  yes: Show
143
                  no: "Don't show"
144
            - a button to recall a checked out item in the holdings list of the biblio record details page.
139
145
140
    Checkout Policy:
146
    Checkout Policy:
141
        -
147
        -
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-1 / +40 lines)
Lines 195-200 function verify_images() { Link Here
195
     [% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() {
195
     [% IF ( AmazonCoverImages || LocalCoverImages ) %]$(window).load(function() {
196
        verify_images();
196
        verify_images();
197
     });[% END %]
197
     });[% END %]
198
199
    //AJAX call to send a recall notice to the user who currently has the item.
200
    function recall_item(itemnumber) {
201
        var button = $("#recall_"+itemnumber);
202
203
        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?'))) {
204
            return;
205
        }
206
207
        //Disable the button to prevent spamming
208
        button.attr("disabled",true);
209
210
        $.ajax({
211
            url: '/cgi-bin/koha/circ/send_recall_notice.pl',
212
            type: 'POST',
213
            dataType: 'text',
214
            data: {itemnumber: itemnumber},
215
            success: function(msg){
216
                if(msg == "SUCCESS") {
217
                    button.attr("value",_("Recall sent"));
218
                }
219
                else if(msg == "UNAUTHORIZED") {
220
                    alert(_("Failed to send the recall notice:")+"\n"+_("You do not have the required permissions to do this action.")+" (circulate_remaining_permissions)");
221
                    button.attr("disabled",false);
222
                }
223
                else {
224
                    alert(_("Failed to send the recall notice:")+"\n"+msg);
225
                    button.attr("disabled",false);
226
                }
227
            },
228
            error: function(request,status){
229
                alert(_("Failed to send the recall notice:")+"\n"+status);
230
                button.attr("disabled",false);
231
            }
232
        });
233
    }
234
198
//]]>
235
//]]>
199
</script>
236
</script>
200
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
237
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
Lines 649-654 function verify_images() { Link Here
649
                                    </a>
686
                                    </a>
650
                                [% END %]
687
                                [% END %]
651
                                : due [% item.datedue %]
688
                                : due [% item.datedue %]
689
                                [% IF ( ShowRecallButton ) %]
690
                                    <input type="button" id="recall_[% item.itemnumber %]" name="recall_[% item.itemnumber %]" value="Recall" onclick="recall_item([% item.itemnumber %]);" />
691
                                [% END %]
652
                            </span>
692
                            </span>
653
                        [% ELSIF ( item.transfertwhen ) %]
693
                        [% ELSIF ( item.transfertwhen ) %]
654
                            <span class="intransit">In transit from [% item.transfertfrom %] to [% item.transfertto %] since [% item.transfertwhen %]</span>
694
                            <span class="intransit">In transit from [% item.transfertfrom %] to [% item.transfertto %] since [% item.transfertwhen %]</span>
655
- 

Return to bug 8688