[Koha-cvs] CVS: koha/admin marc_subfields_structure.pl,1.21,1.22

Paul POULAIN tipaul at users.sourceforge.net
Fri May 28 10:24:16 CEST 2004


Update of /cvsroot/koha/koha/admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29849/admin

Modified Files:
	marc_subfields_structure.pl 
Log Message:
hidding hidden & isurl constraints into MARC subfield structure

Index: marc_subfields_structure.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/marc_subfields_structure.pl,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** marc_subfields_structure.pl	18 May 2004 15:22:45 -0000	1.21
--- marc_subfields_structure.pl	28 May 2004 08:24:14 -0000	1.22
***************
*** 34,38 ****
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $sth=$dbh->prepare("Select tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,thesaurus_category,value_builder from marc_subfield_structure where (tagfield like ? and itemtype=?) order by tagfield");
  	$sth->execute("$searchstring%",$itemtype);
  	my @results;
--- 34,38 ----
  	my @data=split(' ',$searchstring);
  	my $count=@data;
! 	my $sth=$dbh->prepare("Select * from marc_subfield_structure where (tagfield like ? and itemtype=?) order by tagfield");
  	$sth->execute("$searchstring%",$itemtype);
  	my @results;
***************
*** 140,144 ****
  
  	# build values list
! 	my $sth=$dbh->prepare("select tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,thesaurus_category,value_builder from marc_subfield_structure where tagfield=? and itemtype=?"); # and tagsubfield='$tagsubfield'");
  	$sth->execute($tagfield,$itemtype);
  	my @loop_data = ();
--- 140,144 ----
  
  	# build values list
! 	my $sth=$dbh->prepare("select * from marc_subfield_structure where tagfield=? and itemtype=?"); # and tagsubfield='$tagsubfield'");
  	$sth->execute($tagfield,$itemtype);
  	my @loop_data = ();
***************
*** 193,196 ****
--- 193,198 ----
  		$row_data{repeatable} = CGI::checkbox("repeatable$i",$data->{'repeatable'}?'checked':'',1,'');
  		$row_data{mandatory} = CGI::checkbox("mandatory$i",$data->{'mandatory'}?'checked':'',1,'');
+ 		$row_data{hidden} = CGI::checkbox("hidden$i",$data->{'hidden'}?'checked':'',1,'');
+ 		$row_data{isurl} = CGI::checkbox("isurl$i",$data->{'isurl'}?'checked':'',1,'');
  		$row_data{bgcolor} = $toggle;
  		push(@loop_data, \%row_data);
***************
*** 217,220 ****
--- 219,224 ----
  		$row_data{repeatable} = CGI::checkbox('repeatable','',1,'');
  		$row_data{mandatory} = CGI::checkbox('mandatory','',1,'');
+ 		$row_data{hidden} = CGI::checkbox('hidden','',1,'');
+ 		$row_data{isurl} = CGI::checkbox('isurl','',1,'');
  		$row_data{kohafield}= CGI::scrolling_list( -name=>'kohafield',
  					-values=> \@kohafields,
***************
*** 250,255 ****
  	my $dbh = C4::Context->dbh;
  	$template->param(tagfield => "$input->param('tagfield')");
! 	my $sth=$dbh->prepare("replace marc_subfield_structure (tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,thesaurus_category,value_builder,itemtype)
! 									values (?,?,?,?,?,?,?,?,?,?,?,?,?)");
  	my @tagsubfield	= $input->param('tagsubfield');
  	my @liblibrarian	= $input->param('liblibrarian');
--- 254,259 ----
  	my $dbh = C4::Context->dbh;
  	$template->param(tagfield => "$input->param('tagfield')");
! 	my $sth=$dbh->prepare("replace marc_subfield_structure (tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,seealso,authorised_value,thesaurus_category,value_builder,hidden,isurl,itemtype)
! 									values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
  	my @tagsubfield	= $input->param('tagsubfield');
  	my @liblibrarian	= $input->param('liblibrarian');
***************
*** 275,278 ****
--- 279,284 ----
  		my $thesaurus_category		=$thesaurus_category[$i];
  		my $value_builder=$value_builder[$i];
+ 		my $hidden = $input->param("hidden$i")?1:0;
+ 		my $isurl = $input->param("isurl$i")?1:0;
  		if ($liblibrarian) {
  			unless (C4::Context->config('demo') eq 1) {
***************
*** 288,292 ****
  									$authorised_value,
  									$thesaurus_category,
! 									$value_builder,$itemtype);
  			}
  		}
--- 294,302 ----
  									$authorised_value,
  									$thesaurus_category,
! 									$value_builder,
! 									$hidden,
! 									$isurl,
! 									$itemtype,
! 									);
  			}
  		}
***************
*** 301,305 ****
  } elsif ($op eq 'delete_confirm') {
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select tagfield,tagsubfield,liblibrarian,libopac,repeatable,mandatory,kohafield,tab,authorised_value,thesaurus_category,value_builder from marc_subfield_structure where tagfield=? and tagsubfield=? and itemtype=?");
  	$sth->execute($tagfield,$tagsubfield);
  	my $data=$sth->fetchrow_hashref;
--- 311,315 ----
  } elsif ($op eq 'delete_confirm') {
  	my $dbh = C4::Context->dbh;
! 	my $sth=$dbh->prepare("select * from marc_subfield_structure where tagfield=? and tagsubfield=? and itemtype=?");
  	$sth->execute($tagfield,$tagsubfield);
  	my $data=$sth->fetchrow_hashref;
***************
*** 350,355 ****
--- 360,371 ----
  		$row_data{thesaurus_category}	= $results->[$i]{'thesaurus_category'};
  		$row_data{value_builder}	= $results->[$i]{'value_builder'};
+ 		$row_data{hidden}	= $results->[$i]{'hidden'};
+ 		$row_data{isurl}	= $results->[$i]{'isurl'};
  		$row_data{delete} = "$script_name?op=delete_confirm&tagfield=$tagfield&tagsubfield=".$results->[$i]{'tagsubfield'}."&itemtype=$itemtype";
  		$row_data{bgcolor} = $toggle;
+ 		if ($row_data{tab} eq -1) {
+ 			$row_data{subfield_ignored} = 1;
+ 		}
+ 
  		push(@loop_data, \%row_data);
  	}





More information about the Koha-cvs mailing list