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

(-)a/Koha/Item.pm (-1 / +1 lines)
Lines 149-155 sub article_request_type { Link Here
149
      :                                      undef;
149
      :                                      undef;
150
    my $borrowertype = $borrower->categorycode;
150
    my $borrowertype = $borrower->categorycode;
151
    my $itemtype = $self->effective_itemtype();
151
    my $itemtype = $self->effective_itemtype();
152
    my $rules = GetIssuingRule( $borrowertype, $itemtype, $branchcode );
152
    my $rules = C4::Circulation::GetIssuingRule( $borrowertype, $itemtype, $branchcode );
153
153
154
    return $rules->{article_requests} || q{};
154
    return $rules->{article_requests} || q{};
155
}
155
}
(-)a/admin/smart-rules.pl (+2 lines)
Lines 148-153 elsif ($op eq 'add') { Link Here
148
    my $hardduedatecompare = $input->param('hardduedatecompare');
148
    my $hardduedatecompare = $input->param('hardduedatecompare');
149
    my $rentaldiscount = $input->param('rentaldiscount');
149
    my $rentaldiscount = $input->param('rentaldiscount');
150
    my $opacitemholds = $input->param('opacitemholds') || 0;
150
    my $opacitemholds = $input->param('opacitemholds') || 0;
151
    my $article_requests = $input->param('article_requests') || 'no';
151
    my $overduefinescap = $input->param('overduefinescap') || undef;
152
    my $overduefinescap = $input->param('overduefinescap') || undef;
152
    my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
153
    my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
153
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
154
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
Lines 178-183 elsif ($op eq 'add') { Link Here
178
        opacitemholds                 => $opacitemholds,
179
        opacitemholds                 => $opacitemholds,
179
        overduefinescap               => $overduefinescap,
180
        overduefinescap               => $overduefinescap,
180
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
181
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
182
        article_requests              => $article_requests,
181
    };
183
    };
182
184
183
    my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype, branchcode => $br});
185
    my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype, branchcode => $br});
(-)a/circ/article-request-slip.pl (+67 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2015 ByWater Solutions
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
22
use CGI qw( -utf8 );
23
24
use C4::Context;
25
use C4::Output;
26
use C4::Auth;
27
use Koha::ArticleRequests;
28
29
my $cgi = new CGI;
30
31
my $id = $cgi->param('id');
32
33
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
34
    {
35
        template_name   => "circ/printslip.tt",
36
        query           => $cgi,
37
        type            => "intranet",
38
        authnotrequired => 0,
39
        flagsrequired   => { circulate => "circulate_remaining_permissions" },
40
    }
41
);
42
43
my $ar = Koha::ArticleRequests->find($id);
44
45
$template->param( article_request => $ar );
46
47
my $slip = C4::Letters::GetPreparedLetter(
48
    module                 => 'circulation',
49
    letter_code            => 'AR_SLIP',
50
    message_transport_type => 'print',
51
    tables                 => {
52
        article_requests => $ar->id,
53
        borrowers        => $ar->borrowernumber,
54
        biblio           => $ar->biblionumber,
55
        biblioitems      => $ar->biblionumber,
56
        items            => $ar->itemnumber,
57
        branches         => $ar->branchcode,
58
    },
59
);
60
61
$template->param(
62
    slip   => $slip->{content},
63
    caller => 'article-request',
64
    plain  => !$slip->{is_html},
65
);
66
67
output_html_with_http_headers $cgi, $cookie, $template->output;
(-)a/circ/article-requests.pl (+47 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2015 ByWater Solutions
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
22
use CGI qw ( -utf8 );
23
24
use C4::Auth;
25
use C4::Output;
26
use Koha::ArticleRequests;
27
28
my $query = new CGI;
29
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
30
    {
31
        template_name   => "circ/article-requests.tt",
32
        query           => $query,
33
        type            => "intranet",
34
        authnotrequired => 0,
35
        flagsrequired   => { circulate => "circulate_remaining_permissions" },
36
    }
37
);
38
39
my $branchcode = defined( $query->param('branchcode') ) ? $query->param('branchcode') : C4::Context->userenv->{'branch'};
40
41
$template->param(
42
    branchcode                  => $branchcode,
43
    article_requests_pending    => scalar Koha::ArticleRequests->pending($branchcode),
44
    article_requests_processing => scalar Koha::ArticleRequests->processing($branchcode),
45
);
46
47
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/circ/request-article-do.pl (+62 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright ByWater Solutions 2015
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
22
use CGI qw ( -utf8 );
23
24
use C4::Auth;
25
use C4::Output;
26
27
use Koha::ArticleRequest;
28
29
my $cgi = new CGI;
30
31
checkauth( $cgi, 0, { circulate => 'circulate_remaining_permissions' }, 'intranet' );
32
33
my $biblionumber   = $cgi->param('biblionumber');
34
my $borrowernumber = $cgi->param('borrowernumber');
35
my $branchcode     = $cgi->param('branchcode');
36
37
my $itemnumber = $cgi->param('itemnumber') || undef;
38
my $title      = $cgi->param('title')      || undef;
39
my $author     = $cgi->param('author')     || undef;
40
my $volume     = $cgi->param('volume')     || undef;
41
my $issue      = $cgi->param('issue')      || undef;
42
my $date       = $cgi->param('date')       || undef;
43
my $pages      = $cgi->param('pages')      || undef;
44
my $chapters   = $cgi->param('chapters')   || undef;
45
46
my $ar = Koha::ArticleRequest->new(
47
    {
48
        borrowernumber => $borrowernumber,
49
        biblionumber   => $biblionumber,
50
        branchcode     => $branchcode,
51
        itemnumber     => $itemnumber,
52
        title          => $title,
53
        author         => $author,
54
        volume         => $volume,
55
        issue          => $issue,
56
        date           => $date,
57
        pages          => $pages,
58
        chapters       => $chapters,
59
    }
60
)->store();
61
62
print $cgi->redirect("/cgi-bin/koha/circ/request-article.pl?biblionumber=$biblionumber");
(-)a/circ/request-article.pl (+74 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2015 ByWater Solutions
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
22
use C4::Output;
23
use C4::Auth;
24
use C4::Utils::DataTables::Members;
25
use Koha::Biblios;
26
use Koha::Borrowers;
27
use Koha::ArticleRequests;
28
29
my $input = new CGI;
30
31
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
32
    {
33
        template_name   => "circ/request-article.tt",
34
        query           => $input,
35
        type            => "intranet",
36
        authnotrequired => 0,
37
        flagsrequired   => { circulate => 'circulate_remaining_permissions' },
38
    }
39
);
40
41
my $biblionumber      = $input->param('biblionumber');
42
my $patron_cardnumber = $input->param('patron_cardnumber');
43
my $patron_id         = $input->param('patron_id');
44
45
my $biblio = Koha::Biblios->find($biblionumber);
46
my $patron = Koha::Borrowers->find( $patron_id ? $patron_id : { cardnumber => $patron_cardnumber } );
47
48
if (!$patron && $patron_cardnumber) {
49
    my $results = C4::Utils::DataTables::Members::search(
50
        {
51
            searchmember => $patron_cardnumber,
52
            dt_params    => { iDisplayLength => -1 },
53
        }
54
    );
55
56
    my $patrons = $results->{patrons};
57
58
    if ( scalar @$patrons == 1 ) {
59
        $patron = Koha::Borrowers->find( $patrons->[0]->{borrowernumber} );
60
    }
61
    elsif (@$patrons) {
62
        $template->param( patrons => $patrons );
63
    }
64
    else {
65
        $template->param( no_patrons_found => $patron_cardnumber );
66
    }
67
}
68
69
$template->param(
70
    biblio => $biblio,
71
    patron => $patron,
72
);
73
74
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css (-3 / +3 lines)
Lines 1708-1715 ul.budget_hierarchy li:first-child:after { Link Here
1708
.child_fund_amount {
1708
.child_fund_amount {
1709
    font-style: italic;
1709
    font-style: italic;
1710
}
1710
}
1711
.holdcount { font-size : 105%; line-height : 200%; }
1711
.number_box { font-size : 105%; line-height : 200%; }
1712
.holdcount a {
1712
.number_box a {
1713
	border : 1px solid #a4bedd;
1713
	border : 1px solid #a4bedd;
1714
	background-color : #e4ecf5;
1714
	background-color : #e4ecf5;
1715
	font-weight : bold;
1715
	font-weight : bold;
Lines 1718-1724 ul.budget_hierarchy li:first-child:after { Link Here
1718
	padding : .1em .4em;
1718
	padding : .1em .4em;
1719
	text-decoration : none;
1719
	text-decoration : none;
1720
}
1720
}
1721
.holdcount a:hover { background-color : #ebeff7; }
1721
.number_box a:hover { background-color : #ebeff7; }
1722
.container {
1722
.container {
1723
	border : 1px solid #EEE;
1723
	border : 1px solid #EEE;
1724
	padding : 1em;
1724
	padding : 1em;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc (-33 / +51 lines)
Lines 1-38 Link Here
1
[% USE Koha %]
1
[% USE Biblio %]
2
[% USE Biblio %]
2
[% SET biblio_object_id = object || biblionumber %]
3
[% SET biblio_object_id = object || biblionumber %]
4
3
<div id="menu">
5
<div id="menu">
4
<ul>
6
    <ul>
5
    [% IF ( detailview ) %]<li class="active">[% ELSE %]<li>[% END %]
7
        [% IF ( detailview ) %]<li class="active">[% ELSE %]<li>[% END %]
6
    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio_object_id %]">Normal</a></li>
8
        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio_object_id %]">Normal</a></li>
7
9
8
[% IF ( can_view_MARC ) %]
10
        [% IF ( can_view_MARC ) %]
9
[% IF ( marcview ) %]<li class="active">[% ELSE %]<li>[% END %]
11
            [% IF ( marcview ) %]<li class="active">[% ELSE %]<li>[% END %]
10
<a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio_object_id %]">MARC</a></li>
12
             <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio_object_id %]">MARC</a></li>
11
[% END %]
13
        [% END %]
12
14
13
[% IF ( can_view_labeledMARC ) %]
15
        [% IF ( can_view_labeledMARC ) %]
14
    [% IF ( labeledmarcview ) %]<li class="active">[% ELSE %]<li>[% END %]
16
            [% IF ( labeledmarcview ) %]<li class="active">[% ELSE %]<li>[% END %]
15
	<a href="/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=[% biblio_object_id %]">Labeled MARC</a></li>
17
            <a href="/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=[% biblio_object_id %]">Labeled MARC</a></li>
16
[% END %]
18
        [% END %]
17
19
18
[% IF ( can_view_ISBD ) %]
20
        [% IF ( can_view_ISBD ) %]
19
    [% IF ( isbdview ) %]<li class="active">[% ELSE %]<li>[% END %]
21
            [% IF ( isbdview ) %]<li class="active">[% ELSE %]<li>[% END %]
20
    <a href="/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=[% biblio_object_id %]">ISBD</a></li>
22
            <a href="/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=[% biblio_object_id %]">ISBD</a></li>
21
[% END %]
23
        [% END %]
22
24
23
    [% IF ( moredetailview ) %]<li class="active">[% ELSE %]<li>[% END %]
25
        [% IF ( moredetailview ) %]<li class="active">[% ELSE %]<li>[% END %]
24
    <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblio_object_id %]">Items</a></li>
26
        <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% biblio_object_id %]">Items</a></li>
25
    [% IF ( CAN_user_reserveforothers ) %]
27
26
    [% IF ( holdsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio_object_id %]">Holds ([% Biblio.HoldsCount( biblio_object_id ) %])</a></li>
28
        [% IF ( CAN_user_reserveforothers ) %]
27
    [% END %]
29
            [% IF ( holdsview ) %]<li class="active">[% ELSE %]<li>[% END %]
28
    [% IF ( EasyAnalyticalRecords ) %][% IF ( analyze ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio_object_id %]&amp;analyze=1">Analytics</a></li>[% END %]
30
            <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio_object_id %]">Holds ([% Biblio.HoldsCount( biblio_object_id ) %])</a></li>
29
31
        [% END %]
30
    [% IF ( subscriptionsnumber ) %]<li><a href="/cgi-bin/koha/serials/serials-search.pl?searched=1&amp;biblionumber=[% biblio_object_id %]">Subscription(s)</a></li>[% END %]
32
31
</ul>
33
        [% IF ( EasyAnalyticalRecords ) %]
32
<ul>
34
            [% IF ( analyze ) %]<li class="active">[% ELSE %]<li>[% END %]
33
[% IF ( issuehistoryview ) %]<li class="active">[% ELSE %]<li>[% END %]
35
            <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio_object_id %]&amp;analyze=1">Analytics</a></li>
34
<a href="/cgi-bin/koha/catalogue/issuehistory.pl?biblionumber=[% biblio_object_id %]" >Checkout history</a></li>
36
        [% END %]
35
[% IF ( CAN_user_tools_view_system_logs ) %][% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=CATALOGUING&amp;action=MODIFY&amp;object=[% biblio_object_id %]">Modification log</a> </li>[% END %]
37
36
</ul>
38
        [% IF Koha.Preference('ArticleRequests') %]
39
            [% IF ( article_requests_view ) %]<li class="active">[% ELSE %]<li>[% END %]
40
            <a href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% IF ( object ) %][% object %][% ELSE %][% biblionumber %][% END %]">Article requests ([% Biblio.ArticleRequestsActiveCount( biblio_object_id ) %])</a></li>
41
        [% END %]
42
43
        [% IF ( subscriptionsnumber ) %]<li><a href="/cgi-bin/koha/serials/serials-search.pl?searched=1&amp;biblionumber=[% biblio_object_id %]">Subscription(s)</a></li>[% END %]
44
    </ul>
45
46
    <ul>
47
        [% IF ( issuehistoryview ) %]<li class="active">[% ELSE %]<li>[% END %]
48
        <a href="/cgi-bin/koha/catalogue/issuehistory.pl?biblionumber=[% biblio_object_id %]" >Checkout history</a></li>
49
50
        [% IF ( CAN_user_tools_view_system_logs ) %]
51
            [% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]
52
            <a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=CATALOGUING&amp;action=MODIFY&amp;object=[% biblio_object_id %]">Modification log</a> </li>
53
        [% END %]
54
    </ul>
37
</div>
55
</div>
38
56
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (+4 lines)
Lines 263-268 CAN_user_serials_create_subscription ) %] Link Here
263
    [% END %]
