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

(-)a/Koha/Item/Transfer.pm (+14 lines)
Lines 33-38 Koha::Item::Transfer - Koha Item Transfer Object class Link Here
33
33
34
=cut
34
=cut
35
35
36
=head3 item
37
38
  my $item = Koha::Library->item;
39
40
Returns the associated item for this transfer.
41
42
=cut
43
44
sub item {
45
    my ( $self ) = @_;
46
    my $rs = $self->_result->itemnumber;
47
    return Koha::Item->_new_from_dbic( $rs );
48
}
49
36
=head3 type
50
=head3 type
37
51
38
=cut
52
=cut
(-)a/Koha/Library.pm (+14 lines)
Lines 50-55 sub stockrotationstages { Link Here
50
    return Koha::StockRotationStages->_new_from_dbic( $rs );
50
    return Koha::StockRotationStages->_new_from_dbic( $rs );
51
}
51
}
52
52
53
=head3 outgoing_transfers
54
55
  my $outgoing_transfers = Koha::Library->outgoing_transfers;
56
57
Returns the outgoing item transfers associated with this Library.
58
59
=cut
60
61
sub outgoing_transfers {
62
    my ( $self ) = @_;
63
    my $rs = $self->_result->branchtransfers_frombranches;
64
    return Koha::Item::Transfers->_new_from_dbic( $rs );
65
}
66
53
=head3 get_effective_marcorgcode
67
=head3 get_effective_marcorgcode
54
68
55
    my $marcorgcode = Koha::Libraries->find( $library_id )->get_effective_marcorgcode();
69
    my $marcorgcode = Koha::Libraries->find( $library_id )->get_effective_marcorgcode();
(-)a/circ/transferstosend.pl (+67 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2000-2002 Katipo Communications
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 3 of the License, or
10
# (at your option) any later version.
11
#
12
# Koha is distributed in the hope that it will be useful, but
13
# WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
20
use Modern::Perl;
21
use CGI qw ( -utf8 );
22
use C4::Context;
23
use C4::Auth;
24
use C4::Output;
25
26
use Koha::DateUtils;
27
28
my $input      = new CGI;
29
my $itemnumber = $input->param('itemnumber');
30
31
my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
32
    {
33
        template_name   => "circ/transferstosend.tt",
34
        query           => $input,
35
        type            => "intranet",
36
        authnotrequired => 0,
37
        flagsrequired   => { circulate => "circulate_remaining_permissions" },
38
        debug           => 1,
39
    }
40
);
41
42
# set the userenv branch
43
my $branchcode = C4::Context->userenv->{'branch'};
44
45
# transfers prompted by stockrotation
46
my @transfers = Koha::Libraries->search(
47
    {
48
        'branchtransfers_frombranches.frombranch'  => $branchcode,
49
        'branchtransfers_frombranches.datesent'    => { '!=' => undef },
50
        'branchtransfers_frombranches.datearrived' => undef,
51
        'branchtransfers_frombranches.comments'    => "StockrotationAdvance"
52
    },
53
    {
54
        prefetch => 'branchtransfers_frombranches',
55
        order_by => 'branchtransfers_frombranches.frombranch'
56
    }
57
);
58
59
$template->param(
60
    branchesloop => \@transfers,
61
    show_date    => output_pref(
62
        { dt => dt_from_string, dateformat => 'iso', dateonly => 1 }
63
    )
64
);
65
66
output_html_with_http_headers $input, $cookie, $template->output;
67
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt (+3 lines)
Lines 93-98 Link Here
93
                            <a class="circ-button" href="/cgi-bin/koha/circ/branchtransfers.pl"><i class="fa fa-exchange"></i> Transfer</a>
93
                            <a class="circ-button" href="/cgi-bin/koha/circ/branchtransfers.pl"><i class="fa fa-exchange"></i> Transfer</a>
94
                        </li>
94
                        </li>
95
                    [% END %]
95
                    [% END %]
96
                    <li>
97
                        <a class="circ-button" href="/cgi-bin/koha/circ/transferstosend.pl"><i class="fa fa-sign-out"></i> Transfers to send</a>
98
                    </li>
96
                    <li>
99
                    <li>
97
                        <a class="circ-button" href="/cgi-bin/koha/circ/transferstoreceive.pl"><i class="fa fa-sign-in"></i> Transfers to receive</a>
100
                        <a class="circ-button" href="/cgi-bin/koha/circ/transferstoreceive.pl"><i class="fa fa-sign-in"></i> Transfers to receive</a>
98
                    </li>
101
                    </li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstosend.tt (-1 / +104 lines)
