From 89f7388354a18ba20a787f0529e6371469c91de0 Mon Sep 17 00:00:00 2001 From: tipaul Date: Thu, 4 Aug 2005 12:12:13 +0000 Subject: [PATCH] synch'ing 2.2 and head --- acqui.simple/addbiblio.pl | 32 ++++++++++++++++-------- acqui.simple/additem-nomarc.pl | 2 +- acqui.simple/additem.pl | 13 ++++++++-- admin/systempreferences.pl | 45 +++++++++++++++++++++++++++------- authorities/auth_finder.pl | 4 +-- 5 files changed, 72 insertions(+), 24 deletions(-) diff --git a/acqui.simple/addbiblio.pl b/acqui.simple/addbiblio.pl index e072a78220..7f218e2d6d 100755 --- a/acqui.simple/addbiblio.pl +++ b/acqui.simple/addbiblio.pl @@ -177,7 +177,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 @@ -190,18 +190,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}=""; } elsif ($tagslib->{$tag}->{$subfield}->{'hidden'}) { - $subfield_data{marc_value}=""; + $subfield_data{marc_value}=""; # it's a standard field } else { - if (length($value) >200) { - $subfield_data{marc_value}=""; + if (length($value) >100) { + $subfield_data{marc_value}=""; } else { - $subfield_data{marc_value}=""; #" + $subfield_data{marc_value}=""; #" } } return \%subfield_data; @@ -224,14 +224,26 @@ sub build_tabs ($$$$) { my $indicator; # if MARC::Record is not empty => use it as master loop, then add missing subfields that should be in the tab. # if MARC::Record is empty => use tab as master loop. - if ($record ne -1 && $record->field($tag)) { - my @fields = $record->field($tag); + if ($record ne -1 && ($record->field($tag) || $tag eq '000')) { + my @fields; + if ($tag ne '000') { + @fields = $record->field($tag); + } else { + push @fields,$record->leader(); + } foreach my $field (@fields) { my @subfields_data; if ($tag<10) { - my $value=$field->data(); - my $subfield="@"; + my ($value,$subfield); + if ($tag ne '000') { + $value=$field->data(); + $subfield="@"; + } else { + $value = $field; + $subfield='@'; + } next if ($tagslib->{$tag}->{$subfield}->{tab} ne $tabloop); + next if ($tagslib->{$tag}->{$subfield}->{kohafield} eq 'biblio.biblionumber'); push(@subfields_data, &create_input($tag,$subfield,char_decode($value,$encoding),$i,$tabloop,$record,$authorised_values_sth)); $i++; } else { diff --git a/acqui.simple/additem-nomarc.pl b/acqui.simple/additem-nomarc.pl index 6747c08b0a..73b9c79aca 100755 --- a/acqui.simple/additem-nomarc.pl +++ b/acqui.simple/additem-nomarc.pl @@ -20,7 +20,7 @@ # Suite 330, Boston, MA 02111-1307 USA # $Log$ -# Revision 1.5 2005/05/04 08:45:33 tipaul +# Revision 1.6 2005/08/04 12:12:13 tipaul # synch'ing 2.2 and head # # Revision 1.4.2.1 2005/03/25 12:52:44 tipaul diff --git a/acqui.simple/additem.pl b/acqui.simple/additem.pl index 4f5c70446d..8c07917d1e 100755 --- a/acqui.simple/additem.pl +++ b/acqui.simple/additem.pl @@ -144,8 +144,9 @@ my ($template, $loggedinuser, $cookie) my %indicators; $indicators{995}=' '; # now, build existiing item list -my $temp = MARCgetbiblio($dbh,$bibid); -my @fields = $temp->fields(); +# my $temp = MARCgetbiblio($dbh,$bibid); +# 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 my @big_array; #---- finds where items.itemnumber is stored @@ -305,6 +306,14 @@ foreach my $tag (sort keys %{$tagslib}) { $i++ } } +my ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "acqui.simple/additem.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {editcatalogue => 1}, + debug => 1, + }); # 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, diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index 6eeffb37c5..3fc2fa52d2 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -48,6 +48,35 @@ use C4::Search; use HTML::Template; use C4::Context; +my %tabsysprefs; +$tabsysprefs{acquisitions}="Acquisitions"; +$tabsysprefs{gist}="Acquisitions"; +$tabsysprefs{authoritysep}="Authorities"; +$tabsysprefs{ISBD}="Catalogue"; +$tabsysprefs{marc}="Catalogue"; +$tabsysprefs{marcflavour}="Catalogue"; +$tabsysprefs{SubscriptionHistory}="Catalogue"; +$tabsysprefs{maxoutstanding}="Circulation"; +$tabsysprefs{printcirculationslips}="Circulation"; +$tabsysprefs{ReturnBeforeExpiry}="Circulation"; +$tabsysprefs{suggestion}="Acquisitions"; +$tabsysprefs{automembernum}="Members"; +$tabsysprefs{noissuescharge}="Circulation"; +$tabsysprefs{opacthemes}="OPAC"; +$tabsysprefs{opaclanguages}="OPAC"; +$tabsysprefs{LibraryName}="OPAC"; +$tabsysprefs{opacstylesheet}="OPAC"; +$tabsysprefs{BiblioDefaultView}="OPAC"; +$tabsysprefs{hidelostitem}="OPAC"; +$tabsysprefs{KohaAdmin}="Admin"; +$tabsysprefs{checkdigit}="Admin"; +$tabsysprefs{dateformat}="Admin"; +$tabsysprefs{insecure}="Admin"; +$tabsysprefs{ldapinfos}="Admin"; +$tabsysprefs{ldapserver}="Admin"; +$tabsysprefs{itemcallnumber}="Catalogue"; +$tabsysprefs{maxreserves}="Circulation"; +$tabsysprefs{virtualshelves}="OPAC"; my %tabsysprefs; $tabsysprefs{acquisitions}="Acquisitions"; @@ -94,12 +123,12 @@ sub StringSearch { $sth->execute($syspref); while (my $data=$sth->fetchrow_hashref){ push(@results,$data); - $cnt ++; + $cnt++; } $sth->finish; } } - }else { + } else { my $strsth ="Select variable,value,explanation,type,options from systempreferences where variable not in ("; foreach my $syspref (keys %tabsysprefs){ $strsth .= $dbh->quote($syspref).","; @@ -111,7 +140,7 @@ sub StringSearch { $sth->execute(); while (my $data=$sth->fetchrow_hashref){ push(@results,$data); - $cnt ++; + $cnt++; } $sth->finish; } @@ -333,19 +362,16 @@ if ($op eq 'add_form') { #Adding tab management for system preferences my $tab=$input->param('tab'); - if ($searchfield ne '') { - $template->param(searchfield => "

You Searched for $searchfield

"); - } my $env; my ($count,$results)=StringSearch($env,$searchfield,$tab); my $toggle=0; my @loop_data = (); for (my $i=$offset; $i < ($offset+$pagesize<$count?$offset+$pagesize:$count); $i++){ - if ($toggle eq 0){ + if ($toggle eq 0){ $toggle=1; - } else { + } else { $toggle=0; - } + } my %row_data; # get a fresh hash for the row data $row_data{variable} = $results->[$i]{'variable'}; $row_data{value} = $results->[$i]{'value'}; @@ -355,6 +381,7 @@ if ($op eq 'add_form') { $row_data{delete} = "$script_name?op=delete_confirm&searchfield=".$results->[$i]{'variable'}; push(@loop_data, \%row_data); } + $tab=($tab?$tab:"Others"); $template->param(loop => \@loop_data, $tab => 1); if ($offset>0) { my $prevpage = $offset-$pagesize; diff --git a/authorities/auth_finder.pl b/authorities/auth_finder.pl index 97acdc9038..86f567571e 100755 --- a/authorities/auth_finder.pl +++ b/authorities/auth_finder.pl @@ -92,8 +92,9 @@ if ($op eq "do_search") { my @field_data = (); + my @marclist_ini = $query->param('marclist'); # get marclist again, as the previous one has been modified by catalogsearch (mainentry replaced by field name for(my $i = 0 ; $i <= $#marclist ; $i++) { - push @field_data, { term => "marclist", val=>$marclist[$i] }; + push @field_data, { term => "marclist", val=>$marclist_ini[$i] }; push @field_data, { term => "and_or", val=>$and_or[$i] }; push @field_data, { term => "excluding", val=>$excluding[$i] }; push @field_data, { term => "operator", val=>$operator[$i] }; @@ -157,7 +158,6 @@ if ($op eq "do_search") { $template->param(authtypesloop => \@authtypesloop, authtypecode => $authtypecode); -#warn "CAT : $authtypecode"; # Print the page output_html_with_http_headers $query, $cookie, $template->output; -- 2.39.5