263
    [% END %]
264
[% END %]
264
[% END %]
265
265
266
[% IF Koha.Preference('ArticleRequests') %]
267
    <div class="btn-group"><a id="placehold" class="btn btn-small" href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% biblionumber %]"><i class="fa fa-file-text-o"></i> Request article</a></div>
268
[% END %]
269
266
</form>
270
</form>
267
</div>
271
</div>
268
272
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+43 lines)
Lines 762-764 Circulation: Link Here
762
            - "Patron categories allowed to checkout in a batch"
762
            - "Patron categories allowed to checkout in a batch"
763
            - pref: BatchCheckoutsValidCategories
763
            - pref: BatchCheckoutsValidCategories
764
            - "(list of patron categories separated with a pipe '|')"
764
            - "(list of patron categories separated with a pipe '|')"
765
    Article Requests:
766
        -
767
            - pref: ArticleRequests
768
              choices:
769
                  yes: Enable
770
                  no: "Don't enable"
771
            - patrons to place article requests.
772
        -
773
            - For records that are record level or item level requestable, make the following fields mandatory
774
            - pref: ArticleRequestsMandatoryFields
775
              multiple:
776
                title: Title
777
                author: Author
778
                volume: Volume
779
                issue: Issue
780
                date: Date
781
                pages: Pages
782
                chapters: Chapters
783
            -
784
        -
785
            - For records that are only record level requestable, make the following fields mandatory
786
            - pref: ArticleRequestsMandatoryFieldsRecordOnly
787
              multiple:
788
                title: Title
789
                author: Author
790
                volume: Volume
791
                issue: Issue
792
                date: Date
793
                pages: Pages
794
                chapters: Chapters
795
            -
796
        -
797
            - For records that are only item level requestable, make the following fields mandatory
798
            - pref: ArticleRequestsMandatoryFieldsItemOnly
799
              multiple:
800
                title: Title
801
                author: Author
802
                volume: Volume
803
                issue: Issue
804
                date: Date
805
                pages: Pages
806
                chapters: Chapters
807
            -
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (+21 lines)
Lines 178-183 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde Link Here
178
                <th>Holds allowed (count)</th>
178
                <th>Holds allowed (count)</th>
179
                <th>On shelf holds allowed</th>
179
                <th>On shelf holds allowed</th>
180
                <th>Item level holds</th>
180
                <th>Item level holds</th>
181
                <th>Article requests</th>
181
                <th>Rental discount (%)</th>
182
                <th>Rental discount (%)</th>
182
                <th>Actions</th>
183
                <th>Actions</th>
183
            </tr>
184
            </tr>
Lines 263-268 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde Link Here
263
                                                                If any unavailable
264
                                                                If any unavailable
264
                                                            [% END %]</td>
265
                                                            [% END %]</td>
265
                                                        <td>[% IF rule.opacitemholds == 'F'%]Force[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td>
266
                                                        <td>[% IF rule.opacitemholds == 'F'%]Force[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td>
267
                                                        <td>
268
                                                            [% IF rule.article_requests == 'no' %]
269
                                                                No
270
                                                            [% ELSIF rule.article_requests == 'yes' %]
271
                                                                Yes
272
                                                            [% ELSIF rule.article_requests == 'bib_only' %]
273
                                                                Record only
274
                                                            [% ELSIF rule.article_requests == 'item_only' %]
275
                                                                Item only
276
                                                            [% END %]
277
                                                        </td>
266
							<td>[% rule.rentaldiscount %]</td>
278
							<td>[% rule.rentaldiscount %]</td>
267
                                                        <td class="actions">
279
                                                        <td class="actions">
268
                                                          <a href="#" class="editrule btn btn-mini"><i class="fa fa-pencil"></i> Edit</a>
280
                                                          <a href="#" class="editrule btn btn-mini"><i class="fa fa-pencil"></i> Edit</a>
Lines 342-347 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde Link Here
342
                            <option value="F">Force</option>
354
                            <option value="F">Force</option>
343
                        </select>
355
                        </select>
344
                    </td>
356
                    </td>
357
                    <td>
358
                        <select id="article_requests" name="article_requests">
359
                            <option value="no">No</option>
360
                            <option value="yes">Yes</option>
361
                            <option value="bib_only">Record only</option>
362
                            <option value="item_only">Item only</option>
363
                        </select>
364
                    </td>
345
                    <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
365
                    <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
346
                    <td class="actions">
366
                    <td class="actions">
347
                        <input type="hidden" name="branch" value="[% current_branch %]"/>
367
                        <input type="hidden" name="branch" value="[% current_branch %]"/>
Lines 373-378 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde Link Here
373
                      <th>Holds allowed (count)</th>
393
                      <th>Holds allowed (count)</th>
374
                      <th>On shelf holds allowed</th>
394
                      <th>On shelf holds allowed</th>
375
                      <th>Item level holds</th>
395
                      <th>Item level holds</th>
396
                      <th>Article requests</th>
376
                      <th>Rental discount (%)</th>
397
                      <th>Rental discount (%)</th>
377
                      <th colspan="2">&nbsp;</th>
398
                      <th colspan="2">&nbsp;</th>
378
                    </tr>
399
                    </tr>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (+19 lines)
Lines 2-7 Link Here
2
[% USE KohaDates %]
2
[% USE KohaDates %]
3
[% USE AuthorisedValues %]
3
[% USE AuthorisedValues %]
4
[% USE Branches %]
4
[% USE Branches %]
5
[% USE Biblio %]
5
6
6
[% ShowCourseReserves = 0 %]
7
[% ShowCourseReserves = 0 %]
7
[% IF UseCourseReserves %]
8
[% IF UseCourseReserves %]
Lines 384-389 function verify_images() { Link Here
384
        [% END %]
385
        [% END %]
385
        <span id="catalogue_detail_marc_preview" class="results_summary"><span class="label">MARC Preview:</span> <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber %]&amp;viewas=html" title="MARC" class="previewMARC">Show</a></span>
386
        <span id="catalogue_detail_marc_preview" class="results_summary"><span class="label">MARC Preview:</span> <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber %]&amp;viewas=html" title="MARC" class="previewMARC">Show</a></span>
386
387
388
        [% IF ( holdcount ) %]
389
            <span class="results_summary">
390
                <span class="label">Holds:</span>
391
                <span class="number_box">
392
                    <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">[% holdcount %]</a>
393
                </span>
394
            </span>
395
        [% END %]
396
397
        [% IF ( article_requests_count = Biblio.ArticleRequestsActiveCount( biblionumber ) ) %]
398
            <span class="results_summary">
399
                <span class="label">Article requests:</span>
400
                <span class="number_box">
401
                    <a href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% biblionumber %]">[% article_requests_count %]</a>
