Browse Source

synch'ing 2.2 and head

3.0.x
tipaul 19 years ago
parent
commit
89f7388354
  1. 32
      acqui.simple/addbiblio.pl
  2. 2
      acqui.simple/additem-nomarc.pl
  3. 13
      acqui.simple/additem.pl
  4. 45
      admin/systempreferences.pl
  5. 4
      authorities/auth_finder.pl

32
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}="<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
} 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}="<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
} elsif ($tag eq '') {
$subfield_data{marc_value}="<input type=\"hidden\" name=\"field_value\" value=\"$value\">";
} 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
} else {
if (length($value) >200) {
$subfield_data{marc_value}="<textarea name=\"fieldvalue\" cols=\"50\" rows=\"5\" >$value</textarea>";
if (length($value) >100) {
$subfield_data{marc_value}="<textarea name=\"field_value\" cols=\"80\" rows=\"5\" >$value</textarea>";
} 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;
@ -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 {

2
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

13
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,

45
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 => "<p>You Searched for <strong>$searchfield</strong></p>");
}
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&amp;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;

4
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;

Loading…
Cancel
Save