Lines 32-38
sub StringSearch {
Link Here
|
32 |
$searchstring=~ s/\'/\\\'/g; |
32 |
$searchstring=~ s/\'/\\\'/g; |
33 |
my @data=split(' ',$searchstring); |
33 |
my @data=split(' ',$searchstring); |
34 |
my $count=@data; |
34 |
my $count=@data; |
35 |
my $sth=$dbh->prepare("Select host,port,db,userid,password,name,id,checked,rank,syntax,encoding from z3950servers where (name like ?) order by rank,name"); |
35 |
my $sth=$dbh->prepare("Select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout from z3950servers where (name like ?) order by rank,name"); |
36 |
$sth->execute("$data[0]\%"); |
36 |
$sth->execute("$data[0]\%"); |
37 |
my @results; |
37 |
my @results; |
38 |
while (my $data=$sth->fetchrow_hashref) { |
38 |
while (my $data=$sth->fetchrow_hashref) { |
Lines 74-86
if ($op eq 'add_form') {
Link Here
|
74 |
my $data; |
74 |
my $data; |
75 |
if ($searchfield) { |
75 |
if ($searchfield) { |
76 |
my $dbh = C4::Context->dbh; |
76 |
my $dbh = C4::Context->dbh; |
77 |
my $sth=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax,encoding from z3950servers where (name = ?) order by rank,name"); |
77 |
my $sth=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout from z3950servers where (name = ?) order by rank,name"); |
78 |
$sth->execute($searchfield); |
78 |
$sth->execute($searchfield); |
79 |
$data=$sth->fetchrow_hashref; |
79 |
$data=$sth->fetchrow_hashref; |
80 |
$sth->finish; |
80 |
$sth->finish; |
81 |
} |
81 |
} |
82 |
$template->param( $_ => $data->{$_} ) |
82 |
$template->param( $_ => $data->{$_} ) |
83 |
for ( qw( host port db userid password checked rank ) ); |
83 |
for ( qw( host port db userid password checked rank timeout ) ); |
84 |
$template->param( $_ . $data->{$_} => 1) |
84 |
$template->param( $_ . $data->{$_} => 1) |
85 |
for ( qw( syntax encoding ) ); |
85 |
for ( qw( syntax encoding ) ); |
86 |
# END $OP eq ADD_FORM |
86 |
# END $OP eq ADD_FORM |
Lines 92-98
if ($op eq 'add_form') {
Link Here
|
92 |
my $sth=$dbh->prepare("select * from z3950servers where name=?"); |
92 |
my $sth=$dbh->prepare("select * from z3950servers where name=?"); |
93 |
$sth->execute($input->param('searchfield')); |
93 |
$sth->execute($input->param('searchfield')); |
94 |
if ($sth->rows) { |
94 |
if ($sth->rows) { |
95 |
$sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=? where name=?"); |
95 |
$sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=?,timeout=? where name=?"); |
96 |
$sth->execute($input->param('host'), |
96 |
$sth->execute($input->param('host'), |
97 |
$input->param('port'), |
97 |
$input->param('port'), |
98 |
$input->param('db'), |
98 |
$input->param('db'), |
Lines 103-116
if ($op eq 'add_form') {
Link Here
|
103 |
$input->param('rank'), |
103 |
$input->param('rank'), |
104 |
$input->param('syntax'), |
104 |
$input->param('syntax'), |
105 |
$input->param('encoding'), |
105 |
$input->param('encoding'), |
|
|
106 |
$input->param('timeout'), |
106 |
$input->param('searchfield'), |
107 |
$input->param('searchfield'), |
107 |
); |
108 |
); |
108 |
} |
109 |
} |
109 |
else { |
110 |
else { |
110 |
$sth=$dbh->prepare( |
111 |
$sth=$dbh->prepare( |
111 |
"INSERT INTO z3950servers " . |
112 |
"INSERT INTO z3950servers " . |
112 |
"(host,port,db,userid,password,name,checked,rank,syntax,encoding) " . |
113 |
"(host,port,db,userid,password,name,checked,rank,syntax,encoding,timeout) " . |
113 |
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ); |
114 |
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ); |
114 |
$sth->execute( |
115 |
$sth->execute( |
115 |
$input->param( 'host' ), |
116 |
$input->param( 'host' ), |
116 |
$input->param( 'port' ), |
117 |
$input->param( 'port' ), |
Lines 121-127
if ($op eq 'add_form') {
Link Here
|
121 |
$input->param( 'checked' ), |
122 |
$input->param( 'checked' ), |
122 |
$input->param( 'rank' ), |
123 |
$input->param( 'rank' ), |
123 |
$input->param( 'syntax' ), |
124 |
$input->param( 'syntax' ), |
124 |
$input->param( 'encoding' ) ); |
125 |
$input->param( 'encoding' ), |
|
|
126 |
$input->param( 'timeout' ) ); |
125 |
} |
127 |
} |
126 |
$sth->finish; |
128 |
$sth->finish; |
127 |
# END $OP eq ADD_VALIDATE |
129 |
# END $OP eq ADD_VALIDATE |
Lines 131-137
if ($op eq 'add_form') {
Link Here
|
131 |
$template->param(delete_confirm => 1); |
133 |
$template->param(delete_confirm => 1); |
132 |
my $dbh = C4::Context->dbh; |
134 |
my $dbh = C4::Context->dbh; |
133 |
|
135 |
|
134 |
my $sth2=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax,encoding from z3950servers where (name = ?) order by rank,name"); |
136 |
my $sth2=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout from z3950servers where (name = ?) order by rank,name"); |
135 |
$sth2->execute($searchfield); |
137 |
$sth2->execute($searchfield); |
136 |
my $data=$sth2->fetchrow_hashref; |
138 |
my $data=$sth2->fetchrow_hashref; |
137 |
$sth2->finish; |
139 |
$sth2->finish; |
Lines 144-150
if ($op eq 'add_form') {
Link Here
|
144 |
checked => $data->{'checked'}, |
146 |
checked => $data->{'checked'}, |
145 |
rank => $data->{'rank'}, |
147 |
rank => $data->{'rank'}, |
146 |
syntax => $data->{'syntax'}, |
148 |
syntax => $data->{'syntax'}, |
147 |
encoding => $data->{'encoding'} ); |
149 |
encoding => $data->{'encoding'}, |
|
|
150 |
timeout => $data->{'timeout'} ); |
148 |
|
151 |
|
149 |
# END $OP eq DELETE_CONFIRM |
152 |
# END $OP eq DELETE_CONFIRM |
150 |
################## DELETE_CONFIRMED ################################## |
153 |
################## DELETE_CONFIRMED ################################## |
Lines 174-180
if ($op eq 'add_form') {
Link Here
|
174 |
checked => $results->[$i]{'checked'}, |
177 |
checked => $results->[$i]{'checked'}, |
175 |
rank => $results->[$i]{'rank'}, |
178 |
rank => $results->[$i]{'rank'}, |
176 |
syntax => $results->[$i]{'syntax'}, |
179 |
syntax => $results->[$i]{'syntax'}, |
177 |
encoding => $results->[$i]{'encoding'}); |
180 |
encoding => $results->[$i]{'encoding'}, |
|
|
181 |
timeout => $results->[$i]{'timeout'}); |
178 |
push @loop, \%row; |
182 |
push @loop, \%row; |
179 |
|
183 |
|
180 |
} |
184 |
} |