402
                </span>
403
            </span>
404
        [% END %]
405
387
        [% IF ( AmazonCoverImages  || LocalCoverImages ) %]
406
        [% IF ( AmazonCoverImages  || LocalCoverImages ) %]
388
        </div><div class="yui-u" id="bookcoverimg">
407
        </div><div class="yui-u" id="bookcoverimg">
389
        [% IF ( LocalCoverImages ) %]
408
        [% IF ( LocalCoverImages ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (+3 lines)
Lines 559-564 var holdForPatron = function () { Link Here
559
                                  <a id="reserve_[% SEARCH_RESULT.biblionumber %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Holds</a>
559
                                  <a id="reserve_[% SEARCH_RESULT.biblionumber %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Holds</a>
560
                                  [% IF ( holdfor ) %] <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]&amp;findborrower=[% holdfor_cardnumber %]">Place hold for [% holdfor_firstname %] [% holdfor_surname %] ([% holdfor_cardnumber %])</a></span>[% END %]
560
                                  [% IF ( holdfor ) %] <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]&amp;findborrower=[% holdfor_cardnumber %]">Place hold for [% holdfor_firstname %] [% holdfor_surname %] ([% holdfor_cardnumber %])</a></span>[% END %]
561
                              [% END %]
561
                              [% END %]
562
                              [% IF Koha.Preference('ArticleRequests') %]
563
                                  | <a id="requst_article_[% SEARCH_RESULT.biblionumber %]" href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Request article</a>
564
                              [% END %]
562
                          [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
565
                          [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
563
                          | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Edit record</a>
566
                          | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Edit record</a>
564
                          [% END %]
567
                          [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt (+407 lines)
Line 0 Link Here
1
[% USE KohaDates %]
2
[% USE ItemTypes %]
3
[% USE Branches %]
4
[% USE AuthorisedValues %]
5
6
[% INCLUDE 'doc-head-open.inc' %]
7
<title>Koha &rsaquo; Circulation &rsaquo; Article requests</title>
8
[% INCLUDE 'doc-head-close.inc' %]
9
<style type="text/css"> p { margin-top: 0; }</style>
10
</head>
11
12
<body id="circ_view_holdsqueue" class="circ">
13
    [% INCLUDE 'header.inc' %]
14
    [% INCLUDE 'cat-search.inc' %]
15
16
    <script type="text/javascript">//<![CDATA[
17
        $(document).ready(function() {
18
            $('#article-request-tabs').tabs();
19
20
            [% IF article_requests_pending.count %]
21
                $(".ar-pending-none").hide();
22
            [% END %]
23
24
            [% IF article_requests_processing.count %]
25
                $(".ar-processing-none").hide();
26
            [% END %]
27
        });
28
29
        function PrintSlip(link) {
30
            window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
31
        }
32
33
        function Cancel( id, a ) {
34
            notes = prompt(_("Reason for cancelation:"));
35
            if ( notes == null ) {
36
                return;
37
            }
38
39
            a.closest('td').prepend('<img src="[% interface %]/[% theme %]/img/loading-small.gif"/>');
40
            a.closest('div').hide();
41
            $.ajax({
42
                type: "POST",
43
                url: '/cgi-bin/koha/svc/article_request',
44
                data: {
45
                    action: 'cancel',
46
                    id: id,
47
                    notes: notes
48
                },
49
                success: function( data ) {
50
                    a.closest('tr').remove();
51
                    UpdateTabCounts()
52
                },
53
                dataType: 'json'
54
            });
55
        }
56
57
        function Process( id, a ) {
58
            var table_row = a.closest('tr').clone();
59
            table_row.find('.ar-process-request').remove();
60
61
            a.closest('td').prepend('<img src="[% interface %]/[% theme %]/img/loading-small.gif"/>');
62
            a.closest('div').hide();
63
            $.ajax({
64
                type: "POST",
65
                url: '/cgi-bin/koha/svc/article_request',
66
                data: {
67
                    action: 'process',
68
                    id: id,
69
                },
70
                success: function( data ) {
71
                    a.closest('tr').remove();
72
                    $("#article-requests-processing-table").append( table_row );
73
                    $("#article-requests-processing-table .ar-processing-none").hide();
74
                    UpdateTabCounts()
75
                },
76
                dataType: 'json'
77
            });
78
        }
79
80
        function Complete( id, a ) {
81
            a.closest('td').prepend('<img src="[% interface %]/[% theme %]/img/loading-small.gif"/>');
82
            a.closest('div').hide();
83
            $.ajax({
84
                type: "POST",
85
                url: '/cgi-bin/koha/svc/article_request',
86
                data: {
87
                    action: 'complete',
88
                    id: id,
89
                },
90
                success: function( data ) {
91
                    a.closest('tr').remove();
92
                    UpdateTabCounts()
93
                },
94
                dataType: 'json'
95
            });
96
        }
97
98
        function UpdateTabCounts() {
99
            var pending_count = $('#article-requests-pending-table tbody tr.ar-row').length;
100
            $("#ar_pending_count").html( pending_count );
101
            if ( pending_count == 0 ) $(".ar-pending-none").show();
102
103
            var processing_count = $('#article-requests-processing-table tbody tr.ar-row').length;
104
            $("#ar_processing_count").html( processing_count );
105
            if ( processing_count == 0 ) $(".ar-processing-none").show();
106
        }
107
    //]]></script>
108
109
    <div id="breadcrumbs">
110
        <a href="/cgi-bin/koha/mainpage.pl">Home</a>
111
        &rsaquo;
112
        <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
113
        &rsaquo;
114
        <a href="/cgi-bin/koha/circ/article-requests.pl">Article requests</a>
115
    </div>
116
117
<div id="doc" class="yui-t7">
118
    <div id="bd">
119
        <div id="yui-main">
120
            <div class="yui-g">
121
122
                <h1>Article requests</h1>
123
124
                <form id="ar-branchcode-form" method="post">
125
                    <select name="branchcode" id="branchcode">
126
                        <option value="">All libraries</option>
127
                        [% FOREACH b IN Branches.all %]
128
                            [% IF b.branchcode == branchcode %]
129
                                <option value="[% b.branchcode %]" selected="selected">[% b.branchname %]</option>
130
                            [% ELSE %]
131
                                <option value="[% b.branchcode %]">[% b.branchname %]</option>
132
                            [% END %]
133
                        [% END %]
134
                    </select>
135
                    <button type="submit" class="btn btn-small" type="submit">
136
                        <i class="fa fa-refresh"></i> Update
137
                    </button>
138
                </form>
139
140
                <div id="article-request-tabs" class="toptabs">
141
                    <ul>
142
                        <li>
143
                            <a href="#article-requests-pending">
144
                                Pending (<span id="ar_pending_count">[% article_requests_pending.count %]</span>)
145
                            </a>
146
                        </li>
147
148
                        <li>
149
                            <a href="#article-requests-processing">
150
                                Processing (<span id="ar_processing_count">[% article_requests_processing.count %]</span>)
151
                            </a>
152
                        </li>
153
                    </ul>
154
155
                    <div id="article-requests-pending">
156
                        <table id="article-requests-pending-table">
157
                            <thead>
158
                                <tr>
159
                                    <th class="ar-title">Title</th>
160
                                    <th class="ar-request">Requested article</th>
161
                                    <th class="ar-collection">Collection</th>
162
                                    <th class="ar-itemtype">Item type</th>
163
                                    <th class="ar-callnumber">Call number</th>
164
                                    <th class="ar-copynumber">Copy number</th>
165
                                    <th class="ar-enumchron">Enumeration</th>
166
                                    <th class="ar-barcode">Barcode</th>
167
                                    <th class="ar-patron">Patron</th>
168
                                    <th class="ar-date">Date</th>
169
                                    <th class="ar-actions">Actions</th>
170
                                </tr>
171
                            </thead>
172
173
                             <tbody>
174
                                <tr class="ar-pending-none">
175
                                    <td colspan="11">
176
                                        There are no pending article requests at this time.
177
                                    </td>
178
                                </tr>
179
180
                                [% FOREACH ar IN article_requests_pending %]
181
                                    <tr class="ar-row ar-pending">
182
                                        <td class="ar-title">
183
                                            <p>
184
                                                <a href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% ar.biblionumber %]">
185
                                                    <strong>[% ar.biblio.title | html %]</strong>
186
                                                    [% FOREACH s IN itemsloo.subtitle %] [% s %][% END %]
187
                                                </a>
188
                                            </p>
189
190
                                            <p>
191
                                                <div class="ar-biblionumber content_hidden">[% ar.biblionumber %]</div>
192
                                                <div class="ar-author">[% ar.biblio.author %]</div>
193
                                                <div class="ar-pubdata">
194
                                                    [% ar.biblio.biblioitem.publishercode %]
195
196
                                                    [% IF ar.biblio.biblioitem.publicationyear %]
197
                                                        , [% ar.biblio.biblioitem.publicationyear %]
198
                                                    [% ELSIF ar.biblio.copyrightdate %]
199
                                                        , [% ar.biblio.copyrightdate %]
200
                                                    [% END %]
201
202
                                                    [% IF ar.biblio.biblioitem.pages %]
203
                                                        : [% ar.biblio.biblioitem.pages %]
204
                                                    [% END %]
205
206
                                                    [%  r.biblio.biblioitem.size %]
207
208
                                                    [% IF ar.biblio.biblioitem.isbn %]
209
                                                        ISBN: [% ar.biblio.biblioitem.isbn %]
210
                                                    [% END %]
211
                                                </div>
212
                                            </p>
213
                                        </td>
214
                                        <td class="ar-request">
215
                                            [% IF ar.title %]    <p><strong>Title:</strong>    [% ar.title %]    </p> [% END %]
216
                                            [% IF ar.author %]   <p><strong>Author:</strong>   [% ar.author %]   </p> [% END %]
217
                                            [% IF ar.volume %]   <p><strong>Volume:</strong>   [% ar.volume %]   </p> [% END %]
218
                                            [% IF ar.issue %]    <p><strong>Issue:</strong>    [% ar.issue %]    </p> [% END %]
219
                                            [% IF ar.date %]     <p><strong>Date:</strong>     [% ar.date %]     </p> [% END %]
220
                                            [% IF ar.pages %]    <p><strong>Pages:</strong>    [% ar.pages %]    </p> [% END %]
221
                                            [% IF ar.chapters %] <p><strong>Chapters:</strong> [% ar.chapters %] </p> [% END %]
222
                                        </td>
223
                                        <td class="ar-collection">[% AuthorisedValues.GetByCode( 'CCODE', ar.item.ccode ) %]</td>
224
                                        <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) %]</td>
225
                                        <td class="ar-callnumber">
226
                                            [% IF ar.item.location %]
227
                                                <em>[% AuthorisedValues.GetByCode( 'LOC', ar.item.location ) %]</em>
228
                                            [% END %]
229
230
                                            [% ar.item.itemcallnumber %]
231
                                        </td>
232
                                        <td class="ar-copynumber">[% ar.item.copynumber %]</td>
233
                                        <td class="ar-enumchron">[% ar.item.enumchron %]</td>
234
                                        <td class="ar-barcode">[% ar.item.barcode %]</td>
235
                                        <td class="ar-patron">
236
                                            <p>
237
                                                <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber %]">
