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> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com> Conflicts: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
This commit is contained in:
parent
d8a02bac94
commit
fa31fe3c0a
|
|
@ -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');
|
||||
|
|
@ -730,8 +731,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';
|
||||
|
|
@ -753,11 +759,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
|
||||
|
|
@ -870,13 +878,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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -285,6 +285,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);
|
||||
|
||||
|
|
@ -430,13 +436,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;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -731,11 +739,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);
|
||||
|
|
|
|||
|
|
@ -905,15 +905,18 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
|
|||
[% END %]<!-- tag -->
|
||||
[% END %]
|
||||
</div>
|
||||
[% END %]
|
||||
</div>
|
||||
<!-- Fields for fast add cataloguing -->
|
||||
[% END %]<!-- BIG_LOOP -->
|
||||
|
||||
</div><!-- tabs -->
|
||||
|
||||
[%# 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>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -272,10 +272,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>
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ function refocus(calendar) {
|
|||
</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 %]
|
||||
|
|
@ -360,10 +360,10 @@ function refocus(calendar) {
|
|||
[% 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 %]
|
||||
|
|
|
|||
Loading…
Reference in New Issue