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

(-)a/Koha/Item.pm (-1 / +1 lines)
Lines 164-170 sub article_request_type { Link Here
164
      :                                      undef;
164
      :                                      undef;
165
    my $borrowertype = $borrower->categorycode;
165
    my $borrowertype = $borrower->categorycode;
166
    my $itemtype = $self->effective_itemtype();
166
    my $itemtype = $self->effective_itemtype();
167
    my $rules = GetIssuingRule( $borrowertype, $itemtype, $branchcode );
167
    my $rules = C4::Circulation::GetIssuingRule( $borrowertype, $itemtype, $branchcode );
168
168
169
    return $rules->{article_requests} || q{};
169
    return $rules->{article_requests} || q{};
170
}
170
}
(-)a/admin/smart-rules.pl (+2 lines)
Lines 152-157 elsif ($op eq 'add') { Link Here
152
    my $hardduedatecompare = $input->param('hardduedatecompare');
152
    my $hardduedatecompare = $input->param('hardduedatecompare');
153
    my $rentaldiscount = $input->param('rentaldiscount');
153
    my $rentaldiscount = $input->param('rentaldiscount');
154
    my $opacitemholds = $input->param('opacitemholds') || 0;
154
    my $opacitemholds = $input->param('opacitemholds') || 0;
155
    my $article_requests = $input->param('article_requests') || 'no';
155
    my $overduefinescap = $input->param('overduefinescap') || undef;
156
    my $overduefinescap = $input->param('overduefinescap') || undef;
156
    my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
157
    my $cap_fine_to_replacement_price = $input->param('cap_fine_to_replacement_price') eq 'on';
157
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
158
    $debug and warn "Adding $br, $bor, $itemtype, $fine, $maxissueqty, $maxonsiteissueqty, $cap_fine_to_replacement_price";
Lines 183-188 elsif ($op eq 'add') { Link Here
183
        opacitemholds                 => $opacitemholds,
184
        opacitemholds                 => $opacitemholds,
184
        overduefinescap               => $overduefinescap,
185
        overduefinescap               => $overduefinescap,
185
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
186
        cap_fine_to_replacement_price => $cap_fine_to_replacement_price,
187
        article_requests              => $article_requests,
186
    };
188
    };
187
189
188
    my $issuingrule = Koha::IssuingRules->find({categorycode => $bor, itemtype => $itemtype, branchcode => $br});
190
    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.pl (+111 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::Patrons;
27
use Koha::ArticleRequests;
28
29
my $cgi = new CGI;
30
31
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
32
    {
33
        template_name   => "circ/request-article.tt",
34
        query           => $cgi,
35
        type            => "intranet",
36
        authnotrequired => 0,
37
        flagsrequired   => { circulate => 'circulate_remaining_permissions' },
38
    }
39
);
40
41
my $action            = $cgi->param('action') || q{};
42
my $biblionumber      = $cgi->param('biblionumber');
43
my $patron_cardnumber = $cgi->param('patron_cardnumber');
44
my $patron_id         = $cgi->param('patron_id');
45
46
my $biblio = Koha::Biblios->find($biblionumber);
47
my $patron =
48
    $patron_id         ? Koha::Patrons->find($patron_id)
49
  : $patron_cardnumber ? Koha::Patrons->find( { cardnumber => $patron_cardnumber } )
50
  : undef;
