Skip to content
Browse files

[fixes #14986797] fixes for fastadd

- in circulation, allow creation of bib and item using FA framework which,
  after deliberation, is decided to be hardcoded rather than controlled by
  syspref.  If the FA framework doesn't exist yet, the librarian will get
  a friendly warning message but can proceed w/ fastadd and checkout using
  default framework
- get 952$c explicitly (the barcode) for displaying at top of framework in
  additem.pl, eliminating the bug that the field's text never displayed
  and merely left behind a hyphen since code previously used regex instead
  of hash keys.  This also incidentally fixes the bug that attempting to
  submit the form fails due to a JS error with trying to pass rmBarcode
  over a nondisplaying field
  • Loading branch information...
1 parent 4c60e4f commit 83818ae009f6f20417373385c1c694d6d6310073 @hgq hgq committed Jul 20, 2011
View
12 cataloguing/additem.pl
@@ -469,13 +469,11 @@
## Move barcode field to the top of the list.
my $barcode_index = 0;
-foreach my $i ( @$item ) {
- if ( $i->{'marc_lib'} =~ m/Barcode/ ) {
- last;
- }
- else {
- $barcode_index++;
- }
+for my $i(0..$#{$item}) {
+ if (($$item[$i]{tag} ~~ '952') && ($$item[$i]{subfield} ~~ 'p')) {
+ $barcode_index = $i;
+ last;
+ }
}
my @tmp = splice( @$item, $barcode_index, 1 );
my $t = $tmp[0];
View
10 circ/fastcat.pl
@@ -89,6 +89,10 @@
# my $session = get_session($sessionID);
#}
+## look for the 'FA' framework
+my %fw = %{C4::Koha::getframeworks() // {}};
+my $errNoFA = $fw{FA} ? 0:1;
+
if ($write_record) {
my $bib_record = MARC::Record->new();
my $author_tag = q{100};
@@ -128,8 +132,8 @@
MARC::Field->new( $publisher_tag, q{ }, q{ }, @publisher_fields );
$bib_record->append_fields($field);
}
-
- my ( $biblionumber, $biblioitemnumber ) = AddBiblio( $bib_record, q{} );
+ my $framework = $errNoFA? '' : 'FA';
+ my ( $biblionumber, $biblioitemnumber ) = AddBiblio( $bib_record, $framework );
my $item = {
itemnotes => $itemnotes,
@@ -198,6 +202,7 @@
}
$template->param(
+ errNoFA => $errNoFA,
fastcat => 1,
barcode => $barcode,
borrowernumber => $borrowernumber,
@@ -206,6 +211,7 @@
);
output_html_with_http_headers $query, $cookie, $template->output;
+exit;
sub get_item_type_loop {
my $dbh = shift;
View
1 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tmpl
@@ -61,6 +61,7 @@ function Check(f) {
}
else {
document.getElementById('error'+i).style.backgroundColor='#ffffff';
+ document.getElementById('error'+i).style.color='#000000';
}
}
}
View
7 koha-tmpl/intranet-tmpl/prog/en/modules/circ/fastcat.tmpl
@@ -10,6 +10,13 @@
<div id="yui-main">
<div class="yui-b"><div class="yui-g">
+<TMPL_IF NAME="errNoFA">
+<div class="alert"><span class=problem>Warning:</span> No &quot;FA&quot; framework found for fast add.
+Using default framework.<br>
+After adding this item, add the &quot;FA&quot; framework and change this bibliographic record's
+framework accordingly.
+</div>
+</TMPL_IF>
<h2>Add Brief Record For Barcode <!-- TMPL_VAR NAME="barcode" --></h2>
<form method="post" action="/cgi-bin/koha/circ/fastcat.pl">

0 comments on commit 83818ae

Please sign in to comment.
Something went wrong with that request. Please try again.