238
                                                    [% ar.borrower.surname %][% IF ar.borrower.firstname %], [% ar.borrower.firstname %][% END %] ([% ar.borrower.cardnumber %])
239
                                                </a>
240
                                            </p>
241
242
                                            <p>[% ar.borrower.phone %]</p>
243
                                        </td>
244
                                        <td class="ar-date"><span title="[% ar.created_on %]">[% ar.created_on | $KohaDates %]</span></td>
245
                                        <td class="ar-actions">
246
                                            <div class="dropdown">
247
                                                <a class="btn btn-mini dropdown-toggle" id="ar-actions" role="button" data-toggle="dropdown" href="#">
248
                                                    Actions <b class="caret"></b>
249
                                                </a>
250
251
                                                <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="ar-actions">
252
                                                    <li>
253
                                                        <a class="ar-process-request" href="#" onclick="Process( [% ar.id %], $(this) ); return false;">
254
                                                            <i class="icon-ok-circle"></i>
255
                                                            Process request
256
                                                        </a>
257
258
                                                        <a class="ar-complete-request" href="#" onclick="Complete( [% ar.id %], $(this) ); return false;">
259
                                                            <i class="icon-ok-circle"></i>
260
                                                            Complete request
261
                                                        </a>
262
263
                                                        <a class="ar-cancel-request" href="#" onclick="Cancel( [% ar.id %], $(this) ); return false;">
264
                                                            <i class="icon-remove-circle"></i>
265
                                                            Cancel request
266
                                                        </a>
267
268
                                                        <a class="ar-print-request" href="#" onclick="PrintSlip('article-request-slip.pl?id=[% ar.id %]'); return false;">
269
                                                            <i class="icon-print"></i>
270
                                                            Print slip
271
                                                        </a>
272
                                                    </li>
273
                                                </ul>
274
                                            </div>
275
                                        </td>
276
                                    </tr>
277
                                [% END %]
278
                            </tbody>
279
                        </table>
280
                    </div>
281
282
                    <div id="article-requests-processing">
283
                        <table id="article-requests-processing-table">
284
                            <thead>
285
                                <tr>
286
                                    <th class="ar-title">Title</th>
287
                                    <th class="ar-request">Requested article</th>
288
                                    <th class="ar-collection">Collection</th>
289
                                    <th class="ar-itemtype">Item type</th>
290
                                    <th class="ar-callnumber">Call number</th>
291
                                    <th class="ar-copynumber">Copy number</th>
292
                                    <th class="ar-enumchron">Enumeration</th>
293
                                    <th class="ar-barcode">Barcode</th>
294
                                    <th class="ar-patron">Patron</th>
295
                                    <th class="ar-date">Date</th>
296
                                    <th class="ar-actions">Actions</th>
297
                                </tr>
298
                            </thead>
299
300
                             <tbody>
301
                                <tr class="ar-processing-none">
302
                                    <td colspan="11">
303
                                        There are no article requests in processing at this time.
304
                                    </td>
305
                                </tr>
306
307
                                [% FOREACH ar IN article_requests_processing %]
308
                                    <tr class="ar-row ar-processing">
309
                                        <td class="ar-title">
310
                                            <p>
311
                                                <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% ar.biblionumber %]">
312
                                                    <strong>[% ar.biblio.title | html %]</strong>
313
                                                    [% FOREACH s IN itemsloo.subtitle %] [% s %][% END %]
314
                                                </a>
315
                                            </p>
316
317
                                            <p>
318
                                                <div class="ar-biblionumber content_hidden">[% ar.biblionumber %]</div>
319
                                                <div class="ar-author">[% ar.biblio.author %]</div>
320
                                                <div class="ar-pubdata">
321
                                                    [% ar.biblio.biblioitem.publishercode %]
322
323
                                                    [% IF ar.biblio.biblioitem.publicationyear %]
324
                                                        , [% ar.biblio.biblioitem.publicationyear %]
325
                                                    [% ELSIF ar.biblio.copyrightdate %]
326
                                                        , [% ar.biblio.copyrightdate %]
327
                                                    [% END %]
328
329
                                                    [% IF ar.biblio.biblioitem.pages %]
330
                                                        : [% ar.biblio.biblioitem.pages %]
331
                                                    [% END %]
332
333
                                                    [%  r.biblio.biblioitem.size %]
334
335
                                                    [% IF ar.biblio.biblioitem.isbn %]
336
                                                        ISBN: [% ar.biblio.biblioitem.isbn %]
337
                                                    [% END %]
338
                                                </div>
339
                                            </p>
340
                                        </td>
341
                                        <td class="ar-request">
342
                                            [% IF ar.title %]    <p><strong>Title:</strong>    [% ar.title %]    </p> [% END %]
343
                                            [% IF ar.author %]   <p><strong>Author:</strong>   [% ar.author %]   </p> [% END %]
344
                                            [% IF ar.volume %]   <p><strong>Volume:</strong>   [% ar.volume %]   </p> [% END %]
345
                                            [% IF ar.issue %]    <p><strong>Issue:</strong>    [% ar.issue %]    </p> [% END %]
346
                                            [% IF ar.date %]     <p><strong>Date:</strong>     [% ar.date %]     </p> [% END %]
347
                                            [% IF ar.pages %]    <p><strong>Pages:</strong>    [% ar.pages %]    </p> [% END %]
348
                                            [% IF ar.chapters %] <p><strong>Chapters:</strong> [% ar.chapters %] </p> [% END %]
349
                                        </td>
350
                                        <td class="ar-collection">[% AuthorisedValues.GetByCode( 'CCODE', ar.item.ccode ) %]</td>
351
                                        <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) %]</td>
352
                                        <td class="ar-callnumber">
353
                                            [% IF ar.item.location %]
354
                                                <em>[% AuthorisedValues.GetByCode( 'LOC', ar.item.location ) %]</em>
355
                                            [% END %]
356
357
                                            [% ar.item.itemcallnumber %]
358
                                        </td>
359
                                        <td class="ar-copynumber">[% ar.item.copynumber %]</td>
360
                                        <td class="ar-enumchron">[% ar.item.enumchron %]</td>
361
                                        <td class="ar-barcode">[% ar.item.barcode %]</td>
362
                                        <td class="ar-patron">
363
                                            <p>
364
                                                <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber %]">
365
                                                    [% ar.borrower.surname %][% IF ar.borrower.firstname %], [% ar.borrower.firstname %][% END %] ([% ar.borrower.cardnumber %])
366
                                                </a>
367
                                            </p>
368
369
                                            <p>[% ar.borrower.phone %]</p>
370
                                        </td>
371
                                        <td class="ar-date"><span title="[% ar.created_on %]">[% ar.created_on | $KohaDates %]</span></td>
372
                                        <td class="ar-actions">
373
                                            <div class="dropdown">
374
                                                <a class="btn btn-mini dropdown-toggle" id="ar-actions" role="button" data-toggle="dropdown" href="#">
375
                                                    Actions <b class="caret"></b>
376
                                                </a>
377
378
                                                <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="ar-actions">
379
                                                    <li>
380
                                                        <a href="#" onclick="Complete( [% ar.id %], $(this) ); return false;">
381
                                                            <i class="icon-ok-circle"></i>
382
                                                            Complete request
383
                                                        </a>
384
385
                                                        <a href="#" onclick="Cancel( [% ar.id %], $(this) ); return false;">
386
                                                            <i class="icon-remove-circle"></i>
387
                                                            Cancel request
388
                                                        </a>
389
390
                                                        <a href="#" onclick="PrintSlip('article-request-slip.pl?id=[% ar.id %]'); return false;">
391
                                                            <i class="icon-print"></i>
392
                                                            Print slip
393
                                                        </a>
394
                                                    </li>
395
                                                </ul>
396
                                            </div>
397
                                        </td>
398
                                    </tr>
399
                                [% END %]
400
                            </tbody>
401
                        </table>
402
                    </div>
403
                </div>
404
            </div>
405
        </div>
406
    </div>
407
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt (+5 lines)
Lines 42-47 Link Here
42
    <li>    <a href="/cgi-bin/koha/circ/waitingreserves.pl">Holds awaiting pickup</a></li>
42
    <li>    <a href="/cgi-bin/koha/circ/waitingreserves.pl">Holds awaiting pickup</a></li>
43
	<li>    <a href="/cgi-bin/koha/circ/reserveratios.pl">Hold ratios</a></li>
43
	<li>    <a href="/cgi-bin/koha/circ/reserveratios.pl">Hold ratios</a></li>
44
	<li>    <a href="/cgi-bin/koha/circ/transferstoreceive.pl">Transfers to receive</a></li>
44
	<li>    <a href="/cgi-bin/koha/circ/transferstoreceive.pl">Transfers to receive</a></li>
45
    [% IF Koha.Preference('ArticleRequests') %]
46
        <li>
47
            <a href="/cgi-bin/koha/circ/article-requests.pl" title="Article requests">Article requests</a>
48
        </li>
49
    [% END %]
45
     [% IF ( CAN_user_circulate_overdues_report ) %]<li>    <a href="/cgi-bin/koha/circ/overdue.pl">Overdues</a>
