Permalink
Browse files

Merge pull request #80 from hgq/10_07_pt14986797_4_08

10 07 pt14986797 4 08
  • Loading branch information...
ctfliblime committed Jul 20, 2011
2 parents 4c60e4f + 83818ae commit 4f204d360fa98d9cc1f905c64139c1d851dd27f2
View
@@ -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
@@ -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;
@@ -61,6 +61,7 @@ function Check(f) {
}
else {
document.getElementById('error'+i).style.backgroundColor='#ffffff';
+ document.getElementById('error'+i).style.color='#000000';
}
}
}
@@ -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 4f204d3

Please sign in to comment.