Bugzilla – Attachment 51531 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 [QA Followup] - Get rid of separate scripts just for creating new requests
Bug-14610-QA-Followup---Get-rid-of-separate-script.patch (text/plain), 11.55 KB, created by
Kyle M Hall (khall)
on 2016-05-16 13:42:28 UTC
(
hide
)
Description:
Bug 14610 [QA Followup] - Get rid of separate scripts just for creating new requests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-05-16 13:42:28 UTC
Size:
11.55 KB
patch
obsolete
>From eaba2f79c44d34b4e7df321d2cb520201f654203 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 16 Feb 2016 13:41:43 +0000 >Subject: [PATCH] Bug 14610 [QA Followup] - Get rid of separate scripts just > for creating new requests > >--- > circ/request-article-do.pl | 62 ---------------------- > circ/request-article.pl | 49 ++++++++++++++--- > .../prog/en/modules/circ/request-article.tt | 3 +- > .../bootstrap/en/modules/opac-request-article.tt | 3 +- > opac/opac-request-article-do.pl | 62 ---------------------- > opac/opac-request-article.pl | 33 ++++++++++++ > 6 files changed, 78 insertions(+), 134 deletions(-) > delete mode 100755 circ/request-article-do.pl > delete mode 100755 opac/opac-request-article-do.pl > >diff --git a/circ/request-article-do.pl b/circ/request-article-do.pl >deleted file mode 100755 >index 66fd3c5..0000000 >--- a/circ/request-article-do.pl >+++ /dev/null >@@ -1,62 +0,0 @@ >-#!/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; >- >-checkauth( $cgi, 0, { circulate => 'circulate_remaining_permissions' }, 'intranet' ); >- >-my $biblionumber = $cgi->param('biblionumber'); >-my $borrowernumber = $cgi->param('borrowernumber'); >-my $branchcode = $cgi->param('branchcode'); >- >-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, >- branchcode => $branchcode, >- 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 >index 448cac8..6c083d5 100755 >--- a/circ/request-article.pl >+++ b/circ/request-article.pl >@@ -26,26 +26,59 @@ use Koha::Biblios; > use Koha::Borrowers; > use Koha::ArticleRequests; > >-my $input = new CGI; >+my $cgi = new CGI; > > my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user( > { > template_name => "circ/request-article.tt", >- query => $input, >+ query => $cgi, > type => "intranet", > authnotrequired => 0, > flagsrequired => { circulate => 'circulate_remaining_permissions' }, > } > ); > >-my $biblionumber = $input->param('biblionumber'); >-my $patron_cardnumber = $input->param('patron_cardnumber'); >-my $patron_id = $input->param('patron_id'); >+my $action = $cgi->param('action') || q{}; >+my $biblionumber = $cgi->param('biblionumber'); >+my $patron_cardnumber = $cgi->param('patron_cardnumber'); >+my $patron_id = $cgi->param('patron_id'); > > my $biblio = Koha::Biblios->find($biblionumber); >-my $patron = Koha::Borrowers->find( $patron_id ? $patron_id : { cardnumber => $patron_cardnumber } ); >+my $patron = Koha::Borrowers->find( >+ $patron_id ? $patron_id : { cardnumber => $patron_cardnumber } ); > >-if (!$patron && $patron_cardnumber) { >+if ( $action eq 'create' ) { >+ my $borrowernumber = $cgi->param('borrowernumber'); >+ my $branchcode = $cgi->param('branchcode'); >+ >+ 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, >+ branchcode => $branchcode, >+ itemnumber => $itemnumber, >+ title => $title, >+ author => $author, >+ volume => $volume, >+ issue => $issue, >+ date => $date, >+ pages => $pages, >+ chapters => $chapters, >+ } >+ )->store(); >+ >+} >+ >+if ( !$patron && $patron_cardnumber ) { > my $results = C4::Utils::DataTables::Members::search( > { > searchmember => $patron_cardnumber, >@@ -71,4 +104,4 @@ $template->param( > patron => $patron, > ); > >-output_html_with_http_headers $input, $cookie, $template->output; >+output_html_with_http_headers $cgi, $cookie, $template->output; >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 0ce2cc7..e74e289 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 >@@ -161,7 +161,8 @@ $(document).ready(function() { > [% ELSE %] > [% IF biblio.can_article_request( patron ) %] > >- <form id="place-article-request" method="post" action="/cgi-bin/koha/circ/request-article-do.pl"> >+ <form id="place-article-request" method="post" action="/cgi-bin/koha/circ/request-article.pl"> >+ <input type="hidden" name="action" value="create" /> > <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber %]" /> > <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.id %]" /> > >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 >index 7937292..bb5042f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-request-article.tt >@@ -25,7 +25,8 @@ > > <h3>Place article request for [% biblio.title %]</h3> > >- <form id="place-article-request" method="post" action="/cgi-bin/koha/opac-request-article-do.pl"> >+ <form id="place-article-request" method="post" action="/cgi-bin/koha/opac-request-article.pl"> >+ <input type="hidden" name="action" value="create" /> > <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblio.biblionumber %]" /> > > <fieldset class="rows"> >diff --git a/opac/opac-request-article-do.pl b/opac/opac-request-article-do.pl >deleted file mode 100755 >index 921b8fd..0000000 >--- a/opac/opac-request-article-do.pl >+++ /dev/null >@@ -1,62 +0,0 @@ >-#!/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 ( $userid, $cookie, $sessionID ) = checkauth( $cgi, 0, {}, 'opac' ); >-my $borrowernumber = C4::Context->userenv->{'number'}; >- >-my $biblionumber = $cgi->param('biblionumber'); >-my $branchcode = $cgi->param('branchcode'); >- >-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, >- branchcode => $branchcode, >- 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 >index a5b1b83..5920366 100755 >--- a/opac/opac-request-article.pl >+++ b/opac/opac-request-article.pl >@@ -39,8 +39,41 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > } > ); > >+my $action = $cgi->param('action') || q{}; > my $biblionumber = $cgi->param('biblionumber'); > >+if ( $action eq 'create' ) { >+ my $branchcode = $cgi->param('branchcode'); >+ >+ 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, >+ branchcode => $branchcode, >+ 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"); >+ exit; >+} >+ > my $biblio = Koha::Biblios->find($biblionumber); > my $patron = Koha::Borrowers->find($borrowernumber); > >-- >2.1.4
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