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 359-364 foreach ( keys %{$dat} ) { Link Here
359
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
363
$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
360
$template->param(
364
$template->param(
361
    itemloop        => \@itemloop,
365
    itemloop        => \@itemloop,
366
    items_checked_out   => $items_checked_out,
362
    otheritemloop   => \@otheritemloop,
367
    otheritemloop   => \@otheritemloop,
363
    biblionumber        => $biblionumber,
368
    biblionumber        => $biblionumber,
364
    ($analyze? 'analyze':'detailview') =>1,
369
    ($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>>', '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
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 378-383 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
378
('ShelfBrowserUsesHomeBranch','1','1','Use the item home branch when finding items for the shelf browser.','YesNo'),
378
('ShelfBrowserUsesHomeBranch','1','1','Use the item home branch when finding items for the shelf browser.','YesNo'),
379
('ShelfBrowserUsesLocation','1','1','Use the item location when finding items for the shelf browser.','YesNo'),
379
('ShelfBrowserUsesLocation','1','1','Use the item location when finding items for the shelf browser.','YesNo'),
380
('ShowPatronImageInWebBasedSelfCheck','0','','If ON, displays patron image when a patron uses web-based self-checkout','YesNo'),
380
('ShowPatronImageInWebBasedSelfCheck','0','','If ON, displays patron image when a patron uses web-based self-checkout','YesNo'),
381
('ShowRecallButton','0','','If on, show a button to recall a checked out item in the holdings list of the biblio record details page.','YesNo'),
381
('ShowReviewer','full','none|full|first|surname|firstandinitial|username','Choose how a commenter\'s identity is presented alongside comments in the OPAC','Choice'),
382
('ShowReviewer','full','none|full|first|surname|firstandinitial|username','Choose how a commenter\'s identity is presented alongside comments in the OPAC','Choice'),
382
('ShowReviewerPhoto','1','','If ON, photo of reviewer will be shown beside comments in OPAC','YesNo'),
383
('ShowReviewerPhoto','1','','If ON, photo of reviewer will be shown beside comments in OPAC','YesNo'),
383
('singleBranchMode','0',NULL,'Operate in Single-branch mode, hide branch selection in the OPAC','YesNo'),
384
('singleBranchMode','0',NULL,'Operate in Single-branch mode, hide branch selection in the OPAC','YesNo'),
(-)a/installer/data/mysql/updatedatabase.pl (+11 lines)
Lines 9804-9809 if ( CheckVersion($DBversion) ) { Link Here
9804
    SetVersion($DBversion);
9804
    SetVersion($DBversion);
9805
}
9805
}
9806
9806
9807
$DBversion = 'XXX';
9808
if ( CheckVersion($DBversion) ) {
9809
    $dbh->do("INSERT INTO `letter` (`module`, `code`, `name`, `title`, `content`) VALUES
9810
('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');
9811
");
9812
    $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')");
9813
    print "Upgrade to $DBversion done (Bug 8688: Add the 'RECALL' letter)\n";
9814
    SetVersion ($DBversion);
9815
}
9816
9817
9807
=head1 FUNCTIONS
9818
=head1 FUNCTIONS
9808
9819
9809
=head2 TableExists($table)
9820
=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 189-194 function verify_images() { Link Here
189
     [% IF ( AmazonCoverImages ) %]$(window).load(function() {
189
     [% IF ( AmazonCoverImages ) %]$(window).load(function() {
190
        verify_images();
190
        verify_images();
191
     });[% END %]
191
     });[% END %]
192
193
    //AJAX call to send a recall notice to the user who currently has the item.
194
    function recall_item(itemnumber) {
195
        var button = $("#recall_"+itemnumber);
196
197
        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?'))) {
198
            return;
199
        }
200
201
        //Disable the button to prevent spamming
202
        button.attr("disabled",true);
203
204
        $.ajax({
205
            url: '/cgi-bin/koha/circ/send_recall_notice.pl',
206
            type: 'POST',
207
            dataType: 'text',
208
            data: {itemnumber: itemnumber},
209
            success: function(msg){
210
                if(msg == "SUCCESS") {
211
                    button.attr("value",_("Recall sent"));
212
                }
213
                else if(msg == "UNAUTHORIZED") {
214
                    alert(_("Failed to send the recall notice:")+"\n"+_("You do not have the required permissions to do this action.")+" (circulate_remaining_permissions)");
215
                    button.attr("disabled",false);
216
                }
217
                else {
218
                    alert(_("Failed to send the recall notice:")+"\n"+msg);
219
                    button.attr("disabled",false);
220
                }
221
            },
222
            error: function(request,status){
223
                alert(_("Failed to send the recall notice:")+"\n"+status);
224
                button.attr("disabled",false);
225
            }
226
        });
227
    }
228
192
//]]>
229
//]]>
193
</script>
230
</script>
194
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
231
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
Lines 612-617 function verify_images() { Link Here
612
                                    </a>
649
                                    </a>
613
                                [% END %]
650
                                [% END %]
614
                                : due [% item.datedue %]
651
                                : due [% item.datedue %]
652
                                [% IF ( ShowRecallButton ) %]
653
                                    <input type="button" id="recall_[% item.itemnumber %]" name="recall_[% item.itemnumber %]" value="Recall" onclick="recall_item([% item.itemnumber %]);" />
654
                                [% END %]
615
                            </span>
655
                            </span>
616
                        [% ELSIF ( item.transfertwhen ) %]
656
                        [% ELSIF ( item.transfertwhen ) %]
617
                            <span class="intransit">In transit from [% item.transfertfrom %] to [% item.transfertto %] since [% item.transfertwhen %]</span>
657
                            <span class="intransit">In transit from [% item.transfertfrom %] to [% item.transfertto %] since [% item.transfertwhen %]</span>
618
- 

Return to bug 8688