50
     [% IF ( CAN_user_circulate_overdues_report ) %]<li>    <a href="/cgi-bin/koha/circ/overdue.pl">Overdues</a>
46
	- <b>Warning:</b> This report is very resource intensive on
51
	- <b>Warning:</b> This report is very resource intensive on
47
	systems with large numbers of overdue items.</li>[% END %]
52
	systems with large numbers of overdue items.</li>[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt (+371 lines)
Line 0 Link Here
1
[% USE KohaDates %]
2
[% USE Branches %]
3
[% SET article_requests_view = 1 %]
4
[% SET biblionumber = biblio.biblionumber %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Koha &rsaquo; Circulation &rsaquo; Request article</title>
7
[% INCLUDE 'doc-head-close.inc' %]
8
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
9
[% INCLUDE 'datatables.inc' %]
10
11
<script type="text/javascript">
12
// <![CDATA[
13
$('#current-article-requests').ready(function() {
14
    $(".hide").hide();
15
});
16
17
$(document).ready(function() {
18
    $( "#patron" ).autocomplete({
19
        source: "/cgi-bin/koha/circ/ysearch.pl",
20
        minLength: 3,
21
        select: function( event, ui ) {
22
            $( "#patron" ).val( ui.item.cardnumber );
23
            $( "#holds_patronsearch" ).submit();
24
            return false;
25
        }
26
    })
27
    .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
28
        return $( "<li></li>" )
29
        .data( "ui-autocomplete-item", item )
30
        .append( "<a>" + item.surname + ", " + item.firstname +
31
                 " (" + item.cardnumber + ") <small>" + item.address +
32
                 " " + item.city + " " + item.zipcode + " " +
33
                 item.country + "</small></a>" )
34
        .appendTo( ul );
35
    };
36
37
    $( ".ar-update-branchcode" ).on('focus', function(){
38
        previous_branchcode = this.value;
39
    }).on('change', function(){
40
        var branchcode = this.value;
41
        var c = confirm(_("Are you sure you want to change the pickup library from %s to %s for this request?").format( previous_branchcode, branchcode ));
42
43
        if ( c ) {
44
            var id = this.id.split("branchcode-")[1];
45
            $("#update-processing-" + id ).css({opacity: 0, visibility: "visible"}).animate({opacity: 1.0}, 200);
46
47
            $.ajax({
48
                type: "POST",
49
                url: '/cgi-bin/koha/svc/article_request',
50
                data: {
51
                    action: 'update_branchcode',
52
                    id: id,
53
                    branchcode: branchcode,
54
                },
55
                success: function( data ) {
56
                    $("#update-processing-" + id ).css({opacity: 1.0, visibility: "visible"}).animate({opacity: 0}, 200);
57
                },
58
                dataType: 'json'
59
            });
60
61
        } else {
62
            this.value = previous_branchcode;
63
        }
64
    });
65
66
    $(".ar-cancel-request").on("click", function(){
67
        var a = $(this);
68
        var notes = prompt(_("Reason for cancellation:"));
69
70
        if ( notes != null ) {
71
            var id = this.id.split("cancel-")[1];
72
            $("#cancel-processing-" + id ).hide('slow');
73
            $("#cancel-processing-spinner-" + id ).show('slow');
74
75
            $.ajax({
76
                type: "POST",
77
                url: '/cgi-bin/koha/svc/article_request',
78
                data: {
79
                    action: 'cancel',
80
                    id: id,
81
                    notes: notes
82
                },
83
                success: function( data ) {
84
                    a.parents('tr').hide('slow');
85
                },
86
                dataType: 'json'
87
            });
88
        }
89
    });
90
});
91
// ]]>
92
</script>
93
</head>
94
95
<body id="circ_article_request" class="catalog">
96
    [% INCLUDE 'header.inc' %]
97
    [% INCLUDE 'circ-search.inc' %]
98
99
    <div id="breadcrumbs">
100
        <a href="/cgi-bin/koha/mainpage.pl">Home</a>
101
        &rsaquo;
102
        <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
103
        &rsaquo;
104
        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">[% biblio.title | html %]</a>
105
        &rsaquo;
106
        Request article
107
    </div>
108
109
    <div id="doc3" class="yui-t2">
110
        <div id="bd">
111
            <div id="yui-main">
112
                <div class="yui-b">
113
114
                    <h1>Request article from <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.id %]">[% biblio.title | html %]</a></h1>
115
                    [% IF no_patrons_found %]
116
                        <div class="dialog alert">
117
                            <h3>Patron not found</h3>
118
                            <p>No patron with this name, please, try another</p>
119
                        </div>
120
                    [% ELSIF patrons %]
121
                        <form id="article_request_patron_results" method="post">
122
                            <fieldset>
123
                                <table id="table_borrowers">
124
                                    <thead>
125
                                        <tr>
126
                                            <th></th>
127
                                            <th>Name</th>
128
                                            <th>Cardnumber</th>
129
                                            <th>Category</th>
130
                                            <th>Library</th>
131
                                            <th>Address</th>
132
                                        </tr>
133
                                    </thead>
134
                                    <tbody>
135
                                        [% FOREACH patron IN patrons %]
136
                                            <tr>
137
                                                <td><input type="radio" name="patron_id" value="[% patron.borrowernumber %]"/></td>
138
                                                <td>[% patron.surname %], [% patron.firstname %]</td>
139
                                                <td>[% patron.cardnumber %]</td>
140
                                                <td>[% patron.categorycode %]</td>
141
                                                <td>[% patron.branchcode %]</td>
142
                                                <td>[% patron.address %]</td>
143
                                            </tr>
144
                                        [% END %]
145
                                    </tbody>
146
                                </table>
147
                                <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
148
                                <fieldset class="action"><input type="submit" value="Select" /></fieldset>
149
                            </fieldset>
150
                        </form>
151
                    [% ELSIF !patron %]
152
                        <form id="article_requests_patronsearch" action="request-article.pl" method="post">
153
                            <fieldset class="brief">
154
                                <label for="patron">Patron: </label>
155
                                <div class="hint">Enter patron card number or partial name:</div>
156
                                <input type="text" size="40" id="patron" class="focus" name="patron_cardnumber" />
157
                                <input type="submit" value="Search" />
158
                                <input type="hidden" name="biblionumber" value="[% biblio.id %]" />
159
                            </fieldset>
160
                        </form>
161
                    [% ELSE %]
162
                        [% IF biblio.can_article_request( patron ) %]
163
164
                            <form id="place-article-request" method="post" action="/cgi-bin/koha/circ/request-article-do.pl">
165
                                <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber %]" />
166
                                <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.id %]" />
167
168
                                <fieldset class="rows">
169
                                    <legend>Place article request from [% biblio.title %] for [% patron.firstname %] [% patron.surname %] ( [% patron.cardnumber %] )</legend>
170
                                    <p/>
171
                                    <ul>
172
                                        <li>
173
                                            <label for="title">Title:</label>
174
                                            <input type="text" name="title" id="title" size="50"/>
175
                                        </li>
176
177
                                        <li>
178
                                            <label for="author">Author:</label>
179
                                            <input type="text" name="author" id="author" size="50"/>
180
                                        </li>
181
182
                                        <li>
183
                                            <label for="volume">Volume:</label>
184
                                            <input type="text" name="volume" id="volume" size="50"/>
185
                                        </li>
186
187
                                        <li>
188
                                            <label for="issue">Issue:</label>
189
                                            <input type="text" name="issue" id="issue" size="50"/>
190
                                        </li>
191
192
                                        <li>
193
                                            <label for="date">Date:</label>
194
                                            <input type="text" name="date" id="date" size="50"/>
195
                                        </li>
196
197
                                        <li>
198
                                            <label for="pages">Pages:</label>
199
                                            <input type="text" name="pages" id="pages" size="50"/>
200
                                        </li>
201
202
                                        <li>
203
                                            <label for="chapters">Chapters:</label>
204
                                            <input type="text" name="chapters" id="chapters" size="50"/>
205
                                        </li>
206
207
                                        <li>
208
                                            <label for="branchcode">Pickup library:</label>
209
                                            <select name="branchcode" id="branchcode">
210
                                                [% FOREACH b IN Branches.all %]
211
                                                    [% IF b.branchcode == Branches.GetLoggedInBranchcode %]
212
                                                        <option value="[% b.branchcode %]" selected="selected">[% b.branchname %]</option>
213
                                                    [% ELSE %]
214
                                                        <option value="[% b.branchcode %]">[% b.branchname %]</option>
215
                                                    [% END %]
216
                                                [% END %]
217
                                            </select>
218
                                        </li>
219
                                    </ul>
220
                                </fieldset>
221
222
                                [% SET article_request_type = biblio.article_request_type( patron ) %]
223
                                [% IF article_request_type != 'bib_only' %]
224
                                    <table id="current-requests-table" class="ar-table table table-bordered table-striped">
225
                                        <caption>Select item:</caption>
226
                                        <thead>
227
                                            <tr>
228
                                                <th>&nbsp;</th>
229
                                                <th>Item type</th>
230
                                                <th>Barcode</th>
231
                                                <th>Home library</th>
232
                                                <th>Call number</th>
233
                                                <th>Enumeration</th>
234
                                            </tr>
235
                                        </thead>
236
237
                                        <tbody>
238
                                            [% FOREACH item IN biblio.items %]
239
                                                [% IF item.can_article_request( patron ) %]
240
                                                    <tr>
241
                                                        <td>
242
                                                            [% IF article_request_type == 'item_only' && !checked %]
243
                                                                [% SET checked = 1 %]
244
                                                                <input type="radio" name="itemnumber" value="[% item.itemnumber %]" checked="checked" />
245
                                                            [% ELSE %]
246
                                                                <input type="radio" name="itemnumber" value="[% item.itemnumber %]" />
247
                                                            [% END %]
248
                                                        </td>
249
                                                        <td>
250
                                                            [% item.itype %]
251
                                                        </td>
252
                                                        <td>
253
                                                            [% item.barcode %]
254
                                                        </td>
255
                                                        <td>
256
                                                            [% item.homebranch %]
257
                                                        </td>
258
                                                        <td>
259
                                                            [% item.itemcallnumber %]
260
                                                        </td>
261
                                                        <td>
262
                                                            [% item.enumchron %]
263
                                                        </td>
264
                                                    </tr>
265
                                                [% END %]
266
                                            [% END %]
267
268
                                            [% IF article_request_type != 'item_only' %]
