|
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 93-99
if ($op eq 'add_form') {
Link Here
|
| 93 |
$sth->execute($input->param('searchfield')); |
93 |
$sth->execute($input->param('searchfield')); |
| 94 |
my $checked = $input->param('checked') ? 1 : 0; |
94 |
my $checked = $input->param('checked') ? 1 : 0; |
| 95 |
if ($sth->rows) { |
95 |
if ($sth->rows) { |
| 96 |
$sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=? where name=?"); |
96 |
$sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=?,timeout=? where name=?"); |
| 97 |
$sth->execute($input->param('host'), |
97 |
$sth->execute($input->param('host'), |
| 98 |
$input->param('port'), |
98 |
$input->param('port'), |
| 99 |
$input->param('db'), |
99 |
$input->param('db'), |
|
Lines 104-117
if ($op eq 'add_form') {
Link Here
|
| 104 |
$input->param('rank'), |
104 |
$input->param('rank'), |
| 105 |
$input->param('syntax'), |
105 |
$input->param('syntax'), |
| 106 |
$input->param('encoding'), |
106 |
$input->param('encoding'), |
|
|
107 |
$input->param('timeout'), |
| 107 |
$input->param('searchfield'), |
108 |
$input->param('searchfield'), |
| 108 |
); |
109 |
); |
| 109 |
} |
110 |
} |
| 110 |
else { |
111 |
else { |
| 111 |
$sth=$dbh->prepare( |
112 |
$sth=$dbh->prepare( |
| 112 |
"INSERT INTO z3950servers " . |
113 |
"INSERT INTO z3950servers " . |
| 113 |
"(host,port,db,userid,password,name,checked,rank,syntax,encoding) " . |
114 |
"(host,port,db,userid,password,name,checked,rank,syntax,encoding,timeout) " . |
| 114 |
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ); |
115 |
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ); |
| 115 |
$sth->execute( |
116 |
$sth->execute( |
| 116 |
$input->param( 'host' ), |
117 |
$input->param( 'host' ), |
| 117 |
$input->param( 'port' ), |
118 |
$input->param( 'port' ), |
|
Lines 122-127
if ($op eq 'add_form') {
Link Here
|
| 122 |
$input->param( 'checked' ), |
123 |
$input->param( 'checked' ), |
| 123 |
$input->param( 'rank' ), |
124 |
$input->param( 'rank' ), |
| 124 |
$input->param( 'syntax' ), |
125 |
$input->param( 'syntax' ), |
|
|
126 |
$input->param( 'timeout' ), |
| 125 |
$input->param( 'encoding' ) ); |
127 |
$input->param( 'encoding' ) ); |
| 126 |
} |
128 |
} |
| 127 |
$sth->finish; |
129 |
$sth->finish; |
|
Lines 132-138
if ($op eq 'add_form') {
Link Here
|
| 132 |
$template->param(delete_confirm => 1); |
134 |
$template->param(delete_confirm => 1); |
| 133 |
my $dbh = C4::Context->dbh; |
135 |
my $dbh = C4::Context->dbh; |
| 134 |
|
136 |
|
| 135 |
my $sth2=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax,encoding from z3950servers where (name = ?) order by rank,name"); |
137 |
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"); |
| 136 |
$sth2->execute($searchfield); |
138 |
$sth2->execute($searchfield); |
| 137 |
my $data=$sth2->fetchrow_hashref; |
139 |
my $data=$sth2->fetchrow_hashref; |
| 138 |
$sth2->finish; |
140 |
$sth2->finish; |
|
Lines 145-150
if ($op eq 'add_form') {
Link Here
|
| 145 |
checked => $data->{'checked'}, |
147 |
checked => $data->{'checked'}, |
| 146 |
rank => $data->{'rank'}, |
148 |
rank => $data->{'rank'}, |
| 147 |
syntax => $data->{'syntax'}, |
149 |
syntax => $data->{'syntax'}, |
|
|
150 |
timeout => $data->{'timeout'}, |
| 148 |
encoding => $data->{'encoding'} ); |
151 |
encoding => $data->{'encoding'} ); |
| 149 |
|
152 |
|
| 150 |
# END $OP eq DELETE_CONFIRM |
153 |
# END $OP eq DELETE_CONFIRM |
|
Lines 175-181
if ($op eq 'add_form') {
Link Here
|
| 175 |
checked => $results->[$i]{'checked'}, |
178 |
checked => $results->[$i]{'checked'}, |
| 176 |
rank => $results->[$i]{'rank'}, |
179 |
rank => $results->[$i]{'rank'}, |
| 177 |
syntax => $results->[$i]{'syntax'}, |
180 |
syntax => $results->[$i]{'syntax'}, |
| 178 |
encoding => $results->[$i]{'encoding'}); |
181 |
encoding => $results->[$i]{'encoding'}, |
|
|
182 |
timeout => $results->[$i]{'timeout'}); |
| 179 |
push @loop, \%row; |
183 |
push @loop, \%row; |
| 180 |
|
184 |
|
| 181 |
} |
185 |
} |