Line 0 Link Here
0
- 
1
[% USE raw %]
2
[% USE Asset %]
3
[% USE Koha %]
4
[% USE KohaDates %]
5
[% USE Branches %]
6
[% SET footerjs = 1 %]
7
[% INCLUDE 'doc-head-open.inc' %]
8
<title>Koha &rsaquo; Circulation &rsaquo; Transfers to send</title>
9
[% INCLUDE 'doc-head-close.inc' %]
10
</head>
11
12
<body id="circ_transferstosend" class="circ">
13
[% INCLUDE 'header.inc' %]
14
[% INCLUDE 'circ-search.inc' %]
15
16
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>  &rsaquo; Transfers to send</div>
17
18
<div class="main container-fluid">
19
    <div class="row">
20
        <div class="col-sm-12">
21
            <main>
22
                <div class="row">
23
24
                [% IF Koha.Preference('CircSidebar') %]
25
                    <div class="col-sm-10 col-sm-push-2">
26
                [% ELSE %]
27
                    <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
28
                [% END %]
29
30
        <h1>Transfers required by your library as of [% show_date | $KohaDates %]</h1>
31
	[% IF ( branchesloop ) %]
32
        <p>Your library is the origin for the following transfer(s)</p>
33
        <div id="resultlist">
34
        [% FOREACH branchesloo IN branchesloop %]
35
            [% IF ( branchesloo.branchcode ) %]
36
            <table style="width: 100%" id="transferst[% branchesloo.branchcode | html %]">
37
            <caption>Sending to [% branchesloo.branchname | html %]</caption>
38
            <thead><tr>
39
                <th class="title-string">Date of request</th>
40
                <th class="anti-the">Title</th>
41
                <th>On hold for</th>
42
                <th>Home library</th>
43
                <th>Call no.</th>
44
                <th>&nbsp;</th>
45
            </tr></thead>
46
            <tbody>[% FOREACH transfer IN branchesloo.outgoing_transfers %]
47
                <tr>
48
                    <td><p><span title="[% transfer.datesent | html %]">[% transfer.datesent | $KohaDates %]</span></p></td>
49
                    <td>
50
                        [% INCLUDE 'biblio-default-view.inc' biblionumber = transfer.item.biblionumber %][% transfer.item.biblio.title | html %] [% IF ( transfer.item.biblio.subtitles ) %] [% FOREACH subtitle IN transfer.item.biblio.subtitles %][% subtitle.subfield | html %][% END %][% END %]</a> [% IF ( transfer.item.biblio.author ) %]by [% transfer.item.biblio.author | html %][% END %]
51
                            [% IF ( transfer.item.effective_itemtype ) %] (<b>[% transfer.item.effective_itemtype | html %]</b>)[% END %]
52
                            <br />Barcode: [% transfer.item.barcode | html %]
53
                    </td>
54
                    <td><p>None</p></td>
55
                    <td></td>
56
                    <td>[% transfer.item.itemcallnumber | html %]</td>
57
                    <td class="actions">
58
                        <a href="/cgi-bin/koha/catalogue/stockrotation.pl?op=toggle_in_demand&stage_id=4&item_id=[% transfer.itemnumber %]&biblionumber=[% transfer.item.biblionumber %]" class="btn btn-default btn-xs"><i class="fa fa-fire"></i> Mark "In demand"</a>
59
                        <a href="/cgi-bin/koha/circ/returns.pl?itemnumber=[% transfer.itemnumber | uri %]&amp;canceltransfer=1&amp;dest=ttr" class="btn btn-default btn-xs"><i class="fa fa-times"></i> Cancel transfer</a>
60
                    </td>
61
                </tr>
62
            [% END %]</tbody>
63
            </table>
64
            [% END %]
65
        [% END %]
66
        </div>
67
    [% ELSE %]
68
        <p>No transfers to send</p>
69
    [% END %]
70
71
                    [% IF Koha.Preference('CircSidebar') %]
72
                            </div> <!-- /.col-sm-10.col-sm-push-2 -->
73
                            <div class="col-sm-2 col-sm-pull-10">
74
                                <aside>
75
                                    [% INCLUDE 'circ-nav.inc' %]
76
                                </aside>
77
                            </div> <!-- /.col-sm-2.col-sm-pull-10 -->
78
                        </div> <!-- /.row -->
79
                    [% END %]
80
81
            </main>
82
        </div> <!-- /.col-sm-12 -->
83
    </div> <!-- /.row -->
84
85
[% MACRO jsinclude BLOCK %]
86
    [% INCLUDE 'datatables.inc' %]
87
    <script>
88
        $(document).ready(function() {
89
            [% FOREACH branchesloo IN branchesloop %]
90
            $("#transferst[% branchesloo.branchcode | html %]").dataTable($.extend(true, {}, dataTablesDefaults, {
91
                "aoColumnDefs": [
92
                    { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
93
                    { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
94
                    { "sType": "title-string", "aTargets" : [ "title-string" ] }
95
                ],
96
                "sDom": 't',
97
                "bPaginate": false
98
            }));
99
            [% END %]
100
        });
101
    </script>
102
[% END %]
103
104
[% INCLUDE 'intranet-bottom.inc' %]

Return to bug 22569