synch'ing 2.2 and head
This commit is contained in:
parent
ed9616f474
commit
89f7388354
5 changed files with 72 additions and 24 deletions
|
@ -177,7 +177,7 @@ sub create_input () {
|
||||||
$subfield_data{marc_value}= build_authorized_values_list($tag, $subfield, $value, $dbh,$authorised_values_sth);
|
$subfield_data{marc_value}= build_authorized_values_list($tag, $subfield, $value, $dbh,$authorised_values_sth);
|
||||||
# it's a thesaurus / authority field
|
# it's a thesaurus / authority field
|
||||||
} elsif ($tagslib->{$tag}->{$subfield}->{authtypecode}) {
|
} elsif ($tagslib->{$tag}->{$subfield}->{authtypecode}) {
|
||||||
$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"47\" maxlength=\"255\" DISABLE READONLY> <a href=\"javascript:Dopop('../authorities/auth_finder.pl?authtypecode=".$tagslib->{$tag}->{$subfield}->{authtypecode}."&index=$i',$i)\">...</a>";
|
$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"77\" maxlength=\"255\" DISABLE READONLY> <a href=\"javascript:Dopop('../authorities/auth_finder.pl?authtypecode=".$tagslib->{$tag}->{$subfield}->{authtypecode}."&index=$i',$i)\">...</a>";
|
||||||
# it's a plugin field
|
# it's a plugin field
|
||||||
} elsif ($tagslib->{$tag}->{$subfield}->{'value_builder'}) {
|
} elsif ($tagslib->{$tag}->{$subfield}->{'value_builder'}) {
|
||||||
# opening plugin. Just check wether we are on a developper computer on a production one
|
# opening plugin. Just check wether we are on a developper computer on a production one
|
||||||
|
@ -190,18 +190,18 @@ sub create_input () {
|
||||||
require $plugin;
|
require $plugin;
|
||||||
my $extended_param = plugin_parameters($dbh,$rec,$tagslib,$i,$tabloop);
|
my $extended_param = plugin_parameters($dbh,$rec,$tagslib,$i,$tabloop);
|
||||||
my ($function_name,$javascript) = plugin_javascript($dbh,$rec,$tagslib,$i,$tabloop);
|
my ($function_name,$javascript) = plugin_javascript($dbh,$rec,$tagslib,$i,$tabloop);
|
||||||
$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";
|
$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"77\" maxlength=\"255\" OnFocus=\"javascript:Focus$function_name($i)\" OnBlur=\"javascript:Blur$function_name($i)\"> <a href=\"javascript:Clic$function_name($i)\">...</a> $javascript";
|
||||||
# it's an hidden field
|
# it's an hidden field
|
||||||
} elsif ($tag eq '') {
|
} elsif ($tag eq '') {
|
||||||
$subfield_data{marc_value}="<input type=\"hidden\" name=\"field_value\" value=\"$value\">";
|
$subfield_data{marc_value}="<input type=\"hidden\" name=\"field_value\" value=\"$value\">";
|
||||||
} elsif ($tagslib->{$tag}->{$subfield}->{'hidden'}) {
|
} elsif ($tagslib->{$tag}->{$subfield}->{'hidden'}) {
|
||||||
$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"50\" maxlength=\"255\" DISABLE READONLY>";
|
$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"80\" maxlength=\"255\" DISABLE READONLY>";
|
||||||
# it's a standard field
|
# it's a standard field
|
||||||
} else {
|
} else {
|
||||||
if (length($value) >200) {
|
if (length($value) >100) {
|
||||||
$subfield_data{marc_value}="<textarea name=\"fieldvalue\" cols=\"50\" rows=\"5\" >$value</textarea>";
|
$subfield_data{marc_value}="<textarea name=\"field_value\" cols=\"80\" rows=\"5\" >$value</textarea>";
|
||||||
} else {
|
} else {
|
||||||
$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"50\">"; #"
|
$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"80\">"; #"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return \%subfield_data;
|
return \%subfield_data;
|
||||||
|
@ -224,14 +224,26 @@ sub build_tabs ($$$$) {
|
||||||
my $indicator;
|
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 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 MARC::Record is empty => use tab as master loop.
|
||||||
if ($record ne -1 && $record->field($tag)) {
|
if ($record ne -1 && ($record->field($tag) || $tag eq '000')) {
|
||||||
my @fields = $record->field($tag);
|
my @fields;
|
||||||
|
if ($tag ne '000') {
|
||||||
|
@fields = $record->field($tag);
|
||||||
|
} else {
|
||||||
|
push @fields,$record->leader();
|
||||||
|
}
|
||||||
foreach my $field (@fields) {
|
foreach my $field (@fields) {
|
||||||
my @subfields_data;
|
my @subfields_data;
|
||||||
if ($tag<10) {
|
if ($tag<10) {
|
||||||
my $value=$field->data();
|
my ($value,$subfield);
|
||||||
my $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}->{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));
|
push(@subfields_data, &create_input($tag,$subfield,char_decode($value,$encoding),$i,$tabloop,$record,$authorised_values_sth));
|
||||||
$i++;
|
$i++;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
# Suite 330, Boston, MA 02111-1307 USA
|
# Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
# $Log$
|
# $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
|
# synch'ing 2.2 and head
|
||||||
#
|
#
|
||||||
# Revision 1.4.2.1 2005/03/25 12:52:44 tipaul
|
# Revision 1.4.2.1 2005/03/25 12:52:44 tipaul
|
||||||
|
|
|
@ -144,8 +144,9 @@ my ($template, $loggedinuser, $cookie)
|
||||||
my %indicators;
|
my %indicators;
|
||||||
$indicators{995}=' ';
|
$indicators{995}=' ';
|
||||||
# now, build existiing item list
|
# now, build existiing item list
|
||||||
my $temp = MARCgetbiblio($dbh,$bibid);
|
# my $temp = MARCgetbiblio($dbh,$bibid);
|
||||||
my @fields = $temp->fields();
|
# 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 %witness; #---- stores the list of subfields used at least once, with the "meaning" of the code
|
||||||
my @big_array;
|
my @big_array;
|
||||||
#---- finds where items.itemnumber is stored
|
#---- finds where items.itemnumber is stored
|
||||||
|
@ -305,6 +306,14 @@ foreach my $tag (sort keys %{$tagslib}) {
|
||||||
$i++
|
$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.
|
# 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,
|
$template->param(item_loop => \@item_value_loop,
|
||||||
|
|
|
@ -48,6 +48,35 @@ use C4::Search;
|
||||||
use HTML::Template;
|
use HTML::Template;
|
||||||
use C4::Context;
|
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;
|
my %tabsysprefs;
|
||||||
$tabsysprefs{acquisitions}="Acquisitions";
|
$tabsysprefs{acquisitions}="Acquisitions";
|
||||||
|
@ -94,12 +123,12 @@ sub StringSearch {
|
||||||
$sth->execute($syspref);
|
$sth->execute($syspref);
|
||||||
while (my $data=$sth->fetchrow_hashref){
|
while (my $data=$sth->fetchrow_hashref){
|
||||||
push(@results,$data);
|
push(@results,$data);
|
||||||
$cnt ++;
|
$cnt++;
|
||||||
}
|
}
|
||||||
$sth->finish;
|
$sth->finish;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
my $strsth ="Select variable,value,explanation,type,options from systempreferences where variable not in (";
|
my $strsth ="Select variable,value,explanation,type,options from systempreferences where variable not in (";
|
||||||
foreach my $syspref (keys %tabsysprefs){
|
foreach my $syspref (keys %tabsysprefs){
|
||||||
$strsth .= $dbh->quote($syspref).",";
|
$strsth .= $dbh->quote($syspref).",";
|
||||||
|
@ -111,7 +140,7 @@ sub StringSearch {
|
||||||
$sth->execute();
|
$sth->execute();
|
||||||
while (my $data=$sth->fetchrow_hashref){
|
while (my $data=$sth->fetchrow_hashref){
|
||||||
push(@results,$data);
|
push(@results,$data);
|
||||||
$cnt ++;
|
$cnt++;
|
||||||
}
|
}
|
||||||
$sth->finish;
|
$sth->finish;
|
||||||
}
|
}
|
||||||
|
@ -333,9 +362,6 @@ if ($op eq 'add_form') {
|
||||||
#Adding tab management for system preferences
|
#Adding tab management for system preferences
|
||||||
my $tab=$input->param('tab');
|
my $tab=$input->param('tab');
|
||||||
|
|
||||||
if ($searchfield ne '') {
|
|
||||||
$template->param(searchfield => "<p>You Searched for <strong>$searchfield</strong></p>");
|
|
||||||
}
|
|
||||||
my $env;
|
my $env;
|
||||||
my ($count,$results)=StringSearch($env,$searchfield,$tab);
|
my ($count,$results)=StringSearch($env,$searchfield,$tab);
|
||||||
my $toggle=0;
|
my $toggle=0;
|
||||||
|
@ -355,6 +381,7 @@ if ($op eq 'add_form') {
|
||||||
$row_data{delete} = "$script_name?op=delete_confirm&searchfield=".$results->[$i]{'variable'};
|
$row_data{delete} = "$script_name?op=delete_confirm&searchfield=".$results->[$i]{'variable'};
|
||||||
push(@loop_data, \%row_data);
|
push(@loop_data, \%row_data);
|
||||||
}
|
}
|
||||||
|
$tab=($tab?$tab:"Others");
|
||||||
$template->param(loop => \@loop_data, $tab => 1);
|
$template->param(loop => \@loop_data, $tab => 1);
|
||||||
if ($offset>0) {
|
if ($offset>0) {
|
||||||
my $prevpage = $offset-$pagesize;
|
my $prevpage = $offset-$pagesize;
|
||||||
|
|
|
@ -92,8 +92,9 @@ if ($op eq "do_search") {
|
||||||
my @field_data = ();
|
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++) {
|
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 => "and_or", val=>$and_or[$i] };
|
||||||
push @field_data, { term => "excluding", val=>$excluding[$i] };
|
push @field_data, { term => "excluding", val=>$excluding[$i] };
|
||||||
push @field_data, { term => "operator", val=>$operator[$i] };
|
push @field_data, { term => "operator", val=>$operator[$i] };
|
||||||
|
@ -157,7 +158,6 @@ if ($op eq "do_search") {
|
||||||
|
|
||||||
$template->param(authtypesloop => \@authtypesloop,
|
$template->param(authtypesloop => \@authtypesloop,
|
||||||
authtypecode => $authtypecode);
|
authtypecode => $authtypecode);
|
||||||
#warn "CAT : $authtypecode";
|
|
||||||
|
|
||||||
# Print the page
|
# Print the page
|
||||||
output_html_with_http_headers $query, $cookie, $template->output;
|
output_html_with_http_headers $query, $cookie, $template->output;
|
||||||
|
|
Loading…
Reference in a new issue