@@ -, +, @@ QA --- C4/Breeding.pm | 4 +- admin/z3950servers.pl | 105 ++++++++++---------- cataloguing/z3950_auth_search.pl | 2 +- .../prog/en/modules/admin/z3950servers.tt | 12 ++- .../en/modules/cataloguing/z3950_auth_search.tt | 8 +- 5 files changed, 68 insertions(+), 63 deletions(-) --- a/C4/Breeding.pm +++ a/C4/Breeding.pm @@ -455,9 +455,9 @@ sub _isbn_replace { =head2 ImportBreedingAuth - ImportBreedingAuth($marcrecords,$overwrite_auth,$filename,$encoding,$z3950random,$batch_type); +ImportBreedingAuth($marcrecords,$overwrite_auth,$filename,$encoding,$z3950random,$batch_type); - TODO description +TODO description =cut --- a/admin/z3950servers.pl +++ a/admin/z3950servers.pl @@ -85,24 +85,27 @@ $template->param(script_name => $script_name, ################## ADD_FORM ################################## # called by default. Used to create form to add or modify a record -if ($op eq 'add_form') { - $template->param(add_form => 1); - #---- if primkey exists, it's a modify action, so read values to modify... - my $data; - if ($searchfield) { - my $dbh = C4::Context->dbh; - my $sth=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype from z3950servers where (name = ?) order by rank,name"); - $sth->execute($searchfield); - $data=$sth->fetchrow_hashref; - $sth->finish; - } - $template->param( $_ => $data->{$_} ) - for ( qw( host port db userid password checked rank timeout encoding ) ); - $template->param( $_ . $data->{$_} => 1) - for ( qw( syntax recordtype ) ); - # END $OP eq ADD_FORM +if ( $op eq 'add_form' ) { + $template->param( add_form => 1 ); + + #---- if primkey exists, it's a modify action, so read values to modify... + my $data; + if ($searchfield) { + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare( +"select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype from z3950servers where (name = ?) order by rank,name" + ); + $sth->execute($searchfield); + $data = $sth->fetchrow_hashref; + $sth->finish; + } + $template->param( $_ => $data->{$_} ) + for (qw( host port db userid password checked rank timeout encoding )); + $template->param( $_ . $data->{$_} => 1 ) for (qw( syntax recordtype )); + + # END $OP eq ADD_FORM ################## ADD_VALIDATE ################################## -# called by add_form, used to insert/modify data in DB + # called by add_form, used to insert/modify data in DB } elsif ($op eq 'add_validate') { my $dbh=C4::Context->dbh; my $sth=$dbh->prepare("select * from z3950servers where name=?"); @@ -133,43 +136,43 @@ if ($op eq 'add_form') { "(host,port,db,userid,password,name,checked,rank,syntax,encoding,timeout,recordtype) " . "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ); $sth->execute( - $input->param( 'host' ), - $input->param( 'port' ), - $input->param( 'db' ), - $input->param( 'userid' ), - $input->param( 'password' ), - $input->param( 'searchfield' ), - $checked, - $input->param( 'rank' ), - $input->param( 'syntax' ), - $input->param( 'encoding' ), - $input->param( 'timeout' ), - $input->param( 'recordtype' ) ); - } - $sth->finish; - # END $OP eq ADD_VALIDATE + $input->param('host'), $input->param('port'), + $input->param('db'), $input->param('userid'), + $input->param('password'), $input->param('searchfield'), + $checked, $input->param('rank'), + $input->param('syntax'), $input->param('encoding'), + $input->param('timeout'), $input->param('recordtype') + ); + } + $sth->finish; + + # END $OP eq ADD_VALIDATE ################## DELETE_CONFIRM ################################## # called by default form, used to confirm deletion of data in DB } elsif ($op eq 'delete_confirm') { - $template->param(delete_confirm => 1); - my $dbh = C4::Context->dbh; - - my $sth2=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype from z3950servers where (name = ?) order by rank,name"); - $sth2->execute($searchfield); - my $data=$sth2->fetchrow_hashref; - $sth2->finish; - - $template->param(host => $data->{'host'}, - port => $data->{'port'}, - db => $data->{'db'}, - userid => $data->{'userid'}, - password => $data->{'password'}, - checked => $data->{'checked'}, - rank => $data->{'rank'}, - syntax => $data->{'syntax'}, - timeout => $data->{'timeout'}, - recordtype => $data->{'recordtype'}, - encoding => $data->{'encoding'} ); + $template->param( delete_confirm => 1 ); + my $dbh = C4::Context->dbh; + + my $sth2 = $dbh->prepare( +"select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype from z3950servers where (name = ?) order by rank,name" + ); + $sth2->execute($searchfield); + my $data = $sth2->fetchrow_hashref; + $sth2->finish; + + $template->param( + host => $data->{'host'}, + port => $data->{'port'}, + db => $data->{'db'}, + userid => $data->{'userid'}, + password => $data->{'password'}, + checked => $data->{'checked'}, + rank => $data->{'rank'}, + syntax => $data->{'syntax'}, + timeout => $data->{'timeout'}, + recordtype => $data->{'recordtype'}, + encoding => $data->{'encoding'} + ); # END $OP eq DELETE_CONFIRM ################## DELETE_CONFIRMED ################################## --- a/cataloguing/z3950_auth_search.pl +++ a/cataloguing/z3950_auth_search.pl @@ -23,7 +23,7 @@ use strict; use warnings; -use CGI qw( -utf8 ); +use CGI qw / -utf8 /; use C4::Auth; use C4::Output; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt @@ -241,7 +241,7 @@ seconds
Target | Hostname/Port | Database | Userid | Password | Checked | Rank | Syntax | Encoding | Timeout | Record type | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|
[% loo.name %] | [% loo.host %]:[% loo.port %] | [% loo.db %] | [% loo.userid %] | [% loo.password %] | [% IF ( loo.checked ) %]Yes[% ELSE %]No[% END %] | [% loo.rank %] | [% loo.syntax %] | [% loo.encoding %] | [% loo.timeout %] | [% loo.recordtype %] | Edit | Delete | [% loo.name %] | [% loo.host %]:[% loo.port %] | [% loo.db %] | [% loo.userid %] | [% loo.password %] | [% IF ( loo.checked ) %]Yes[% ELSE %]No[% END %] | [% loo.rank %] | + +[% loo.syntax %] | [% loo.encoding %] | [% loo.timeout %] | [% loo.recordtype %] | Edit | Delete | [% END %] -