MARC authority management (continued)
This commit is contained in:
parent
e80f1f8f60
commit
e7e930ab39
|
|
@ -20,6 +20,7 @@ use strict;
|
|||
require Exporter;
|
||||
use C4::Context;
|
||||
use C4::Database;
|
||||
use C4::Koha;
|
||||
use MARC::Record;
|
||||
|
||||
use vars qw($VERSION @ISA @EXPORT);
|
||||
|
|
@ -30,8 +31,8 @@ $VERSION = 0.01;
|
|||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(
|
||||
&AUTHgettagslib
|
||||
&MARCfindsubfield
|
||||
&MARCfind_frameworkcode
|
||||
&AUTHfindsubfield
|
||||
&AUTHfind_authtypecode
|
||||
|
||||
&AUTHaddauthority
|
||||
&AUTHmodauthority
|
||||
|
|
@ -39,6 +40,8 @@ $VERSION = 0.01;
|
|||
&AUTHaddsubfield
|
||||
&AUTHgetauthority
|
||||
|
||||
&authoritysearch
|
||||
|
||||
&MARCmodsubfield
|
||||
&AUTHhtml2marc
|
||||
&AUTHaddword
|
||||
|
|
@ -46,12 +49,209 @@ $VERSION = 0.01;
|
|||
&char_decode
|
||||
);
|
||||
|
||||
sub authoritysearch {
|
||||
my ($dbh, $tags, $and_or, $excluding, $operator, $value, $offset,$length,$authtypecode) = @_;
|
||||
# build the sql request. She will look like :
|
||||
# select m1.bibid
|
||||
# from auth_subfield_table as m1, auth_subfield_table as m2
|
||||
# where m1.authid=m2.authid and
|
||||
# (m1.subfieldvalue like "Des%" and m2.subfieldvalue like "27%")
|
||||
|
||||
# "Normal" statements
|
||||
my @normal_tags = ();
|
||||
my @normal_and_or = ();
|
||||
my @normal_operator = ();
|
||||
my @normal_value = ();
|
||||
# Extracts the NOT statements from the list of statements
|
||||
for(my $i = 0 ; $i <= $#{$value} ; $i++)
|
||||
{
|
||||
if(@$operator[$i] eq "contains") # if operator is contains, splits the words in separate requests
|
||||
{
|
||||
foreach my $word (split(/ /, @$value[$i]))
|
||||
{
|
||||
unless (C4::Context->stopwords->{uc($word)}) { #it's NOT a stopword => use it. Otherwise, ignore
|
||||
my $tag = substr(@$tags[$i],0,3);
|
||||
my $subf = substr(@$tags[$i],3,1);
|
||||
push @normal_tags, @$tags[$i];
|
||||
push @normal_and_or, "and"; # assumes "foo" and "bar" if "foo bar" is entered
|
||||
push @normal_operator, @$operator[$i];
|
||||
push @normal_value, $word;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
push @normal_tags, @$tags[$i];
|
||||
push @normal_and_or, @$and_or[$i];
|
||||
push @normal_operator, @$operator[$i];
|
||||
push @normal_value, @$value[$i];
|
||||
}
|
||||
}
|
||||
|
||||
# Finds the basic results without the NOT requests
|
||||
my ($sql_tables, $sql_where1, $sql_where2) = create_request($dbh,\@normal_tags, \@normal_and_or, \@normal_operator, \@normal_value);
|
||||
|
||||
my $sth;
|
||||
if ($sql_where2) {
|
||||
$sth = $dbh->prepare("select distinct m1.authid from auth_header,$sql_tables where m1.authid=auth_header.authid and auth_header.authtypecode=? and $sql_where2 and ($sql_where1)");
|
||||
warn "Q2 : select distinct m1.authid from auth_header,$sql_tables where m1.authid=auth_header.authid and auth_header.authtypecode=? and $sql_where2 and ($sql_where1)";
|
||||
} else {
|
||||
$sth = $dbh->prepare("select distinct m1.authid from auth_header,$sql_tables where m1.authid=auth_header.authid and auth_header.authtypecode=? and $sql_where1");
|
||||
warn "Q : select distinct m1.authid from auth_header,$sql_tables where m1.authid=auth_header.authid and auth_header.authtypecode=? and $sql_where1";
|
||||
}
|
||||
$sth->execute($authtypecode);
|
||||
my @result = ();
|
||||
|
||||
while (my ($authid) = $sth->fetchrow) {
|
||||
warn "AUTH: $authid";
|
||||
push @result,$authid;
|
||||
}
|
||||
|
||||
# we have authid list. Now, loads summary from [offset] to [offset]+[length]
|
||||
my $counter = $offset;
|
||||
my @finalresult = ();
|
||||
my $oldline;
|
||||
while (($counter <= $#result) && ($counter <= ($offset + $length))) {
|
||||
warn "HERE";
|
||||
# get MARC::Record of the authority
|
||||
my $record = AUTHgetauthority($dbh,$result[$counter]);
|
||||
# then build the summary
|
||||
my $authtypecode = AUTHfind_authtypecode($dbh,$result[$counter]);
|
||||
my $authref = getauthtype($authtypecode);
|
||||
my $summary = $authref->{summary};
|
||||
my @fields = $record->fields();
|
||||
foreach my $field (@fields) {
|
||||
my $tag = $field->tag();
|
||||
if ($tag<10) {
|
||||
} else {
|
||||
my @subf = $field->subfields;
|
||||
for my $i (0..$#subf) {
|
||||
my $subfieldcode = $subf[$i][0];
|
||||
my $subfieldvalue = $subf[$i][1];
|
||||
my $tagsubf = $tag.$subfieldcode;
|
||||
$summary =~ s/\[(.?.?.?)$tagsubf(.*?)]/$1$subfieldvalue\[$1$tagsubf$2]$2$3/g;
|
||||
}
|
||||
}
|
||||
}
|
||||
$summary =~ s/\[(.*?)]//g;
|
||||
$summary =~ s/\n/<br>/g;
|
||||
# then add a line for the template loop
|
||||
my %newline;
|
||||
$newline{summary} = $summary;
|
||||
$newline{authid} = $result[$counter];
|
||||
push @finalresult, \%newline;
|
||||
my $nbresults = $#result + 1;
|
||||
return (\@finalresult, $nbresults);
|
||||
}
|
||||
}
|
||||
|
||||
# Creates the SQL Request
|
||||
|
||||
sub create_request {
|
||||
my ($dbh,$tags, $and_or, $operator, $value) = @_;
|
||||
|
||||
my $sql_tables; # will contain marc_subfield_table as m1,...
|
||||
my $sql_where1; # will contain the "true" where
|
||||
my $sql_where2 = "("; # will contain m1.authid=m2.authid
|
||||
my $nb_active=0; # will contain the number of "active" entries. and entry is active is a value is provided.
|
||||
my $nb_table=1; # will contain the number of table. ++ on each entry EXCEPT when an OR is provided.
|
||||
|
||||
for(my $i=0; $i<=@$value;$i++) {
|
||||
if (@$value[$i]) {
|
||||
$nb_active++;
|
||||
if ($nb_active==1) {
|
||||
if (@$operator[$i] eq "start") {
|
||||
$sql_tables .= "auth_subfield_table as m$nb_table,";
|
||||
$sql_where1 .= "(m1.subfieldvalue like ".$dbh->quote("@$value[$i]%");
|
||||
if (@$tags[$i]) {
|
||||
$sql_where1 .=" and m1.tag+m1.subfieldcode in (@$tags[$i])";
|
||||
}
|
||||
$sql_where1.=")";
|
||||
} elsif (@$operator[$i] eq "contains") {
|
||||
$sql_tables .= "auth_word as m$nb_table,";
|
||||
$sql_where1 .= "(m1.word like ".$dbh->quote("@$value[$i]%");
|
||||
if (@$tags[$i]) {
|
||||
$sql_where1 .=" and m1.tag+m1.subfieldid in (@$tags[$i])";
|
||||
}
|
||||
$sql_where1.=")";
|
||||
} else {
|
||||
$sql_tables .= "auth_subfield_table as m$nb_table,";
|
||||
$sql_where1 .= "(m1.subfieldvalue @$operator[$i] ".$dbh->quote("@$value[$i]");
|
||||
if (@$tags[$i]) {
|
||||
$sql_where1 .=" and m1.tag+m1.subfieldcode in (@$tags[$i])";
|
||||
}
|
||||
$sql_where1.=")";
|
||||
}
|
||||
} else {
|
||||
if (@$operator[$i] eq "start") {
|
||||
$nb_table++;
|
||||
$sql_tables .= "auth_subfield_table as m$nb_table,";
|
||||
$sql_where1 .= "@$and_or[$i] (m$nb_table.subfieldvalue like ".$dbh->quote("@$value[$i]%");
|
||||
if (@$tags[$i]) {
|
||||
$sql_where1 .=" and m$nb_table.tag+m$nb_table.subfieldcode in (@$tags[$i])";
|
||||
}
|
||||
$sql_where1.=")";
|
||||
$sql_where2 .= "m1.authid=m$nb_table.authid and ";
|
||||
} elsif (@$operator[$i] eq "contains") {
|
||||
if (@$and_or[$i] eq 'and') {
|
||||
$nb_table++;
|
||||
$sql_tables .= "auth_word as m$nb_table,";
|
||||
$sql_where1 .= "@$and_or[$i] (m$nb_table.word like ".$dbh->quote("@$value[$i]%");
|
||||
if (@$tags[$i]) {
|
||||
$sql_where1 .=" and m$nb_table.tag+m$nb_table.subfieldid in(@$tags[$i])";
|
||||
}
|
||||
$sql_where1.=")";
|
||||
$sql_where2 .= "m1.authid=m$nb_table.authid and ";
|
||||
} else {
|
||||
$sql_where1 .= "@$and_or[$i] (m$nb_table.word like ".$dbh->quote("@$value[$i]%");
|
||||
if (@$tags[$i]) {
|
||||
$sql_where1 .=" and m$nb_table.tag+m$nb_table.subfieldid in (@$tags[$i])";
|
||||
}
|
||||
$sql_where1.=")";
|
||||
$sql_where2 .= "m1.authid=m$nb_table.authid and ";
|
||||
}
|
||||
} else {
|
||||
$nb_table++;
|
||||
$sql_tables .= "auth_subfield_table as m$nb_table,";
|
||||
$sql_where1 .= "@$and_or[$i] (m$nb_table.subfieldvalue @$operator[$i] ".$dbh->quote(@$value[$i]);
|
||||
if (@$tags[$i]) {
|
||||
$sql_where1 .=" and m$nb_table.tag+m$nb_table.subfieldcode in (@$tags[$i])";
|
||||
}
|
||||
$sql_where2 .= "m1.authid=m$nb_table.authid and ";
|
||||
$sql_where1.=")";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($sql_where2 ne "(") # some datas added to sql_where2, processing
|
||||
{
|
||||
$sql_where2 = substr($sql_where2, 0, (length($sql_where2)-5)); # deletes the trailing ' and '
|
||||
$sql_where2 .= ")";
|
||||
}
|
||||
else # no sql_where2 statement, deleting '('
|
||||
{
|
||||
$sql_where2 = "";
|
||||
}
|
||||
chop $sql_tables; # deletes the trailing ','
|
||||
return ($sql_tables, $sql_where1, $sql_where2);
|
||||
}
|
||||
|
||||
|
||||
sub AUTHfind_authtypecode {
|
||||
my ($dbh,$authid) = @_;
|
||||
my $sth = $dbh->prepare("select authtypecode from auth_header where authid=?");
|
||||
$sth->execute($authid);
|
||||
my ($authtypecode) = $sth->fetchrow;
|
||||
return $authtypecode;
|
||||
}
|
||||
|
||||
|
||||
sub AUTHgettagslib {
|
||||
my ($dbh,$forlibrarian,$authtypecode)= @_;
|
||||
warn "AUTH : $authtypecode";
|
||||
# warn "AUTH : $authtypecode";
|
||||
$authtypecode="" unless $authtypecode;
|
||||
warn "AUTH : $authtypecode";
|
||||
# warn "AUTH : $authtypecode";
|
||||
my $sth;
|
||||
my $libfield = ($forlibrarian eq 1)? 'liblibrarian' : 'libopac';
|
||||
# check that framework exists
|
||||
|
|
@ -171,7 +371,7 @@ sub AUTHgetauthority {
|
|||
my $record = MARC::Record->new();
|
||||
#---- TODO : the leader is missing
|
||||
$record->leader(' ');
|
||||
my $sth=$dbh->prepare("select authid,subfieldid,tag,tagorder,tag_indicator,subfieldcode,subfieldorder,subfieldvalue,valuebloblink
|
||||
my $sth=$dbh->prepare("select authid,subfieldid,tag,tagorder,tag_indicator,subfieldcode,subfieldorder,subfieldvalue
|
||||
from auth_subfield_table
|
||||
where authid=? order by tag,tagorder,subfieldcode
|
||||
");
|
||||
|
|
@ -558,6 +758,9 @@ Paul POULAIN paul.poulain@free.fr
|
|||
|
||||
# $Id$
|
||||
# $Log$
|
||||
# Revision 1.2 2004/06/10 08:29:01 tipaul
|
||||
# MARC authority management (continued)
|
||||
#
|
||||
# Revision 1.1 2004/06/07 07:35:01 tipaul
|
||||
# MARC authority management package
|
||||
#
|
||||
|
|
|
|||
11
C4/Biblio.pm
11
C4/Biblio.pm
|
|
@ -240,24 +240,24 @@ sub MARCgettagslib {
|
|||
$res->{$tag}->{repeatable}=$repeatable;
|
||||
}
|
||||
|
||||
$sth=$dbh->prepare("select tagfield,tagsubfield,$libfield as lib,tab, mandatory, repeatable,authorised_value,thesaurus_category,value_builder,kohafield,seealso,hidden,isurl from marc_subfield_structure where frameworkcode=? order by tagfield,tagsubfield");
|
||||
$sth=$dbh->prepare("select tagfield,tagsubfield,$libfield as lib,tab, mandatory, repeatable,authorised_value,authtypecode,value_builder,kohafield,seealso,hidden,isurl from marc_subfield_structure where frameworkcode=? order by tagfield,tagsubfield");
|
||||
$sth->execute($frameworkcode);
|
||||
|
||||
my $subfield;
|
||||
my $authorised_value;
|
||||
my $thesaurus_category;
|
||||
my $authtypecode;
|
||||
my $value_builder;
|
||||
my $kohafield;
|
||||
my $seealso;
|
||||
my $hidden;
|
||||
my $isurl;
|
||||
while ( ($tag, $subfield, $lib, $tab, $mandatory, $repeatable,$authorised_value,$thesaurus_category,$value_builder,$kohafield,$seealso,$hidden,$isurl) = $sth->fetchrow) {
|
||||
while ( ($tag, $subfield, $lib, $tab, $mandatory, $repeatable,$authorised_value,$authtypecode,$value_builder,$kohafield,$seealso,$hidden,$isurl) = $sth->fetchrow) {
|
||||
$res->{$tag}->{$subfield}->{lib}=$lib;
|
||||
$res->{$tag}->{$subfield}->{tab}=$tab;
|
||||
$res->{$tag}->{$subfield}->{mandatory}=$mandatory;
|
||||
$res->{$tag}->{$subfield}->{repeatable}=$repeatable;
|
||||
$res->{$tag}->{$subfield}->{authorised_value}=$authorised_value;
|
||||
$res->{$tag}->{$subfield}->{thesaurus_category}=$thesaurus_category;
|
||||
$res->{$tag}->{$subfield}->{authtypecode}=$authtypecode;
|
||||
$res->{$tag}->{$subfield}->{value_builder}=$value_builder;
|
||||
$res->{$tag}->{$subfield}->{kohafield}=$kohafield;
|
||||
$res->{$tag}->{$subfield}->{seealso}=$seealso;
|
||||
|
|
@ -2191,6 +2191,9 @@ Paul POULAIN paul.poulain@free.fr
|
|||
|
||||
# $Id$
|
||||
# $Log$
|
||||
# Revision 1.92 2004/06/10 08:29:01 tipaul
|
||||
# MARC authority management (continued)
|
||||
#
|
||||
# Revision 1.91 2004/06/03 10:03:01 tipaul
|
||||
# * frameworks and itemtypes are independant
|
||||
# * in the MARC editor, showing the + to duplicate a tag only if the tag is repeatable
|
||||
|
|
|
|||
13
C4/Koha.pm
13
C4/Koha.pm
|
|
@ -59,7 +59,7 @@ Koha.pm provides many functions for Koha scripts.
|
|||
&getprinters &getprinter
|
||||
&getitemtypes &getitemtypeinfo
|
||||
&getframeworks &getframeworkinfo
|
||||
&getauthtypes
|
||||
&getauthtypes &getauthtype
|
||||
$DEBUG);
|
||||
|
||||
use vars qw();
|
||||
|
|
@ -322,6 +322,17 @@ sub getauthtypes {
|
|||
return (\%authtypes);
|
||||
}
|
||||
|
||||
sub getauthtype {
|
||||
my ($authtypecode) = @_;
|
||||
# returns a reference to a hash of references to authtypes...
|
||||
my %authtypes;
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $sth=$dbh->prepare("select * from auth_types where authtypecode=?");
|
||||
$sth->execute($authtypecode);
|
||||
my $res=$sth->fetchrow_hashref;
|
||||
return $res;
|
||||
}
|
||||
|
||||
=head2 getframework
|
||||
|
||||
$frameworks = &getframework();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,164 @@
|
|||
#!/usr/bin/perl
|
||||
# WARNING: 4-character tab stops here
|
||||
|
||||
# Copyright 2000-2002 Katipo Communications
|
||||
#
|
||||
# This file is part of Koha.
|
||||
#
|
||||
# Koha is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation; either version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
|
||||
# Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
use strict;
|
||||
require Exporter;
|
||||
use CGI;
|
||||
use C4::Auth;
|
||||
use HTML::Template;
|
||||
use C4::Context;
|
||||
use C4::Search;
|
||||
use C4::Auth;
|
||||
use C4::Output;
|
||||
use C4::Interface::CGI::Output;
|
||||
use C4::AuthoritiesMarc;
|
||||
use C4::SearchMarc;
|
||||
use C4::Catalogue;
|
||||
use C4::Koha; # XXX subfield_is_koha_internal_p
|
||||
|
||||
my $query=new CGI;
|
||||
my $op = $query->param('op');
|
||||
my $authtypecode = $query->param('authtypecode');
|
||||
my $dbh = C4::Context->dbh;
|
||||
|
||||
my $startfrom=$query->param('startfrom');
|
||||
$startfrom=0 if(!defined $startfrom);
|
||||
my ($template, $loggedinuser, $cookie);
|
||||
my $resultsperpage;
|
||||
|
||||
my $authtypes = getauthtypes;
|
||||
my @authtypesloop;
|
||||
foreach my $thisauthtype (keys %$authtypes) {
|
||||
my $selected = 1 if $thisauthtype eq $authtypecode;
|
||||
my %row =(value => $thisauthtype,
|
||||
selected => $selected,
|
||||
authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
|
||||
);
|
||||
push @authtypesloop, \%row;
|
||||
}
|
||||
|
||||
if ($op eq "do_search") {
|
||||
my @marclist = $query->param('marclist');
|
||||
my @and_or = $query->param('and_or');
|
||||
my @excluding = $query->param('excluding');
|
||||
my @operator = $query->param('operator');
|
||||
my @value = $query->param('value');
|
||||
|
||||
$resultsperpage= $query->param('resultsperpage');
|
||||
$resultsperpage = 19 if(!defined $resultsperpage);
|
||||
my $orderby = $query->param('orderby');
|
||||
|
||||
# builds tag and subfield arrays
|
||||
my @tags;
|
||||
|
||||
my ($results,$total) = authoritysearch($dbh, \@tags,\@and_or,
|
||||
\@excluding, \@operator, \@value,
|
||||
$startfrom*$resultsperpage, $resultsperpage,$orderby);
|
||||
|
||||
($template, $loggedinuser, $cookie)
|
||||
= get_template_and_user({template_name => "authorities/auth_finder.tmpl",
|
||||
query => $query,
|
||||
type => 'intranet',
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {borrowers => 1},
|
||||
flagsrequired => {catalogue => 1},
|
||||
debug => 1,
|
||||
});
|
||||
|
||||
# multi page display gestion
|
||||
my $displaynext=0;
|
||||
my $displayprev=$startfrom;
|
||||
if(($total - (($startfrom+1)*($resultsperpage))) > 0 ){
|
||||
$displaynext = 1;
|
||||
}
|
||||
|
||||
my @field_data = ();
|
||||
|
||||
|
||||
for(my $i = 0 ; $i <= $#marclist ; $i++)
|
||||
{
|
||||
push @field_data, { term => "marclist", val=>$marclist[$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] };
|
||||
push @field_data, { term => "value", val=>$value[$i] };
|
||||
}
|
||||
|
||||
my @numbers = ();
|
||||
|
||||
if ($total>$resultsperpage)
|
||||
{
|
||||
for (my $i=1; $i<$total/$resultsperpage+1; $i++)
|
||||
{
|
||||
if ($i<16)
|
||||
{
|
||||
my $highlight=0;
|
||||
($startfrom==($i-1)) && ($highlight=1);
|
||||
push @numbers, { number => $i,
|
||||
highlight => $highlight ,
|
||||
searchdata=> \@field_data,
|
||||
startfrom => ($i-1)};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my $from = $startfrom*$resultsperpage+1;
|
||||
my $to;
|
||||
|
||||
if($total < (($startfrom+1)*$resultsperpage))
|
||||
{
|
||||
$to = $total;
|
||||
} else {
|
||||
$to = (($startfrom+1)*$resultsperpage);
|
||||
}
|
||||
$template->param(result => $results,
|
||||
startfrom=> $startfrom,
|
||||
displaynext=> $displaynext,
|
||||
displayprev=> $displayprev,
|
||||
resultsperpage => $resultsperpage,
|
||||
startfromnext => $startfrom+1,
|
||||
startfromprev => $startfrom-1,
|
||||
searchdata=>\@field_data,
|
||||
total=>$total,
|
||||
from=>$from,
|
||||
to=>$to,
|
||||
numbers=>\@numbers,
|
||||
);
|
||||
|
||||
} else {
|
||||
($template, $loggedinuser, $cookie)
|
||||
= get_template_and_user({template_name => "authorities/auth_finder.tmpl",
|
||||
query => $query,
|
||||
type => 'intranet',
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {catalogue => 1},
|
||||
debug => 1,
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$template->param(authtypesloop => \@authtypesloop);
|
||||
|
||||
# Print the page
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
|
||||
# Local Variables:
|
||||
# tab-width: 4
|
||||
# End:
|
||||
|
|
@ -33,63 +33,6 @@ use C4::SearchMarc;
|
|||
use C4::Catalogue;
|
||||
use C4::Koha; # XXX subfield_is_koha_internal_p
|
||||
|
||||
# Creates the list of active tags using the active MARC configuration
|
||||
sub create_marclist {
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $tagslib = AUTHgettagslib($dbh,1);
|
||||
my @marcarray;
|
||||
push @marcarray,"";
|
||||
my $widest_menu_item_width = 0;
|
||||
for (my $pass = 1; $pass <= 2; $pass += 1)
|
||||
{
|
||||
for (my $tabloop = 0; $tabloop<=9;$tabloop++)
|
||||
{
|
||||
my $separator_inserted_p = 0; # FIXME... should not use!!
|
||||
foreach my $tag (sort(keys (%{$tagslib})))
|
||||
{
|
||||
foreach my $subfield (sort(keys %{$tagslib->{$tag}}))
|
||||
{
|
||||
next if subfield_is_koha_internal_p($subfield);
|
||||
next unless ($tagslib->{$tag}->{$subfield}->{tab} eq $tabloop);
|
||||
my $menu_item = "$tag$subfield - $tagslib->{$tag}->{$subfield}->{lib}";
|
||||
if ($pass == 1)
|
||||
{
|
||||
$widest_menu_item_width = length $menu_item if($widest_menu_item_width < length $menu_item);
|
||||
} else {
|
||||
if (!$separator_inserted_p)
|
||||
{
|
||||
my $w = int(($widest_menu_item_width - 3 + 0.5)/2);
|
||||
my $s = ('-' x ($w * 4/5));
|
||||
push @marcarray, "$s $tabloop $s";
|
||||
$separator_inserted_p = 1;
|
||||
}
|
||||
push @marcarray, $menu_item;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return \@marcarray;
|
||||
}
|
||||
|
||||
# Creates a scrolling list with the associated default value.
|
||||
# Using more than one scrolling list in a CGI assigns the same default value to all the
|
||||
# scrolling lists on the page !?!? That's why this function was written.
|
||||
sub create_scrolling_list {
|
||||
my ($params) = @_;
|
||||
my $scrollist = sprintf("<select name=\"%s\" size=\"%d\" onChange='%s'>\n", $params->{'name'}, $params->{'size'}, $params->{'onChange'});
|
||||
|
||||
foreach my $tag (@{$params->{'values'}})
|
||||
{
|
||||
my $selected = "selected " if($params->{'default'} eq $tag);
|
||||
$scrollist .= sprintf("<option %svalue=\"%s\">%s</option>\n", $selected, $tag, $tag);
|
||||
}
|
||||
|
||||
$scrollist .= "</select>\n";
|
||||
|
||||
return $scrollist;
|
||||
}
|
||||
|
||||
my $query=new CGI;
|
||||
my $op = $query->param('op');
|
||||
my $authtypecode = $query->param('authtypecode');
|
||||
|
|
@ -108,7 +51,6 @@ foreach my $thisauthtype (keys %$authtypes) {
|
|||
selected => $selected,
|
||||
authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
|
||||
);
|
||||
warn "X = $authtypes->{$thisauthtype}{'authtypetext'}";
|
||||
push @authtypesloop, \%row;
|
||||
}
|
||||
|
||||
|
|
@ -121,30 +63,14 @@ if ($op eq "do_search") {
|
|||
|
||||
$resultsperpage= $query->param('resultsperpage');
|
||||
$resultsperpage = 19 if(!defined $resultsperpage);
|
||||
my $orderby = $query->param('orderby');
|
||||
|
||||
# builds tag and subfield arrays
|
||||
my @tags;
|
||||
|
||||
foreach my $marc (@marclist) {
|
||||
if ($marc) {
|
||||
my ($tag,$subfield) = MARCfind_marc_from_kohafield($dbh,$marc);
|
||||
if ($tag) {
|
||||
push @tags,$dbh->quote("$tag$subfield");
|
||||
} else {
|
||||
push @tags, $dbh->quote(substr($marc,0,4));
|
||||
}
|
||||
} else {
|
||||
push @tags, "";
|
||||
}
|
||||
}
|
||||
findseealso($dbh,\@tags);
|
||||
my ($results,$total) = catalogsearch($dbh, \@tags,\@and_or,
|
||||
my ($results,$total) = authoritysearch($dbh, \@tags,\@and_or,
|
||||
\@excluding, \@operator, \@value,
|
||||
$startfrom*$resultsperpage, $resultsperpage,$orderby);
|
||||
|
||||
$startfrom*$resultsperpage, $resultsperpage,$authtypecode);
|
||||
warn "R : $results";
|
||||
($template, $loggedinuser, $cookie)
|
||||
= get_template_and_user({template_name => "authorities/authorities-home.tmpl",
|
||||
= get_template_and_user({template_name => "authorities/searchresultlist.tmpl",
|
||||
query => $query,
|
||||
type => 'intranet',
|
||||
authnotrequired => 0,
|
||||
|
|
@ -199,7 +125,8 @@ if ($op eq "do_search") {
|
|||
} else {
|
||||
$to = (($startfrom+1)*$resultsperpage);
|
||||
}
|
||||
$template->param(result => $results,
|
||||
$template->param(result => $results) if $results;
|
||||
$template->param(
|
||||
startfrom=> $startfrom,
|
||||
displaynext=> $displaynext,
|
||||
displayprev=> $displayprev,
|
||||
|
|
@ -296,64 +223,7 @@ else {
|
|||
flagsrequired => {catalogue => 1},
|
||||
debug => 1,
|
||||
});
|
||||
#$template->param(loggedinuser => $loggedinuser);
|
||||
|
||||
my $marcarray = create_marclist();
|
||||
|
||||
my $marclist = CGI::scrolling_list(-name=>"marclist",
|
||||
-values=> $marcarray,
|
||||
-size=>1,
|
||||
-multiple=>0,
|
||||
-onChange => "sql_update()",
|
||||
);
|
||||
|
||||
my @statements = ();
|
||||
|
||||
# Considering initial search with 3 criterias
|
||||
push @statements, { "marclist" => $marclist, "first" => 1 };
|
||||
push @statements, { "marclist" => $marclist, "first" => 0 };
|
||||
push @statements, { "marclist" => $marclist, "first" => 0 };
|
||||
my $sth=$dbh->prepare("Select itemtype,description from itemtypes order by description");
|
||||
$sth->execute;
|
||||
my @itemtype;
|
||||
my %itemtypes;
|
||||
push @itemtype, "";
|
||||
$itemtypes{''} = "";
|
||||
while (my ($value,$lib) = $sth->fetchrow_array) {
|
||||
push @itemtype, $value;
|
||||
$itemtypes{$value}=$lib;
|
||||
}
|
||||
|
||||
my $CGIitemtype=CGI::scrolling_list( -name => 'value',
|
||||
-values => \@itemtype,
|
||||
-labels => \%itemtypes,
|
||||
-size => 1,
|
||||
-multiple => 0 );
|
||||
$sth->finish;
|
||||
|
||||
my @branches;
|
||||
my @select_branch;
|
||||
my %select_branches;
|
||||
my ($count2,@branches)=branches();
|
||||
push @select_branch, "";
|
||||
$select_branches{''} = "";
|
||||
for (my $i=0;$i<$count2;$i++){
|
||||
push @select_branch, $branches[$i]->{'branchcode'};#
|
||||
$select_branches{$branches[$i]->{'branchcode'}} = $branches[$i]->{'branchname'};
|
||||
}
|
||||
my $CGIbranch=CGI::scrolling_list( -name => 'value',
|
||||
-values => \@select_branch,
|
||||
-labels => \%select_branches,
|
||||
-size => 1,
|
||||
-multiple => 0 );
|
||||
$sth->finish;
|
||||
|
||||
|
||||
$template->param("statements" => \@statements,
|
||||
"nbstatements" => 3,
|
||||
CGIitemtype => $CGIitemtype,
|
||||
CGIbranch => $CGIbranch,
|
||||
);
|
||||
}
|
||||
|
||||
$template->param(authtypesloop => \@authtypesloop);
|
||||
|
|
|
|||
|
|
@ -172,6 +172,7 @@ sub build_tabs ($$$$) {
|
|||
my @loop_data = ();
|
||||
foreach my $tag (sort(keys (%{$tagslib}))) {
|
||||
my $indicator;
|
||||
# warn "TAG : $tag => ".$tagslib->{$tag}->{lib}."//";
|
||||
# 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)) {
|
||||
|
|
@ -285,9 +286,11 @@ my $error = $input->param('error');
|
|||
my $authid=$input->param('authid'); # if authid exists, it's a modif, not a new authority.
|
||||
my $z3950 = $input->param('z3950');
|
||||
my $op = $input->param('op');
|
||||
# warn "OP : $op";
|
||||
my $authtypecode = $input->param('authtypecode');
|
||||
my $dbh = C4::Context->dbh;
|
||||
$authtypecode = &AUTHfind_authtypecode($dbh,$authid) if $authid;
|
||||
# warn "authtypecode : $authtypecode && authid = $authid";
|
||||
my ($template, $loggedinuser, $cookie)
|
||||
= get_template_and_user({template_name => "authorities/authorities.tmpl",
|
||||
query => $input,
|
||||
|
|
@ -300,11 +303,11 @@ my ($template, $loggedinuser, $cookie)
|
|||
$tagslib = AUTHgettagslib($dbh,1,$authtypecode);
|
||||
my $record=-1;
|
||||
my $encoding="";
|
||||
$record = AUTHgetauth($dbh,$authid) if ($authid);
|
||||
$record = AUTHgetauthority($dbh,$authid) if ($authid);
|
||||
|
||||
$is_a_modif=0;
|
||||
my ($oldbiblionumtagfield,$oldbiblionumtagsubfield);
|
||||
my ($oldbiblioitemnumtagfield,$oldbiblioitemnumtagsubfield,$bibitem,$oldbiblioitemnumber);
|
||||
# my ($oldbiblionumtagfield,$oldbiblionumtagsubfield);
|
||||
# my ($oldbiblioitemnumtagfield,$oldbiblioitemnumtagsubfield,$bibitem,$oldbiblioitemnumber);
|
||||
if ($authid) {
|
||||
$is_a_modif=1;
|
||||
# if it's a modif, retrieve old biblio and bibitem numbers for the future modification of old-DB.
|
||||
|
|
@ -331,6 +334,7 @@ if ($op eq "add") {
|
|||
}
|
||||
my $record = AUTHhtml2marc($dbh,\@tags,\@subfields,\@values,%indicators);
|
||||
# MARC::Record built => now, record in DB
|
||||
warn "IN ADD : ".$record->as_formatted();
|
||||
if ($is_a_modif) {
|
||||
AUTHmodauthority($dbh,$record,$authid,$authtypecode);
|
||||
} else {
|
||||
|
|
@ -384,30 +388,40 @@ if ($op eq "add") {
|
|||
build_tabs ($template, $record, $dbh,$encoding);
|
||||
build_hidden_data;
|
||||
$template->param(
|
||||
authid => $authid,
|
||||
oldbiblionumtagfield => $oldbiblionumtagfield,
|
||||
oldbiblionumtagsubfield => $oldbiblionumtagsubfield,
|
||||
oldbiblioitemnumtagfield => $oldbiblioitemnumtagfield,
|
||||
oldbiblioitemnumtagsubfield => $oldbiblioitemnumtagsubfield,
|
||||
oldbiblioitemnumber => $oldbiblioitemnumber );
|
||||
authid => $authid,);
|
||||
# oldbiblionumtagfield => $oldbiblionumtagfield,
|
||||
# oldbiblionumtagsubfield => $oldbiblionumtagsubfield,
|
||||
# oldbiblioitemnumtagfield => $oldbiblioitemnumtagfield,
|
||||
# oldbiblioitemnumtagsubfield => $oldbiblioitemnumtagsubfield,
|
||||
# oldbiblioitemnumber => $oldbiblioitemnumber );
|
||||
} elsif ($op eq "delete") {
|
||||
#------------------------------------------------------------------------------------------------------------------------------
|
||||
&AUTHdelauthority($dbh,$authid);
|
||||
}
|
||||
#------------------------------------------------------------------------------------------------------------------------------
|
||||
#------------------------------------------------------------------------------------------------------------------------------
|
||||
# MAIN
|
||||
#------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
build_tabs ($template, $record, $dbh,$encoding);
|
||||
build_hidden_data;
|
||||
$template->param(
|
||||
authid => $authid,
|
||||
oldbiblionumtagfield => $oldbiblionumtagfield,
|
||||
oldbiblionumtagsubfield => $oldbiblionumtagsubfield,
|
||||
oldbiblioitemnumtagfield => $oldbiblioitemnumtagfield,
|
||||
oldbiblioitemnumtagsubfield => $oldbiblioitemnumtagsubfield,
|
||||
oldbiblioitemnumber => $oldbiblioitemnumber );
|
||||
$template->param(
|
||||
authtypecode => $authtypecode,
|
||||
);
|
||||
# oldbiblionumtagfield => $oldbiblionumtagfield,
|
||||
# oldbiblionumtagsubfield => $oldbiblionumtagsubfield,
|
||||
# oldbiblioitemnumtagfield => $oldbiblioitemnumtagfield,
|
||||
# # oldbiblioitemnumtagsubfield => $oldbiblioitemnumtagsubfield,
|
||||
# oldbiblioitemnumber => $oldbiblioitemnumber,
|
||||
authtypecode => $authtypecode,
|
||||
);
|
||||
|
||||
my $authtypes = getauthtypes;
|
||||
my @authtypesloop;
|
||||
foreach my $thisauthtype (keys %$authtypes) {
|
||||
my $selected = 1 if $thisauthtype eq $authtypecode;
|
||||
my %row =(value => $thisauthtype,
|
||||
selected => $selected,
|
||||
authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
|
||||
);
|
||||
warn "X = $authtypes->{$thisauthtype}{'authtypetext'}";
|
||||
push @authtypesloop, \%row;
|
||||
}
|
||||
|
||||
$template->param(authtypesloop => \@authtypesloop);
|
||||
output_html_with_http_headers $input, $cookie, $template->output;
|
||||
|
|
@ -0,0 +1,183 @@
|
|||
#!/usr/bin/perl
|
||||
|
||||
# Copyright 2000-2002 Katipo Communications
|
||||
#
|
||||
# This file is part of Koha.
|
||||
#
|
||||
# Koha is free software; you can redistribute it and/or modify it under the
|
||||
# terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation; either version 2 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
|
||||
# Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
=head1 NAME
|
||||
|
||||
etail.pl : script to show an authority in MARC format
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This script needs an authid
|
||||
|
||||
It shows the authority in a (nice) MARC format depending on authority MARC
|
||||
parameters tables.
|
||||
|
||||
=head1 FUNCTIONS
|
||||
|
||||
=over 2
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
use strict;
|
||||
require Exporter;
|
||||
use C4::AuthoritiesMarc;
|
||||
use C4::Auth;
|
||||
use C4::Context;
|
||||
use C4::Output;
|
||||
use C4::Interface::CGI::Output;
|
||||
use CGI;
|
||||
use C4::Search;
|
||||
use MARC::Record;
|
||||
use C4::Koha;
|
||||
# use C4::Biblio;
|
||||
# use C4::Catalogue;
|
||||
use HTML::Template;
|
||||
|
||||
my $query=new CGI;
|
||||
|
||||
my $dbh=C4::Context->dbh;
|
||||
|
||||
my $authid = $query->param('authid');
|
||||
my $authtypecode = &AUTHfind_authtypecode($dbh,$authid);
|
||||
my $tagslib = &AUTHgettagslib($dbh,1,$authtypecode);
|
||||
|
||||
my $record =AUTHgetauthority($dbh,$authid);
|
||||
# open template
|
||||
my ($template, $loggedinuser, $cookie)
|
||||
= get_template_and_user({template_name => "authorities/detail.tmpl",
|
||||
query => $query,
|
||||
type => "intranet",
|
||||
authnotrequired => 0,
|
||||
flagsrequired => {catalogue => 1},
|
||||
debug => 1,
|
||||
});
|
||||
|
||||
# fill arrays
|
||||
my @loop_data =();
|
||||
my $tag;
|
||||
# loop through each tab 0 through 9
|
||||
# for (my $tabloop = 0; $tabloop<=10;$tabloop++) {
|
||||
# loop through each tag
|
||||
my @fields = $record->fields();
|
||||
my @loop_data =();
|
||||
foreach my $field (@fields) {
|
||||
my @subfields_data;
|
||||
# if tag <10, there's no subfield, use the "@" trick
|
||||
if ($field->tag()<10) {
|
||||
# next if ($tagslib->{$field->tag()}->{'@'}->{tab} ne $tabloop);
|
||||
next if ($tagslib->{$field->tag()}->{'@'}->{hidden});
|
||||
my %subfield_data;
|
||||
$subfield_data{marc_lib}=$tagslib->{$field->tag()}->{'@'}->{lib};
|
||||
$subfield_data{marc_value}=$field->data();
|
||||
$subfield_data{marc_subfield}='@';
|
||||
$subfield_data{marc_tag}=$field->tag();
|
||||
push(@subfields_data, \%subfield_data);
|
||||
} else {
|
||||
my @subf=$field->subfields;
|
||||
# loop through each subfield
|
||||
for my $i (0..$#subf) {
|
||||
$subf[$i][0] = "@" unless $subf[$i][0];
|
||||
# next if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{tab} ne $tabloop);
|
||||
next if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{hidden});
|
||||
my %subfield_data;
|
||||
$subfield_data{marc_lib}=$tagslib->{$field->tag()}->{$subf[$i][0]}->{lib};
|
||||
if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{isurl}) {
|
||||
$subfield_data{marc_value}="<a href=\"$subf[$i][1]\">$subf[$i][1]</a>";
|
||||
} else {
|
||||
$subfield_data{marc_value}=$subf[$i][1];
|
||||
}
|
||||
$subfield_data{marc_subfield}=$subf[$i][0];
|
||||
$subfield_data{marc_tag}=$field->tag();
|
||||
push(@subfields_data, \%subfield_data);
|
||||
}
|
||||
}
|
||||
if ($#subfields_data>=0) {
|
||||
my %tag_data;
|
||||
$tag_data{tag}=$field->tag().' -'. $tagslib->{$field->tag()}->{lib};
|
||||
$tag_data{subfield} = \@subfields_data;
|
||||
push (@loop_data, \%tag_data);
|
||||
}
|
||||
}
|
||||
$template->param("0XX" =>\@loop_data);
|
||||
# }
|
||||
# now, build item tab !
|
||||
# the main difference is that datas are in lines and not in columns : thus, we build the <th> first, then the values...
|
||||
# loop through each tag
|
||||
# warning : we may have differents number of columns in each row. Thus, we first build a hash, complete it if necessary
|
||||
# then construct template.
|
||||
# my @fields = $record->fields();
|
||||
# my %witness; #---- stores the list of subfields used at least once, with the "meaning" of the code
|
||||
# my @big_array;
|
||||
# foreach my $field (@fields) {
|
||||
# next if ($field->tag()<10);
|
||||
# my @subf=$field->subfields;
|
||||
# my %this_row;
|
||||
# # loop through each subfield
|
||||
# for my $i (0..$#subf) {
|
||||
# next if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{tab} ne 10);
|
||||
# $witness{$subf[$i][0]} = $tagslib->{$field->tag()}->{$subf[$i][0]}->{lib};
|
||||
# $this_row{$subf[$i][0]} =$subf[$i][1];
|
||||
# }
|
||||
# if (%this_row) {
|
||||
# push(@big_array, \%this_row);
|
||||
# }
|
||||
# }
|
||||
# #fill big_row with missing datas
|
||||
# foreach my $subfield_code (keys(%witness)) {
|
||||
# for (my $i=0;$i<=$#big_array;$i++) {
|
||||
# $big_array[$i]{$subfield_code}=" " unless ($big_array[$i]{$subfield_code});
|
||||
# }
|
||||
# }
|
||||
# # now, construct template !
|
||||
# my @item_value_loop;
|
||||
# my @header_value_loop;
|
||||
# for (my $i=0;$i<=$#big_array; $i++) {
|
||||
# my $items_data;
|
||||
# foreach my $subfield_code (keys(%witness)) {
|
||||
# $items_data .="<td>".$big_array[$i]{$subfield_code}."</td>";
|
||||
# }
|
||||
# my %row_data;
|
||||
# $row_data{item_value} = $items_data;
|
||||
# push(@item_value_loop,\%row_data);
|
||||
# }
|
||||
# foreach my $subfield_code (keys(%witness)) {
|
||||
# my %header_value;
|
||||
# $header_value{header_value} = $witness{$subfield_code};
|
||||
# push(@header_value_loop, \%header_value);
|
||||
# }
|
||||
|
||||
my $authtypes = getauthtypes;
|
||||
my @authtypesloop;
|
||||
foreach my $thisauthtype (keys %$authtypes) {
|
||||
my $selected = 1 if $thisauthtype eq $authtypecode;
|
||||
my %row =(value => $thisauthtype,
|
||||
selected => $selected,
|
||||
authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
|
||||
);
|
||||
push @authtypesloop, \%row;
|
||||
}
|
||||
|
||||
$template->param(authid => $authid,
|
||||
authtypesloop => \@authtypesloop);
|
||||
output_html_with_http_headers $query, $cookie, $template->output;
|
||||
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
<!-- TMPL_INCLUDE NAME="popup-top.inc" -->
|
||||
<div id="mainbloc">
|
||||
|
||||
<h1 class="authority">Authority search</h1>
|
||||
|
||||
<form name="f" method="post">
|
||||
<input type="hidden" name="op" value="do_search">
|
||||
<input type="hidden" name="type" value="intranet">
|
||||
<input type="hidden" name="nbstatements" value="<!-- TMPL_VAR NAME="nbstatements" -->">
|
||||
<div id="bloc25">
|
||||
<h2 class="authority">Search on</h2>
|
||||
<p>
|
||||
<label class="label100">Authority type</label>
|
||||
<select name="authtype">
|
||||
<!-- TMPL_LOOP name="authtypesloop" -->
|
||||
<option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->>
|
||||
<!-- TMPL_VAR name="authtypetext" -->
|
||||
</option>
|
||||
<!-- /TMPL_LOOP -->
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label class="label100">Search value</label>
|
||||
<input type="text" name="value" value="<!-- TMPL_VAR name="value" -->">
|
||||
<input type="hidden" name="marclist" value="">
|
||||
<input type="hidden" name="and_or" value="and">
|
||||
<input type="hidden" name="excluding" value="">
|
||||
<input type="hidden" name="operator" value="contains">
|
||||
</p>
|
||||
<p>
|
||||
<input type="submit" value="Start search" class="button authority">
|
||||
</p>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- TMPL_INCLUDE NAME="popup-bottom.inc" -->
|
||||
|
||||
|
|
@ -10,161 +10,28 @@
|
|||
<div id="bloc25">
|
||||
<h2 class="authority">Search on</h2>
|
||||
<p>
|
||||
<label class="label20">Keyword</label>
|
||||
<label class="label100">Authority type</label>
|
||||
<select name="authtypecode">
|
||||
<!-- TMPL_LOOP name="authtypesloop" -->
|
||||
<option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->>
|
||||
<!-- TMPL_VAR name="authtypetext" -->
|
||||
</option>
|
||||
<!-- /TMPL_LOOP -->
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<label class="label100">Search value</label>
|
||||
<input type="text" name="value" value="<!-- TMPL_VAR name="value" -->">
|
||||
<input type="hidden" name="marclist" value="">
|
||||
<input type="hidden" name="and_or" value="and">
|
||||
<input type="hidden" name="excluding" value="">
|
||||
<input type="hidden" name="operator" value="contains">
|
||||
<input type="text" name="value" onchange="sql_update()">
|
||||
</p>
|
||||
<p>
|
||||
<label class="label20">Title</label>
|
||||
<input type="hidden" name="marclist" value="biblio.title">
|
||||
<input type="hidden" name="and_or" value="and">
|
||||
<input type="hidden" name="excluding" value="">
|
||||
<input type="hidden" name="operator" value="contains">
|
||||
<input type="text" name="value" onchange="sql_update()">
|
||||
</p>
|
||||
<p>
|
||||
<label class="label20">author</label> <input type="hidden" name="marclist" value="biblio.author">
|
||||
<input type="hidden" name="and_or" value="and">
|
||||
<input type="hidden" name="excluding" value="">
|
||||
<input type="hidden" name="operator" value="contains">
|
||||
<input type="text" name="value" onchange="sql_update()">
|
||||
</p>
|
||||
<p>
|
||||
<label class="label20">barcode</label>
|
||||
<input type="hidden" name="marclist" value="items.barcode">
|
||||
<input type="hidden" name="and_or" value="and">
|
||||
<input type="hidden" name="excluding" value="">
|
||||
<input type="hidden" name="operator" value="contains">
|
||||
<input type="text" name="value" onchange="sql_update()">
|
||||
</p>
|
||||
</div>
|
||||
<div id="bloc25">
|
||||
<h2 class="authority">Search on</h2>
|
||||
<p>
|
||||
<label class="label20">Illustrator</label>
|
||||
<input type="hidden" name="marclist" value="biblioitems.illus">
|
||||
<input type="hidden" name="and_or" value="and">
|
||||
<input type="hidden" name="excluding" value="">
|
||||
<input type="hidden" name="operator" value="contains">
|
||||
<input type="text" name="value" onchange="sql_update()">
|
||||
</p>
|
||||
<p>
|
||||
<label class="label20">Dewey</label><input type="hidden" name="marclist" value="biblioitems.dewey">
|
||||
<input type="hidden" name="and_or" value="and">
|
||||
<input type="hidden" name="excluding" value="">
|
||||
<input type="hidden" name="operator" value="contains">
|
||||
<input type="text" name="value" onchange="sql_update()">
|
||||
</p>
|
||||
<p>
|
||||
<label class="label20">Item Type</label> <input type="hidden" name="marclist" value="biblioitems.itemtype">
|
||||
<input type="hidden" name="and_or" value="and">
|
||||
<input type="hidden" name="excluding" value="">
|
||||
<input type="hidden" name="operator" value="=">
|
||||
<!-- TMPL_VAR name="CGIitemtype" -->
|
||||
</p>
|
||||
<p>
|
||||
<label class="label20">branch</label>
|
||||
<input type="hidden" name="marclist" value="items.holdingbranch">
|
||||
<input type="hidden" name="and_or" value="and">
|
||||
<input type="hidden" name="excluding" value="">
|
||||
<input type="hidden" name="operator" value="=">
|
||||
<!-- TMPL_VAR name="CGIbranch" -->
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div id="bloc100">
|
||||
<h2 class="authority">More fields</h2>
|
||||
<!-- TMPL_LOOP NAME="statements" -->
|
||||
<p>
|
||||
<select name="and_or" size="1" onchange="sql_update()">
|
||||
<option value="and">and</option>
|
||||
<option <!-- TMPL_IF NAME="or" -->selected <!-- /TMPL_IF -->value="or">or</option>
|
||||
</select>
|
||||
<!-- TMPL_VAR name="marclist" -->
|
||||
<select name="excluding" size="1" onchange="sql_update()">
|
||||
<option value="0"> </option>
|
||||
<option <!-- TMPL_IF NAME="not" -->selected <!-- /TMPL_IF -->value="1">not</option>
|
||||
</select>
|
||||
<select name="operator" size="1" onchange="sql_update()">
|
||||
<option <!-- TMPL_IF NAME="contains" -->selected<!-- /TMPL_IF --> value="contains">Contains</option>
|
||||
<option <!-- TMPL_IF NAME="eq" -->selected<!-- /TMPL_IF --> value="=">Is equal to</option>
|
||||
<option <!-- TMPL_IF NAME="start" -->selected<!-- /TMPL_IF --> value="start">Starts with</option>
|
||||
<option <!-- TMPL_IF NAME="gt" -->selected<!-- /TMPL_IF --> value=">">Is greater than</option>
|
||||
<option <!-- TMPL_IF NAME="ge" -->selected<!-- /TMPL_IF --> value=">=">Is greater or equal to</option>
|
||||
<option <!-- TMPL_IF NAME="lt" -->selected<!-- /TMPL_IF --> value="<">Is lower than</option>
|
||||
<option <!-- TMPL_IF NAME="le" -->selected<!-- /TMPL_IF --> value="<=">Is lower or equal to</option>
|
||||
</select>
|
||||
<input type="text" name="value" onChange="sql_update()" <!-- TMPL_IF NAME="value" -->value="<!-- TMPL_VAR NAME="value" -->"<!-- /TMPL_IF -->>
|
||||
</p>
|
||||
<!-- /TMPL_LOOP -->
|
||||
<p>
|
||||
<input type="button authority" value="Add criteria" onClick="AddStatement()" class="button authority">
|
||||
</p>
|
||||
Warning : the "contains" statement does NOT work if you enter 2 or less letters
|
||||
</div>
|
||||
<div id="bloc25">
|
||||
<p>
|
||||
<div name="sql">
|
||||
<textarea name="sql" rows=3 cols=70 disabled readonly></textarea>
|
||||
</div>
|
||||
</p>
|
||||
<p>Results per page :
|
||||
<select align="right" name="resultsperpage" size="1">
|
||||
<option value="20">20</option>
|
||||
<option value="50">50</option>
|
||||
<option value="100">100</option>
|
||||
</select>
|
||||
Ordered by
|
||||
<select name="orderby" size="1">
|
||||
<option value="biblio.title">Title</option>
|
||||
<option value="biblio.author">Author</option>
|
||||
<option value="biblioitems.dewey">Dewey</option>
|
||||
<option value="biblioitems.publicationyear">Publication Year</option>
|
||||
<option value="biblioitems.publishercode">Publisher</option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<input type="submit" value="Start search" class="button authority">
|
||||
<a href="javascript:PopupSuggestion()" class="button authority">Suggestions</a>
|
||||
</p>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
function sql_update() {
|
||||
document.f.sql.value="";
|
||||
for (i=0 ; i<document.f.marclist.length ; i++) {
|
||||
if (document.f.value[i].value.length>0) {
|
||||
document.f.sql.value = document.f.sql.value+
|
||||
document.f.and_or[i].value + ' (' +
|
||||
document.f.excluding[i].value + ' ' +
|
||||
document.f.marclist[i].value + ' ' +
|
||||
document.f.operator[i].value + ' ' +
|
||||
'\''+document.f.value[i].value + '\') ';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function AddStatement() {
|
||||
|
||||
document.forms[0].op.value="AddStatement";
|
||||
document.f.submit();
|
||||
}
|
||||
|
||||
function PopupSuggestion() {
|
||||
var strQuery="";
|
||||
for (i=0 ; i<document.f.marclist.length ; i++) {
|
||||
if (document.f.value[i].value.length>0) {
|
||||
strQuery += " "+document.f.value[i].value;
|
||||
}
|
||||
}
|
||||
newin=window.open("suggest.pl?Q="+strQuery,"Suggestions",'width=500,height=400,toolbar=false,scrollbars=yes');
|
||||
}
|
||||
|
||||
</script>
|
||||
</div>
|
||||
<!-- TMPL_INCLUDE NAME="auth-bottom.inc" -->
|
||||
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ function Check(f) {
|
|||
alertString2 += "\n- "+ total_missing_mandatory_subfields +_(" mandatory fields empty (see bold subfields)");
|
||||
alert(alertString2);
|
||||
} else {
|
||||
document.forms[0].submit();
|
||||
document.forms[1].submit();
|
||||
}
|
||||
}
|
||||
function Dopop(link,i) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
<!-- TMPL_INCLUDE NAME="auth-top.inc" -->
|
||||
<link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR name="themelang" -->/includes/marc-editor.css">
|
||||
<div class="tabbed">
|
||||
<h1 class="authority">Authority number : <!-- TMPL_VAR name="authid" --></h1>
|
||||
<a href="authorities.pl?authid=<!-- TMPL_VAR name="authid" -->">
|
||||
<img border="0" src="<!-- TMPL_VAR name="interface" -->/<!-- TMPL_VAR name="theme" -->/images/fileopen.png">
|
||||
</a>
|
||||
<a href="javascript:confirm_deletion()">
|
||||
<img border="0" src="<!-- TMPL_VAR name="interface" -->/<!-- TMPL_VAR name="theme" -->/images/edittrash.png">
|
||||
</a>
|
||||
<a href="javascript:Dopop('detailprint.pl?authid=<!-- TMPL_VAR name="authid" -->')" class="button authority">
|
||||
Print
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div name="0XX" id="0XX" class="tab" style="visibility:visible">
|
||||
<!-- TMPL_LOOP name="0XX" -->
|
||||
<p class="MARCtag">
|
||||
<!-- TMPL_VAR name="tag" -->
|
||||
</p>
|
||||
<!-- TMPL_LOOP name="subfield" -->
|
||||
<p>
|
||||
<label class="labelsubfield">
|
||||
<a href="search.marc/search.pl?op=do_search&marclist=<!-- TMPL_VAR name="marc_tag" --><!-- TMPL_VAR name="marc_subfield" -->&operator==&type=intranet&value=<!-- TMPL_VAR name="marc_value" ESCAPE=URL -->">
|
||||
<img border="0" src="<!-- TMPL_VAR name="interface" -->/<!-- TMPL_VAR name="theme" -->/images/filefind.png" height=15>
|
||||
</a>
|
||||
<!-- TMPL_VAR name="marc_subfield" -->
|
||||
<!-- TMPL_VAR name="marc_lib" --></label>
|
||||
<!-- TMPL_VAR name="marc_value" -->
|
||||
</p>
|
||||
<!-- /TMPL_LOOP -->
|
||||
<!-- /TMPL_LOOP -->
|
||||
</div>
|
||||
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
|
||||
function confirm_deletion() {
|
||||
var is_confirmed = confirm('Are you sure you want to delete this biblio?');
|
||||
if (is_confirmed) {
|
||||
window.location="acqui.simple/addbiblio.pl?op=delete&bibid=<!-- TMPL_VAR name="bibid" -->";
|
||||
}
|
||||
}
|
||||
function Dopop(link) {
|
||||
newin=window.open(link,'width=500,height=400,toolbar=false,scrollbars=yes');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
<!-- TMPL_INCLUDE NAME="auth-top.inc" -->
|
||||
<div id="mainbloc">
|
||||
<h1 class="authority">Authority search results</h1>
|
||||
<div id="resultnumber">
|
||||
<p>
|
||||
<!-- TMPL_IF NAME=displayprev -->
|
||||
<a href=search.pl?startfrom=<!-- TMPL_VAR NAME="startfromprev" -->&<!-- TMPL_LOOP NAME=searchdata --><!-- TMPL_VAR NAME="term" -->=<!-- TMPL_VAR name="val" ESCAPE=URL -->&<!-- /TMPL_LOOP -->resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&type=intranet&op=do_search>
|
||||
<img src="/intranet-tmpl/default/images/numbers/prev.gif" border=0>
|
||||
</a>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_LOOP NAME=numbers -->
|
||||
<!-- TMPL_IF NAME=highlight -->
|
||||
<img src="/intranet-tmpl/default/images/numbers/<!-- TMPL_VAR NAME=number -->-highlight.gif">
|
||||
<!-- TMPL_ELSE -->
|
||||
<a href=search.pl?startfrom=<!-- TMPL_VAR NAME=startfrom -->&<!-- TMPL_LOOP NAME=searchdata --><!-- TMPL_VAR NAME="term" -->=<!-- TMPL_VAR name="val" ESCAPE=URL -->&<!-- /TMPL_LOOP -->resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&type=intranet&op=do_search><img src="/intranet-tmpl/default/images/numbers/<!-- TMPL_VAR NAME=number -->.gif" border=0></a>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- /TMPL_LOOP -->
|
||||
<!-- TMPL_IF NAME=displaynext -->
|
||||
<a href=search.pl?startfrom=<!-- TMPL_VAR NAME="startfromnext" -->&<!-- TMPL_LOOP NAME=searchdata --><!-- TMPL_VAR NAME="term" -->=<!-- TMPL_VAR name="val" ESCAPE=URL -->&<!-- /TMPL_LOOP -->&resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&type=intranet&op=do_search><img src="/intranet-tmpl/default/images/numbers/next.gif" border=0></a>
|
||||
<!-- /TMPL_IF -->
|
||||
</p>
|
||||
<p>
|
||||
<!-- TMPL_IF name=total -->
|
||||
 <b>Results <!-- TMPL_VAR name="from" --> to <!-- TMPL_VAR name="to" --> of <!-- TMPL_VAR name="total" --></b><br><br>
|
||||
<!-- TMPL_ELSE -->
|
||||
  No results found.<br>
|
||||
<!-- /TMPL_IF -->
|
||||
</p>
|
||||
</div>
|
||||
<div id="resultlist">
|
||||
<table>
|
||||
<tr>
|
||||
<th class="authority">Authority #</th>
|
||||
<th class="authority">Author</th>
|
||||
</tr>
|
||||
<!-- TMPL_LOOP name="result" -->
|
||||
<tr>
|
||||
<td><a href="detail.pl?authid=<!-- TMPL_VAR name="authid" -->"><!-- TMPL_VAR name="authid" --></a></td>
|
||||
<td><!-- TMPL_VAR name="summary" --></td>
|
||||
</tr>
|
||||
<!-- /TMPL_LOOP -->
|
||||
</table>
|
||||
</div>
|
||||
<div id="resultnumber">
|
||||
<p>
|
||||
<!-- TMPL_IF NAME=displayprev -->
|
||||
<a href=search.pl?startfrom=<!-- TMPL_VAR NAME="startfromprev" -->&<!-- TMPL_LOOP NAME=searchdata --><!-- TMPL_VAR NAME="term" -->=<!-- TMPL_VAR name="val" ESCAPE=URL -->&<!-- /TMPL_LOOP -->resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&type=intranet&op=do_search><img src="/intranet-tmpl/default/images/numbers/prev.gif" border=0></a>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- TMPL_LOOP NAME=numbers -->
|
||||
<!-- TMPL_IF NAME=highlight -->
|
||||
<img src="/intranet-tmpl/default/images/numbers/<!-- TMPL_VAR NAME=number -->-highlight.gif">
|
||||
<!-- TMPL_ELSE -->
|
||||
<a href=search.pl?startfrom=<!-- TMPL_VAR NAME=startfrom -->&<!-- TMPL_LOOP NAME=searchdata --><!-- TMPL_VAR NAME="term" -->=<!-- TMPL_VAR name="val" ESCAPE=URL -->&<!-- /TMPL_LOOP -->resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&type=intranet&op=do_search><img src="/intranet-tmpl/default/images/numbers/<!-- TMPL_VAR NAME=number -->.gif" border=0></a>
|
||||
<!-- /TMPL_IF -->
|
||||
<!-- /TMPL_LOOP -->
|
||||
<!-- TMPL_IF NAME=displaynext -->
|
||||
<a href=search.pl?startfrom=<!-- TMPL_VAR NAME="startfromnext" -->&<!-- TMPL_LOOP NAME=searchdata --><!-- TMPL_VAR NAME="term" -->=<!-- TMPL_VAR name="val" ESCAPE=URL -->&<!-- /TMPL_LOOP -->&resultsperpage=<!-- TMPL_VAR NAME="resultsperpage" -->&type=intranet&op=do_search><img src="/intranet-tmpl/default/images/numbers/next.gif" border=0></a>
|
||||
<!-- /TMPL_IF -->
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- TMPL_INCLUDE NAME="auth-bottom.inc" -->
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
if(!x && document.getElementById) x=document.getElementById(n); return x;
|
||||
}
|
||||
function SetOn(item) {
|
||||
for(i=1;i<=6;i++) {
|
||||
for(i=1;i<=7;i++) {
|
||||
SetOff(i);
|
||||
}
|
||||
if (!(layer = MM_findObj('Hint' + item))) return;
|
||||
|
|
@ -113,10 +113,14 @@
|
|||
All the system reports
|
||||
</div>
|
||||
<div id="Hint5" class="hint">
|
||||
<h1 class="reports">Authorities</h1>
|
||||
Authorities management & searches
|
||||
</div>
|
||||
<div id="Hint6" class="hint">
|
||||
<h1 class="parameters">Parameters</h1>
|
||||
Alter Koha System preferences
|
||||
</div>
|
||||
<div id="Hint6" class="hint">
|
||||
<div id="Hint7" class="hint">
|
||||
<h1 class="circulation">Circulation</h1>
|
||||
Work at the front desk on Issues and returns using only a barcode reader and a mouse
|
||||
</div>
|
||||
|
|
@ -125,13 +129,15 @@
|
|||
|
||||
<a href="/cgi-bin/koha/loadmodules.pl?module=search&type=intranet" class="catalogue" onMouseOver="SetOn(1);">Catalogue</a><br/>
|
||||
|
||||
<a href="/cgi-bin/koha/circ/circulation.pl" class="circulation" onMouseOver="SetOn(6);">Circulation</a><br/>
|
||||
<a href="/cgi-bin/koha/circ/circulation.pl" class="circulation" onMouseOver="SetOn(7);">Circulation</a><br/>
|
||||
|
||||
<a href="/cgi-bin/koha/members/members-home.pl" class="members" onMouseOver="SetOn(2);">Members</a><br/>
|
||||
|
||||
<a href="/cgi-bin/koha/authorities/authorities-home.pl" class="reports" onMouseOver="SetOn(5);">Authorities</a><br/>
|
||||
|
||||
<a href="/cgi-bin/koha/reports-home.pl" class="reports" onMouseOver="SetOn(4);">Reports</a><br/>
|
||||
|
||||
<a href="/cgi-bin/koha/admin-home.pl" class="parameters" onMouseOver="SetOn(5);">Parameters</a><br/>
|
||||
<a href="/cgi-bin/koha/admin-home.pl" class="parameters" onMouseOver="SetOn(6);">Parameters</a><br/>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
<label> </label>
|
||||
<label>Text for OPAC</label> <input type=text name="libopac" value="<!-- TMPL_VAR name="libopac" -->" size=40 maxlength=80>
|
||||
</p>
|
||||
<p><label> </label><label>Managed in tab</label> <!-- TMPL_VAR name="tab" --> (ignore means that the subfield is NOT managed by Koha)</p>
|
||||
<p><label> </label><label>Managed</label> <!-- TMPL_VAR name="tab" --></p>
|
||||
<p><label> </label><!-- TMPL_VAR name="hidden" --> hidden (subfield is managed, but hidden. -should be filled by a plugin or thesaurus-)</p>
|
||||
<p><label> </label><!-- TMPL_VAR name="isurl" --> URL (if checked, it means that the subfield is an URL and can be clicked</p>
|
||||
<p>
|
||||
|
|
@ -103,8 +103,7 @@
|
|||
<!-- TMPL_IF name="subfield_ignored" -->
|
||||
<i>subfield ignored</i>
|
||||
<!-- TMPL_ELSE -->
|
||||
Tab :<!-- TMPL_VAR name="tab" -->,
|
||||
<!-- TMPL_IF name="repeatable" -->Repeatable, <!-- TMPL_ELSE -->Not repeatable,<!-- /TMPL_IF -->
|
||||
Managed, <!-- TMPL_IF name="repeatable" -->Repeatable, <!-- TMPL_ELSE -->Not repeatable,<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="mandatory" -->Mandatory, <!-- TMPL_ELSE -->Not mandatory,<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="seealso" -->see also : <!-- TMPL_VAR name="seealso" -->,<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="hidden" -->hidden,<!-- /TMPL_IF -->
|
||||
|
|
|
|||
|
|
@ -73,6 +73,10 @@ function Check(f) {
|
|||
<label class="label100">Description</label>
|
||||
<input type=text name="authtypetext" size=40 maxlength=80 value='<!-- TMPL_VAR name="authtypetext" escape=HTML -->'>
|
||||
</p>
|
||||
<p>
|
||||
<label class="label100">Summary</label>
|
||||
<textarea name="summary" cols="40" rows="10"><!-- TMPL_VAR name="summary" --></textarea>
|
||||
</p>
|
||||
<p><label class="label100">Report tag</label>
|
||||
<input type="text" name="auth_tag_to_report" size=5 maxlength=3 value="<!-- TMPL_VAR name="auth_tag_to_report">">
|
||||
Enter here the number of the tag that will be reported in the biblio (subfield by subfield). For example, in UNIMARC, enter 200 to report every 200 subfield in the 70x biblio</p>
|
||||
|
|
@ -112,6 +116,7 @@ function Check(f) {
|
|||
<tr>
|
||||
<th class="parameters">Code</th>
|
||||
<th class="parameters">Description</th>
|
||||
<th class="parameters">summary</th>
|
||||
<th class="parameters">Tag reported</th>
|
||||
<th class="parameters"> </th>
|
||||
<th class="parameters">Edit</th>
|
||||
|
|
@ -121,6 +126,7 @@ function Check(f) {
|
|||
<td> </td>
|
||||
<td>Default framework</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td><a href="auth_tag_structure.pl" class="button parameters">MARC structure</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
|
|
@ -130,6 +136,7 @@ function Check(f) {
|
|||
<tr>
|
||||
<td><!-- TMPL_VAR name="authtypecode" --></td>
|
||||
<td><!-- TMPL_VAR name="authtypetext" --></td>
|
||||
<td><!-- TMPL_VAR name="summary" --></td>
|
||||
<td><!-- TMPL_VAR name="auth_tag_to_report" --></td>
|
||||
<td><a href="auth_tag_structure.pl?authtypecode=<!-- TMPL_VAR name="authtypecode" -->" class="button parameters" >MARC structure</a></td>
|
||||
<td><a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&authtypecode=<!-- TMPL_VAR name="authtypecode" escape="HTML" -->"><img src="<!-- TMPL_VAR NAME='interface' -->/<!-- TMPL_VAR name="theme" -->/images/fileopen.png" width=32 hspace=0 vspace=0 border=0></a></td>
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
<p><label> </label><!-- TMPL_VAR name="isurl" --> URL (if checked, it means that the subfield is an URL and can be clicked</p>
|
||||
<p>
|
||||
<label> </label><label>Auth value:</label> <!-- TMPL_VAR name="authorised_value" -->
|
||||
or thesaurus: <!-- TMPL_VAR name="thesaurus_category" -->
|
||||
or thesaurus: <!-- TMPL_VAR name="authtypes" -->
|
||||
or plugin: <!-- TMPL_VAR name="value_builder" -->
|
||||
</p>
|
||||
</td>
|
||||
|
|
@ -116,7 +116,7 @@
|
|||
<!-- TMPL_IF name="hidden" -->hidden,<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="isurl" -->is an url,<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="authorised_value" --> Auth value :<!-- TMPL_VAR name="authorised_value" -->,<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="thesaurus_category" --> Thesaurus :<!-- TMPL_VAR name="thesaurus_category" -->,<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="authtypecode" --> Authority :<!-- TMPL_VAR name="authtypecode" -->,<!-- /TMPL_IF -->
|
||||
<!-- TMPL_IF name="value_builder" -->Plugin :<!-- TMPL_VAR name="value_builder" -->,<!-- /TMPL_IF -->
|
||||
<!-- /TMPL_IF -->
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -212,6 +212,7 @@ my %requiretables = (
|
|||
authtypecode char(10) not NULL,
|
||||
authtypetext char(255) not NULL,
|
||||
auth_tag_to_report char(3) not NULL,
|
||||
summary text not NULL,
|
||||
PRIMARY KEY (authtypecode)
|
||||
)",
|
||||
biblio_framework => "(
|
||||
|
|
@ -261,7 +262,6 @@ my %requiretables = (
|
|||
subfieldcode char(1) NOT NULL default '',
|
||||
subfieldorder tinyint(4) NOT NULL default '1',
|
||||
subfieldvalue varchar(255) default NULL,
|
||||
valuebloblink bigint(20) default NULL,
|
||||
PRIMARY KEY (subfieldid),
|
||||
KEY authid (authid),
|
||||
KEY tag (tag),
|
||||
|
|
@ -1111,6 +1111,23 @@ if ($items{'bulk'} eq "varchar(30)") {
|
|||
$sti->execute;
|
||||
}
|
||||
|
||||
# changing the marc_subfield_structure table around...
|
||||
my %marc_subfield_structure;
|
||||
|
||||
$sth = $dbh->prepare("show columns from marc_subfield_structure");
|
||||
$sth->execute;
|
||||
while ( my ( $column, $type, $null, $key, $default, $extra ) = $sth->fetchrow )
|
||||
{
|
||||
$marc_subfield_structure{$column} = $type;
|
||||
}
|
||||
|
||||
if ($marc_subfield_structure{thesaurus_category}) {
|
||||
print " changing thesaurus_category in marc_subfield_structure table\n";
|
||||
my $sti =
|
||||
$dbh->prepare("ALTER TABLE marc_subfield_structure CHANGE `thesaurus_category` `authtypecode` VARCHAR(10 ) DEFAULT NULL");
|
||||
$sti->execute;
|
||||
}
|
||||
|
||||
#
|
||||
# creating index in issuingrules if needed
|
||||
#
|
||||
|
|
@ -1183,6 +1200,9 @@ $sth->finish;
|
|||
exit;
|
||||
|
||||
# $Log$
|
||||
# Revision 1.83 2004/06/10 08:32:02 tipaul
|
||||
# MARC authority management (continued)
|
||||
#
|
||||
# Revision 1.82 2004/06/03 12:46:58 tipaul
|
||||
# * frameworks and itemtypes are independant
|
||||
#
|
||||
|
|
|
|||
Loading…
Reference in New Issue