269
                                                <tr>
270
                                                    <td>
271
                                                        <input type="radio" name="itemnumber" value="" checked="checked"/>
272
                                                    </td>
273
                                                    <td colspan="5">
274
                                                        Any item
275
                                                    </td>
276
                                                </tr>
277
                                            [% END %]
278
                                        </tbody>
279
                                    </table>
280
                                [% END %]
281
282
                                <p>
283
                                    <input type="submit" class="btn" value="Place request" />
284
                                </p>
285
                            </form>
286
                        [% ELSE %]
287
                            No article requests can be made for this record.
288
                        [% END %]
289
290
                    [% END %]
291
292
                    [% IF biblio.article_requests_current && !patron %]
293
                        <fieldset class="rows left" id="current-article-requests-fieldset">
294
                            <legend>Current article requests</legend>
295
296
                            <table id="current-article-requests-table">
297
                                <tr>
298
                                    <th>Placed on</th>
299
                                    <th>Patron</th>
300
                                    <th>Title</th>
301
                                    <th>Author</th>
302
                                    <th>Volume</th>
303
                                    <th>Issue</th>
304
                                    <th>Date</th>
305
                                    <th>Pages</th>
306
                                    <th>Chapters</th>
307
                                    <th>Item</th>
308
                                    <th>Status</th>
309
                                    <th>Pickup library</th>
310
                                    <th>&nbsp;</th>
311
                                </tr>
312
313
                                [% FOREACH ar IN biblio.article_requests_current %]
314
                                    <tr>
315
                                        <td>[% ar.created_on | $KohaDates %]</td>
316
                                        <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% ar.borrowernumber %]">[% ar.borrower.firstname %] [% ar.borrower.surname %]</a></td>
317
                                        <td>[% ar.title %]</td>
318
                                        <td>[% ar.author %]</td>
319
                                        <td>[% ar.volume %]</td>
320
                                        <td>[% ar.issue %]</td>
321
                                        <td>[% ar.date %]</td>
322
                                        <td>[% ar.pages %]</td>
323
                                        <td>[% ar.chapters %]</td>
324
                                        <td>
325
                                            [% IF ar.item %]
326
                                                <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% ar.itemnumber %]&biblionumber=[% ar.biblionumber %]">[% ar.item.barcode %]</a>
327
                                            [% END %]
328
                                        </td>
329
                                        <td>
330
                                            [% IF ar.status == 'PENDING' %]
331
                                                Pending
332
                                            [% ELSIF ar.status == 'PROCESSING' %]
333
                                                Processing
334
                                            [% ELSIF ar.status == 'COMPLETED' %]
335
                                                Completed
336
                                            [% ELSIF ar.status == 'CANCELED' %]
337
                                                Canceled
338
                                            [% END %]
339
                                        </td>
340
                                        <td>
341
                                            <i id="update-processing-[% ar.id %]" class="fa fa-cog fa-spin hidden"></i>
342
                                            <select name="branchcode" id="branchcode-[% ar.id %]" class="ar-update-branchcode">
343
                                                [% FOREACH b IN Branches.all %]
344
                                                    [% IF b.branchcode == ar.branchcode %]
345
                                                        <option value="[% b.branchcode %]" selected="selected">[% b.branchname %]</option>
346
                                                    [% ELSE %]
347
                                                        <option value="[% b.branchcode %]">[% b.branchname %]</option>
348
                                                    [% END %]
349
                                                [% END %]
350
                                            </select>
351
                                        </td>
352
                                        <td>
353
                                            <a title="Cancel article request" href="#" id="cancel-[% ar.id %]" class="ar-cancel-request">
354
                                                <i id="cancel-processing-spinner-[% ar.id %]" class="fa fa-cog fa-spin hide"></i>
355
                                                <i id="cancel-processing-[% ar.id %]" class="fa fa-times fa-lg" style="color:red"></i>
356
                                            </a>
357
                                        </td>
358
                                    </tr>
359
                                [% END %]
360
                            </table>
361
                        </fieldset>
362
                    [% END %]
363
                </div>
364
            </div>
365
366
            <div class="yui-b">
367
                [% INCLUDE 'biblio-view-menu.inc' %]
368
            </div>
369
        </div>
370
    </div>
371
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt (+9 lines)
Lines 124-131 var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this news item? This Link Here
124
                    || ( CAN_user_borrowers && pending_borrower_modifications )
124
                    || ( CAN_user_borrowers && pending_borrower_modifications )
125
                    || ( CAN_user_acquisition && pendingsuggestions )
125
                    || ( CAN_user_acquisition && pendingsuggestions )
126
                    || ( CAN_user_borrowers && pending_discharge_requests )
126
                    || ( CAN_user_borrowers && pending_discharge_requests )
127
                    || pending_article_requests
127
            ) %]
128
            ) %]
128
                <div id="area-pending">
129
                <div id="area-pending">
130
                    [% IF pending_article_requests %]
131
                    <div class="pending-info" id="article_requests_pending">
132
133
                        <a href="/cgi-bin/koha/circ/article-requests.pl">Article requests</a>:
134
                        <span class="pending-number-link">[% pending_article_requests %]</span>
135
                    </div>
136
                    [% END %]
137
129
                    [% IF ( CAN_user_acquisition && pendingsuggestions ) %]
138
                    [% IF ( CAN_user_acquisition && pendingsuggestions ) %]
130
                    <div class="pending-info" id="suggestions_pending">
139
                    <div class="pending-info" id="suggestions_pending">
131
140
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc (+8 lines)
Lines 1-3 Link Here
1
[% USE Biblio %]
1
<ul id="action">
2
<ul id="action">
2
    [% UNLESS ( norequests ) %]
3
    [% UNLESS ( norequests ) %]
