From ef716417366fa454bf2e76d68137ac0fb76e84c7 Mon Sep 17 00:00:00 2001 From: tipaul Date: Thu, 19 Jan 2006 12:48:00 +0000 Subject: [PATCH] moving cataloguing scripts to a cataloguing directory (more logic than acqui.simple !!!) & updating prog templates --- cataloguing/addbiblio.pl | 12 +- cataloguing/addbooks.pl | 2 +- cataloguing/additem.pl | 21 +- .../prog/en/cataloguing/addbiblio.tmpl | 546 ++++++++++++++++++ .../prog/en/cataloguing/addbooks.tmpl | 61 ++ .../prog/en/cataloguing/additem.tmpl | 134 +++++ 6 files changed, 758 insertions(+), 18 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/cataloguing/addbiblio.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/cataloguing/addbooks.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/cataloguing/additem.tmpl diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 2921576cf0..55b5c5bdf3 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -179,7 +179,7 @@ sub create_input () { $subfield_data{marc_value}= build_authorized_values_list($tag, $subfield, $value, $dbh,$authorised_values_sth); # it's a thesaurus / authority field } elsif ($tagslib->{$tag}->{$subfield}->{authtypecode}) { - $subfield_data{marc_value}=" {$tag}->{$subfield}->{authtypecode}."&index=$i',$i)\">..."; + $subfield_data{marc_value}=" {$tag}->{$subfield}->{authtypecode}."&index=$i',$i)\">..."; # it's a plugin field } elsif ($tagslib->{$tag}->{$subfield}->{'value_builder'}) { # opening plugin. Just check wether we are on a developper computer on a production one @@ -192,18 +192,18 @@ sub create_input () { require $plugin; my $extended_param = plugin_parameters($dbh,$rec,$tagslib,$i,$tabloop); my ($function_name,$javascript) = plugin_javascript($dbh,$rec,$tagslib,$i,$tabloop); - $subfield_data{marc_value}=" ... $javascript"; + $subfield_data{marc_value}=" ... $javascript"; # it's an hidden field } elsif ($tag eq '') { - $subfield_data{marc_value}=""; + $subfield_data{marc_value}=""; } elsif ($tagslib->{$tag}->{$subfield}->{'hidden'}) { - $subfield_data{marc_value}=""; + $subfield_data{marc_value}=""; # it's a standard field } else { if (length($value) >100) { $subfield_data{marc_value}=""; } else { - $subfield_data{marc_value}=""; #" + $subfield_data{marc_value}=""; #" } } return \%subfield_data; @@ -360,7 +360,7 @@ my $bibid; $frameworkcode = &MARCfind_frameworkcode($dbh,$biblionumber) if ($biblionumber and not ($frameworkcode)); $frameworkcode='' if ($frameworkcode eq 'Default'); my ($template, $loggedinuser, $cookie) - = get_template_and_user({template_name => "acqui.simple/addbiblio.tmpl", + = get_template_and_user({template_name => "cataloguing/addbiblio.tmpl", query => $input, type => "intranet", authnotrequired => 0, diff --git a/cataloguing/addbooks.pl b/cataloguing/addbooks.pl index 4222fe7d16..45c72747fa 100755 --- a/cataloguing/addbooks.pl +++ b/cataloguing/addbooks.pl @@ -48,7 +48,7 @@ my $error = $query->param('error'); my $success = $query->param('biblioitem'); my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { - template_name => "acqui.simple/addbooks.tmpl", + template_name => "cataloguing/addbooks.tmpl", query => $query, type => "intranet", authnotrequired => 0, diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index e93cd6edcd..3bfb7c2821 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -58,7 +58,7 @@ my $op = $input->param('op'); my $itemtype = &MARCfind_frameworkcode($dbh,$biblionumber); my $tagslib = &MARCgettagslib($dbh,1,$itemtype); -my $record = MARCgetbiblio($dbh,$bibid); +my $record = MARCgetbiblio($dbh,$biblionumber); # warn "==>".$record->as_formatted; my $oldrecord = MARCmarc2koha($dbh,$record); my $itemrecord; @@ -95,11 +95,11 @@ if ($op eq "additem") { } } # check for item barcode # being unique - my $addedolditem = MARCmarc2koha($dbh,$addeditem); + my $addedolditem = MARCmarc2koha($dbh,$record); my $exists = get_item_from_barcode($addedolditem->{'barcode'}); push @errors,"barcode_not_unique" if($exists); # if barcode exists, don't create, but report The problem. - $itemnumber = NEWnewitem($dbh,$addeditem,$biblionumber,$biblioitemnumber) unless ($exists); + $itemnumber = NEWnewitem($dbh,$addedolditem,$biblionumber,$biblioitemnumber) unless ($exists); $nextop = "additem"; #------------------------------------------------------------------------------------------------------------------------------ } elsif ($op eq "edititem") { @@ -123,7 +123,7 @@ if ($op eq "additem") { # build indicator hash. my @ind_tag = $input->param('ind_tag'); my @indicator = $input->param('indicator'); -# my $itemnum = $input->param('itemnum'); +# my $itemnumber = $input->param('itemnumber'); my %indicators; for (my $i=0;$i<=$#ind_tag;$i++) { $indicators{$ind_tag[$i]} = $indicator[$i]; @@ -131,8 +131,8 @@ if ($op eq "additem") { my $itemrecord = MARChtml2marc($dbh,\@tags,\@subfields,\@values,%indicators); # MARC::Record builded => now, record in DB # warn "R: ".$record->as_formatted; - my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = NEWmoditem($dbh,$record,$bibid,$itemnum,0); - $itemnum=""; + my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = NEWmoditem($dbh,$record,$biblionumber,$itemnumber,0); + $itemnumber=""; $nextop="additem"; } @@ -141,7 +141,7 @@ if ($op eq "additem") { # build screen with existing items. and "new" one #------------------------------------------------------------------------------------------------------------------------------ my ($template, $loggedinuser, $cookie) - = get_template_and_user({template_name => "acqui.simple/additem.tmpl", + = get_template_and_user({template_name => "cataloguing/additem.tmpl", query => $input, type => "intranet", authnotrequired => 0, @@ -152,7 +152,7 @@ my ($template, $loggedinuser, $cookie) my %indicators; $indicators{995}=' '; # now, build existiing item list -my $temp = MARCgetbiblio($dbh,$bibid); +my $temp = MARCgetbiblio($dbh,$biblionumber); my @fields = $temp->fields(); #my @fields = $record->fields(); my %witness; #---- stores the list of subfields used at least once, with the "meaning" of the code @@ -237,7 +237,7 @@ foreach my $tag (sort keys %{$tagslib}) { my $test = (C4::Context->preference("IndependantBranches")) && ($tag eq $branchtagfield) && ($subfield eq $branchtagsubfield) && (C4::Context->userenv->{flags} != 1) && ($value) && ($value ne C4::Context->userenv->{branch}) ; -# print $input->redirect(".pl?bibid=$bibid") if ($test); +# print $input->redirect(".pl?biblionumber=$biblionumber") if ($test); # search for itemcallnumber if applicable if ($tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.itemcallnumber' && C4::Context->preference('itemcallnumber')) { my $CNtag = substr(C4::Context->preference('itemcallnumber'),0,3); @@ -316,8 +316,7 @@ foreach my $tag (sort keys %{$tagslib}) { # what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. $template->param(item_loop => \@item_value_loop, item_header_loop => \@header_value_loop, - bibid => $bibid, - biblionumber =>$oldbiblionumber, + biblionumber => $biblionumber, title => $oldrecord->{title}, author => $oldrecord->{author}, item => \@loop_data, diff --git a/koha-tmpl/intranet-tmpl/prog/en/cataloguing/addbiblio.tmpl b/koha-tmpl/intranet-tmpl/prog/en/cataloguing/addbiblio.tmpl new file mode 100644 index 0000000000..e955cfffc1 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/cataloguing/addbiblio.tmpl @@ -0,0 +1,546 @@ +Koha -- Cataloging: Edit MARC Record Number Add MARC Record + + + + +
+

Edit MARC Record Number Add MARC Record With Framework :

+ + + + " /> + " /> + + 0 + + + 1 + + + 2 + + + 3 + + + 4 + + + 5 + + + 6 + + + 7 + + + 8 + + + 9 + + +
+ + +

Is this a duplicate of " onclick="openWindow('../MARCdetail.pl?bib=&popup=1', 'Duplicate biblio'; return false;)">?

+

You must either :

+ +
+ + + +

+ + " /> + " /> - + + ')">+ + +

+ + +

+ + + " /> + " /> + " /> + " /> + " /> +

+ + + + +
+ + +

+ + " /> + " /> - + + ')">+ + +

+ + +

+ + + " /> + " /> + " /> + " /> + " /> +

+ + +
+ +
+ + +

+ + " /> + " /> - + + ')">+ + +

+ + +

+ + + " /> + " /> + " /> + " /> + " /> +

+ + +
+ +
+ + +

+ + " /> + " /> - + + ')">+ + +

+ + +

+ + + " /> + " /> + " /> + " /> + " /> +

+ + +
+ +
+ + +

+ + " /> + " /> - + + ')">+ + +

+ + +

+ + + " /> + " /> + " /> + " /> + " /> +

+ + +
+ +
+ + +

+ + " /> + " /> - + + ')">+ + +

+ + +

+ + + " /> + " /> + " /> + " /> + " /> +

+ + +
+ +
+ + +

+ + " /> + " /> - + + ')">+ + +

+ + +

+ + + " /> + " /> + " /> + " /> + " /> +

+ + +
+ +
+ + +

+ + " /> + " /> - + + ')">+ + +

+ + +

+ + + " /> + " /> + " /> + " /> + " /> +

+ + +
+ +
+ + +

+ + " /> + " /> - + + ')">+ + +

+ + +

+ + + " /> + " /> + " /> + " /> + " /> +

+ + +
+ +
+ + +

+ + " /> + " /> - + + ')">+ + +

+ + +

+ + + " /> + " /> + " /> + " /> + " /> +

+ + +
+ +
+ + " /> + " /> + " /> + " /> + " /> +
+

+ + " /> + " /> + " /> + + " /> + " /> + " /> + " /> + + " /> + " /> + + +
+ + + + + + +
+ +
+ + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/cataloguing/addbooks.tmpl b/koha-tmpl/intranet-tmpl/prog/en/cataloguing/addbooks.tmpl new file mode 100644 index 0000000000..ee24657b81 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/cataloguing/addbooks.tmpl @@ -0,0 +1,61 @@ +Koha -- Cataloging Home + + + + +

Catalog Maintenance

+ + No items found + + +

Search Existing Records

+ + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/cataloguing/additem.tmpl b/koha-tmpl/intranet-tmpl/prog/en/cataloguing/additem.tmpl new file mode 100644 index 0000000000..eb102a4a47 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/cataloguing/additem.tmpl @@ -0,0 +1,134 @@ +Koha -- Cataloging: Items for Bibliographic Record + + + + + +

Items for by (Record #)

+ +
+
+ " /> + " /> + +

Existing items

+ + + + + + + + + + + + + + +
+ +  
&itemnum=">Edit,)">Delete
+ +
+ +
+ +

Add Item

+ +

Edit Item

+ + +

+ + + " /> + " /> + " /> +

+ + " /> + + ERROR : Barcode already exists ! + + + + + " /> + " /> + " /> + + + + +
+
+ " /> + +
+
+ " /> + +
+
+ " /> + +
+
+ " /> + +
+
+ + + \ No newline at end of file -- 2.39.2