Bugzilla – Attachment 42828 Details for
Bug 14610
Add ability to place article requests in Koha
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14610 - Add ability to place document delivery / article requests in Koha
Bug-14610---Add-ability-to-place-document-delivery.patch (text/plain), 96.62 KB, created by
Kyle M Hall (khall)
on 2015-09-23 17:01:03 UTC
(
hide
)
Description:
Bug 14610 - Add ability to place document delivery / article requests in Koha
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-09-23 17:01:03 UTC
Size:
96.62 KB
patch
obsolete
>From b211a5e7c1d8cc70410e1ebb31c7a96027157062 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 28 Jul 2015 11:53:36 -0400 >Subject: [PATCH] Bug 14610 - Add ability to place document delivery / article requests in Koha > >--- > C4/Letters.pm | 25 +- > Koha/ArticleRequest.pm | 81 +++++ > Koha/ArticleRequest/Status.pm | 44 +++ > Koha/ArticleRequests.pm | 37 ++- > Koha/Biblio.pm | 175 ++++++++++ > Koha/Biblios.pm | 2 +- > Koha/Borrower.pm | 70 ++++ > Koha/Item.pm | 47 +++- > Koha/Schema/Result/ArticleRequest.pm | 25 ++- > Koha/Template/Plugin/Biblio.pm | 11 + > circ/article-request-slip.pl | 66 ++++ > circ/article-requests.pl | 44 +++ > circ/request-article-cancel.pl | 45 +++ > circ/request-article-do.pl | 68 ++++ > circ/request-article.pl | 53 +++ > installer/data/mysql/atomicupdate/bug_14610.sql | 2 + > .../prog/en/includes/biblio-view-menu.inc | 1 + > .../prog/en/modules/catalogue/results.tt | 1 + > .../prog/en/modules/circ/article-requests.tt | 352 ++++++++++++++++++++ > .../prog/en/modules/circ/circulation-home.tt | 3 + > .../prog/en/modules/circ/request-article.tt | 245 ++++++++++++++ > .../intranet-tmpl/prog/en/modules/intranet-main.tt | 9 + > .../bootstrap/en/includes/opac-detail-sidebar.inc | 8 + > .../bootstrap/en/modules/opac-request-article.tt | 157 +++++++++ > .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 4 + > .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 90 +++++ > koha-tmpl/opac-tmpl/bootstrap/less/opac.less | 18 + > mainpage.pl | 3 + > opac/opac-article-request-cancel.pl | 47 +++ > opac/opac-request-article-do.pl | 67 ++++ > opac/opac-request-article.pl | 53 +++ > opac/opac-user.pl | 2 + > svc/article_request | 58 ++++ > 33 files changed, 1894 insertions(+), 19 deletions(-) > create mode 100644 Koha/ArticleRequest/Status.pm > create mode 100755 circ/article-request-slip.pl > create mode 100755 circ/article-requests.pl > create mode 100755 circ/request-article-cancel.pl > create mode 100755 circ/request-article-do.pl > create mode 100755 circ/request-article.pl > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt > create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt > create mode 100755 opac/opac-article-request-cancel.pl > create mode 100755 opac/opac-request-article-do.pl > create mode 100755 opac/opac-request-article.pl > create mode 100755 svc/article_request > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index db9f987..3108230 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -746,18 +746,19 @@ sub _parseletter_sth { > # broke things for the rest of us. prepare_cached is a better > # way to cache statement handles anyway. > my $query = >- ($table eq 'biblio' ) ? "SELECT * FROM $table WHERE biblionumber = ?" : >- ($table eq 'biblioitems' ) ? "SELECT * FROM $table WHERE biblionumber = ?" : >- ($table eq 'items' ) ? "SELECT * FROM $table WHERE itemnumber = ?" : >- ($table eq 'issues' ) ? "SELECT * FROM $table WHERE itemnumber = ?" : >- ($table eq 'old_issues' ) ? "SELECT * FROM $table WHERE itemnumber = ? ORDER BY timestamp DESC LIMIT 1" : >- ($table eq 'reserves' ) ? "SELECT * FROM $table WHERE borrowernumber = ? and biblionumber = ?" : >- ($table eq 'borrowers' ) ? "SELECT * FROM $table WHERE borrowernumber = ?" : >- ($table eq 'branches' ) ? "SELECT * FROM $table WHERE branchcode = ?" : >- ($table eq 'suggestions' ) ? "SELECT * FROM $table WHERE suggestionid = ?" : >- ($table eq 'aqbooksellers') ? "SELECT * FROM $table WHERE id = ?" : >- ($table eq 'aqorders' ) ? "SELECT * FROM $table WHERE ordernumber = ?" : >- ($table eq 'opac_news' ) ? "SELECT * FROM $table WHERE idnew = ?" : >+ ($table eq 'biblio' ) ? "SELECT * FROM $table WHERE biblionumber = ?" : >+ ($table eq 'biblioitems' ) ? "SELECT * FROM $table WHERE biblionumber = ?" : >+ ($table eq 'items' ) ? "SELECT * FROM $table WHERE itemnumber = ?" : >+ ($table eq 'issues' ) ? "SELECT * FROM $table WHERE itemnumber = ?" : >+ ($table eq 'old_issues' ) ? "SELECT * FROM $table WHERE itemnumber = ? ORDER BY timestamp DESC LIMIT 1" : >+ ($table eq 'reserves' ) ? "SELECT * FROM $table WHERE borrowernumber = ? and biblionumber = ?" : >+ ($table eq 'borrowers' ) ? "SELECT * FROM $table WHERE borrowernumber = ?" : >+ ($table eq 'branches' ) ? "SELECT * FROM $table WHERE branchcode = ?" : >+ ($table eq 'suggestions' ) ? "SELECT * FROM $table WHERE suggestionid = ?" : >+ ($table eq 'aqbooksellers') ? "SELECT * FROM $table WHERE id = ?" : >+ ($table eq 'aqorders' ) ? "SELECT * FROM $table WHERE ordernumber = ?" : >+ ($table eq 'opac_news' ) ? "SELECT * FROM $table WHERE idnew = ?" : >+ ($table eq 'article_requests') ? "SELECT * FROM $table WHERE id = ?" : > ($table eq 'borrower_modifications') ? "SELECT * FROM $table WHERE verification_token = ?" : > undef ; > unless ($query) { >diff --git a/Koha/ArticleRequest.pm b/Koha/ArticleRequest.pm >index 1adf17a..cd51264 100644 >--- a/Koha/ArticleRequest.pm >+++ b/Koha/ArticleRequest.pm >@@ -22,6 +22,10 @@ use Modern::Perl; > use Carp; > > use Koha::Database; >+use Koha::Borrowers; >+use Koha::Biblios; >+use Koha::Items; >+use Koha::ArticleRequest::Status; > > use base qw(Koha::Object); > >@@ -35,6 +39,83 @@ Koha::ArticleRequest - Koha Article Request Object class > > =cut > >+=head3 process >+ >+=cut >+ >+sub process { >+ my ( $self ) = @_; >+ >+ $self->status( Koha::ArticleRequest::Status::Processing ); >+ return $self->store(); >+} >+ >+=head3 complete >+ >+=cut >+ >+sub complete { >+ my ( $self ) = @_; >+ >+ $self->status( Koha::ArticleRequest::Status::Completed ); >+ return $self->store(); >+} >+ >+=head3 cancel >+ >+=cut >+ >+sub cancel { >+ my ( $self, $notes ) = @_; >+ >+ $self->status( Koha::ArticleRequest::Status::Canceled ); >+ $self->notes( $notes ) if $notes; >+ return $self->store(); >+} >+ >+ >+=head3 biblio >+ >+Returns the Koha::Biblio object for this article request >+ >+=cut >+ >+sub biblio { >+ my ( $self ) = @_; >+ >+ $self->{_biblio} ||= Koha::Biblios->find( $self->biblionumber() ); >+ >+ return $self->{_biblio}; >+} >+ >+=head3 item >+ >+Returns the Koha::Item object for this article request >+ >+=cut >+ >+sub item { >+ my ( $self ) = @_; >+ >+ $self->{_item} ||= Koha::Items->find( $self->itemnumber() ); >+ >+ return $self->{_item}; >+} >+ >+=head3 borrower >+ >+Returns the Koha::Borrower object for this article request >+ >+=cut >+ >+sub borrower { >+ my ( $self ) = @_; >+ >+ $self->{_borrower} ||= Koha::Borrowers->find( $self->borrowernumber() ); >+ >+ return $self->{_borrower}; >+} >+ > =head3 type > > =cut >diff --git a/Koha/ArticleRequest/Status.pm b/Koha/ArticleRequest/Status.pm >new file mode 100644 >index 0000000..e3d4d3f >--- /dev/null >+++ b/Koha/ArticleRequest/Status.pm >@@ -0,0 +1,44 @@ >+package Koha::ArticleRequest::Status; >+ >+# Copyright ByWater Solutions 2015 >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+sub Open { >+ return 'OPEN'; >+} >+ >+sub Processing { >+ return 'PROCESSING'; >+} >+ >+sub Completed { >+ return 'COMPLETED'; >+} >+ >+sub Canceled { >+ return 'CANCELED'; >+} >+ >+=head1 AUTHOR >+ >+Kyle M Hall <kyle@bywatersolutions.com> >+ >+=cut >+ >+1; >diff --git a/Koha/ArticleRequests.pm b/Koha/ArticleRequests.pm >index b110966..26f3338 100644 >--- a/Koha/ArticleRequests.pm >+++ b/Koha/ArticleRequests.pm >@@ -23,7 +23,8 @@ use Carp; > > use Koha::Database; > >-use Koha::Borrower; >+use Koha::ArticleRequest; >+use Koha::ArticleRequest::Status; > > use base qw(Koha::Objects); > >@@ -37,12 +38,44 @@ Koha::ArticleRequests - Koha ArticleRequests Object class > > =cut > >+=head3 open >+ >+=cut >+ >+sub open { >+ return Koha::ArticleRequests->search( { status => Koha::ArticleRequest::Status::Open } ); >+} >+ >+=head3 processing >+ >+=cut >+ >+sub processing { >+ return Koha::ArticleRequests->search( { status => Koha::ArticleRequest::Status::Processing } ); >+} >+ >+=head3 completed >+ >+=cut >+ >+sub completed { >+ return Koha::ArticleRequests->search( { status => Koha::ArticleRequest::Status::Completed } ); >+} >+ >+=head3 canceled >+ >+=cut >+ >+sub canceled { >+ return Koha::ArticleRequests->search( { status => Koha::ArticleRequest::Status::Completed } ); >+} >+ > =head3 type > > =cut > > sub type { >- return 'ArticleRequests'; >+ return 'ArticleRequest'; > } > > sub object_class { >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 9c467d7..fce5a55 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -25,6 +25,11 @@ use Koha::Database; > > use base qw(Koha::Object); > >+use C4::Circulation qw(GetIssuingRule); >+use Koha::Items; >+use Koha::ArticleRequests; >+use Koha::ArticleRequest::Status; >+ > =head1 NAME > > Koha::Biblio - Koha Biblio Object class >@@ -35,6 +40,176 @@ Koha::Biblio - Koha Biblio Object class > > =cut > >+=head3 can_article_request >+ >+my $bool = $biblio->can_article_request( $borrower ); >+ >+Returns true if article requests can be made for this record >+ >+$borrower must be a Koha::Borrower object >+ >+=cut >+ >+sub can_article_request { >+ my ( $self, $borrower ) = @_; >+ >+ my $rule = $self->article_request_type($borrower); >+ return q{} if $rule eq 'item_only' && !$self->items()->count(); >+ return 1 if $rule && $rule ne 'no'; >+ >+ return q{}; >+} >+ >+=head3 article_request_type >+ >+my $type = $biblio->article_request_type( $borrower ); >+ >+Returns the article request type based on items, or on the record >+itself if there are no items. >+ >+$borrower must be a Koha::Borrower object >+ >+=cut >+ >+sub article_request_type { >+ my ( $self, $borrower ) = @_; >+ >+ my $rule = $self->article_request_type_for_items( $borrower ); >+ return $rule if $rule; >+ >+ # If the record has no items that are requestable, go by the record itemtype >+ $rule = $self->article_request_type_for_bib($borrower); >+ return $rule if $rule; >+ >+ return q{}; >+} >+ >+=head3 article_request_type_for_bib >+ >+my $type = $biblio->article_request_type_for_bib >+ >+Returns the article request type 'yes', 'no', 'item_only', 'bib_only', for the given record >+ >+=cut >+ >+sub article_request_type_for_bib { >+ my ( $self, $borrower ) = @_; >+ >+ my $borrowertype = $borrower->categorycode; >+ my $itemtype = $self->itemtype(); >+ my $rules = GetIssuingRule( $borrowertype, $itemtype ); >+ >+ return $rules->{article_requests} || q{}; >+} >+ >+=head3 article_request_type_for_items >+ >+my $type = $biblio->article_request_type_for_items >+ >+Returns the article request type 'yes', 'no', 'item_only', 'bib_only', for the given record's items >+ >+If there is a conflict where some items are 'bib_only' and some are 'item_only', 'bib_only' will be returned. >+ >+=cut >+ >+sub article_request_type_for_items { >+ my ( $self, $borrower ) = @_; >+ >+ my $counts; >+ foreach my $item ( $self->items()->as_list() ) { >+ my $rule = $item->article_request_type($borrower); >+ return $rule if $rule eq 'bib_only'; # we don't need to go any further >+ $counts->{$rule}++; >+ } >+ >+ return 'item_only' if $counts->{item_only}; >+ return 'yes' if $counts->{yes}; >+ return 'no' if $counts->{no}; >+ return q{}; >+} >+ >+=head3 article_requests >+ >+my @requests = $biblio->article_requests >+ >+Returns the article requests associated with this Biblio >+ >+=cut >+ >+sub article_requests { >+ my ( $self, $borrower ) = @_; >+ >+ $self->{_article_requests} ||= Koha::ArticleRequests->search( { biblionumber => $self->biblionumber() } ); >+ >+ return wantarray ? $self->{_article_requests}->as_list : $self->{_article_requests}; >+} >+ >+=head3 article_requests_current >+ >+my @requests = $biblio->article_requests_current >+ >+Returns the article requests associated with this Biblio that are incomplete >+ >+=cut >+ >+sub article_requests_current { >+ my ( $self, $borrower ) = @_; >+ >+ $self->{_article_requests_current} ||= Koha::ArticleRequests->search( >+ { >+ biblionumber => $self->biblionumber(), >+ -or => [ >+ { status => Koha::ArticleRequest::Status::Open }, >+ { status => Koha::ArticleRequest::Status::Processing } >+ ] >+ } >+ ); >+ >+ return wantarray ? $self->{_article_requests_current}->as_list : $self->{_article_requests_current}; >+} >+ >+=head3 article_requests_finished >+ >+my @requests = $biblio->article_requests_finished >+ >+Returns the article requests associated with this Biblio that are completed >+ >+=cut >+ >+sub article_requests_finished { >+ my ( $self, $borrower ) = @_; >+ >+ $self->{_article_requests_finished} ||= Koha::ArticleRequests->search( >+ { >+ biblionumber => $self->biblionumber(), >+ -or => [ >+ { status => Koha::ArticleRequest::Status::Completed }, >+ { status => Koha::ArticleRequest::Status::Canceled } >+ ] >+ } >+ ); >+ >+ return wantarray ? $self->{_article_requests_finished}->as_list : $self->{_article_requests_finished}; >+} >+ >+=head3 items >+ >+my @items = $biblio->items(); >+my $items = $biblio->items(); >+ >+Returns a list of Koha::Item objects or a Koha::Items object of >+items associated with this bib >+ >+=cut >+ >+sub items { >+ my ( $self ) = @_; >+ >+ $self->{_items} ||= Koha::Items->search({ biblionumber => $self->biblionumber() }); >+ >+ return $self->{_items}; >+} >+ > =head3 type > > =cut >diff --git a/Koha/Biblios.pm b/Koha/Biblios.pm >index cba48ea..020f933 100644 >--- a/Koha/Biblios.pm >+++ b/Koha/Biblios.pm >@@ -1,6 +1,6 @@ > package Koha::Biblios; > >-# Copyright ByWater Solutions 2014 >+# Copyright ByWater Solutions 2015 > # > # This file is part of Koha. > # >diff --git a/Koha/Borrower.pm b/Koha/Borrower.pm >index 93426bf..84ce27a 100644 >--- a/Koha/Borrower.pm >+++ b/Koha/Borrower.pm >@@ -23,6 +23,9 @@ use Carp; > > use Koha::Database; > >+use Koha::ArticleRequests; >+use Koha::ArticleRequest::Status; >+ > use base qw(Koha::Object); > > =head1 NAME >@@ -35,6 +38,73 @@ Koha::Borrower - Koha Borrower Object class > > =cut > >+=head3 article_requests >+ >+my @requests = $borrower->article_requests(); >+my $requests = $borrower->article_requests(); >+ >+Returns either a list of ArticleRequests objects, >+or an ArtitleRequests object, depending on the >+calling context. >+ >+=cut >+ >+sub article_requests { >+ my ( $self ) = @_; >+ >+ $self->{_article_requests} ||= Koha::ArticleRequests->search({ borrowernumber => $self->borrowernumber() }); >+ >+ return $self->{_article_requests}; >+} >+ >+=head3 article_requests_current >+ >+my @requests = $patron->article_requests_current >+ >+Returns the article requests associated with this patron that are incomplete >+ >+=cut >+ >+sub article_requests_current { >+ my ( $self ) = @_; >+ >+ $self->{_article_requests_current} ||= Koha::ArticleRequests->search( >+ { >+ borrowernumber => $self->id(), >+ -or => [ >+ { status => Koha::ArticleRequest::Status::Open }, >+ { status => Koha::ArticleRequest::Status::Processing } >+ ] >+ } >+ ); >+ >+ return $self->{_article_requests_current}; >+} >+ >+=head3 article_requests_finished >+ >+my @requests = $biblio->article_requests_finished >+ >+Returns the article requests associated with this patron that are completed >+ >+=cut >+ >+sub article_requests_finished { >+ my ( $self, $borrower ) = @_; >+ >+ $self->{_article_requests_finished} ||= Koha::ArticleRequests->search( >+ { >+ borrowernumber => $self->id(), >+ -or => [ >+ { status => Koha::ArticleRequest::Status::Completed }, >+ { status => Koha::ArticleRequest::Status::Canceled } >+ ] >+ } >+ ); >+ >+ return $self->{_article_requests_finished}; >+} >+ > =head3 type > > =cut >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 2dcccfb..b6f84c4 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -21,8 +21,8 @@ use Modern::Perl; > > use Carp; > >-use Koha::Database; >- >+use C4::Context; >+use C4::Circulation qw(GetIssuingRule); > use Koha::Branches; > > use base qw(Koha::Object); >@@ -73,6 +73,49 @@ sub holding_branch { > return $self->{_holding_branch}; > } > >+=head3 can_article_request >+ >+my $bool = $item->can_article_request( $borrower ) >+ >+Returns true if item can be specifically requested >+ >+$borrower must be a Koha::Borrower object >+ >+=cut >+ >+sub can_article_request { >+ my ( $self, $borrower ) = @_; >+ >+ my $rule = $self->article_request_type($borrower); >+ >+ return 1 if $rule && $rule ne 'no' && $rule ne 'bib_only'; >+ return q{}; >+} >+ >+=head3 article_request_type >+ >+my $type = $item->article_request_type( $borrower ) >+ >+returns 'yes', 'no', 'bib_only', or 'item_only' >+ >+$borrower must be a Koha::Borrower object >+ >+=cut >+ >+sub article_request_type { >+ my ( $self, $borrower ) = @_; >+ >+ my $branch_control = C4::Context->preference('HomeOrHoldingBranch'); >+ my $branchcode = >+ $branch_control eq 'homebranch' ? $self->homebranch >+ : $branch_control eq 'holdingbranch' ? $self->holdingbranch >+ : undef; >+ my $borrowertype = $borrower->categorycode; >+ my $itemtype = $self->effective_itemtype(); >+ my $rules = GetIssuingRule( $borrowertype, $itemtype, $branchcode ); >+ >+ return $rules->{article_requests} || q{}; >+} > > =head3 type > >diff --git a/Koha/Schema/Result/ArticleRequest.pm b/Koha/Schema/Result/ArticleRequest.pm >index ffa282b..03f5b1d 100644 >--- a/Koha/Schema/Result/ArticleRequest.pm >+++ b/Koha/Schema/Result/ArticleRequest.pm >@@ -82,6 +82,18 @@ __PACKAGE__->table("article_requests"); > data_type: 'text' > is_nullable: 1 > >+=head2 status >+ >+ data_type: 'enum' >+ default_value: 'OPEN' >+ extra: {list => ["OPEN","PROCESSING","COMPLETED","CANCELED"]} >+ is_nullable: 0 >+ >+=head2 notes >+ >+ data_type: 'text' >+ is_nullable: 1 >+ > =head2 created_on > > data_type: 'timestamp' >@@ -120,6 +132,15 @@ __PACKAGE__->add_columns( > { data_type => "text", is_nullable => 1 }, > "chapters", > { data_type => "text", is_nullable => 1 }, >+ "status", >+ { >+ data_type => "enum", >+ default_value => "OPEN", >+ extra => { list => ["OPEN", "PROCESSING", "COMPLETED", "CANCELED"] }, >+ is_nullable => 0, >+ }, >+ "notes", >+ { data_type => "text", is_nullable => 1 }, > "created_on", > { > data_type => "timestamp", >@@ -200,8 +221,8 @@ __PACKAGE__->belongs_to( > ); > > >-# Created by DBIx::Class::Schema::Loader v0.07040 @ 2015-07-28 10:40:02 >-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Gcq0lkNV972sKkcueQq19w >+# Created by DBIx::Class::Schema::Loader v0.07040 @ 2015-09-02 13:10:22 >+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KfP2PsyQthZxHfzWAOxGIg > > > # You can replace this text with custom code or comments, and it will be preserved on regeneration >diff --git a/Koha/Template/Plugin/Biblio.pm b/Koha/Template/Plugin/Biblio.pm >index 3f9cc4f..79a6df0 100644 >--- a/Koha/Template/Plugin/Biblio.pm >+++ b/Koha/Template/Plugin/Biblio.pm >@@ -23,6 +23,8 @@ use Template::Plugin; > use base qw( Template::Plugin ); > > use Koha::Holds; >+use Koha::Biblios; >+use Koha::Borrowers; > > sub HoldsCount { > my ( $self, $biblionumber ) = @_; >@@ -32,4 +34,13 @@ sub HoldsCount { > return $holds->count(); > } > >+sub CanArticleRequest { >+ my ( $self, $biblionumber, $borrowernumber ) = @_; >+ >+ my $biblio = Koha::Biblios->find( $biblionumber ); >+ my $borrower = Koha::Borrowers->find( $borrowernumber ); >+ >+ return $biblio ? $biblio->can_article_request( $borrower ) : 0; >+} >+ > 1; >diff --git a/circ/article-request-slip.pl b/circ/article-request-slip.pl >new file mode 100755 >index 0000000..b7929f1 >--- /dev/null >+++ b/circ/article-request-slip.pl >@@ -0,0 +1,66 @@ >+#!/usr/bin/perl >+ >+# Copyright 2015 ByWater Solutions >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use CGI qw( -utf8 ); >+ >+use C4::Context; >+use C4::Output; >+use C4::Auth; >+use Koha::ArticleRequests; >+ >+my $cgi = new CGI; >+ >+my $id = $cgi->param('id'); >+ >+my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >+ { >+ template_name => "circ/printslip.tt", >+ query => $cgi, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => { circulate => "circulate_remaining_permissions" }, >+ } >+); >+ >+my $ar = Koha::ArticleRequests->find($id); >+ >+$template->param( article_request => $ar ); >+ >+my $slip = C4::Letters::GetPreparedLetter( >+ module => 'circulation', >+ letter_code => 'AR_PRINT', >+ 'message_transport_type' => 'print', >+ tables => { >+ 'article_requests' => $ar->id, >+ 'borrowers' => $ar->borrowernumber, >+ 'biblio' => $ar->biblionumber, >+ 'items' => $ar->itemnumber, >+ }, >+); >+ >+$template->param( >+ slip => $slip->{content}, >+ caller => 'article-request', >+ plain => !$slip->{is_html}, >+); >+ >+output_html_with_http_headers $cgi, $cookie, $template->output; >+ >diff --git a/circ/article-requests.pl b/circ/article-requests.pl >new file mode 100755 >index 0000000..3980e39 >--- /dev/null >+++ b/circ/article-requests.pl >@@ -0,0 +1,44 @@ >+#!/usr/bin/perl >+ >+# Copyright 2015 ByWater Solutions >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use CGI qw ( -utf8 ); >+ >+use C4::Auth; >+use C4::Output; >+use Koha::ArticleRequests; >+ >+my $query = new CGI; >+my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >+ { >+ template_name => "circ/article-requests.tt", >+ query => $query, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => { circulate => "circulate_remaining_permissions" }, >+ } >+); >+ >+$template->param( >+ article_requests_open => scalar Koha::ArticleRequests->open(), >+ article_requests_processing => scalar Koha::ArticleRequests->processing(), >+); >+ >+output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/circ/request-article-cancel.pl b/circ/request-article-cancel.pl >new file mode 100755 >index 0000000..23a999d >--- /dev/null >+++ b/circ/request-article-cancel.pl >@@ -0,0 +1,45 @@ >+#!/usr/bin/perl >+ >+# Copyright 2015 >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use CGI qw ( -utf8 ); >+ >+use C4::Output; >+use C4::Auth; >+use Koha::ArticleRequests; >+ >+my $cgi = new CGI; >+ >+my ( $template, $librarian, $cookie, $flags ) = get_template_and_user( >+ { >+ template_name => "circ/request-article.tt", >+ query => $cgi, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => { circulate => 'circulate_remaining_permissions' }, >+ } >+); >+ >+my $id = $cgi->param('id'); >+my $ar = Koha::ArticleRequests->find($id); >+$ar->cancel(); >+my $biblionumber = $ar->biblionumber; >+ >+print $cgi->redirect("/cgi-bin/koha/circ/request-article.pl?biblionumber=$biblionumber"); >diff --git a/circ/request-article-do.pl b/circ/request-article-do.pl >new file mode 100755 >index 0000000..eee2c8a >--- /dev/null >+++ b/circ/request-article-do.pl >@@ -0,0 +1,68 @@ >+#!/usr/bin/perl >+ >+# Copyright ByWater Solutions 2015 >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use CGI qw ( -utf8 ); >+ >+use C4::Auth; >+use C4::Output; >+ >+use Koha::ArticleRequest; >+ >+my $cgi = new CGI; >+ >+my ( $template, $librarian, $cookie, $flags ) = get_template_and_user( >+ { >+ template_name => "circ/request-article.tt", >+ query => $cgi, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => { circulate => 'circulate_remaining_permissions' }, >+ } >+); >+ >+my $biblionumber = $cgi->param('biblionumber'); >+my $borrowernumber = $cgi->param('borrowernumber'); >+ >+my $itemnumber = $cgi->param('itemnumber') || undef; >+my $title = $cgi->param('title') || undef; >+my $author = $cgi->param('author') || undef; >+my $volume = $cgi->param('volume') || undef; >+my $issue = $cgi->param('issue') || undef; >+my $date = $cgi->param('date') || undef; >+my $pages = $cgi->param('pages') || undef; >+my $chapters = $cgi->param('chapters') || undef; >+ >+my $ar = Koha::ArticleRequest->new( >+ { >+ borrowernumber => $borrowernumber, >+ biblionumber => $biblionumber, >+ itemnumber => $itemnumber, >+ title => $title, >+ author => $author, >+ volume => $volume, >+ issue => $issue, >+ date => $date, >+ pages => $pages, >+ chapters => $chapters, >+ } >+)->store(); >+ >+print $cgi->redirect("/cgi-bin/koha/circ/request-article.pl?biblionumber=$biblionumber"); >diff --git a/circ/request-article.pl b/circ/request-article.pl >new file mode 100755 >index 0000000..20ee9d6 >--- /dev/null >+++ b/circ/request-article.pl >@@ -0,0 +1,53 @@ >+#!/usr/bin/perl >+ >+# Copyright 2015 ByWater Solutions >+# Copyright 2000-2002 Katipo Communications >+# Copyright 2011 Catalyst IT >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use C4::Output; >+use C4::Auth; >+use Koha::Biblios; >+use Koha::Borrowers; >+use Koha::ArticleRequests; >+ >+my $input = new CGI; >+ >+my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user( >+ { >+ template_name => "circ/request-article.tt", >+ query => $input, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => { circulate => 'circulate_remaining_permissions' }, >+ } >+); >+ >+my $biblionumber = $input->param('biblionumber'); >+my $patron_cardnumber = $input->param('patron_cardnumber'); >+ >+my $biblio = Koha::Biblios->find($biblionumber); >+my $patron = Koha::Borrowers->find( { cardnumber => $patron_cardnumber } ); >+ >+$template->param( >+ biblio => $biblio, >+ patron => $patron, >+); >+ >+output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/installer/data/mysql/atomicupdate/bug_14610.sql b/installer/data/mysql/atomicupdate/bug_14610.sql >index 0611768..781af4f 100644 >--- a/installer/data/mysql/atomicupdate/bug_14610.sql >+++ b/installer/data/mysql/atomicupdate/bug_14610.sql >@@ -10,6 +10,8 @@ CREATE TABLE `koha_kohaqa`.`article_requests` ( > `date` TEXT NULL DEFAULT NULL , > `pages` TEXT NULL DEFAULT NULL , > `chapters` TEXT NULL DEFAULT NULL , >+ `status` enum('OPEN','PROCESSING','COMPLETED','CANCELED') NOT NULL DEFAULT 'OPEN', >+ `notes` text, > `created_on` TIMESTAMP NOT NULL , > `updated_on` TIMESTAMP NULL DEFAULT NULL , > INDEX ( `borrowernumber` ), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc >index 4258aa3..9c123a4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc >@@ -26,6 +26,7 @@ > [% IF ( holdsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio_object_id %]">Holds ([% Biblio.HoldsCount( biblio_object_id ) %])</a></li> > [% END %] > [% IF ( EasyAnalyticalRecords ) %][% IF ( analyze ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio_object_id %]&analyze=1">Analytics</a></li>[% END %] >+ [% IF ( article_requests_view ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% IF ( object ) %][% object %][% ELSE %][% biblionumber %][% END %]">Article requests</a></li> > > [% IF ( subscriptionsnumber ) %]<li><a href="/cgi-bin/koha/serials/serials-search.pl?searched=1&biblionumber=[% biblio_object_id %]">Subscription(s)</a></li>[% END %] > </ul> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >index 4b1c94b..a49344a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -536,6 +536,7 @@ var holdForPatron = function () { > <a id="reserve_[% SEARCH_RESULT.biblionumber %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Holds</a> > [% IF ( holdfor ) %] <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]&findborrower=[% holdfor_cardnumber %]">Place hold for [% holdfor_firstname %] [% holdfor_surname %] ([% holdfor_cardnumber %])</a></span>[% END %] > [% END %] >+ | <a id="requst_article_[% SEARCH_RESULT.biblionumber %]" href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Request article</a> > [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] > | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Edit record</a> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt >new file mode 100644 >index 0000000..d8d2500 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt >@@ -0,0 +1,352 @@ >+[% USE KohaDates %] >+[% USE ItemTypes %] >+[% USE Branches %] >+[% USE AuthorisedValues %] >+ >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Circulation › Article requests</title> >+[% INCLUDE 'doc-head-close.inc' %] >+<style type="text/css"> p { margin-top: 0; }</style> >+</head> >+ >+<body id="circ_view_holdsqueue" class="circ"> >+ [% INCLUDE 'header.inc' %] >+ [% INCLUDE 'cat-search.inc' %] >+ >+ <script type="text/javascript">//<![CDATA[ >+ $(document).ready(function() { >+ $('#article-request-tabs').tabs(); >+ }); >+ >+ function PrintSlip(link) { >+ window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top'); >+ } >+ >+ function Cancel( id, a ) { >+ notes = prompt("Reason for cancelation:"); >+ if ( notes == null ) { >+ return; >+ } >+ >+ a.closest('td').prepend('<img src="[% interface %]/[% theme %]/img/loading-small.gif"/>'); >+ a.closest('div').hide(); >+ $.ajax({ >+ type: "POST", >+ url: '/cgi-bin/koha/svc/article_request', >+ data: { >+ action: 'cancel', >+ id: id, >+ notes: notes >+ }, >+ success: function( data ) { >+ a.closest('tr').remove(); >+ }, >+ dataType: 'json' >+ }); >+ } >+ >+ function Process( id, a ) { >+ a.closest('td').prepend('<img src="[% interface %]/[% theme %]/img/loading-small.gif"/>'); >+ a.closest('div').hide(); >+ $.ajax({ >+ type: "POST", >+ url: '/cgi-bin/koha/svc/article_request', >+ data: { >+ action: 'process', >+ id: id, >+ }, >+ success: function( data ) { >+ a.closest('tr').remove(); >+ }, >+ dataType: 'json' >+ }); >+ } >+ >+ function Complete( id, a ) { >+ a.closest('td').prepend('<img src="[% interface %]/[% theme %]/img/loading-small.gif"/>'); >+ a.closest('div').hide(); >+ $.ajax({ >+ type: "POST", >+ url: '/cgi-bin/koha/svc/article_request', >+ data: { >+ action: 'complete', >+ id: id, >+ }, >+ success: function( data ) { >+ a.closest('tr').remove(); >+ }, >+ dataType: 'json' >+ }); >+ } >+ //]]></script> >+ >+ <div id="breadcrumbs"> >+ <a href="/cgi-bin/koha/mainpage.pl">Home</a> >+ › >+ <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> >+ › >+ <a href="/cgi-bin/koha/circ/article-requests.pl">Article requests</a> >+ </div> >+ >+<div id="doc" class="yui-t7"> >+ <div id="bd"> >+ <div id="yui-main"> >+ <div class="yui-g"> >+ >+ <h1>Article requests</h1> >+ >+ <div id="article-request-tabs" class="toptabs"> >+ <ul> >+ <li><a href="#article-requests-open">Open ([% article_requests_open.count %])</a></li> >+ <li><a href="#article-requests-processing">Processing ([% article_requests_processing.count %])</a></li> >+ </ul> >+ >+ <div id="article-requests-open"> >+ [% IF article_requests_open.count %] >+ <table id="article-requests-processing-open-table"> >+ <thead> >+ <tr> >+ <th class="ar-title">Title</th> >+ <th class="ar-request">Requested article</th> >+ <th class="ar-collection">Collection</th> >+ <th class="ar-itemtype">Item type</th> >+ <th class="ar-callnumber">Call number</th> >+ <th class="ar-copynumber">Copy number</th> >+ <th class="ar-enumchron">Enumeration</th> >+ <th class="ar-barcode">Barcode</th> >+ <th class="ar-patron">Patron</th> >+ <th class="ar-date">Date</th> >+ <th class="ar-actions">Actions</th> >+ </tr> >+ </thead> >+ >+ <tbody> >+ [% FOREACH ar IN article_requests_open %] >+ <tr> >+ <td class="ar-title"> >+ <p> >+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% ar.biblionumber %]"> >+ <strong>[% ar.biblio.title | html %]</strong> >+ [% FOREACH s IN itemsloo.subtitle %] [% s %][% END %] >+ </a> >+ </p> >+ >+ <p> >+ <div class="ar-biblionumber content_hidden">[% ar.biblionumber %]</div> >+ <div class="ar-author">[% ar.biblio.author %]</div> >+ <div class="ar-pubdata"> >+ [% ar.biblio.biblioitem.publishercode %] >+ >+ [% IF ar.biblio.biblioitem.publicationyear %] >+ , [% ar.biblio.biblioitem.publicationyear %] >+ [% ELSIF ar.biblio.copyrightdate %] >+ , [% ar.biblio.copyrightdate %] >+ [% END %] >+ >+ [% IF ar.biblio.biblioitem.pages %] >+ : [% ar.biblio.biblioitem.pages %] >+ [% END %] >+ >+ [% r.biblio.biblioitem.size %] >+ >+ [% IF ar.biblio.biblioitem.isbn %] >+ ISBN: [% ar.biblio.biblioitem.isbn %] >+ [% END %] >+ </div> >+ </p> >+ </td> >+ <td class="ar-request"> >+ [% IF ar.title %] <p><strong>Title:</strong> [% ar.title %] </p> [% END %] >+ [% IF ar.author %] <p><strong>Author:</strong> [% ar.author %] </p> [% END %] >+ [% IF ar.volume %] <p><strong>Volume:</strong> [% ar.volume %] </p> [% END %] >+ [% IF ar.issue %] <p><strong>Issue:</strong> [% ar.issue %] </p> [% END %] >+ [% IF ar.date %] <p><strong>Date:</strong> [% ar.date %] </p> [% END %] >+ [% IF ar.pages %] <p><strong>Pages:</strong> [% ar.pages %] </p> [% END %] >+ [% IF ar.chapters %] <p><strong>Chapters:</strong> [% ar.chapters %] </p> [% END %] >+ </td> >+ <td class="ar-collection">[% AuthorisedValues.GetByCode( 'CCODE', ar.item.ccode ) %]</td> >+ <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) %]</td> >+ <td class="ar-callnumber"> >+ [% IF ar.item.location %] >+ <em>[% AuthorisedValues.GetByCode( 'LOC', ar.item.location ) %]</em> >+ [% END %] >+ >+ [% ar.item.itemcallnumber %] >+ </td> >+ <td class="ar-copynumber">[% ar.item.copynumber %]</td> >+ <td class="ar-enumchron">[% ar.item.enumchron %]</td> >+ <td class="ar-barcode">[% ar.item.barcode %]</td> >+ <td class="ar-patron"> >+ <p> >+ <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber %]"> >+ [% ar.borrower.surname %], [% ar.borrower.firstname %] ([% ar.borrower.cardnumber %]) >+ </a> >+ </p> >+ >+ <p>[% ar.borrower.phone %]</p> >+ </td> >+ <td class="ar-date"><span title="[% ar.created_on %]">[% ar.created_on | $KohaDates %]</span></td> >+ <td class="ar-actions"> >+ <div class="dropdown"> >+ <a class="btn btn-mini dropdown-toggle" id="ar-actions" role="button" data-toggle="dropdown" href="#"> >+ Actions <b class="caret"></b> >+ </a> >+ >+ <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="ar-actions"> >+ <li> >+ <a href="#" onclick="Process( [% ar.id %], $(this) ); return false;"> >+ <i class="icon-ok-circle"></i> >+ Process request >+ </a> >+ >+ <a href="#" onclick="Complete( [% ar.id %], $(this) ); return false;"> >+ <i class="icon-ok-circle"></i> >+ Complete request >+ </a> >+ >+ <a href="#" onclick="Cancel( [% ar.id %], $(this) ); return false;"> >+ <i class="icon-remove-circle"></i> >+ Cancel request >+ </a> >+ >+ <a href="#" onclick="PrintSlip('article-request-slip.pl?id=[% ar.id %]'); return false;"> >+ <i class="icon-print"></i> >+ Print slip >+ </a> >+ </li> >+ </ul> >+ </div> >+ </td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ [% ELSE %] >+ There are currently no open article requests. >+ [% END %] >+ </div> >+ >+ <div id="article-requests-processing"> >+ [% IF article_requests_processing.count %] >+ <table id="article-requests-processing-table"> >+ <thead> >+ <tr> >+ <th class="ar-title">Title</th> >+ <th class="ar-request">Requested article</th> >+ <th class="ar-collection">Collection</th> >+ <th class="ar-itemtype">Item type</th> >+ <th class="ar-callnumber">Call number</th> >+ <th class="ar-copynumber">Copy number</th> >+ <th class="ar-enumchron">Enumeration</th> >+ <th class="ar-barcode">Barcode</th> >+ <th class="ar-patron">Patron</th> >+ <th class="ar-date">Date</th> >+ <th class="ar-actions">Actions</th> >+ </tr> >+ </thead> >+ >+ <tbody> >+ [% FOREACH ar IN article_requests_processing %] >+ <tr> >+ <td class="ar-title"> >+ <p> >+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% ar.biblionumber %]"> >+ <strong>[% ar.biblio.title | html %]</strong> >+ [% FOREACH s IN itemsloo.subtitle %] [% s %][% END %] >+ </a> >+ </p> >+ >+ <p> >+ <div class="ar-biblionumber content_hidden">[% ar.biblionumber %]</div> >+ <div class="ar-author">[% ar.biblio.author %]</div> >+ <div class="ar-pubdata"> >+ [% ar.biblio.biblioitem.publishercode %] >+ >+ [% IF ar.biblio.biblioitem.publicationyear %] >+ , [% ar.biblio.biblioitem.publicationyear %] >+ [% ELSIF ar.biblio.copyrightdate %] >+ , [% ar.biblio.copyrightdate %] >+ [% END %] >+ >+ [% IF ar.biblio.biblioitem.pages %] >+ : [% ar.biblio.biblioitem.pages %] >+ [% END %] >+ >+ [% r.biblio.biblioitem.size %] >+ >+ [% IF ar.biblio.biblioitem.isbn %] >+ ISBN: [% ar.biblio.biblioitem.isbn %] >+ [% END %] >+ </div> >+ </p> >+ </td> >+ <td class="ar-request"> >+ [% IF ar.title %] <p><strong>Title:</strong> [% ar.title %] </p> [% END %] >+ [% IF ar.author %] <p><strong>Author:</strong> [% ar.author %] </p> [% END %] >+ [% IF ar.volume %] <p><strong>Volume:</strong> [% ar.volume %] </p> [% END %] >+ [% IF ar.issue %] <p><strong>Issue:</strong> [% ar.issue %] </p> [% END %] >+ [% IF ar.date %] <p><strong>Date:</strong> [% ar.date %] </p> [% END %] >+ [% IF ar.pages %] <p><strong>Pages:</strong> [% ar.pages %] </p> [% END %] >+ [% IF ar.chapters %] <p><strong>Chapters:</strong> [% ar.chapters %] </p> [% END %] >+ </td> >+ <td class="ar-collection">[% AuthorisedValues.GetByCode( 'CCODE', ar.item.ccode ) %]</td> >+ <td class="ar-itemtype">[% ItemTypes.GetDescription( ar.item.effective_itemtype ) %]</td> >+ <td class="ar-callnumber"> >+ [% IF ar.item.location %] >+ <em>[% AuthorisedValues.GetByCode( 'LOC', ar.item.location ) %]</em> >+ [% END %] >+ >+ [% ar.item.itemcallnumber %] >+ </td> >+ <td class="ar-copynumber">[% ar.item.copynumber %]</td> >+ <td class="ar-enumchron">[% ar.item.enumchron %]</td> >+ <td class="ar-barcode">[% ar.item.barcode %]</td> >+ <td class="ar-patron"> >+ <p> >+ <a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% ar.borrower.cardnumber %]"> >+ [% ar.borrower.surname %], [% ar.borrower.firstname %] ([% ar.borrower.cardnumber %]) >+ </a> >+ </p> >+ >+ <p>[% ar.borrower.phone %]</p> >+ </td> >+ <td class="ar-date"><span title="[% ar.created_on %]">[% ar.created_on | $KohaDates %]</span></td> >+ <td class="ar-actions"> >+ <div class="dropdown"> >+ <a class="btn btn-mini dropdown-toggle" id="ar-actions" role="button" data-toggle="dropdown" href="#"> >+ Actions <b class="caret"></b> >+ </a> >+ >+ <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="ar-actions"> >+ <li> >+ <a href="#" onclick="Complete( [% ar.id %], $(this) ); return false;"> >+ <i class="icon-ok-circle"></i> >+ Complete request >+ </a> >+ >+ <a href="#" onclick="Cancel( [% ar.id %], $(this) ); return false;"> >+ <i class="icon-remove-circle"></i> >+ Cancel request >+ </a> >+ >+ <a href="#" onclick="PrintSlip('article-request-slip.pl?id=[% ar.id %]'); return false;"> >+ <i class="icon-print"></i> >+ Print slip >+ </a> >+ </li> >+ </ul> >+ </div> >+ </td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ [% ELSE %] >+ There are currently no article requests being processed. >+ [% END %] >+ </div> >+ </div> >+ </div> >+ </div> >+ </div> >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt >index 9450aaa..a1b2e6b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt >@@ -41,6 +41,9 @@ > <li> <a href="/cgi-bin/koha/circ/pendingreserves.pl" title="holds to retrieve off the shelf">Holds to pull</a></li> > <li> <a href="/cgi-bin/koha/circ/waitingreserves.pl" title="holds waiting for patron pickup">Holds awaiting pickup</a></li> > <li> <a href="/cgi-bin/koha/circ/reserveratios.pl">Hold ratios</a></li> >+ <li> >+ <a href="/cgi-bin/koha/circ/article-requests.pl" title="Article requests">Article requests</a> >+ </li> > <li> <a href="/cgi-bin/koha/circ/transferstoreceive.pl" title="transfers to receive at your library">Transfers to receive</a></li> > [% IF ( CAN_user_circulate_overdues_report ) %]<li> <a href="/cgi-bin/koha/circ/overdue.pl">Overdues</a> > - <b>Warning:</b> This report is very resource intensive on >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt >new file mode 100644 >index 0000000..2c45af7 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt >@@ -0,0 +1,245 @@ >+[% USE KohaDates %] >+[% SET article_requests_view = 1 %] >+[% SET biblionumber = biblio.biblionumber %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Circulation › Request article</title> >+[% INCLUDE 'doc-head-close.inc' %] >+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >+[% INCLUDE 'datatables.inc' %] >+ >+<script type="text/javascript"> >+// <![CDATA[ >+$(document).ready(function() { >+ $( "#patron" ).autocomplete({ >+ source: "/cgi-bin/koha/circ/ysearch.pl", >+ minLength: 3, >+ select: function( event, ui ) { >+ $( "#patron" ).val( ui.item.cardnumber ); >+ $( "#holds_patronsearch" ).submit(); >+ return false; >+ } >+ }) >+ .data( "ui-autocomplete" )._renderItem = function( ul, item ) { >+ return $( "<li></li>" ) >+ .data( "ui-autocomplete-item", item ) >+ .append( "<a>" + item.surname + ", " + item.firstname + >+ " (" + item.cardnumber + ") <small>" + item.address + >+ " " + item.city + " " + item.zipcode + " " + >+ item.country + "</small></a>" ) >+ .appendTo( ul ); >+ }; >+}); >+// ]]> >+</script> >+</head> >+ >+<body id="circ_article_request" class="catalog"> >+ [% INCLUDE 'header.inc' %] >+ [% INCLUDE 'circ-search.inc' %] >+ >+ <div id="breadcrumbs"> >+ <a href="/cgi-bin/koha/mainpage.pl">Home</a> >+ › >+ <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a> >+ › >+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">[% biblio.title | html %]</a> >+ › >+ Request article >+ </div> >+ >+ <div id="doc3" class="yui-t2"> >+ <div id="bd"> >+ <div id="yui-main"> >+ <div class="yui-b"> >+ >+ <h1>Request article from <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.id %]">[% biblio.title | html %]</a></h1> >+ >+ [% UNLESS patron %] >+ <form id="article_requests_patronsearch" action="request-article.pl" method="post"> >+ <fieldset class="brief"> >+ <label for="patron">Patron: </label> >+ <div class="hint">Enter patron card number or partial name:</div> >+ <input type="text" size="40" id="patron" class="focus" name="patron_cardnumber" /> >+ <input type="submit" value="Search" /> >+ <input type="hidden" name="biblionumber" value="[% biblio.id %]" /> >+ </fieldset> >+ </form> >+ [% ELSE %] >+ [% IF biblio.can_article_request( patron ) %] >+ >+ <form id="place-article-request" method="post" action="/cgi-bin/koha/circ/request-article-do.pl"> >+ <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber %]" /> >+ <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.id %]" /> >+ >+ <fieldset class="rows"> >+ <legend>Place article request from [% biblio.title %] for [% patron.firstname %] [% patron.surname %] ( [% patron.cardnumber %] )</legend> >+ <p/> >+ <ul> >+ <li> >+ <label for="title">Title:</label> >+ <input type="text" name="title" id="title" size="50"/> >+ </li> >+ >+ <li> >+ <label for="author">Author:</label> >+ <input type="text" name="author" id="author" size="50"/> >+ </li> >+ >+ <li> >+ <label for="volume">Volume:</label> >+ <input type="text" name="volume" id="volume" size="50"/> >+ </li> >+ >+ <li> >+ <label for="issue">Issue:</label> >+ <input type="text" name="issue" id="issue" size="50"/> >+ </li> >+ >+ <li> >+ <label for="date">Date:</label> >+ <input type="text" name="date" id="date" size="50"/> >+ </li> >+ >+ <li> >+ <label for="pages">Pages:</label> >+ <input type="text" name="pages" id="pages" size="50"/> >+ </li> >+ >+ <li> >+ <label for="chapters">Chapters:</label> >+ <input type="text" name="chapters" id="pages" size="50"/> >+ </li> >+ </ul> >+ </fieldset> >+ >+ [% SET article_request_type = biblio.article_request_type( patron ) %] >+ [% IF article_request_type != 'bib_only' %] >+ <table class="copiesrow table table-bordered table-striped"> >+ <caption>Select item:</caption> >+ <thead> >+ <tr> >+ <th> </th> >+ <th>Item type</th> >+ <th>Barcode</th> >+ <th>Home library</th> >+ <th>Call number</th> >+ </tr> >+ </thead> >+ >+ <tbody> >+ [% FOREACH item IN biblio.items %] >+ [% IF item.can_article_request( patron ) %] >+ <tr> >+ <td> >+ [% IF article_request_type == 'item_only' && !checked %] >+ [% SET checked = 1 %] >+ <input type="radio" name="itemnumber" value="[% item.itemnumber %]" checked="checked" /> >+ [% ELSE %] >+ <input type="radio" name="itemnumber" value="[% item.itemnumber %]" /> >+ [% END %] >+ </td> >+ <td> >+ [% item.itype %] >+ </td> >+ <td> >+ [% item.barcode %] >+ </td> >+ <td> >+ [% item.homebranch %] >+ </td> >+ <td> >+ [% item.itemcallnumber %] >+ </td> >+ </tr> >+ [% END %] >+ [% END %] >+ >+ [% IF article_request_type != 'item_only' %] >+ <tr> >+ <td> >+ <input type="radio" name="itemnumber" value="" checked="checked"/> >+ </td> >+ <td colspan="4"> >+ Any item >+ </td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ [% END %] >+ >+ <p> >+ <input type="submit" class="btn" value="Place request" /> >+ </p> >+ </form> >+ [% ELSE %] >+ No article requests can be made for this record. >+ [% END %] >+ >+ [% END %] >+ >+ [% IF biblio.article_requests_current && !patron %] >+ <fieldset class="rows left"> >+ <legend>Current article requests</legend> >+ >+ <table> >+ <tr> >+ <th>Placed on</th> >+ <th>Patron</th> >+ <th>Title</th> >+ <th>Author</th> >+ <th>Volume</th> >+ <th>Issue</th> >+ <th>Date</th> >+ <th>Pages</th> >+ <th>Chapters</th> >+ <th>Item</th> >+ <th>Status</th> >+ <th> </th> >+ </tr> >+ >+ [% FOREACH ar IN biblio.article_requests_current %] >+ <tr> >+ <td>[% ar.created_on | $KohaDates %]</td> >+ <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% ar.borrowernumber %]">[% ar.borrower.firstname %] [% ar.borrower.surname %]</a></td> >+ <td>[% ar.title %]</td> >+ <td>[% ar.author %]</td> >+ <td>[% ar.volume %]</td> >+ <td>[% ar.issue %]</td> >+ <td>[% ar.date %]</td> >+ <td>[% ar.pages %]</td> >+ <td>[% ar.chapters %]</td> >+ <td> >+ [% IF ar.item %] >+ <a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% ar.itemnumber %]&biblionumber=[% ar.biblionumber %]">[% ar.item.barcode %]</a> >+ [% END %] >+ </td> >+ <td> >+ [% IF ar.status == 'OPEN' %] >+ Open >+ [% ELSIF ar.status == 'PROCESSING' %] >+ Processing >+ [% ELSIF ar.status == 'COMPLETED' %] >+ Completed >+ [% ELSIF ar.status == 'CANCELED' %] >+ Canceled >+ [% END %] >+ <td> >+ <a title="Cancel article request" href="/cgi-bin/koha/circ/request-article-cancel.pl?action=cancel&id=[% ar.id %]"> >+ <img src="/intranet-tmpl/prog/img/x.png" border="0" alt="Cancel"> >+ </a> >+ </td> >+ </tr> >+ [% END %] >+ </table> >+ </fieldset> >+ [% END %] >+ </div> >+ </div> >+ >+ <div class="yui-b"> >+ [% INCLUDE 'biblio-view-menu.inc' %] >+ </div> >+ </div> >+ </div> >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >index 8440526..b40d5c2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >@@ -113,8 +113,17 @@ > || ( CAN_user_borrowers && pending_borrower_modifications ) > || ( CAN_user_acquisition && pendingsuggestions ) > || ( CAN_user_borrowers && pending_discharge_requests ) >+ || pending_article_requests > ) %] > <div id="area-pending"> >+ [% IF pending_article_requests %] >+ <div class="pending-info" id="article_requests_pending"> >+ >+ <a href="/cgi-bin/koha/circ/article-requests.pl">Article requests</a>: >+ <span class="pending-number-link">[% pending_article_requests %]</span> >+ </div> >+ [% END %] >+ > [% IF ( CAN_user_acquisition && pendingsuggestions ) %] > <div class="pending-info" id="suggestions_pending"> > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc >index a4ef40e..f2a7697 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc >@@ -1,3 +1,4 @@ >+[% USE Biblio %] > <ul id="action"> > [% UNLESS ( norequests ) %] > [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] >@@ -8,6 +9,13 @@ > [% END %] > [% END %] > [% END %] >+ >+ [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] >+ [% IF Biblio.CanArticleRequest( biblionumber, borrowernumber ) %] >+ <li><a class="article_request" href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% biblionumber %]">Request article</a></li> >+ [% END %] >+ [% END %] >+ > <li><a class="print-large" href="#" onclick="window.print();">Print</a></li> > [% IF Koha.Preference( 'virtualshelves' ) == 1 %] > [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && loggedinusername ) %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt >new file mode 100644 >index 0000000..9f7f283 >--- /dev/null >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt >@@ -0,0 +1,157 @@ >+[% INCLUDE 'doc-head-open.inc' %] >+<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Request article</title> >+[% INCLUDE 'doc-head-close.inc' %] >+[% BLOCK cssinclude %][% END %] >+</head> >+ >+[% INCLUDE 'bodytag.inc' bodyid='opac-holds' %] >+[% INCLUDE 'masthead.inc' %] >+ >+<div class="main"> >+ <ul class="breadcrumb"> >+ <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li> >+ <li><a href="#">Request article</a></li> >+ </ul> >+ >+ <div class="container"> >+ [% IF biblio.can_article_request( patron ) %] >+ <h3>Place article request for [% biblio.title %]</h3> >+ >+ <form id="place-article-request" method="post" action="/cgi-bin/koha/opac-request-article-do.pl"> >+ <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber %]" /> >+ >+ <fieldset class="rows"> >+ <ul> >+ <li> >+ <label for="title">Title:</label> >+ <input type="text" name="title" id="title" size="50"/> >+ </li> >+ >+ <li> >+ <label for="author">Author:</label> >+ <input type="text" name="author" id="author" size="50"/> >+ </li> >+ >+ <li> >+ <label for="volume">Volume:</label> >+ <input type="text" name="volume" id="volume" size="50"/> >+ </li> >+ >+ <li> >+ <label for="issue">Issue:</label> >+ <input type="text" name="issue" id="issue" size="50"/> >+ </li> >+ >+ <li> >+ <label for="date">Date:</label> >+ <input type="text" name="date" id="date" size="50"/> >+ </li> >+ >+ <li> >+ <label for="pages">Pages:</label> >+ <input type="text" name="pages" id="pages" size="50"/> >+ </li> >+ >+ <li> >+ <label for="chapters">Chapters:</label> >+ <input type="text" name="chapters" id="chapters" size="50"/> >+ </li> >+ </ul> >+ </fieldset> >+ >+ [% SET article_request_type = biblio.article_request_type( patron ) %] >+ [% IF article_request_type != 'bib_only' %] >+ <table class="copiesrow table table-bordered table-striped"> >+ <caption>Select a specific item:</caption> >+ <thead> >+ <tr> >+ <th> </th> >+ <th>Item type</th> >+ <th>Barcode</th> >+ <th>Home library</th> >+ <th>Call number</th> >+ </tr> >+ </thead> >+ >+ <tbody> >+ [% FOREACH item IN biblio.items %] >+ [% IF item.can_article_request( patron ) %] >+ <tr> >+ <td> >+ [% IF article_request_type == 'item_only' && !checked %] >+ [% SET checked = 1 %] >+ <input type="radio" name="itemnumber" value="[% item.itemnumber %]" checked="checked" /> >+ [% ELSE %] >+ <input type="radio" name="itemnumber" value="[% item.itemnumber %]" /> >+ [% END %] >+ </td> >+ <td> >+ [% item.itype %] >+ </td> >+ <td> >+ [% item.barcode %] >+ </td> >+ <td> >+ [% item.homebranch %] >+ </td> >+ <td> >+ [% item.itemcallnumber %] >+ </td> >+ </tr> >+ [% END %] >+ [% END %] >+ >+ [% IF article_request_type != 'item_only' %] >+ <tr> >+ <td> >+ <input type="radio" name="itemnumber" value="" checked="checked"/> >+ </td> >+ <td colspan="4"> >+ Any item >+ </td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ [% END %] >+ >+ <input type="submit" class="btn" value="Place request" /> >+ </form> >+ [% ELSE %] >+ No article requests can be made for this record. >+ [% END %] >+ >+ </div> <!-- / .container --> >+</div> <!-- / .main --> >+ >+[% INCLUDE 'opac-bottom.inc' %] >+ >+[% BLOCK jsinclude %] >+<script type="text/javascript"> >+// <![CDATA[ >+ $('#place-article-request').on('submit', function( event ){ >+ if ( ! $("input:radio[name='itemnumber']").is(":checked") ) { >+ event.preventDefault(); >+ alert( _("Please select a specific item for this article request.") ); >+ return 0; >+ } >+ >+ if ( >+ $('#title').val() >+ || $('#author').val() >+ || $('#volume').val() >+ || $('#issue').val() >+ || $('#date').val() >+ || $('#pages').val() >+ || $('#chapters').val() >+ ) { >+ return 1; >+ } else { >+ event.preventDefault(); >+ alert( _("Please fill out at least one field to place article request.") ); >+ return 0; >+ } >+ }); >+// ]]> >+</script> >+[% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index da1d62d..7a70fbc 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -509,6 +509,10 @@ > [% END # UNLESS SEARCH_RESULT.norequests %] > [% END # IF RequestOnOpac %] > >+ [% IF ( Koha.Preference( 'opacuserlogin' ) == 1 ) %] >+ <span class="actions"><a class="article_request" href="/cgi-bin/koha/opac-request-article.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Request article</a></span> >+ [% END %] >+ > [% IF ( TagsInputEnabled ) %] > [% IF ( loggedinusername ) %] > <span class="actions"><a class="tag_add" id="tag_add[% SEARCH_RESULT.biblionumber %]" href="#">Add tag</a></span> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index b5bc8d2..5630d8a 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -112,6 +112,7 @@ > [% END %] > [% IF ( waiting_count ) %][% IF ( BORROWER_INF.atdestination ) %]<li><a href="#opac-user-waiting">Waiting ([% waiting_count %])</a></li>[% END %][% END %] > [% IF ( reserves_count ) %]<li><a href="#opac-user-holds">Holds ([% reserves_count %])</a></li>[% END %] >+ [% IF ( borrower.article_requests_current ) %]<li><a href="#opac-user-article-requests">Article requests ([% borrower.article_requests_current.count %])</a></li>[% END %] > </ul> > > <div id="opac-user-checkouts"> >@@ -667,6 +668,95 @@ > [% END %] > </div> <!-- / #opac-user-holds --> > [% END # / #reserves_count %] >+ >+ [% IF ( borrower.article_requests_current.count ) %] >+ <div id="opac-user-article-requests"> >+ <table id="article-requests-table" class="table table-bordered table-striped"> >+ <caption>Article requests <span class="count">([% borrower.article_requests_current.count %] total)</span></caption> >+ <!-- RESERVES TABLE ROWS --> >+ <thead> >+ <tr> >+ <th class="anti-the">Record title</th> >+ <th class="psort">Placed on</th> >+ <th class="anti-the">Title</th> >+ <th>Author</th> >+ <th>Volume</th> >+ <th>Issue</th> >+ <th>Date</th> >+ <th>Pages</th> >+ <th>Chapters</th> >+ <th>Status</th> >+ <th class="nosort"> </th> >+ </tr> >+ </thead> >+ >+ <tbody> >+ [% FOREACH ar IN borrower.article_requests_current %] >+ <td class="article-request-title"> >+ <a class="article-request-title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ar.biblionumber %]"> >+ [% ar.biblio.title %] >+ [% ar.item.enumchron %] >+ </a> >+ [% ar.biblio.author %] >+ [% IF ar.itemnumber %] <i>(only [% ar.item.barcode %])</i>[% END %] >+ </td> >+ >+ <td class="article-request-created_on"> >+ [% ar.created_on | $KohaDates %] >+ </td> >+ >+ <td class="article-request-title"> >+ [% ar.title %] >+ </td> >+ >+ <td class="article-request-author"> >+ [% ar.author %] >+ </td> >+ >+ <td class="article-request-volume"> >+ [% ar.volume %] >+ </td> >+ >+ <td class="article-request-issue"> >+ [% ar.issue %] >+ </td> >+ >+ <td class="article-request-date"> >+ [% ar.date %] >+ </td> >+ >+ <td class="article-request-pages"> >+ [% ar.pages %] >+ </td> >+ >+ <td class="article-request-chapters"> >+ [% ar.chapters %] >+ </td> >+ >+ <td class="article-request-status"> >+ [% IF ar.status == 'OPEN' %] >+ Open >+ [% ELSIF ar.status == 'PROCESSING' %] >+ Processing >+ [% ELSIF ar.status == 'COMPLETED' %] >+ Completed >+ [% ELSIF ar.status == 'CANCELED' %] >+ Canceled >+ [% END %] >+ </td> >+ >+ <td class="article-request-cancel"> >+ <span class="tdlabel">Cancel:</span> >+ <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> >+ <!-- TODO: replace MSG_CONFIRM_DELETE_HOLD with correct message --> >+ </td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ </div> <!-- / #opac-user-article-requests --> >+ [% END %] >+ > </div> <!-- /#opac-user-views --> > </div> <!-- /#userdetails --> > </div> <!-- /.span10 --> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/less/opac.less b/koha-tmpl/opac-tmpl/bootstrap/less/opac.less >index 6da32e5..f1f2af7 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/less/opac.less >+++ b/koha-tmpl/opac-tmpl/bootstrap/less/opac.less >@@ -266,6 +266,14 @@ td { > padding-left : 21px; > text-decoration : none; > } >+ &.article_request { >+ background-image : url("../images/sprite.png"); /* Place hold small */ >+ background-position : -2px -26px; >+ background-repeat: no-repeat; >+ margin-right : 1em; >+ padding-left : 21px; >+ text-decoration : none; >+ } > &.addtocart { > background-image : url("../images/sprite.png"); /* Cart small */ > background-position : -5px -572px; >@@ -1345,6 +1353,7 @@ a.print-large, > a.removeitems, > a.removeitems.disabled, > a.reserve, >+a.article_request, > a.send, > a.tag_add, > a.removefromlist, >@@ -1473,6 +1482,11 @@ a.reserve { > padding-left : 35px; > } > >+a.article_request { >+ background-position: 0px -24px; /* Place article request */ >+ padding-left : 35px; >+} >+ > a.send { > background-position : 2px -386px; /* Email */ > text-decoration : none; >@@ -2490,4 +2504,8 @@ a.reviewlink:visited { > font-size: 90%; > } > >+.btn-danger { >+ color: white !important; >+} >+ > @import "responsive.less"; >diff --git a/mainpage.pl b/mainpage.pl >index 1ccffad..c327e73 100755 >--- a/mainpage.pl >+++ b/mainpage.pl >@@ -30,6 +30,7 @@ use C4::Suggestions qw/CountSuggestion/; > use C4::Tags qw/get_count_by_tag_status/; > use Koha::Borrower::Modifications; > use Koha::Borrower::Discharge; >+use Koha::ArticleRequests; > > my $query = new CGI; > >@@ -67,6 +68,7 @@ my $pendingsuggestions = CountSuggestion("ASKED"); > my $pending_borrower_modifications = > Koha::Borrower::Modifications->GetPendingModificationsCount( $branch ); > my $pending_discharge_requests = Koha::Borrower::Discharge::count({ pending => 1 }); >+my $pending_article_requests = Koha::ArticleRequests->count(); > > $template->param( > pendingcomments => $pendingcomments, >@@ -74,6 +76,7 @@ $template->param( > pendingsuggestions => $pendingsuggestions, > pending_borrower_modifications => $pending_borrower_modifications, > pending_discharge_requests => $pending_discharge_requests, >+ pending_article_requests => $pending_article_requests, > ); > > # >diff --git a/opac/opac-article-request-cancel.pl b/opac/opac-article-request-cancel.pl >new file mode 100755 >index 0000000..baaa0ae >--- /dev/null >+++ b/opac/opac-article-request-cancel.pl >@@ -0,0 +1,47 @@ >+#!/usr/bin/perl >+ >+# Copyright 2015 >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use CGI qw ( -utf8 ); >+ >+use C4::Output; >+use C4::Auth; >+use Koha::ArticleRequests; >+ >+my $query = new CGI; >+ >+my ( $template, $borrowernumber, $cookie ) = get_template_and_user( >+ { >+ template_name => "opac-account.tt", >+ query => $query, >+ type => "opac", >+ authnotrequired => 0, >+ debug => 1, >+ } >+); >+ >+my $id = $query->param('id'); >+ >+if ( $id && $borrowernumber ) { >+ my $ar = Koha::ArticleRequests->find( $id ); >+ $ar->cancel() if $ar; >+} >+ >+print $query->redirect("/cgi-bin/koha/opac-user.pl#opac-user-article-requests"); >diff --git a/opac/opac-request-article-do.pl b/opac/opac-request-article-do.pl >new file mode 100755 >index 0000000..57c6e8c >--- /dev/null >+++ b/opac/opac-request-article-do.pl >@@ -0,0 +1,67 @@ >+#!/usr/bin/perl >+ >+# Copyright ByWater Solutions 2015 >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use CGI qw ( -utf8 ); >+ >+use C4::Auth; >+use C4::Output; >+ >+use Koha::ArticleRequest; >+ >+my $cgi = new CGI; >+ >+my ( $template, $borrowernumber, $cookie ) = get_template_and_user( >+ { >+ template_name => "opac-request-article.tt", >+ query => $cgi, >+ type => "opac", >+ authnotrequired => 0, >+ debug => 1, >+ } >+); >+ >+my $biblionumber = $cgi->param('biblionumber'); >+ >+my $itemnumber = $cgi->param('itemnumber') || undef; >+my $title = $cgi->param('title') || undef; >+my $author = $cgi->param('author') || undef; >+my $volume = $cgi->param('volume') || undef; >+my $issue = $cgi->param('issue') || undef; >+my $date = $cgi->param('date') || undef; >+my $pages = $cgi->param('pages') || undef; >+my $chapters = $cgi->param('chapters') || undef; >+ >+my $ar = Koha::ArticleRequest->new( >+ { >+ borrowernumber => $borrowernumber, >+ biblionumber => $biblionumber, >+ itemnumber => $itemnumber, >+ title => $title, >+ author => $author, >+ volume => $volume, >+ issue => $issue, >+ date => $date, >+ pages => $pages, >+ chapters => $chapters, >+ } >+)->store(); >+ >+print $cgi->redirect("/cgi-bin/koha/opac-user.pl#opac-user-article-requests"); >diff --git a/opac/opac-request-article.pl b/opac/opac-request-article.pl >new file mode 100755 >index 0000000..2577ec1 >--- /dev/null >+++ b/opac/opac-request-article.pl >@@ -0,0 +1,53 @@ >+#!/usr/bin/perl >+ >+# Copyright ByWater Solutions 2015 >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use CGI qw ( -utf8 ); >+ >+use C4::Auth; >+use C4::Output; >+ >+use Koha::Biblios; >+use Koha::Borrowers; >+ >+my $cgi = new CGI; >+ >+my ( $template, $borrowernumber, $cookie ) = get_template_and_user( >+ { >+ template_name => "opac-request-article.tt", >+ query => $cgi, >+ type => "opac", >+ authnotrequired => 0, >+ debug => 1, >+ } >+); >+ >+my $biblionumber = $cgi->param('biblionumber'); >+ >+my $biblio = Koha::Biblios->find($biblionumber); >+my $patron = Koha::Borrowers->find($borrowernumber); >+ >+$template->param( >+ biblio => $biblio, >+ patron => $patron, >+); >+ >+output_html_with_http_headers $cgi, $cookie, $template->output; >+ >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index d4fbbe3..05a1c7a 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -36,6 +36,7 @@ use C4::Letters; > use C4::Branch; # GetBranches > use Koha::DateUtils; > use Koha::Borrower::Debarments qw(IsDebarred); >+use Koha::Borrowers; > > use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE'; > >@@ -394,6 +395,7 @@ $template->param( > SuspendHoldsOpac => C4::Context->preference('SuspendHoldsOpac'), > AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'), > OpacHoldNotes => C4::Context->preference('OpacHoldNotes'), >+ borrower => Koha::Borrowers->find($borrowernumber), > ); > > output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/svc/article_request b/svc/article_request >new file mode 100755 >index 0000000..449aefd >--- /dev/null >+++ b/svc/article_request >@@ -0,0 +1,58 @@ >+#!/usr/bin/perl >+ >+# Copyright 2015 ByWater Solutions >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 2 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+# >+ >+use Modern::Perl; >+ >+use CGI; >+use JSON qw(to_json); >+ >+use C4::Auth qw(check_cookie_auth); >+use Koha::ArticleRequests; >+ >+my $cgi = new CGI; >+ >+my ( $auth_status, $sessionID ) = >+ check_cookie_auth( $cgi->cookie('CGISESSID'), { circulate => 'circulate_remaining_permissions' } ); >+if ( $auth_status ne "ok" ) { >+ exit 0; >+} >+ >+binmode STDOUT, ':encoding(UTF-8)'; >+print $cgi->header( -type => 'text/plain', -charset => 'UTF-8' ); >+ >+my $id = $cgi->param('id'); >+my $action = $cgi->param('action') || q{}; >+my $notes = $cgi->param('notes'); >+ >+my $ar = Koha::ArticleRequests->find($id); >+ >+if ($ar) { >+ if ( $action eq 'cancel' ) { >+ $ar = $ar->cancel( $notes ); >+ } >+ elsif ( $action eq 'process' ) { >+ $ar = $ar->process(); >+ } >+ elsif ( $action eq 'complete' ) { >+ $ar = $ar->complete(); >+ } >+} >+ >+print to_json( { success => $ar ? 1 : 0 } ); >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14610
:
42822
|
42823
|
42824
|
42825
|
42826
|
42827
|
42828
|
42829
|
43198
|
43199
|
43200
|
43201
|
43202
|
43264
|
43265
|
43266
|
43267
|
43268
|
43270
|
43271
|
43272
|
43273
|
43274
|
43278
|
43279
|
43280
|
43281
|
43282
|
43654
|
43655
|
43656
|
43657
|
43658
|
44219
|
44220
|
44221
|
44222
|
44223
|
44224
|
44225
|
44226
|
44227
|
44228
|
44229
|
44230
|
44231
|
44232
|
44233
|
44234
|
44235
|
44236
|
44237
|
44238
|
44239
|
44240
|
44241
|
44242
|
44916
|
44917
|
44918
|
44919
|
44920
|
44921
|
44922
|
44923
|
44924
|
44925
|
44926
|
45946
|
45947
|
45948
|
45949
|
45950
|
45951
|
45952
|
45953
|
45954
|
45955
|
45956
|
46518
|
46519
|
46520
|
46521
|
46522
|
46523
|
46524
|
46525
|
46526
|
46527
|
46528
|
46529
|
46530
|
46595
|
46596
|
46597
|
46598
|
46599
|
46600
|
46601
|
46602
|
46603
|
46604
|
46605
|
46606
|
46607
|
46608
|
46609
|
46610
|
46611
|
46612
|
47905
|
47906
|
47907
|
47908
|
47909
|
47910
|
47911
|
47912
|
47913
|
47914
|
47915
|
47916
|
47917
|
47918
|
47919
|
47920
|
47921
|
47922
|
48177
|
48178
|
48179
|
48180
|
48181
|
48182
|
48212
|
48213
|
48214
|
48215
|
48216
|
48217
|
48218
|
50348
|
50349
|
50350
|
50351
|
50352
|
50353
|
50354
|
51527
|
51528
|
51529
|
51530
|
51531
|
51532
|
51533
|
51534
|
51778
|
51779
|
51780
|
51781
|
51782
|
51783
|
52688
|
52689
|
52690
|
52691
|
52692
|
52693
|
55556
|
55557
|
55558
|
55559
|
55560
|
55561
|
55568
|
55569
|
56084
|
56085
|
56086
|
56087
|
56088
|
56089
|
56090
|
56318
|
56319
|
56320
|
56321
|
56322
|
56323
|
56324
|
56325
|
56326
|
56327
|
56328
|
56775
|
56776
|
56777
|
56778
|
56779
|
56780
|
56781
|
56782
|
56783
|
56784
|
56785
|
56816
|
56854
|
56855
|
56856
|
56857
|
56858
|
56859
|
56860
|
56861
|
56862
|
56863
|
56864
|
56865