Bugzilla – Attachment 14495 Details for
Bug 7253
fast cataloging not always checking out
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7253: fast cataloging not always checking out
Bug-7253-fast-cataloging-not-always-checking-out.patch (text/plain), 10.69 KB, created by
Paul Poulain
on 2013-01-09 14:42:32 UTC
(
hide
)
Description:
Bug 7253: fast cataloging not always checking out
Filename:
MIME Type:
Creator:
Paul Poulain
Created:
2013-01-09 14:42:32 UTC
Size:
10.69 KB
patch
obsolete
>From 6260f11174405437997ff47ca8995fdb5a120315 Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Mon, 7 Jan 2013 15:46:26 +0100 >Subject: [PATCH] Bug 7253: fast cataloging not always checking out > >When using fast cataloguing to create a biblio and item on the fly, workflow looses datas when a duplicate is detected. >This comes from the use of a mix of circborrowernumber and borrowernumber in forms. > >This patch corrects by using always circborrowernumber in fast cataloguing workflow. >Also adds html and uri escape for barecode where necessery. > >Test plan : >With duplicate : >- Go to a borrower circulation page >- Enter a non existing barcode >- Enter a due date >- Click on "Check Out" >=> a message says the barcode was not found >- Click on "Fast cataloguing" >=> The biblio edition page appears with fast cataloguing framework >- Fill mandatory fields by using an existing ISBN >- Click on "Save" >=> a yes/no message says "Duplicate record suspected" >(Choosing yes will brake fast caloguing workflow, in this case librarian should create an item and checkout again) >- Click on "No" >=> The item edition page appears with barcode already filled >- Fill mandatory datas >- Click on "Add item" >=> Borrower circulation page appears again, check that item has been checked out with the specified due date > >You may test without duplicate > >Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com> >Tested following the plan and by fast cataloging a non-duplicate. >All works as expected. > >Signed-off-by: koha.aixmarseille <koha.aixmarseille@gmail.com> >--- > cataloguing/addbiblio.pl | 34 ++++++++++++------ > cataloguing/additem.pl | 36 +++++++++++++------ > .../prog/en/modules/cataloguing/addbiblio.tt | 4 +- > .../prog/en/modules/cataloguing/additem.tt | 4 ++- > .../prog/en/modules/circ/circulation.tt | 6 ++-- > 5 files changed, 54 insertions(+), 30 deletions(-) > >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index caacd91..51b3c7a 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -39,6 +39,7 @@ use C4::Charset; > use Date::Calc qw(Today); > use MARC::File::USMARC; > use MARC::File::XML; >+use URI::Escape; > > if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { > MARC::File::XML->default_record_format('UNIMARC'); >@@ -725,8 +726,13 @@ my $redirect = $input->param('redirect'); > my $dbh = C4::Context->dbh; > my $hostbiblionumber = $input->param('hostbiblionumber'); > my $hostitemnumber = $input->param('hostitemnumber'); >+# fast cataloguing datas in transit >+my $fa_circborrowernumber = $input->param('circborrowernumber'); >+my $fa_barcode = $input->param('barcode'); >+my $fa_branch = $input->param('branch'); >+my $fa_stickyduedate = $input->param('stickyduedate'); >+my $fa_duedatespec = $input->param('duedatespec'); > >- > my $userflags = 'edit_catalogue'; > if ($frameworkcode eq 'FA'){ > $userflags = 'fast_cataloging'; >@@ -748,11 +754,13 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > > if ($frameworkcode eq 'FA'){ > # We need to grab and set some variables in the template for use on the additems screen >- $template->{VARS}->{'circborrowernumber'} = $input->param('borrowernumber'); >- $template->{VARS}->{'barcode'} = $input->param('barcode'); >- $template->{VARS}->{'branch'} = $input->param('branch'); >- $template->{VARS}->{'stickyduedate'} = $input->param('stickyduedate'); >- $template->{VARS}->{'duedatespec'} = $input->param('duedatespec'); >+ $template->param( >+ 'circborrowernumber' => $fa_circborrowernumber, >+ 'barcode' => $fa_barcode, >+ 'branch' => $fa_branch, >+ 'stickyduedate' => $fa_stickyduedate, >+ 'duedatespec' => $fa_duedatespec, >+ ); > } > > # Getting the list of all frameworks >@@ -865,13 +873,15 @@ if ( $op eq "addbiblio" ) { > } > if ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view")){ > if ($frameworkcode eq 'FA'){ >- my $borrowernumber = $input->param('circborrowernumber'); >- my $barcode = $input->param('barcode'); >- my $branch = $input->param('branch'); >- my $stickyduedate = $input->param('stickyduedate'); >- my $duedatespec = $input->param('duedatespec'); > print $input->redirect( >- "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode&borrowernumber=$borrowernumber&branch=$branch&barcode=$barcode&stickyduedate=$stickyduedate&duedatespec=$duedatespec" >+ '/cgi-bin/koha/cataloguing/additem.pl?' >+ .'biblionumber='.$biblionumber >+ .'&frameworkcode='.$frameworkcode >+ .'&circborrowernumber='.$fa_circborrowernumber >+ .'&branch='.$fa_branch >+ .'&barcode='.uri_escape($fa_barcode) >+ .'&stickyduedate='.$fa_stickyduedate >+ .'&duedatespec='.$fa_duedatespec > ); > exit; > } >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index c9875ca..d5f064e 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -314,6 +314,12 @@ my $itemnumber = $input->param('itemnumber'); > my $op = $input->param('op'); > my $hostitemnumber = $input->param('hostitemnumber'); > my $marcflavour = C4::Context->preference("marcflavour"); >+# fast cataloguing datas >+my $fa_circborrowernumber = $input->param('circborrowernumber'); >+my $fa_barcode = $input->param('barcode'); >+my $fa_branch = $input->param('branch'); >+my $fa_stickyduedate = $input->param('stickyduedate'); >+my $fa_duedatespec = $input->param('duedatespec'); > > my $frameworkcode = &GetFrameworkCode($biblionumber); > >@@ -506,13 +512,15 @@ if ($op eq "additem") { > undef($itemrecord); > } > } >- if ($frameworkcode eq 'FA' && $input->param('borrowernumber')){ >- my $redirect_string = 'borrowernumber=' . uri_escape($input->param('borrowernumber')) . >- '&barcode=' . uri_escape($input->param('barcode')); >- $redirect_string .= '&duedatespec=' . uri_escape($input->param('duedatespec')) . >- '&stickyduedate=1'; >- print $input->redirect("/cgi-bin/koha/circ/circulation.pl?" . $redirect_string); >- exit; >+ if ($frameworkcode eq 'FA' && $fa_circborrowernumber){ >+ print $input->redirect( >+ '/cgi-bin/koha/circ/circulation.pl?' >+ .'borrowernumber='.$fa_circborrowernumber >+ .'&barcode='.uri_escape($fa_barcode) >+ .'&duedatespec='.$fa_duedatespec >+ .'&stickyduedate=1' >+ ); >+ exit; > } > > >@@ -814,11 +822,15 @@ $template->param( > ); > > if ($frameworkcode eq 'FA'){ >- $template->{VARS}->{'borrowernumber'}=$input->param('borrowernumber'); >- $template->{VARS}->{'barcode'}=$input->param('barcode'); >- $template->{VARS}->{'stickyduedate'}=$input->param('stickduedate'); >- $template->{VARS}->{'duedatespec'}=$input->param('duedatespec'); >-} >+ # fast cataloguing datas >+ $template->param( >+ 'circborrowernumber' => $fa_circborrowernumber, >+ 'barcode' => $fa_barcode, >+ 'branch' => $fa_branch, >+ 'stickyduedate' => $fa_stickyduedate, >+ 'duedatespec' => $fa_duedatespec, >+ ); >+} > > foreach my $error (@errors) { > $template->param($error => 1); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >index 7d54142..a5ae0c6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt >@@ -571,13 +571,13 @@ function Changefwk(FwkList) { > > </div><!-- tabs --> > >-<!-- Fields for fast add cataloguing --> >+[%# Fields for fast cataloguing %] > <input type="hidden" name="barcode" value="[% barcode %]" /> > <input type="hidden" name="branch" value="[% branch %]" /> > <input type="hidden" name="circborrowernumber" value="[% circborrowernumber %]" /> > <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" /> > <input type="hidden" name="duedatespec" value="[% duedatespec %]" /> >-<!-- /End of fast add fields --> >+[%# End of fields for fast cataloguing %] > > </form> > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >index 0222046..3e25344 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -215,10 +215,12 @@ $(document).ready(function() { > <input type="submit" value="Save changes" onclick="return Check(this.form)" /> > [% END %]</fieldset> > >- <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> >+ [%# Fields for fast cataloguing %] >+ <input type="hidden" name="circborrowernumber" value="[% circborrowernumber %]" /> > <input type="hidden" name="stickyduedate" value="[% stickyduedate %]" /> > <input type="hidden" name="barcode" value="[% barcode %]" /> > <input type="hidden" name="duedatespec" value="[% duedatespec %]" /> >+ [%# End fields for fast cataloguing %] > > > </form> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index 9c045cd..f99812c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -400,7 +400,7 @@ function validate1(date) { > </p> > [% END %] > >- <input type="hidden" name="barcode" value="[% barcode %]" /> >+ <input type="hidden" name="barcode" value="[% barcode |html %]" /> > <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> > <input type="hidden" name="issueconfirmed" value="1" /> > [% IF ( DEBT ) %]<input type="hidden" name="debt_confirmed" value="1" />[% END %] >@@ -454,10 +454,10 @@ function validate1(date) { > [% END %] > > [% IF ( UNKNOWN_BARCODE ) %] >- <li>The barcode was not found [% barcode %]</li> >+ <li>The barcode was not found [% barcode |html %]</li> > [% IF ( fast_cataloging ) %] > [% IF ( CAN_user_editcatalogue_fast_cataloging ) %] >- <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA&barcode=[% barcode %]&borrowernumber=[% borrowernumber %]&branch=[% branch %]&duedatespec=[% duedatespec %]&stickyduedate=[% stickyduedate %]">Fast cataloging</a> >+ <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA&barcode=[% barcode |uri %]&circborrowernumber=[% borrowernumber %]&branch=[% branch %]&duedatespec=[% duedatespec %]&stickyduedate=[% stickyduedate %]">Fast cataloging</a> > [% END %] > [% END %] > [% END %] >-- >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 7253
:
14459
|
14489
|
14495
|
14536
|
15087
|
15218
|
15219
|
15220
|
15221