From 9125eb7906358c1cc0b0eaa47355867e81f5e5a4 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 30 Oct 2015 13:12:49 -0400 Subject: [PATCH] Bug 14610 [QA Followup] - Change 'Open' to 'Pending' --- Koha/ArticleRequest.pm | 2 +- Koha/ArticleRequest/Status.pm | 4 ++-- Koha/ArticleRequests.pm | 6 +++--- Koha/Biblio.pm | 2 +- Koha/Borrower.pm | 2 +- circ/article-requests.pl | 2 +- installer/data/mysql/atomicupdate/bug_14610.sql | 4 ++-- installer/data/mysql/en/mandatory/sample_notices.sql | 2 +- .../intranet-tmpl/prog/en/modules/circ/article-requests.tt | 12 ++++++------ .../intranet-tmpl/prog/en/modules/circ/request-article.tt | 4 ++-- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 4 ++-- t/db_dependent/ArticleRequests.t | 10 +++++----- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Koha/ArticleRequest.pm b/Koha/ArticleRequest.pm index b578c15..4ecdf2b 100644 --- a/Koha/ArticleRequest.pm +++ b/Koha/ArticleRequest.pm @@ -48,7 +48,7 @@ Koha::ArticleRequest - Koha Article Request Object class sub open { my ($self) = @_; - $self->status(Koha::ArticleRequest::Status::Open); + $self->status(Koha::ArticleRequest::Status::Pending); $self->notify(); return $self; } diff --git a/Koha/ArticleRequest/Status.pm b/Koha/ArticleRequest/Status.pm index e3d4d3f..f66324b 100644 --- a/Koha/ArticleRequest/Status.pm +++ b/Koha/ArticleRequest/Status.pm @@ -19,8 +19,8 @@ package Koha::ArticleRequest::Status; use Modern::Perl; -sub Open { - return 'OPEN'; +sub Pending { + return 'PENDING'; } sub Processing { diff --git a/Koha/ArticleRequests.pm b/Koha/ArticleRequests.pm index c5c06ca..a8da805 100644 --- a/Koha/ArticleRequests.pm +++ b/Koha/ArticleRequests.pm @@ -38,13 +38,13 @@ Koha::ArticleRequests - Koha ArticleRequests Object class =cut -=head3 open +=head3 pending =cut -sub open { +sub pending { my ( $self, $branchcode ) = @_; - my $params = { status => Koha::ArticleRequest::Status::Open }; + my $params = { status => Koha::ArticleRequest::Status::Pending }; $params->{branchcode} = $branchcode if $branchcode; return Koha::ArticleRequests->search( $params ); } diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index b14cec9..c3a8c40 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -183,7 +183,7 @@ sub article_requests_current { { biblionumber => $self->biblionumber(), -or => [ - { status => Koha::ArticleRequest::Status::Open }, + { status => Koha::ArticleRequest::Status::Pending }, { status => Koha::ArticleRequest::Status::Processing } ] } diff --git a/Koha/Borrower.pm b/Koha/Borrower.pm index fc28599..95df917 100644 --- a/Koha/Borrower.pm +++ b/Koha/Borrower.pm @@ -84,7 +84,7 @@ sub article_requests_current { { borrowernumber => $self->id(), -or => [ - { status => Koha::ArticleRequest::Status::Open }, + { status => Koha::ArticleRequest::Status::Pending }, { status => Koha::ArticleRequest::Status::Processing } ] } diff --git a/circ/article-requests.pl b/circ/article-requests.pl index f716f53..816c736 100755 --- a/circ/article-requests.pl +++ b/circ/article-requests.pl @@ -40,7 +40,7 @@ my $branchcode = $query->param('branchcode') || C4::Context->userenv->{'branch'} $template->param( branchcode => $branchcode, - article_requests_open => scalar Koha::ArticleRequests->open($branchcode), + article_requests_pending => scalar Koha::ArticleRequests->pending($branchcode), article_requests_processing => scalar Koha::ArticleRequests->processing($branchcode), ); diff --git a/installer/data/mysql/atomicupdate/bug_14610.sql b/installer/data/mysql/atomicupdate/bug_14610.sql index 7c34c95..05ea170 100644 --- a/installer/data/mysql/atomicupdate/bug_14610.sql +++ b/installer/data/mysql/atomicupdate/bug_14610.sql @@ -19,7 +19,7 @@ CREATE TABLE IF NOT EXISTS `article_requests` ( `date` text, `pages` text, `chapters` text, - `status` enum('OPEN','PROCESSING','COMPLETED','CANCELED') NOT NULL DEFAULT 'OPEN', + `status` enum('PENDING','PROCESSING','COMPLETED','CANCELED') NOT NULL DEFAULT 'PENDING', `notes` text, `created_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `updated_on` timestamp NULL DEFAULT NULL, @@ -37,6 +37,6 @@ CREATE TABLE IF NOT EXISTS `article_requests` ( INSERT INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES ('circulation', 'AR_CANCELED', '', 'Article Request - Email - Canceled', 0, 'Article Request Canceled', '<> <> (<>)\r\n\r\nYour request for an article from <> (<>) has been canceled for the following reason:\r\n\r\n<>\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n', 'email'), ('circulation', 'AR_COMPLETED', '', 'Article Request - Email - Completed', 0, 'Article Request Completed', '<> <> (<>)\r\n\r\nWe are have completed your request for an article from <> (<>).\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n\r\nYou may pick your article up at <>.\r\n\r\nThank you!', 'email'), -('circulation', 'AR_OPEN', '', 'Article Request - Email - Open', 0, 'Article Request Recieved', '<> <> (<>)\r\n\r\nWe have received your request for an article from <> (<>).\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n\r\n\r\nThank you!', 'email'), +('circulation', 'AR_PENDING', '', 'Article Request - Email - Open', 0, 'Article Request Recieved', '<> <> (<>)\r\n\r\nWe have received your request for an article from <> (<>).\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n\r\n\r\nThank you!', 'email'), ('circulation', 'AR_SLIP', '', 'Article Request - Print Slip', 0, 'Test', 'Article Request:\r\n\r\n<> <> (<>)\r\n\r\nTitle: <>\r\nBarcode: <>\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n', 'print'), ('circulation', 'AR_PROCESSING', '', 'Article Request - Email - Processing', 0, 'Article Request Processing', '<> <> (<>)\r\n\r\nWe are now processing your request for an article from <> (<>).\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n\r\nThank you!', 'email'); diff --git a/installer/data/mysql/en/mandatory/sample_notices.sql b/installer/data/mysql/en/mandatory/sample_notices.sql index 9098c88..00ac9a6 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.sql +++ b/installer/data/mysql/en/mandatory/sample_notices.sql @@ -170,6 +170,6 @@ VALUES ('members','PASSWORD_RESET','','Online password reset',1,'Koha password r INSERT INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES ('circulation', 'AR_CANCELED', '', 'Article Request - Email - Canceled', 0, 'Article Request Canceled', '<> <> (<>)\r\n\r\nYour request for an article from <> (<>) has been canceled for the following reason:\r\n\r\n<>\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n', 'email'), ('circulation', 'AR_COMPLETED', '', 'Article Request - Email - Completed', 0, 'Article Request Completed', '<> <> (<>)\r\n\r\nWe are have completed your request for an article from <> (<>).\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n\r\nYou may pick your article up at <>.\r\n\r\nThank you!', 'email'), - ('circulation', 'AR_OPEN', '', 'Article Request - Email - Open', 0, 'Article Request Recieved', '<> <> (<>)\r\n\r\nWe have received your request for an article from <> (<>).\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n\r\n\r\nThank you!', 'email'), + ('circulation', 'AR_PENDING', '', 'Article Request - Email - Open', 0, 'Article Request Recieved', '<> <> (<>)\r\n\r\nWe have received your request for an article from <> (<>).\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n\r\n\r\nThank you!', 'email'), ('circulation', 'AR_SLIP', '', 'Article Request - Print Slip', 0, 'Test', 'Article Request:\r\n\r\n<> <> (<>)\r\n\r\nTitle: <>\r\nBarcode: <>\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n', 'print'), ('circulation', 'AR_PROCESSING', '', 'Article Request - Email - Processing', 0, 'Article Request Processing', '<> <> (<>)\r\n\r\nWe are now processing your request for an article from <> (<>).\r\n\r\nArticle requested:\r\nTitle: <>\r\nAuthor: <>\r\nVolume: <>\r\nIssue: <>\r\nDate: <>\r\nPages: <>\r\nChapters: <>\r\n\r\nThank you!', 'email'); 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 index d6afbfe..139443b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/article-requests.tt @@ -110,13 +110,13 @@
-
- [% IF article_requests_open.count %] - +
+ [% IF article_requests_pending.count %] +
@@ -134,7 +134,7 @@ - [% FOREACH ar IN article_requests_open %] + [% FOREACH ar IN article_requests_pending %]
Title

@@ -235,7 +235,7 @@

[% ELSE %] - There are currently no open article requests. + There are currently no pending article requests. [% END %]
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 index 63c3cb0..04fae7d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/request-article.tt @@ -292,8 +292,8 @@ $(document).ready(function() { [% END %] - [% IF ar.status == 'OPEN' %] - Open + [% IF ar.status == 'PENDING' %] + Pending [% ELSIF ar.status == 'PROCESSING' %] Processing [% ELSIF ar.status == 'COMPLETED' %] 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 f10180c..8bb1a7c 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -760,8 +760,8 @@ - [% IF ar.status == 'OPEN' %] - Open + [% IF ar.status == 'PENDING' %] + Pending [% ELSIF ar.status == 'PROCESSING' %] Processing [% ELSIF ar.status == 'COMPLETED' %] diff --git a/t/db_dependent/ArticleRequests.t b/t/db_dependent/ArticleRequests.t index 7d48ffa..78d5e87 100755 --- a/t/db_dependent/ArticleRequests.t +++ b/t/db_dependent/ArticleRequests.t @@ -79,14 +79,14 @@ my $article_request = Koha::ArticleRequest->new( $article_request = Koha::ArticleRequests->find( $article_request->id ); ok( $article_request->id, 'Koha::ArticleRequest created' ); -is( $article_request->status, Koha::ArticleRequest::Status::Open, 'New article request has status of Open' ); +is( $article_request->status, Koha::ArticleRequest::Status::Pending, 'New article request has status of Open' ); $article_request->process(); is( $article_request->status, Koha::ArticleRequest::Status::Processing, '$ar->process() changes status to Processing' ); $article_request->complete(); is( $article_request->status, Koha::ArticleRequest::Status::Completed, '$ar->complete() changes status to Completed' ); $article_request->cancel(); is( $article_request->status, Koha::ArticleRequest::Status::Canceled, '$ar->complete() changes status to Canceled' ); -$article_request->status(Koha::ArticleRequest::Status::Open); +$article_request->status(Koha::ArticleRequest::Status::Pending); $article_request->store(); is( $article_request->biblio->id, $biblio->id, '$ar->biblio() gets corrosponding Koha::Biblio object' ); @@ -105,7 +105,7 @@ is( $patron->article_requests_current()->count(), 0, 'Completed request not retu $article_request->cancel(); is( $patron->article_requests_current()->count(), 0, 'Canceled request not returned for article_requests_current' ); -$article_request->status(Koha::ArticleRequest::Status::Open); +$article_request->status(Koha::ArticleRequest::Status::Pending); $article_request->store(); is( $patron->article_requests_finished()->count(), 0, 'Open request returned for article_requests_finished' ); @@ -115,7 +115,7 @@ $article_request->complete(); $article_request->cancel(); is( $patron->article_requests_finished()->count(), 1, 'Canceled request not returned for article_requests_finished' ); -$article_request->status(Koha::ArticleRequest::Status::Open); +$article_request->status(Koha::ArticleRequest::Status::Pending); $article_request->store(); $ar = $biblio->article_requests(); @@ -130,7 +130,7 @@ is( $biblio->article_requests_current()->count(), 0, 'Completed request not retu $article_request->cancel(); is( $biblio->article_requests_current()->count(), 0, 'Canceled request not returned for article_requests_current' ); -$article_request->status(Koha::ArticleRequest::Status::Open); +$article_request->status(Koha::ArticleRequest::Status::Pending); $article_request->store(); is( $biblio->article_requests_finished()->count(), 0, 'Open request returned for article_requests_finished' ); -- 2.1.4