[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] koha/acqui.simple additem.pl [rel_2_2]
From: |
Joshua Ferraro |
Subject: |
[Koha-cvs] koha/acqui.simple additem.pl [rel_2_2] |
Date: |
Sat, 14 Apr 2007 15:40:12 +0000 |
CVSROOT: /sources/koha
Module name: koha
Branch: rel_2_2
Changes by: Joshua Ferraro <kados> 07/04/14 15:40:12
Modified files:
acqui.simple : additem.pl
Log message:
if there's a value already present, use it, even if value_builder is on.
This solves a problem where a plugin value would be lost when editing
a record.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/acqui.simple/additem.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.27.2.23&r2=1.27.2.24
Patches:
Index: additem.pl
===================================================================
RCS file: /sources/koha/koha/acqui.simple/Attic/additem.pl,v
retrieving revision 1.27.2.23
retrieving revision 1.27.2.24
diff -u -b -r1.27.2.23 -r1.27.2.24
--- additem.pl 28 Feb 2007 09:09:30 -0000 1.27.2.23
+++ additem.pl 14 Apr 2007 15:40:12 -0000 1.27.2.24
@@ -1,6 +1,6 @@
#!/usr/bin/perl
-# $Id: additem.pl,v 1.27.2.23 2007/02/28 09:09:30 toins Exp $
+# $Id: additem.pl,v 1.27.2.24 2007/04/14 15:40:12 kados Exp $
# Copyright 2000-2002 Katipo Communications
#
@@ -54,7 +54,7 @@
my $op = $input->param('op');
my $itemnum = $input->param('itemnum');
-
+warn "ADDITEM: $op";
# find itemtype
my $itemtype = &MARCfind_frameworkcode($dbh,$bibid);
@@ -64,6 +64,7 @@
my $oldrecord = MARCmarc2koha($dbh,$record);
my $itemrecord;
my $nextop="additem";
+warn $nextop;
my @errors; # store errors found while checking data BEFORE saving item.
#------------------------------------------------------------------------------------------------------------------------------
if ($op eq "additem") {
@@ -80,10 +81,12 @@
#for (my $i=0;$i<=$#ind_tag;$i++) {
# $indicators{$ind_tag[$i]} = $indicator[$i];
#}
+warn join " / " , @tags;
if (C4::Context->preference('TemplateEncoding') eq "iso-8859-1") {
$record =
MARChtml2marc($dbh,address@hidden,address@hidden,address@hidden,address@hidden,address@hidden,address@hidden);
} else {
my $xml =
MARChtml2xml(address@hidden,address@hidden,address@hidden,address@hidden,address@hidden);
+warn $xml;
$record=MARC::Record->new_from_xml($xml,C4::Context->preference('TemplateEncoding'),C4::Context->preference('marcflavour'));
}
# my $xml =
MARChtml2xml(address@hidden,address@hidden,address@hidden,address@hidden,address@hidden);
@@ -153,10 +156,12 @@
#for (my $i=0;$i<=$#ind_tag;$i++) {
# $indicators{$ind_tag[$i]} = $indicator[$i];
#}
+warn join " / " , @tags;
if (C4::Context->preference('TemplateEncoding') eq "iso-8859-1") {
$record =
MARChtml2marc($dbh,address@hidden,address@hidden,address@hidden,address@hidden,address@hidden,address@hidden);
} else {
my $xml =
MARChtml2xml(address@hidden,address@hidden,address@hidden,address@hidden,address@hidden);
+warn $xml;
$record=MARC::Record->new_from_xml($xml,C4::Context->preference('TemplateEncoding'),C4::Context->preference('marcflavour'));
}
#my $record =
MARChtml2marc($dbh,address@hidden,address@hidden,address@hidden,%indicators);
@@ -165,6 +170,7 @@
my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) =
NEWmoditem($dbh,$record,$bibid,$itemnum,0);
$itemnum="";
$nextop="additem";
+warn $nextop;
}
#
@@ -284,7 +290,7 @@
# print $input->redirect(".pl?bibid=$bibid") if ($test);
# search for itemcallnumber if applicable
##Lc callnumbers expect 2 subfields like 050ab or 090ab . Modified to accept 2
subfields
-warn "$value / $tag / $subfield";
+# warn "$value / $tag / $subfield";
if (!$value && $tagslib->{$tag}->{$subfield}->{kohafield} eq
'items.itemcallnumber' && C4::Context->preference('itemcallnumber')) {
my $CNtag =
substr(C4::Context->preference('itemcallnumber'),0,3);
my $CNsubfield =
substr(C4::Context->preference('itemcallnumber'),3,1);
@@ -353,7 +359,7 @@
require $plugin;
my $extended_param =
plugin_parameters($dbh,$record,$tagslib,$i,0);
my ($function_name,$javascript) =
plugin_javascript($dbh,$record,$tagslib,$i,0);
- $subfield_data{marc_value}="<input type=\"text\"
name=\"field_value\" size=47 maxlength=255 DISABLE READONLY
OnFocus=\"javascript:Focus$function_name($i)\"
OnBlur=\"javascript:Blur$function_name($i)\"> <a
href=\"javascript:Clic$function_name($i)\">...</a> $javascript";
+ $subfield_data{marc_value}="<input type=\"text\"
name=\"field_value\" value=\"$value\" size=47 maxlength=255
OnFocus=\"javascript:Focus$function_name($i)\"
OnBlur=\"javascript:Blur$function_name($i)\"> <a
href=\"javascript:Clic$function_name($i)\">...</a> $javascript";
} else {
$subfield_data{marc_value}="<input type=\"text\"
name=\"field_value\" value=\"$value\" size=50 maxlength=255>";
}
- [Koha-cvs] koha/acqui.simple additem.pl [rel_2_2],
Joshua Ferraro <=