51
52
if ( $action eq 'create' ) {
53
    my $borrowernumber = $cgi->param('borrowernumber');
54
    my $branchcode     = $cgi->param('branchcode');
55
56
    my $itemnumber   = $cgi->param('itemnumber')   || undef;
57
    my $title        = $cgi->param('title')        || undef;
58
    my $author       = $cgi->param('author')       || undef;
59
    my $volume       = $cgi->param('volume')       || undef;
60
    my $issue        = $cgi->param('issue')        || undef;
61
    my $date         = $cgi->param('date')         || undef;
62
    my $pages        = $cgi->param('pages')        || undef;
63
    my $chapters     = $cgi->param('chapters')     || undef;
64
    my $patron_notes = $cgi->param('patron_notes') || undef;
65
66
    my $ar = Koha::ArticleRequest->new(
67
        {
68
            borrowernumber => $borrowernumber,
69
            biblionumber   => $biblionumber,
70
            branchcode     => $branchcode,
71
            itemnumber     => $itemnumber,
72
            title          => $title,
73
            author         => $author,
74
            volume         => $volume,
75
            issue          => $issue,
76
            date           => $date,
77
            pages          => $pages,
78
            chapters       => $chapters,
79
            patron_notes   => $patron_notes,
80
        }
81
    )->store();
82
83
}
84
85
if ( !$patron && $patron_cardnumber ) {
86
    my $results = C4::Utils::DataTables::Members::search(
87
        {
88
            searchmember => $patron_cardnumber,
89
            dt_params    => { iDisplayLength => -1 },
90
        }
91
    );
92
93
    my $patrons = $results->{patrons};
94
95
    if ( scalar @$patrons == 1 ) {
96
        $patron = Koha::Patrons->find( $patrons->[0]->{borrowernumber} );
97
    }
98
    elsif (@$patrons) {
99
        $template->param( patrons => $patrons );
100
    }
101
    else {
102
        $template->param( no_patrons_found => $patron_cardnumber );
103
    }
104
}
105
106
$template->param(
107
    biblio => $biblio,
108
    patron => $patron,
109
);
110
111
output_html_with_http_headers $cgi, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css (-3 / +3 lines)
Lines 1725-1732 ul.budget_hierarchy li:first-child:after { Link Here
1725
.child_fund_amount {
1725
.child_fund_amount {
1726
    font-style: italic;
1726
    font-style: italic;
1727
}
1727
}
1728
.holdcount { font-size : 105%; line-height : 200%; }
1728
.number_box { font-size : 105%; line-height : 200%; }
1729
.holdcount a {
1729
.number_box a {
1730
	border : 1px solid #a4bedd;
1730
	border : 1px solid #a4bedd;
1731
	background-color : #e4ecf5;
1731
	background-color : #e4ecf5;
1732
	font-weight : bold;
1732
	font-weight : bold;
Lines 1735-1741 ul.budget_hierarchy li:first-child:after { Link Here
1735
	padding : .1em .4em;
1735
	padding : .1em .4em;
1736
	text-decoration : none;
1736
	text-decoration : none;
1737
}
1737
}
1738
.holdcount a:hover { background-color : #ebeff7; }
1738
.number_box a:hover { background-color : #ebeff7; }
1739
.container {
1739
.container {
1740
	border : 1px solid #EEE;
1740
	border : 1px solid #EEE;
1741
	padding : 1em;
1741
	padding : 1em;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc (+7 lines)
Lines 1-5 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 %]
Lines 27-32 Link Here
27
    [% END %]
29
    [% END %]
28
    [% IF ( EasyAnalyticalRecords ) %][% IF ( analyze ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio_object_id | url  %]&amp;analyze=1">Analytics</a></li>[% END %]
30
    [% IF ( EasyAnalyticalRecords ) %][% IF ( analyze ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio_object_id | url  %]&amp;analyze=1">Analytics</a></li>[% END %]
29
31
32
    [% IF Koha.Preference('ArticleRequests') %]
33
        [% IF ( article_requests_view ) %]<li class="active">[% ELSE %]<li>[% END %]
34
        <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>
35
    [% END %]
36
30
    [% IF ( subscriptionsnumber ) %]<li><a href="/cgi-bin/koha/serials/serials-search.pl?searched=1&amp;biblionumber=[% biblio_object_id | url  %]">Subscription(s)</a></li>[% END %]
37
    [% IF ( subscriptionsnumber ) %]<li><a href="/cgi-bin/koha/serials/serials-search.pl?searched=1&amp;biblionumber=[% biblio_object_id | url  %]">Subscription(s)</a></li>[% END %]
31
</ul>
38
</ul>
32
<ul>
39
<ul>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (+4 lines)
Lines 261-266 CAN_user_serials_create_subscription ) %] Link Here
261
    [% END %]
261
    [% END %]
262
[% END %]
262
[% END %]
263
263
264
[% IF Koha.Preference('ArticleRequests') %]
265
    <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>
266
[% END %]
267
264
</div>
268
</div>
265
269
266
    <!--Modal for Dublin Core-->
270
    <!--Modal for Dublin Core-->
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+43 lines)
Lines 769-771 Circulation: Link Here
769
            - "Patron categories allowed to checkout in a batch"
769
            - "Patron categories allowed to checkout in a batch"
770
            - pref: BatchCheckoutsValidCategories
770
            - pref: BatchCheckoutsValidCategories
771
            - "(list of patron categories separated with a pipe '|')"
771
            - "(list of patron categories separated with a pipe '|')"
772
    Article Requests:
773
        -
774
            - pref: ArticleRequests
775
              choices:
776
                  yes: Enable
777
                  no: "Don't enable"
778
            - patrons to place article requests.
779
        -
780
            - For records that are record level or item level requestable, make the following fields mandatory
781
            - pref: ArticleRequestsMandatoryFields
782
              multiple:
783
                title: Title
784
                author: Author
785
                volume: Volume
786
                issue: Issue
787
                date: Date
788
                pages: Pages
789
                chapters: Chapters
790
            -
791
        -
792
            - For records that are only record level requestable, make the following fields mandatory
793
            - pref: ArticleRequestsMandatoryFieldsRecordOnly
794
              multiple:
795
                title: Title
796
                author: Author
797
                volume: Volume
798
                issue: Issue
799
                date: Date
800
                pages: Pages
801
                chapters: Chapters
802
            -
803
        -
804
            - For records that are only item level requestable, make the following fields mandatory
805
            - pref: ArticleRequestsMandatoryFieldsItemOnly
806
              multiple:
807
                title: Title
808
                author: Author
809
                volume: Volume
810
                issue: Issue
811
                date: Date
812
                pages: Pages
813
                chapters: Chapters
814
            -
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (+21 lines)
Lines 189-194 $(document).ready(function() { Link Here
189
                <th>Holds per record (count)</th>
189
                <th>Holds per record (count)</th>
190
                <th>On shelf holds allowed</th>
190
                <th>On shelf holds allowed</th>
191
                <th>Item level holds</th>
191
                <th>Item level holds</th>
192
                <th>Article requests</th>
192
                <th>Rental discount (%)</th>
193
                <th>Rental discount (%)</th>
193
                <th>Actions</th>
194
                <th>Actions</th>
194
            </tr>
195
            </tr>
Lines 275-280 $(document).ready(function() { Link Here
275
                                                                If any unavailable
276
                                                                If any unavailable
276
                                                            [% END %]</td>
277
                                                            [% END %]</td>
277
                                                        <td>[% IF rule.opacitemholds == 'F'%]Force[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td>
278
                                                        <td>[% IF rule.opacitemholds == 'F'%]Force[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td>
279
                                                        <td>
280
                                                            [% IF rule.article_requests == 'no' %]
281
                                                                No
282
                                                            [% ELSIF rule.article_requests == 'yes' %]
283
                                                                Yes
284
                                                            [% ELSIF rule.article_requests == 'bib_only' %]
285
                                                                Record only
286
                                                            [% ELSIF rule.article_requests == 'item_only' %]
287
                                                                Item only
288
                                                            [% END %]
289
                                                        </td>
278
							<td>[% rule.rentaldiscount %]</td>
290
							<td>[% rule.rentaldiscount %]</td>
279
                                                        <td class="actions">
291
                                                        <td class="actions">
280
                                                          <a href="#" class="editrule btn btn-mini"><i class="fa fa-pencil"></i> Edit</a>
292
                                                          <a href="#" class="editrule btn btn-mini"><i class="fa fa-pencil"></i> Edit</a>
Lines 355-360 $(document).ready(function() { Link Here
355
                            <option value="F">Force</option>
367
                            <option value="F">Force</option>
356
                        </select>
368
                        </select>
357
                    </td>
369
                    </td>
370
                    <td>
371
                        <select id="article_requests" name="article_requests">
372
                            <option value="no">No</option>
373
                            <option value="yes">Yes</option>
374
                            <option value="bib_only">Record only</option>
375
                            <option value="item_only">Item only</option>
376
                        </select>
377
                    </td>
358
                    <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
378
                    <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
359
                    <td class="actions">
379
                    <td class="actions">
360
                        <input type="hidden" name="branch" value="[% current_branch %]"/>
380
                        <input type="hidden" name="branch" value="[% current_branch %]"/>
Lines 387-392 $(document).ready(function() { Link Here
387
                      <th>Holds per record (count)</th>
407
                      <th>Holds per record (count)</th>
388
                      <th>On shelf holds allowed</th>
408
                      <th>On shelf holds allowed</th>
389
                      <th>Item level holds</th>
409
                      <th>Item level holds</th>
410
                      <th>Article requests</th>
390
                      <th>Rental discount (%)</th>
411
                      <th>Rental discount (%)</th>
391
                      <th colspan="2">&nbsp;</th>
412
                      <th colspan="2">&nbsp;</th>
392
                    </tr>
413
                    </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 408-413 function verify_images() { Link Here
408
        [% END %]
409
        [% END %]
409
        <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>
410
        <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>
410
411
412
        [% IF ( holdcount ) %]
413
            <span class="results_summary">
414
                <span class="label">Holds:</span>
415
                <span class="number_box">
416
                    <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">[% holdcount %]</a>
417
                </span>
418
            </span>
419
        [% END %]
420
421
        [% IF ( article_requests_count = Biblio.ArticleRequestsActiveCount( biblionumber ) ) %]
422
            <span class="results_summary">
423
                <span class="label">Article requests:</span>
424
                <span class="number_box">
425
                    <a href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% biblionumber %]">[% article_requests_count %]</a>
426
                </span>
427
            </span>
428
        [% END %]
429
411
        [% IF ( AmazonCoverImages  || LocalCoverImages ) %]
430
        [% IF ( AmazonCoverImages  || LocalCoverImages ) %]
412
        </div><div class="yui-u" id="bookcoverimg">
431
        </div><div class="yui-u" id="bookcoverimg">
413
        [% IF ( LocalCoverImages ) %]
432
        [% IF ( LocalCoverImages ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (+4 lines)
Lines 599-604 var holdForPatron = function () { Link Here
599
                                    [% END %]
599
                                    [% END %]
600
                                [% END # / IF intranetbookbag %]
600
                                [% END # / IF intranetbookbag %]
601
601
602
                          [% IF Koha.Preference('ArticleRequests') %]
603
                              | <a id="requst_article_[% SEARCH_RESULT.biblionumber %]" href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Request article</a>
604
                          [% END %]
605
602
                          [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
606
                          [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
603
                          | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Edit record</a>
607
                          | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Edit record</a>
604
                          [% END %]
608
                          [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt (+409 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
                                            [% IF ar.patron_notes %] <p><strong>Patron notes:</strong> [% ar.patron_notes %] </p> [% END %]
223
                                        </td>
224
                                        <td class="ar-collection">[% AuthorisedValues.GetByCode( 'CCODE', ar.item.ccode ) %]</td>
225
                                        <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) %]</td>
226
                                        <td class="ar-callnumber">
227
                                            [% IF ar.item.location %]
228
                                                <em>[% AuthorisedValues.GetByCode( 'LOC', ar.item.location ) %]</em>
229
                                            [% END %]
230
231
                                            [% ar.item.itemcallnumber %]
232
                                        </td>
233
                                        <td class="ar-copynumber">[% ar.item.copynumber %]</td>
234
                                        <td class="ar-enumchron">[% ar.item.enumchron %]</td>
235
                                        <td class="ar-barcode">[% ar.item.barcode %]</td>
236
                                        <td class="ar-patron">
237
                                            <p>
238
                                                <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber %]">
239
                                                    [% ar.borrower.surname %][% IF ar.borrower.firstname %], [% ar.borrower.firstname %][% END %] ([% ar.borrower.cardnumber %])
240
                                                </a>
241
                                            </p>
242
243
                                            <p>[% ar.borrower.phone %]</p>
244
                                        </td>
245
                                        <td class="ar-date"><span title="[% ar.created_on %]">[% ar.created_on | $KohaDates %]</span></td>
246
                                        <td class="ar-actions">
247
                                            <div class="dropdown">
248
                                                <a class="btn btn-mini dropdown-toggle" id="ar-actions" role="button" data-toggle="dropdown" href="#">
249
                                                    Actions <b class="caret"></b>
250
                                                </a>
251
252
                                                <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="ar-actions">
253
                                                    <li>
254
                                                        <a class="ar-process-request" href="#" onclick="Process( [% ar.id %], $(this) ); return false;">
255
                                                            <i class="icon-ok-circle"></i>
256
                                                            Process request
257
                                                        </a>
258
259
                                                        <a class="ar-complete-request" href="#" onclick="Complete( [% ar.id %], $(this) ); return false;">
260
                                                            <i class="icon-ok-circle"></i>
261
                                                            Complete request
262
                                                        </a>
263
264
                                                        <a class="ar-cancel-request" href="#" onclick="Cancel( [% ar.id %], $(this) ); return false;">
265
                                                            <i class="icon-remove-circle"></i>
266
                                                            Cancel request
267
                                                        </a>
268
269
                                                        <a class="ar-print-request" href="#" onclick="PrintSlip('article-request-slip.pl?id=[% ar.id %]'); return false;">
270
                                                            <i class="icon-print"></i>
271
                                                            Print slip
272
                                                        </a>
273
                                                    </li>
274
                                                </ul>
275
                                            </div>
276
                                        </td>
277
                                    </tr>
278
                                [% END %]
279
                            </tbody>
280
                        </table>
281
                    </div>
282
283
                    <div id="article-requests-processing">
284
                        <table id="article-requests-processing-table">
285
                            <thead>
286
                                <tr>
287
                                    <th class="ar-title">Title</th>
288
                                    <th class="ar-request">Requested article</th>
289
                                    <th class="ar-collection">Collection</th>
290
                                    <th class="ar-itemtype">Item type</th>
291
                                    <th class="ar-callnumber">Call number</th>
292
                                    <th class="ar-copynumber">Copy number</th>
293
                                    <th class="ar-enumchron">Enumeration</th>
294
                                    <th class="ar-barcode">Barcode</th>
295
                                    <th class="ar-patron">Patron</th>
296
                                    <th class="ar-date">Date</th>
297
                                    <th class="ar-actions">Actions</th>
298
                                </tr>
299
                            </thead>
300
301
                             <tbody>
302
                                <tr class="ar-processing-none">
303
                                    <td colspan="11">
304
                                        There are no article requests in processing at this time.
305
                                    </td>
306
                                </tr>
307
308
                                [% FOREACH ar IN article_requests_processing %]
309
                                    <tr class="ar-row ar-processing">
310
                                        <td class="ar-title">
311
                                            <p>
312
                                                <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% ar.biblionumber %]">
313
                                                    <strong>[% ar.biblio.title | html %]</strong>
314
                                                    [% FOREACH s IN itemsloo.subtitle %] [% s %][% END %]
315
                                                </a>
316
                                            </p>
317
318
                                            <p>
319
                                                <div class="ar-biblionumber content_hidden">[% ar.biblionumber %]</div>
320
                                                <div class="ar-author">[% ar.biblio.author %]</div>
321
                                                <div class="ar-pubdata">
322
                                                    [% ar.biblio.biblioitem.publishercode %]
323
324
                                                    [% IF ar.biblio.biblioitem.publicationyear %]
325
                                                        , [% ar.biblio.biblioitem.publicationyear %]
326
                                                    [% ELSIF ar.biblio.copyrightdate %]
327
                                                        , [% ar.biblio.copyrightdate %]
328
                                                    [% END %]
329
330
                                                    [% IF ar.biblio.biblioitem.pages %]
331
                                                        : [% ar.biblio.biblioitem.pages %]
332
                                                    [% END %]
333
334
                                                    [%  r.biblio.biblioitem.size %]
335
336
                                                    [% IF ar.biblio.biblioitem.isbn %]
337
                                                        ISBN: [% ar.biblio.biblioitem.isbn %]
338
                                                    [% END %]
339
                                                </div>
340
                                            </p>
341
                                        </td>
342
                                        <td class="ar-request">
343
                                            [% IF ar.title %]        <p><strong>Title:</strong>        [% ar.title %]        </p> [% END %]
344
                                            [% IF ar.author %]       <p><strong>Author:</strong>       [% ar.author %]       </p> [% END %]
345
                                            [% IF ar.volume %]       <p><strong>Volume:</strong>       [% ar.volume %]       </p> [% END %]
346
                                            [% IF ar.issue %]        <p><strong>Issue:</strong>        [% ar.issue %]        </p> [% END %]
347
                                            [% IF ar.date %]         <p><strong>Date:</strong>         [% ar.date %]         </p> [% END %]
348
                                            [% IF ar.pages %]        <p><strong>Pages:</strong>        [% ar.pages %]        </p> [% END %]
349
                                            [% IF ar.chapters %]     <p><strong>Chapters:</strong>     [% ar.chapters %]     </p> [% END %]
350
                                            [% IF ar.patron_notes %] <p><strong>Patron notes:</strong> [% ar.patron_notes %] </p> [% END %]
351
                                        </td>
352
                                        <td class="ar-collection">[% AuthorisedValues.GetByCode( 'CCODE', ar.item.ccode ) %]</td>
353
                                        <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) %]</td>
354
                                        <td class="ar-callnumber">
355
                                            [% IF ar.item.location %]
356
                                                <em>[% AuthorisedValues.GetByCode( 'LOC', ar.item.location ) %]</em>
357
                                            [% END %]
358
359
                                            [% ar.item.itemcallnumber %]
360
                                        </td>
361
                                        <td class="ar-copynumber">[% ar.item.copynumber %]</td>
362
                                        <td class="ar-enumchron">[% ar.item.enumchron %]</td>
363
                                        <td class="ar-barcode">[% ar.item.barcode %]</td>
364
                                        <td class="ar-patron">
365
                                            <p>
366
                                                <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber %]">
367
                                                    [% ar.borrower.surname %][% IF ar.borrower.firstname %], [% ar.borrower.firstname %][% END %] ([% ar.borrower.cardnumber %])
368
                                                </a>
369
                                            </p>
370
371
                                            <p>[% ar.borrower.phone %]</p>
372
                                        </td>
373
                                        <td class="ar-date"><span title="[% ar.created_on %]">[% ar.created_on | $KohaDates %]</span></td>
374
                                        <td class="ar-actions">
375
                                            <div class="dropdown">
376
                                                <a class="btn btn-mini dropdown-toggle" id="ar-actions" role="button" data-toggle="dropdown" href="#">
377
                                                    Actions <b class="caret"></b>
378
                                                </a>
379
380
                                                <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="ar-actions">
381
                                                    <li>
382
                                                        <a href="#" onclick="Complete( [% ar.id %], $(this) ); return false;">
383
                                                            <i class="icon-ok-circle"></i>
384
                                                            Complete request
385
                                                        </a>
386
387
                                                        <a href="#" onclick="Cancel( [% ar.id %], $(this) ); return false;">
388
                                                            <i class="icon-remove-circle"></i>
389
                                                            Cancel request
390
                                                        </a>
391
392
                                                        <a href="#" onclick="PrintSlip('article-request-slip.pl?id=[% ar.id %]'); return false;">
393
                                                            <i class="icon-print"></i>
394
                                                            Print slip
395
                                                        </a>
396
                                                    </li>
397
                                                </ul>
398
                                            </div>
399
                                        </td>
400
                                    </tr>
401
                                [% END %]
402
                            </tbody>
403
                        </table>
404
                    </div>
405
                </div>
406
            </div>
407
        </div>
408
    </div>
409
[% 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 (+380 lines)
Line 0 Link Here
1
[% USE KohaDates %]
2
[% USE Branches %]
3
[% USE ItemTypes %]
4
[% SET article_requests_view = 1 %]
5
[% SET biblionumber = biblio.biblionumber %]
6
[% INCLUDE 'doc-head-open.inc' %]
7
<title>Koha &rsaquo; Circulation &rsaquo; Request article</title>
8
[% INCLUDE 'doc-head-close.inc' %]
9
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
10
[% INCLUDE 'datatables.inc' %]
11
12
<script type="text/javascript">
13
// <![CDATA[
14
$('#current-article-requests').ready(function() {
15
    $(".hide").hide();
16
});
17
18
$(document).ready(function() {
19
    $( "#patron" ).autocomplete({
20
        source: "/cgi-bin/koha/circ/ysearch.pl",
21
        minLength: 3,
22
        select: function( event, ui ) {
23
            $( "#patron" ).val( ui.item.cardnumber );
24
            $( "#holds_patronsearch" ).submit();
25
            return false;
26
        }
27
    })
28
    .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
29
        return $( "<li></li>" )
30
        .data( "ui-autocomplete-item", item )
31
        .append( "<a>" + item.surname + ", " + item.firstname +
32
                 " (" + item.cardnumber + ") <small>" + item.address +
33
                 " " + item.city + " " + item.zipcode + " " +
34
                 item.country + "</small></a>" )
35
        .appendTo( ul );
36
    };
37
38
    $( ".ar-update-branchcode" ).on('focus', function(){
39
        previous_branchcode = this.value;
40
    }).on('change', function(){
41
        var branchcode = this.value;
42
        var c = confirm(_("Are you sure you want to change the pickup library from %s to %s for this request?").format( previous_branchcode, branchcode ));
43
44
        if ( c ) {
45
            var id = this.id.split("branchcode-")[1];
46
            $("#update-processing-" + id ).css({opacity: 0, visibility: "visible"}).animate({opacity: 1.0}, 200);
47
48
            $.ajax({
49
                type: "POST",
50
                url: '/cgi-bin/koha/svc/article_request',
51
                data: {
52
                    action: 'update_branchcode',
53
                    id: id,
54
                    branchcode: branchcode,
55
                },
56
                success: function( data ) {
57
                    $("#update-processing-" + id ).css({opacity: 1.0, visibility: "visible"}).animate({opacity: 0}, 200);
58
                },
59
                dataType: 'json'
60
            });
61
62
        } else {
63
            this.value = previous_branchcode;
64
        }
65
    });
66
67
    $(".ar-cancel-request").on("click", function(){
68
        var a = $(this);
69
        var notes = prompt(_("Reason for cancellation:"));
70
71
        if ( notes != null ) {
72
            var id = this.id.split("cancel-")[1];
73
            $("#cancel-processing-" + id ).hide('slow');
74
            $("#cancel-processing-spinner-" + id ).show('slow');
75
76
            $.ajax({
77
                type: "POST",
78
                url: '/cgi-bin/koha/svc/article_request',
79
                data: {
80
                    action: 'cancel',
81
                    id: id,
82
                    notes: notes
83
                },
84
                success: function( data ) {
85
                    a.parents('tr').hide('slow');
86
                },
87
                dataType: 'json'
88
            });
89
        }
90
    });
91
});
92
// ]]>
93
</script>
94
</head>
95
96
<body id="circ_article_request" class="catalog">
97
    [% INCLUDE 'header.inc' %]
98
    [% INCLUDE 'circ-search.inc' %]
99
100
    <div id="breadcrumbs">
101
        <a href="/cgi-bin/koha/mainpage.pl">Home</a>
102
        &rsaquo;
103
        <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
104
        &rsaquo;
105
        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">[% biblio.title | html %]</a>
106
        &rsaquo;
107
        Request article
108
    </div>
109
110
    <div id="doc3" class="yui-t2">
111
        <div id="bd">
112
            <div id="yui-main">
113
                <div class="yui-b">
114
115
                    <h1>Request article from <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.id %]">[% biblio.title | html %]</a></h1>
116
                    [% IF no_patrons_found %]
117
                        <div class="dialog alert">
118
                            <h3>Patron not found</h3>
119
                            <p>No patron with this name, please, try another</p>
120
                        </div>
121
                    [% ELSIF patrons %]
122
                        <form id="article_request_patron_results" method="post">
123
                            <fieldset>
124
                                <table id="table_borrowers">
125
                                    <thead>
126
                                        <tr>
127
                                            <th></th>
128
                                            <th>Name</th>
129
                                            <th>Cardnumber</th>
130
                                            <th>Category</th>
131
                                            <th>Library</th>
132
                                            <th>Address</th>
133
                                        </tr>
134
                                    </thead>
135
                                    <tbody>
136
                                        [% FOREACH patron IN patrons %]
137
                                            <tr>
138
                                                <td><input type="radio" name="patron_id" value="[% patron.borrowernumber %]"/></td>
139
                                                <td>[% patron.surname %], [% patron.firstname %]</td>
140
                                                <td>[% patron.cardnumber %]</td>
141
                                                <td>[% patron.categorycode %]</td>
142
                                                <td>[% patron.branchcode %]</td>
143
                                                <td>[% patron.address %]</td>
144
                                            </tr>
145
                                        [% END %]
146
                                    </tbody>
147
                                </table>
148
                                <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
149
                                <fieldset class="action"><input type="submit" value="Select" /></fieldset>
150
                            </fieldset>
151
                        </form>
152
                    [% ELSIF !patron %]
153
                        <form id="article_requests_patronsearch" action="request-article.pl" method="post">
154
                            <fieldset class="brief">
155
                                <label for="patron">Patron: </label>
156
                                <div class="hint">Enter patron card number or partial name:</div>
157
                                <input type="text" size="40" id="patron" class="focus" name="patron_cardnumber" />
158
                                <input type="submit" value="Search" />
159
                                <input type="hidden" name="biblionumber" value="[% biblio.id %]" />
160
                            </fieldset>
161
                        </form>
162
                    [% ELSE %]
163
                        [% IF biblio.can_article_request( patron ) %]
164
165
                            <form id="place-article-request" method="post" action="/cgi-bin/koha/circ/request-article.pl">
166
                                <input type="hidden" name="action" value="create" />
167
                                <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber %]" />
168
                                <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.id %]" />
169
170
                                <fieldset class="rows">
171
                                    <legend>Place article request from [% biblio.title %] for [% patron.firstname %] [% patron.surname %] ( [% patron.cardnumber %] )</legend>
172
                                    <p/>
173
                                    <ul>
174
                                        <li>
175
                                            <label for="title">Title:</label>
176
                                            <input type="text" name="title" id="title" size="50"/>
177
                                        </li>
178
179
                                        <li>
180
                                            <label for="author">Author:</label>
181
                                            <input type="text" name="author" id="author" size="50"/>
182
                                        </li>
183
184
                                        <li>
185
                                            <label for="volume">Volume:</label>
186
                                            <input type="text" name="volume" id="volume" size="50"/>
187
                                        </li>
188
189
                                        <li>
190
                                            <label for="issue">Issue:</label>
191
                                            <input type="text" name="issue" id="issue" size="50"/>
192
                                        </li>
193
194
                                        <li>
195
                                            <label for="date">Date:</label>
196
                                            <input type="text" name="date" id="date" size="50"/>
197
                                        </li>
198
199
                                        <li>
200
                                            <label for="pages">Pages:</label>
201
                                            <input type="text" name="pages" id="pages" size="50"/>
202
                                        </li>
203
204
                                        <li>
205
                                            <label for="chapters">Chapters:</label>
206
                                            <input type="text" name="chapters" id="chapters" size="50"/>
207
                                        </li>
208
209
                                        <li>
210
                                            <label for="patron_notes">Patron notes:</label>
211
                                            <input type="text" name="patron_notes" id="patron_notes" size="50"/>
212
                                        </li>
213
214
                                        <li>
215
                                            <label for="branchcode">Pickup library:</label>
216
                                            <select name="branchcode" id="branchcode">
217
                                                [% FOREACH b IN Branches.all %]
218
                                                    [% IF b.branchcode == Branches.GetLoggedInBranchcode %]
219
                                                        <option value="[% b.branchcode %]" selected="selected">[% b.branchname %]</option>
220
                                                    [% ELSE %]
221
                                                        <option value="[% b.branchcode %]">[% b.branchname %]</option>
222
                                                    [% END %]
223
                                                [% END %]
224
                                            </select>
225
                                        </li>
226
                                    </ul>
227
                                </fieldset>
228
229
                                [% SET article_request_type = biblio.article_request_type( patron ) %]
230
                                [% IF article_request_type != 'bib_only' %]
231
                                    <table id="current-requests-table" class="ar-table table table-bordered table-striped">
232
                                        <caption>Select item:</caption>
233
                                        <thead>
234
                                            <tr>
235
                                                <th>&nbsp;</th>
236
                                                <th>Item type</th>
237
                                                <th>Barcode</th>
238
                                                <th>Home library</th>
239
                                                <th>Call number</th>
240
                                                <th>Enumeration</th>
241
                                            </tr>
242
                                        </thead>
243
244
                                        <tbody>
245
                                            [% FOREACH item IN biblio.items %]
246
                                                [% IF item.can_article_request( patron ) %]
247
                                                    <tr>
248
                                                        <td>
249
                                                            [% IF article_request_type == 'item_only' && !checked %]
250
                                                                [% SET checked = 1 %]
251
                                                                <input type="radio" name="itemnumber" value="[% item.itemnumber %]" checked="checked" />
252
                                                            [% ELSE %]
253
                                                                <input type="radio" name="itemnumber" value="[% item.itemnumber %]" />
254
                                                            [% END %]
255
                                                        </td>
256
                                                        <td>
257
                                                            [% ItemTypes.GetDescription( item.itype ) %]
258
                                                        </td>
259
                                                        <td>
260
                                                            [% item.barcode %]
261
                                                        </td>
262
                                                        <td>
263
                                                            [% Branches.GetName( item.homebranch ) %]
264
                                                        </td>
265
                                                        <td>
266
                                                            [% item.itemcallnumber %]
267
                                                        </td>
268
                                                        <td>
269
                                                            [% item.enumchron %]
270
                                                        </td>
271
                                                    </tr>
272
                                                [% END %]
273
                                            [% END %]
274
275
                                            [% IF article_request_type != 'item_only' %]
276
                                                <tr>
277
                                                    <td>
278
                                                        <input type="radio" name="itemnumber" value="" checked="checked"/>
279
                                                    </td>
280
                                                    <td colspan="5">
281
                                                        Any item
282
                                                    </td>
283
                                                </tr>
284
                                            [% END %]
285
                                        </tbody>
286
                                    </table>
287
                                [% END %]
288
289
                                <p>
290
                                    <input type="submit" class="btn" value="Place request" />
291
                                </p>
292
                            </form>
293
                        [% ELSE %]
294
                            No article requests can be made for this record.
295
                        [% END %]
296
297
                    [% END %]
298
299
                    [% IF biblio.article_requests_current && !patron %]
300
                        <fieldset class="rows left" id="current-article-requests-fieldset">
301
                            <legend>Current article requests</legend>
302
303
                            <table id="current-article-requests-table">
304
                                <tr>
305
                                    <th>Placed on</th>
306
                                    <th>Patron</th>
307
                                    <th>Title</th>
308
                                    <th>Author</th>
309
                                    <th>Volume</th>
310
                                    <th>Issue</th>
311
                                    <th>Date</th>
312
                                    <th>Pages</th>
313
                                    <th>Chapters</th>
314
                                    <th>Patron notes</th>
315
                                    <th>Item</th>
316
                                    <th>Status</th>
317
                                    <th>Pickup library</th>
318
                                    <th>&nbsp;</th>
319
                                </tr>
320
321
                                [% FOREACH ar IN biblio.article_requests_current %]
322
                                    <tr>
323
                                        <td>[% ar.created_on | $KohaDates %]</td>
324
                                        <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% ar.borrowernumber %]">[% ar.borrower.firstname %] [% ar.borrower.surname %]</a></td>
325
                                        <td>[% ar.title %]</td>
326
                                        <td>[% ar.author %]</td>
327
                                        <td>[% ar.volume %]</td>
328
                                        <td>[% ar.issue %]</td>
329
                                        <td>[% ar.date %]</td>
330
                                        <td>[% ar.pages %]</td>
331
                                        <td>[% ar.chapters %]</td>
332
                                        <td>[% ar.patron_notes %]</td>
333
                                        <td>
334
                                            [% IF ar.item %]
335
                                                <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% ar.itemnumber %]&biblionumber=[% ar.biblionumber %]">[% ar.item.barcode %]</a>
336
                                            [% END %]
337
                                        </td>
338
                                        <td>
339
                                            [% IF ar.status == 'PENDING' %]
340
                                                Pending
341
                                            [% ELSIF ar.status == 'PROCESSING' %]
342
                                                Processing
343
                                            [% ELSIF ar.status == 'COMPLETED' %]
344
                                                Completed
345
                                            [% ELSIF ar.status == 'CANCELED' %]
346
                                                Canceled
347
                                            [% END %]
348
                                        </td>
349
                                        <td>
350
                                            <i id="update-processing-[% ar.id %]" class="fa fa-cog fa-spin hidden"></i>
351
                                            <select name="branchcode" id="branchcode-[% ar.id %]" class="ar-update-branchcode">
352
                                                [% FOREACH b IN Branches.all %]
353
                                                    [% IF b.branchcode == ar.branchcode %]
354
                                                        <option value="[% b.branchcode %]" selected="selected">[% b.branchname %]</option>
355
                                                    [% ELSE %]
356
                                                        <option value="[% b.branchcode %]">[% b.branchname %]</option>
357
                                                    [% END %]
358
                                                [% END %]
359
                                            </select>
360
                                        </td>
361
                                        <td>
362
                                            <a title="Cancel article request" href="#" id="cancel-[% ar.id %]" class="ar-cancel-request">
363
                                                <i id="cancel-processing-spinner-[% ar.id %]" class="fa fa-cog fa-spin hide"></i>
364
                                                <i id="cancel-processing-[% ar.id %]" class="fa fa-times fa-lg" style="color:red"></i>
365
                                            </a>
366
                                        </td>
367
                                    </tr>
368
                                [% END %]
369
                            </table>
370
                        </fieldset>
371
                    [% END %]
372
                </div>
373
            </div>
374
375
            <div class="yui-b">
376
                [% INCLUDE 'biblio-view-menu.inc' %]
377
            </div>
378
        </div>
379
    </div>
380
[% 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 (+11 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-19 Link Here
8
            [% END %]
9
            [% END %]
9
        [% END %]
10
        [% END %]
10
    [% END %]
11
    [% END %]
12
11
    <li><a class="print-large" href="#">Print</a></li>
13
    <li><a class="print-large" href="#">Print</a></li>
14
15
    [% IF Koha.Preference( 'opacuserlogin' ) == 1 %]
16
        [% IF Koha.Preference('ArticleRequests') %]
17
            <li><a class="article_request" href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% biblionumber %]">Request article</a></li>
18
        [% END %]
19
    [% END %]
20
12
    [% IF Koha.Preference( 'virtualshelves' ) == 1 %]
21
    [% IF Koha.Preference( 'virtualshelves' ) == 1 %]
13
        [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && loggedinusername ) %]
22
        [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && loggedinusername ) %]
14
            <li><a class="addtoshelf" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% biblionumber %]">Save to your lists</a></li>
23
            <li><a class="addtoshelf" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=[% biblionumber %]">Save to your lists</a></li>
15
        [% END %]
24
        [% END %]
16
    [% END %]
25
    [% END %]
26
17
    [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
27
    [% IF Koha.Preference( 'opacbookbag' ) == 1 %]
18
        [% IF ( incart ) %]
28
        [% IF ( incart ) %]
19
            <li><a class="incart cart[% biblionumber %] addrecord" href="#">In your cart</a> <a class="cartRemove cartR[% biblionumber %]" href="#">(remove)</a></li>
29
            <li><a class="incart cart[% biblionumber %] addrecord" href="#">In your cart</a> <a class="cartRemove cartR[% biblionumber %]" href="#">(remove)</a></li>
Lines 21-26 Link Here
21
            <li><a class="addtocart cart[% biblionumber %] addrecord" href="#">Add to your cart</a>  <a style="display:none;" class="cartRemove cartR[% biblionumber %]" href="#">(remove)</a></li>
31
            <li><a class="addtocart cart[% biblionumber %] addrecord" href="#">Add to your cart</a>  <a style="display:none;" class="cartRemove cartR[% biblionumber %]" href="#">(remove)</a></li>
22
        [% END %]
32
        [% END %]
23
    [% END %]
33
    [% END %]
34
24
    [% IF ( OpacHighlightedWords && query_desc ) %]
35
    [% IF ( OpacHighlightedWords && query_desc ) %]
25
    <li>
36
    <li>
26
        <a href="#" class="highlight_toggle" id="highlight_toggle_off">Unhighlight</a>
37
        <a href="#" class="highlight_toggle" id="highlight_toggle_off">Unhighlight</a>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt (+225 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% USE Branches %]
3
[% USE ItemTypes %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Request article</title>
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% BLOCK cssinclude %][% END %]
8
</head>
9
10
[% INCLUDE 'bodytag.inc' bodyid='opac-holds' %]
11
[% INCLUDE 'masthead.inc' %]
12
13
<div class="main">
14
    <ul class="breadcrumb">
15
        <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
16
        <li><a href="#">Request article</a></li>
17
    </ul>
18
19
    <div class="container">
20
        [% IF biblio.can_article_request( patron ) %]
21
            [% SET article_request_type = biblio.article_request_type( patron ) %]
22
23
            [% IF article_request_type == 'yes' %]       [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFields') %]           [% END %]
24
            [% IF article_request_type == 'bib_only' %]  [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFieldsRecordOnly') %] [% END %]
25
            [% IF article_request_type == 'item_only' %] [% SET mandatory_fields = Koha.Preference('ArticleRequestsMandatoryFieldsItemOnly') %]   [% END %]
26
27
            <h3>Place article request for [% biblio.title %]</h3>
28
29
            <form id="place-article-request" method="post" action="/cgi-bin/koha/opac-request-article.pl">
30
                <input type="hidden" name="action" value="create" />
31
                <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber %]" />
32
33
                <fieldset class="rows">
34
                    <ul>
35
                        <li>
36
                            [% IF mandatory_fields.search('title') %]
37
                                <label for="title" class="required">Title:</label>
38
                            [% ELSE %]
39
                                <label for="title">Title:</label>
40
                            [% END %]
41
                            <input type="text" name="title" id="title" size="50"/>
42
                        </li>
43
44
                        <li>
45
                            [% IF mandatory_fields.search('author') %]
46
                                <label for="author" class="required">Author:</label>
47
                            [% ELSE %]
48
                                <label for="author">Author:</label>
49
                            [% END %]
50
                            <input type="text" name="author" id="author" size="50"/>
51
                        </li>
52
53
                        <li>
54
                            [% IF mandatory_fields.search('volume') %]
55
                                <label for="volume" class="required">Volume:</label>
56
                            [% ELSE %]
57
                                <label for="volume">Volume:</label>
58
                            [% END %]
59
                            <input type="text" name="volume" id="volume" size="50"/>
60
                        </li>
61
62
                        <li>
63
                            [% IF mandatory_fields.search('issue') %]
64
                                <label for="issue" class="required">Issue:</label>
65
                            [% ELSE %]
66
                                <label for="issue">Issue:</label>
67
                            [% END %]
68
                            <input type="text" name="issue" id="issue" size="50"/>
69
                        </li>
70
71
                        <li>
72
                            [% IF mandatory_fields.search('date') %]
73
                                <label for="date" class="required">Date:</label>
74
                            [% ELSE %]
75
                                <label for="date">Date:</label>
76
                            [% END %]
77
                            <input type="text" name="date" id="date" size="50"/>
78
                        </li>
79
80
                        <li>
81
                            [% IF mandatory_fields.search('pages') %]
82
                                <label for="pages" class="required">Pages:</label>
83
                            [% ELSE %]
84
                                <label for="pages">Pages:</label>
85
                            [% END %]
86
                            <input type="text" name="pages" id="pages" size="50"/>
87
                        </li>
88
89
                        <li>
90
                            [% IF mandatory_fields.search('chapters') %]
91
                                <label for="chapters" class="required">Chapters:</label>
92
                            [% ELSE %]
93
                                <label for="chapters">Chapters:</label>
94
                            [% END %]
95
                            <input type="text" name="chapters" id="chapters" size="50"/>
96
                        </li>
97
98
                        <li>
99
                            <label for="patron_notes">Notes:</label>
100
                            <input type="text" name="patron_notes" id="patron_notes" size="50"/>
101
                        </li>
102
103
                        <li>
104
                            <label for="branchcode">Pickup library:</label>
105
                            <select name="branchcode" id="branchcode">
106
                                [% FOREACH b IN Branches.all %]
107
                                    [% IF b.branchcode == Branches.GetLoggedInBranchcode %]
108
                                        <option value="[% b.branchcode %]" selected="selected">[% b.branchname %]</option>
109
                                    [% ELSE %]
110
                                        <option value="[% b.branchcode %]">[% b.branchname %]</option>
111
                                    [% END %]
112
                                [% END %]
113
                            </select>
114
                        </li>
115
                    </ul>
116
                </fieldset>
117
118
                [% IF article_request_type != 'bib_only' %]
119
                    <table class="copiesrow table table-bordered table-striped">
120
                        <caption>Select a specific item:</caption>
121
                        <thead>
122
                            <tr>
123
                                <th>&nbsp;</th>
124
                                <th>Item type</th>
125
                                <th>Barcode</th>
126
                                <th>Home library</th>
127
                                <th>Call number</th>
128
                                <th>Enumeration</th>
129
                            </tr>
130
                        </thead>
131
132
                        <tbody>
133
                            [% FOREACH item IN biblio.items %]
134
                                [% IF item.can_article_request( patron ) %]
135
                                    <tr>
136
                                        <td>
137
                                            [% IF article_request_type == 'item_only' && !checked %]
138
                                                [% SET checked = 1 %]
139
                                                <input type="radio" name="itemnumber" value="[% item.itemnumber %]" checked="checked" />
140
                                            [% ELSE %]
141
                                                <input type="radio" name="itemnumber" value="[% item.itemnumber %]" />
142
                                            [% END %]
143
                                        </td>
144
                                        <td>
145
                                            [% ItemTypes.GetDescription( item.itype ) %]
146
                                        </td>
147
                                        <td>
148
                                            [% item.barcode %]
149
                                        </td>
150
                                        <td>
151
                                            [% Branches.GetName( item.homebranch ) %]
152
                                        </td>
153
                                        <td>
154
                                            [% item.itemcallnumber %]
155
                                        </td>
156
                                        <td>
157
                                            [% item.enumchron %]
158
                                        </td>
159
                                    </tr>
160
                                [% END %]
161
                            [% END %]
162
163
                            [% IF article_request_type != 'item_only' %]
164
                                <tr>
165
                                    <td>
166
                                        <input type="radio" name="itemnumber" value="" checked="checked"/>
167
                                    </td>
168
                                    <td colspan="6">
169
                                        Any item
170
                                    </td>
171
                                </tr>
172
                            [% END %]
173
                        </tbody>
174
                    </table>
175
                [% END %]
176
177
                <input type="submit" class="btn" value="Place request" />
178
            </form>
179
        [% ELSE %]
180
            No article requests can be made for this record.
181
        [% END %]
182
183
    </div> <!-- / .container -->
184
</div> <!-- / .main -->
185
186
[% INCLUDE 'opac-bottom.inc' %]
187
188
[% BLOCK jsinclude %]
189
<script type="text/javascript">
190
// <![CDATA[
191
    allow_submit = false;
192
    $('#place-article-request').on('submit', function( event ){
193
        if ( ! allow_submit ) {
194
            event.preventDefault();
195
196
            [% IF article_request_type == 'item_only' %]
197
                if ( ! $("input:radio[name='itemnumber']").is(":checked") ) {
198
                    alert( _("Please select a specific item for this article request.") );
199
                    return 0;
200
                }
201
            [% END %]
202
203
            var mandatory_fields = "[% mandatory_fields %]";
204
            var m = new Array();
205
            if ( mandatory_fields ) m = mandatory_fields.split(",");
206
            var f = new Array();
207
208
            for (i = 0; i < m.length; i++) {
209
                if ( ! $("#" + m[i]).val() ) {
210
                    f.push( m[i] );
211
                }
212
            }
213
214
            if ( f.length ) {
215
                alert( _("The following fields are required and not filled in: ") + f.join(", ") );
216
                return 0;
217
            }
218
219
            allow_submit = true;
220
            $('#place-article-request').submit();
221
        }
222
    });
223
// ]]>
224
</script>
225
[% END %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (+6 lines)
Lines 495-500 Link Here
495
                                                            [% END # UNLESS SEARCH_RESULT.norequests %]
495
                                                            [% END # UNLESS SEARCH_RESULT.norequests %]
496
                                                        [% END # IF RequestOnOpac %]
496
                                                        [% END # IF RequestOnOpac %]
497
497
498
                                                        [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %]
499
                                                            [% IF Koha.Preference('ArticleRequests') %]
500
                                                                <span class="actions"><a class="article_request" href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Request article</a></span>
501
                                                            [% END %]
502
                                                        [% END %]
503
498
                                                        [% IF ( TagsInputEnabled ) %]
504
                                                        [% IF ( TagsInputEnabled ) %]
499
                                                            [% IF ( loggedinusername ) %]
505
                                                            [% IF ( loggedinusername ) %]
500
                                                                <span class="actions"><a class="tag_add" id="tag_add[% SEARCH_RESULT.biblionumber %]" href="#">Add tag</a></span>
506
                                                                <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 (+100 lines)
Lines 147-152 Using this account is not recommended because some parts of Koha will not functi Link Here
147
                                [% IF ( BORROWER_INFO.amountlessthanzero ) %]<li><a href="#opac-user-fines">Credits ([% BORROWER_INFO.amountoutstanding | $Price %])</a></li>[% END %]
147
                                [% IF ( BORROWER_INFO.amountlessthanzero ) %]<li><a href="#opac-user-fines">Credits ([% BORROWER_INFO.amountoutstanding | $Price %])</a></li>[% END %]
148
                            [% END %]
148
                            [% END %]
149
                            [% IF ( RESERVES.count ) %]<li><a href="#opac-user-holds">Holds ([% RESERVES.count %])</a></li>[% END %]
149
                            [% IF ( RESERVES.count ) %]<li><a href="#opac-user-holds">Holds ([% RESERVES.count %])</a></li>[% END %]
150
                            [% 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 %]
150
                        </ul>
151
                        </ul>
151
152
152
                        <div id="opac-user-checkouts">
153
                        <div id="opac-user-checkouts">
Lines 728-733 Using this account is not recommended because some parts of Koha will not functi Link Here
728
                            [% END %]
729
                            [% END %]
729
                        </div> <!-- / #opac-user-holds -->
730
                        </div> <!-- / #opac-user-holds -->
730
                        [% END # / #RESERVES.count %]
731
                        [% END # / #RESERVES.count %]
732
733
                        [% IF Koha.Preference('ArticleRequests') && borrower.article_requests_current.count %]
734
                            <div id="opac-user-article-requests">
735
                                <table id="article-requests-table" class="table table-bordered table-striped">
736
                                    <caption>Article requests <span class="count">([% borrower.article_requests_current.count %] total)</span></caption>
737
                                    <!-- RESERVES TABLE ROWS -->
738
                                    <thead>
739
                                        <tr>
740
                                            <th class="anti-the">Record title</th>
741
                                            <th class="psort">Placed on</th>
742
                                            <th class="anti-the">Title</th>
743
                                            <th>Author</th>
744
                                            <th>Volume</th>
745
                                            <th>Issue</th>
746
                                            <th>Date</th>
747
                                            <th>Pages</th>
748
                                            <th>Chapters</th>
749
                                            <th>Notes</th>
750
                                            <th>Status</th>
751
                                            <th>Pickup library</th>
752
                                            <th class="nosort">&nbsp;</th>
753
                                        </tr>
754
                                    </thead>
755
756
                                    <tbody>
757
                                    [% FOREACH ar IN borrower.article_requests_current %]
758
                                            <td class="article-request-title">
759
                                                <a class="article-request-title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ar.biblionumber %]">
760
                                                    [% ar.biblio.title %]
761
                                                    [% ar.item.enumchron %]
762
                                                </a>
763
                                                [% ar.biblio.author %]
764
                                                [% IF ar.itemnumber %] <i>(only [% ar.item.barcode %])</i>[% END %]
765
                                            </td>
766
767
                                            <td class="article-request-created_on">
768
                                                [% ar.created_on | $KohaDates %]
769
                                            </td>
770
771
                                            <td class="article-request-title">
772
                                                [% ar.title %]
773
                                            </td>
774
775
                                            <td class="article-request-author">
776
                                                [% ar.author %]
777
                                            </td>
778
779
                                            <td class="article-request-volume">
780
                                                [% ar.volume %]
781
                                            </td>
782
783
                                            <td class="article-request-issue">
784
                                                [% ar.issue %]
785
                                            </td>
786
787
                                            <td class="article-request-date">
788
                                                [% ar.date %]
789
                                            </td>
790
791
                                            <td class="article-request-pages">
792
                                                [% ar.pages %]
793
                                            </td>
794
795
                                            <td class="article-request-chapters">
796
                                                [% ar.chapters %]
797
                                            </td>
798
799
                                            <td class="article-request-patron-notes">
800
                                                [% ar.patron_notes %]
801
                                            </td>
802
803
                                            <td class="article-request-status">
804
                                                [% IF ar.status == 'PENDING' %]
805
                                                    Pending
806
                                                [% ELSIF ar.status == 'PROCESSING' %]
807
                                                    Processing
808
                                                [% ELSIF ar.status == 'COMPLETED' %]
809
                                                    Completed
810
                                                [% ELSIF ar.status == 'CANCELED' %]
811
                                                    Canceled
812
                                                [% END %]
813
                                            </td>
814
815
                                            <td class="article-request-branchcode">
816
                                                [% ar.branch.branchname %]
817
                                            </td>
818
819
                                            <td class="article-request-cancel">
820
                                                <span class="tdlabel">Cancel:</span>
821
                                                <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>
822
                                                <!-- TODO: replace MSG_CONFIRM_DELETE_HOLD with correct message -->
823
                                            </td>
824
                                        </tr>
825
                                    [% END %]
826
                                </tbody>
827
                            </table>
828
                        </div> <!-- / #opac-user-article-requests -->
829
                    [% END %]
830
731
                    </div> <!-- /#opac-user-views -->
831
                    </div> <!-- /#opac-user-views -->
732
                </div> <!-- /#userdetails -->
832
                </div> <!-- /#userdetails -->
733
            </div> <!-- /.span10 -->
833
            </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 2503-2506 a.reviewlink:visited { Link Here
2503
    cursor: pointer;
2517
    cursor: pointer;
2504
}
2518
}
2505
2519
2520
.btn-danger {
2521
    color: white !important;
2522
}
2523
2506
@import "responsive.less";
2524
@import "responsive.less";
(-)a/mainpage.pl (+8 lines)
Lines 30-35 use C4::Tags qw/get_count_by_tag_status/; Link Here
30
use Koha::Patron::Modifications;
30
use Koha::Patron::Modifications;
31
use Koha::Patron::Discharge;
31
use Koha::Patron::Discharge;
32
use Koha::Reviews;
32
use Koha::Reviews;
33
use Koha::ArticleRequests;
33
34
34
my $query = new CGI;
35
my $query = new CGI;
35
36
Lines 67-72 my $pendingtags = get_count_by_tag_status(0); Link Here
67
my $pendingsuggestions = CountSuggestion("ASKED");
68
my $pendingsuggestions = CountSuggestion("ASKED");
68
my $pending_borrower_modifications = Koha::Patron::Modifications->pending_count( $branch );
69
my $pending_borrower_modifications = Koha::Patron::Modifications->pending_count( $branch );
69
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
);
70
77
71
$template->param(
78
$template->param(
72
    pendingcomments                => $pendingcomments,
79
    pendingcomments                => $pendingcomments,
Lines 74-79 $template->param( Link Here
74
    pendingsuggestions             => $pendingsuggestions,
81
    pendingsuggestions             => $pendingsuggestions,
75
    pending_borrower_modifications => $pending_borrower_modifications,
82
    pending_borrower_modifications => $pending_borrower_modifications,
76
    pending_discharge_requests     => $pending_discharge_requests,
83
    pending_discharge_requests     => $pending_discharge_requests,
84
    pending_article_requests       => $pending_article_requests,
77
);
85
);
78
86
79
#
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.pl (+87 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::Patrons;
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 $action = $cgi->param('action') || q{};
43
my $biblionumber = $cgi->param('biblionumber');
44
45
if ( $action eq 'create' ) {
46
    my $branchcode = $cgi->param('branchcode');
47
48
    my $itemnumber   = $cgi->param('itemnumber')   || undef;
49
    my $title        = $cgi->param('title')        || undef;
50
    my $author       = $cgi->param('author')       || undef;
51
    my $volume       = $cgi->param('volume')       || undef;
52
    my $issue        = $cgi->param('issue')        || undef;
53
    my $date         = $cgi->param('date')         || undef;
54
    my $pages        = $cgi->param('pages')        || undef;
55
    my $chapters     = $cgi->param('chapters')     || undef;
56
    my $patron_notes = $cgi->param('patron_notes') || undef;
57
58
    my $ar = Koha::ArticleRequest->new(
59
        {
60
            borrowernumber => $borrowernumber,
61
            biblionumber   => $biblionumber,
62
            branchcode     => $branchcode,
63
            itemnumber     => $itemnumber,
64
            title          => $title,
65
            author         => $author,
66
            volume         => $volume,
67
            issue          => $issue,
68
            date           => $date,
69
            pages          => $pages,
70
            chapters       => $chapters,
71
            patron_notes   => $patron_notes,
72
        }
73
    )->store();
74
75
    print $cgi->redirect("/cgi-bin/koha/opac-user.pl#opac-user-article-requests");
76
    exit;
77
}
78
79
my $biblio = Koha::Biblios->find($biblionumber);
80
my $patron = Koha::Patrons->find($borrowernumber);
81
82
$template->param(
83
    biblio => $biblio,
84
    patron => $patron,
85
);
86
87
output_html_with_http_headers $cgi, $cookie, $template->output;
(-)a/opac/opac-user.pl (-1 / +2 lines)
Lines 38-43 use Koha::Holds; Link Here
38
use Koha::Database;
38
use Koha::Database;
39
use Koha::Patron::Messages;
39
use Koha::Patron::Messages;
40
use Koha::Patron::Discharge;
40
use Koha::Patron::Discharge;
41
use Koha::Patrons;
41
42
42
use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE';
43
use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE';
43
44
Lines 334-340 if ( C4::Context->preference('AllowPatronToSetCheckoutsVisibilityForGuarantor' Link Here
334
}
335
}
335
336
336
$template->param(
337
$template->param(
337
    borrower                 => $borr,
338
    borrower                 => Koha::Patrons->find($borrowernumber),
338
    patron_messages          => $patron_messages,
339
    patron_messages          => $patron_messages,
339
    patronupdate             => $patronupdate,
340
    patronupdate             => $patronupdate,
340
    OpacRenewalAllowed       => C4::Context->preference("OpacRenewalAllowed"),
341
    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 234-239 sub add_form { Link Here
234
        } else {
234
        } else {
235
            push @{$field_selection}, add_fields('issues');
235
            push @{$field_selection}, add_fields('issues');
236
        }
236
        }
237
238
        if ( $module eq 'circulation' and $code =~ /^AR_/  ) {
239
            push @{$field_selection}, add_fields('article_requests');
240
        }
237
    }
241
    }
238
242
239
    $template->param(
243
    $template->param(
240
- 

Return to bug 14610