3
        [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
4
        [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
Lines 8-13 Link Here
8
            [% END %]
9
            [% END %]
9
        [% END %]
10
        [% END %]
10
    [% END %]
11
    [% END %]
12
13
    [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
14
        [% IF Koha.Preference('ArticleRequests') %]
15
            <li><a class="article_request" href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% biblionumber %]">Request article</a></li>
16
        [% END %]
17
    [% END %]
18
11
    <li><a class="print-large" href="#" onclick="window.print();">Print</a></li>
19
    <li><a class="print-large" href="#" onclick="window.print();">Print</a></li>
12
    [% IF Koha.Preference( 'virtualshelves' ) == 1 %]
20
    [% IF Koha.Preference( 'virtualshelves' ) == 1 %]
13
        [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && loggedinusername ) %]
21
        [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && loggedinusername ) %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt (+214 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% USE Branches %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Request article</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% BLOCK cssinclude %][% END %]
7
</head>
8
9
[% INCLUDE 'bodytag.inc' bodyid='opac-holds' %]
10
[% INCLUDE 'masthead.inc' %]
11
12
<div class="main">
13
    <ul class="breadcrumb">
14
        <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
15
        <li><a href="#">Request article</a></li>
16
    </ul>
17
18
    <div class="container">
19
        [% IF biblio.can_article_request( patron ) %]
20
            [% SET article_request_type = biblio.article_request_type( patron ) %]
21
22
            [% IF article_request_type == 'yes' %]       [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFields') %]           [% END %]
23
            [% IF article_request_type == 'bib_only' %]  [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFieldsRecordOnly') %] [% END %]
24
            [% IF article_request_type == 'item_only' %] [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFieldsItemOnly') %]   [% END %]
25
26
            <h3>Place article request for [% biblio.title %]</h3>
27
28
            <form id="place-article-request" method="post" action="/cgi-bin/koha/opac-request-article-do.pl">
29
                <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber %]" />
30
31
                <fieldset class="rows">
32
                    <ul>
33
                        <li>
34
                            [% IF mandatory_fields.search('title') %]
35
                                <label for="title" class="required">Title:</label>
36
                            [% ELSE %]
37
                                <label for="title">Title:</label>
38
                            [% END %]
39
                            <input type="text" name="title" id="title" size="50"/>
40
                        </li>
41
42
                        <li>
43
                            [% IF mandatory_fields.search('author') %]
44
                                <label for="author" class="required">Author:</label>
45
                            [% ELSE %]
46
                                <label for="author">Author:</label>
47
                            [% END %]
48
                            <input type="text" name="author" id="author" size="50"/>
49
                        </li>
50
51
                        <li>
52
                            [% IF mandatory_fields.search('volume') %]
53
                                <label for="volume" class="required">Volume:</label>
54
                            [% ELSE %]
55
                                <label for="volume">Volume:</label>
56
                            [% END %]
57
                            <input type="text" name="volume" id="volume" size="50"/>
58
                        </li>
59
60
                        <li>
61
                            [% IF mandatory_fields.search('issue') %]
62
                                <label for="issue" class="required">Issue:</label>
63
                            [% ELSE %]
64
                                <label for="issue">Issue:</label>
65
                            [% END %]
66
                            <input type="text" name="issue" id="issue" size="50"/>
67
                        </li>
68
69
                        <li>
70
                            [% IF mandatory_fields.search('date') %]
71
                                <label for="date" class="required">Date:</label>
72
                            [% ELSE %]
73
                                <label for="date">Date:</label>
74
                            [% END %]
75
                            <input type="text" name="date" id="date" size="50"/>
76
                        </li>
77
78
                        <li>
79
                            [% IF mandatory_fields.search('pages') %]
80
                                <label for="pages" class="required">Pages:</label>
81
                            [% ELSE %]
82
                                <label for="pages">Pages:</label>
83
                            [% END %]
84
                            <input type="text" name="pages" id="pages" size="50"/>
85
                        </li>
86
87
                        <li>
88
                            [% IF mandatory_fields.search('chapters') %]
89
                                <label for="chapters" class="required">Chapters:</label>
90
                            [% ELSE %]
91
                                <label for="chapters">Chapters:</label>
92
                            [% END %]
93
                            <input type="text" name="chapters" id="chapters" size="50"/>
94
                        </li>
95
96
                        <li>
97
                            <label for="branchcode">Pickup library:</label>
98
                            <select name="branchcode" id="branchcode">
99
                                [% FOREACH b IN Branches.all %]
100
                                    [% IF b.branchcode == Branches.GetLoggedInBranchcode %]
101
                                        <option value="[% b.branchcode %]" selected="selected">[% b.branchname %]</option>
102
                                    [% ELSE %]
103
                                        <option value="[% b.branchcode %]">[% b.branchname %]</option>
104
                                    [% END %]
105
                                [% END %]
106
                            </select>
107
                        </li>
108
                    </ul>
109
                </fieldset>
110
111
                [% IF article_request_type != 'bib_only' %]
112
                    <table class="copiesrow table table-bordered table-striped">
113
                        <caption>Select a specific item:</caption>
114
                        <thead>
115
                            <tr>
116
                                <th>&nbsp;</th>
117
                                <th>Item type</th>
118
                                <th>Barcode</th>
119
                                <th>Home library</th>
120
                                <th>Call number</th>
121
                            </tr>
122
                        </thead>
123
124
                        <tbody>
125
                            [% FOREACH item IN biblio.items %]
126
                                [% IF item.can_article_request( patron ) %]
127
                                    <tr>
128
                                        <td>
129
                                            [% IF article_request_type == 'item_only' && !checked %]
130
                                                [% SET checked = 1 %]
131
                                                <input type="radio" name="itemnumber" value="[% item.itemnumber %]" checked="checked" />
132
                                            [% ELSE %]
133
                                                <input type="radio" name="itemnumber" value="[% item.itemnumber %]" />
134
                                            [% END %]
135
                                        </td>
136
                                        <td>
137
                                            [% item.itype %]
138
                                        </td>
139
                                        <td>
140
                                            [% item.barcode %]
141
                                        </td>
142
                                        <td>
143
                                            [% item.homebranch %]
144
                                        </td>
145
                                        <td>
146
                                            [% item.itemcallnumber %]
147
                                        </td>
148
                                    </tr>
149
                                [% END %]
150
                            [% END %]
151
152
                            [% IF article_request_type != 'item_only' %]
153
                                <tr>
154
                                    <td>
155
                                        <input type="radio" name="itemnumber" value="" checked="checked"/>
156
                                    </td>
157
                                    <td colspan="4">
158
                                        Any item
159
                                    </td>
160
                                </tr>
161
                            [% END %]
162
                        </tbody>
163
                    </table>
164
                [% END %]
165
166
                <input type="submit" class="btn" value="Place request" />
167
            </form>
168
        [% ELSE %]
169
            No article requests can be made for this record.
170
        [% END %]
171
172
    </div> <!-- / .container -->
173
</div> <!-- / .main -->
174
175
[% INCLUDE 'opac-bottom.inc' %]
176
177
[% BLOCK jsinclude %]
178
<script type="text/javascript">
179
// <![CDATA[
180
    allow_submit = false;
181
    $('#place-article-request').on('submit', function( event ){
182
        if ( ! allow_submit ) {
183
            event.preventDefault();
184
185
            [% IF article_request_type == 'item_only' %]
186
                if ( ! $("input:radio[name='itemnumber']").is(":checked") ) {
187
                    alert( _("Please select a specific item for this article request.") );
188
                    return 0;
189
                }
190
            [% END %]
191
192
            var mandatory_fields = "[% mandatory_fields %]";
193
            var m = new Array();
194
            if ( mandatory_fields ) m = mandatory_fields.split(",");
195
            var f = new Array();
196
197
            for (i = 0; i < m.length; i++) {
198
                if ( ! $("#" + m[i]).val() ) {
199
                    f.push( m[i] );
200
                }
201
            }
202
203
            if ( f.length ) {
204
                alert( _("The following fields are required and not filled in: ") + f.join(", ") );
205
                return 0;
206
            }
207
208
            allow_submit = true;
209
            $('#place-article-request').submit();
210
        }
211
    });
212
// ]]>
213
</script>
214
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (+6 lines)
Lines 496-501 Link Here
496
                                                            [% END # UNLESS SEARCH_RESULT.norequests %]
496
                                                            [% END # UNLESS SEARCH_RESULT.norequests %]
497
                                                        [% END # IF RequestOnOpac %]
497
                                                        [% END # IF RequestOnOpac %]
498
498
499
                                                        [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
500
                                                            [% IF Koha.Preference('ArticleRequests') %]
501
                                                                <span class="actions"><a class="article_request" href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Request article</a></span>
502
                                                            [% END %]
503
                                                        [% END %]
504
499
                                                        [% IF ( TagsInputEnabled ) %]
505
                                                        [% IF ( TagsInputEnabled ) %]
500
                                                            [% IF ( loggedinusername ) %]
506
                                                            [% IF ( loggedinusername ) %]
501
                                                                <span class="actions"><a class="tag_add" id="tag_add[% SEARCH_RESULT.biblionumber %]" href="#">Add tag</a></span>
507
                                                                <span class="actions"><a class="tag_add" id="tag_add[% SEARCH_RESULT.biblionumber %]" href="#">Add tag</a></span>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (+95 lines)
Lines 120-125 Link Here
120
                                [% IF ( BORROWER_INFO.amountlessthanzero ) %]<li><a href="#opac-user-fines">Credits ([% BORROWER_INFO.amountoutstanding %])</a></li>[% END %]
120
                                [% IF ( BORROWER_INFO.amountlessthanzero ) %]<li><a href="#opac-user-fines">Credits ([% BORROWER_INFO.amountoutstanding %])</a></li>[% END %]
121
                            [% END %]
121
                            [% END %]
122
                            [% IF ( RESERVES.count ) %]<li><a href="#opac-user-holds">Holds ([% RESERVES.count %])</a></li>[% END %]
122
                            [% IF ( RESERVES.count ) %]<li><a href="#opac-user-holds">Holds ([% RESERVES.count %])</a></li>[% END %]
123
                            [% IF Koha.Preference('ArticleRequests') && borrower.article_requests_current %]<li><a href="#opac-user-article-requests">Article requests ([% borrower.article_requests_current.count %])</a></li>[% END %]
123
                        </ul>
124
                        </ul>
124
125
125
                        <div id="opac-user-checkouts">
126
                        <div id="opac-user-checkouts">
Lines 699-704 Link Here
699
                            [% END %]
700
                            [% END %]
700
                        </div> <!-- / #opac-user-holds -->
701
                        </div> <!-- / #opac-user-holds -->
701
                        [% END # / #RESERVES.count %]
702
                        [% END # / #RESERVES.count %]
703
704
                        [% IF Koha.Preference('ArticleRequests') && borrower.article_requests_current.count %]
705
                            <div id="opac-user-article-requests">
706
                                <table id="article-requests-table" class="table table-bordered table-striped">
707
                                    <caption>Article requests <span class="count">([% borrower.article_requests_current.count %] total)</span></caption>
708
                                    <!-- RESERVES TABLE ROWS -->
709
                                    <thead>
710
                                        <tr>
711
                                            <th class="anti-the">Record title</th>
712
                                            <th class="psort">Placed on</th>
713
                                            <th class="anti-the">Title</th>
714
                                            <th>Author</th>
715
                                            <th>Volume</th>
716
                                            <th>Issue</th>
717
                                            <th>Date</th>
718
                                            <th>Pages</th>
719
                                            <th>Chapters</th>
720
                                            <th>Status</th>
721
                                            <th>Pickup library</th>
722
                                            <th class="nosort">&nbsp;</th>
723
                                        </tr>
724
                                    </thead>
725
726
                                    <tbody>
727
                                    [% FOREACH ar IN borrower.article_requests_current %]
728
                                            <td class="article-request-title">
729
                                                <a class="article-request-title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ar.biblionumber %]">
730
                                                    [% ar.biblio.title %]
731
                                                    [% ar.item.enumchron %]
732
                                                </a>
733
                                                [% ar.biblio.author %]
734
                                                [% IF ar.itemnumber %] <i>(only [% ar.item.barcode %])</i>[% END %]
735
                                            </td>
736
737
                                            <td class="article-request-created_on">
738
                                                [% ar.created_on | $KohaDates %]
739
                                            </td>
740
741
                                            <td class="article-request-title">
742
                                                [% ar.title %]
743
                                            </td>
744
745
                                            <td class="article-request-author">
746
                                                [% ar.author %]
747
                                            </td>
748
749
                                            <td class="article-request-volume">
750
                                                [% ar.volume %]
751
                                            </td>
752
753
                                            <td class="article-request-issue">
754
                                                [% ar.issue %]
755
                                            </td>
756
757
                                            <td class="article-request-date">
758
                                                [% ar.date %]
759
                                            </td>
760
761
                                            <td class="article-request-pages">
762
                                                [% ar.pages %]
763
                                            </td>
764
765
                                            <td class="article-request-chapters">
766
                                                [% ar.chapters %]
767
                                            </td>
768
769
                                            <td class="article-request-status">
770
                                                [% IF ar.status == 'PENDING' %]
771
                                                    Pending
772
                                                [% ELSIF ar.status == 'PROCESSING' %]
773
                                                    Processing
774
                                                [% ELSIF ar.status == 'COMPLETED' %]
775
                                                    Completed
776
                                                [% ELSIF ar.status == 'CANCELED' %]
777
                                                    Canceled
778
                                                [% END %]
779
                                            </td>
780
781
                                            <td class="article-request-branchcode">
782
                                                [% ar.branch.branchname %]
783
                                            </td>
784
785
                                            <td class="article-request-cancel">
786
                                                <span class="tdlabel">Cancel:</span>
787
                                                <a class="btn btn-mini btn-danger" href="opac-article-request-cancel.pl?id=[% ar.id %]" onclick="return confirmDelete(MSG_CONFIRM_DELETE_HOLD);"><i class="icon-remove icon-white"></i> Cancel</a>
788
                                                <!-- TODO: replace MSG_CONFIRM_DELETE_HOLD with correct message -->
789
                                            </td>
790
                                        </tr>
791
                                    [% END %]
792
                                </tbody>
793
                            </table>
794
                        </div> <!-- / #opac-user-article-requests -->
795
                    [% END %]
796
702
                    </div> <!-- /#opac-user-views -->
797
                    </div> <!-- /#opac-user-views -->
703
                </div> <!-- /#userdetails -->
798
                </div> <!-- /#userdetails -->
704
            </div> <!-- /.span10 -->
799
            </div> <!-- /.span10 -->
(-)a/koha-tmpl/opac-tmpl/bootstrap/less/opac.less (+18 lines)
Lines 266-271 td { Link Here
266
            padding-left : 21px;
266
            padding-left : 21px;
267
            text-decoration : none;
267
            text-decoration : none;
268
        }
268
        }
269
        &.article_request {
270
            background-image : url("../images/sprite.png"); /* Place hold small */
271
            background-position : -2px -26px;
272
            background-repeat: no-repeat;
273
            margin-right : 1em;
274
            padding-left : 21px;
275
            text-decoration : none;
276
        }
269
        &.addtocart {
277
        &.addtocart {
270
            background-image : url("../images/sprite.png"); /* Cart small */
278
            background-image : url("../images/sprite.png"); /* Cart small */
271
            background-position : -5px -572px;
279
            background-position : -5px -572px;
Lines 1338-1343 a.print-large, Link Here
1338
a.removeitems,
1346
a.removeitems,
1339
a.removeitems.disabled,
1347
a.removeitems.disabled,
1340
a.reserve,
1348
a.reserve,
1349
a.article_request,
1341
a.send,
1350
a.send,
1342
a.tag_add,
1351
a.tag_add,
1343
a.removefromlist,
1352
a.removefromlist,
Lines 1466-1471 a.reserve { Link Here
1466
    padding-left : 35px;
1475
    padding-left : 35px;
1467
}
1476
}
1468
1477
1478
a.article_request {
1479
    background-position: 0px -24px; /* Place article request */
1480
    padding-left : 35px;
1481
}
1482
1469
a.send {
1483
a.send {
1470
    background-position : 2px -386px; /* Email */
1484
    background-position : 2px -386px; /* Email */
1471
    text-decoration : none;
1485
    text-decoration : none;
Lines 2501-2504 a.reviewlink:visited { Link Here
2501
    cursor: pointer;
2515
    cursor: pointer;
2502
}
2516
}
2503
2517
2518
.btn-danger {
2519
    color: white !important;
2520
}
2521
2504
@import "responsive.less";
2522
@import "responsive.less";
(-)a/mainpage.pl (-2 / +9 lines)
Lines 30-35 use C4::Suggestions qw/CountSuggestion/; Link Here
30
use C4::Tags qw/get_count_by_tag_status/;
30
use C4::Tags qw/get_count_by_tag_status/;
31
use Koha::Patron::Modifications;
31
use Koha::Patron::Modifications;
32
use Koha::Patron::Discharge;
32
use Koha::Patron::Discharge;
33
use Koha::ArticleRequests;
33
34
34
my $query = new CGI;
35
my $query = new CGI;
35
36
Lines 65-73 my $branch = Link Here
65
my $pendingcomments    = numberofreviews(0);
66
my $pendingcomments    = numberofreviews(0);
66
my $pendingtags        = get_count_by_tag_status(0);
67
my $pendingtags        = get_count_by_tag_status(0);
67
my $pendingsuggestions = CountSuggestion("ASKED");
68
my $pendingsuggestions = CountSuggestion("ASKED");
68
my $pending_borrower_modifications =
69
my $pending_borrower_modifications = Koha::Patron::Modifications->GetPendingModificationsCount( $branch );
69
  Koha::Patron::Modifications->GetPendingModificationsCount( $branch );
70
my $pending_discharge_requests = Koha::Patron::Discharge::count({ pending => 1 });
70
my $pending_discharge_requests = Koha::Patron::Discharge::count({ pending => 1 });
71
my $pending_article_requests = Koha::ArticleRequests->count(
72
    {
73
        status => Koha::ArticleRequest::Status::Pending,
74
        $branch ? ( branchcode => $branch ) : (),
75
    }
76
);
71
77
72
$template->param(
78
$template->param(
73
    pendingcomments                => $pendingcomments,
79
    pendingcomments                => $pendingcomments,
Lines 75-80 $template->param( Link Here
75
    pendingsuggestions             => $pendingsuggestions,
81
    pendingsuggestions             => $pendingsuggestions,
76
    pending_borrower_modifications => $pending_borrower_modifications,
82
    pending_borrower_modifications => $pending_borrower_modifications,
77
    pending_discharge_requests     => $pending_discharge_requests,
83
    pending_discharge_requests     => $pending_discharge_requests,
84
    pending_article_requests       => $pending_article_requests,
78
);
85
);
79
86
80
#
87
#
(-)a/opac/opac-article-request-cancel.pl (+47 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2015
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
22
use CGI qw ( -utf8 );
23
24
use C4::Output;
25
use C4::Auth;
26
use Koha::ArticleRequests;
27
28
my $query = new CGI;
29
30
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
31
    {
32
        template_name   => "opac-account.tt",
33
        query           => $query,
34
        type            => "opac",
35
        authnotrequired => 0,
36
        debug           => 1,
37
    }
38
);
39
40
my $id = $query->param('id');
41
42
if ( $id && $borrowernumber ) {
43
    my $ar = Koha::ArticleRequests->find( $id );
44
    $ar->cancel() if $ar;
45
}
46
47
print $query->redirect("/cgi-bin/koha/opac-user.pl#opac-user-article-requests");
(-)a/opac/opac-request-article-do.pl (+62 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright ByWater Solutions 2015
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
22
use CGI qw ( -utf8 );
23
24
use C4::Auth;
25
use C4::Output;
26
27
use Koha::ArticleRequest;
28
29
my $cgi = new CGI;
30
31
my ( $userid, $cookie, $sessionID ) = checkauth( $cgi, 0, {}, 'opac' );
32
my $borrowernumber = C4::Context->userenv->{'number'};
33
34
my $biblionumber = $cgi->param('biblionumber');
35
my $branchcode   = $cgi->param('branchcode');
36
37
my $itemnumber = $cgi->param('itemnumber') || undef;
38
my $title      = $cgi->param('title')      || undef;
39
my $author     = $cgi->param('author')     || undef;
40
my $volume     = $cgi->param('volume')     || undef;
41
my $issue      = $cgi->param('issue')      || undef;
42
my $date       = $cgi->param('date')       || undef;
43
my $pages      = $cgi->param('pages')      || undef;
44
my $chapters   = $cgi->param('chapters')   || undef;
45
46
my $ar = Koha::ArticleRequest->new(
47
    {
48
        borrowernumber => $borrowernumber,
49
        biblionumber   => $biblionumber,
50
        branchcode     => $branchcode,
51
        itemnumber     => $itemnumber,
52
        title          => $title,
53
        author         => $author,
54
        volume         => $volume,
55
        issue          => $issue,
56
        date           => $date,
57
        pages          => $pages,
58
        chapters       => $chapters,
59
    }
60
)->store();
61
62
print $cgi->redirect("/cgi-bin/koha/opac-user.pl#opac-user-article-requests");
(-)a/opac/opac-request-article.pl (+52 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright ByWater Solutions 2015
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
22
use CGI qw ( -utf8 );
23
24
use C4::Auth;
25
use C4::Output;
26
27
use Koha::Biblios;
28
use Koha::Borrowers;
29
30
my $cgi = new CGI;
31
32
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
33
    {
34
        template_name   => "opac-request-article.tt",
35
        query           => $cgi,
36
        type            => "opac",
37
        authnotrequired => 0,
38
        debug           => 1,
39
    }
40
);
41
42
my $biblionumber = $cgi->param('biblionumber');
43
44
my $biblio = Koha::Biblios->find($biblionumber);
45
my $patron = Koha::Borrowers->find($borrowernumber);
46
47
$template->param(
48
    biblio => $biblio,
49
    patron => $patron,
50
);
51
52
output_html_with_http_headers $cgi, $cookie, $template->output;
(-)a/opac/opac-user.pl (-1 / +2 lines)
Lines 39-44 use Koha::Patron::Debarments qw(IsDebarred); Link Here
39
use Koha::Holds;
39
use Koha::Holds;
40
use Koha::Database;
40
use Koha::Database;
41
use Koha::Patron::Messages;
41
use Koha::Patron::Messages;
42
use Koha::Patrons;
42
43
43
use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE';
44
use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE';
44
45
Lines 345-351 if ( C4::Context->preference('AllowPatronToSetCheckoutsVisibilityForGuarantor' Link Here
345
}
346
}
346
347
347
$template->param(
348
$template->param(
348
    borrower                 => $borr,
349
    borrower                 => Koha::Patrons->find($borrowernumber),
349
    patron_messages          => $patron_messages,
350
    patron_messages          => $patron_messages,
350
    patronupdate             => $patronupdate,
351
    patronupdate             => $patronupdate,
351
    OpacRenewalAllowed       => C4::Context->preference("OpacRenewalAllowed"),
352
    OpacRenewalAllowed       => C4::Context->preference("OpacRenewalAllowed"),
(-)a/svc/article_request (+63 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2015 ByWater Solutions
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
21
use Modern::Perl;
22
23
use CGI;
24
use JSON qw(to_json);
25
26
use C4::Auth qw(check_cookie_auth);
27
use Koha::ArticleRequests;
28
29
my $cgi = new CGI;
30
31
my ( $auth_status, $sessionID ) =
32
  check_cookie_auth( $cgi->cookie('CGISESSID'), { circulate => 'circulate_remaining_permissions' } );
33
if ( $auth_status ne "ok" ) {
34
    exit 0;
35
}
36
37
binmode STDOUT, ':encoding(UTF-8)';
38
print $cgi->header( -type => 'text/plain', -charset => 'UTF-8' );
39
40
my $id = $cgi->param('id');
41
my $action = $cgi->param('action') || q{};
42
my $notes = $cgi->param('notes');
43
44
my $ar = Koha::ArticleRequests->find($id);
45
46
if ($ar) {
47
    if ( $action eq 'cancel' ) {
48
        $ar = $ar->cancel( $notes );
49
    }
50
    elsif ( $action eq 'process' ) {
51
        $ar = $ar->process();
52
    }
53
    elsif ( $action eq 'complete' ) {
54
        $ar = $ar->complete();
55
    }
56
    elsif ( $action eq 'update_branchcode' ) {
57
        my $branchcode = $cgi->param('branchcode');
58
        $ar->branchcode( $branchcode ) if $branchcode;
59
        $ar = $ar->store();
60
    }
61
}
62
63
print to_json( { success => $ar ? 1 : 0 } );
(-)a/tools/letter.pl (-1 / +4 lines)
Lines 236-241 sub add_form { Link Here
236
        } else {
236
        } else {
237
            push @{$field_selection}, add_fields('issues');
237
            push @{$field_selection}, add_fields('issues');
238
        }
238
        }
239
240
        if ( $module eq 'circulation' and $code =~ /^AR_/  ) {
241
            push @{$field_selection}, add_fields('article_requests');
242
        }
239
    }
243
    }
240
244
241
    $template->param(
245
    $template->param(
242
- 

Return to bug 14610