Lines 40-46
sub StringSearch {
Link Here
|
40 |
$searchstring = ''; |
40 |
$searchstring = ''; |
41 |
} |
41 |
} |
42 |
|
42 |
|
43 |
my $query = "SELECT host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype"; |
43 |
my $query = "SELECT host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype,opac"; |
44 |
$query .= " FROM z3950servers"; |
44 |
$query .= " FROM z3950servers"; |
45 |
if ( $searchstring ne '' ) { $query .= " WHERE (name like ?)" } |
45 |
if ( $searchstring ne '' ) { $query .= " WHERE (name like ?)" } |
46 |
$query .= " ORDER BY rank,name"; |
46 |
$query .= " ORDER BY rank,name"; |
Lines 93-106
if ( $op eq 'add_form' ) {
Link Here
|
93 |
if ($searchfield) { |
93 |
if ($searchfield) { |
94 |
my $dbh = C4::Context->dbh; |
94 |
my $dbh = C4::Context->dbh; |
95 |
my $sth = $dbh->prepare( |
95 |
my $sth = $dbh->prepare( |
96 |
"select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype from z3950servers where (name = ?) order by rank,name" |
96 |
"select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype,opac from z3950servers where (name = ?) order by rank,name" |
97 |
); |
97 |
); |
98 |
$sth->execute($searchfield); |
98 |
$sth->execute($searchfield); |
99 |
$data = $sth->fetchrow_hashref; |
99 |
$data = $sth->fetchrow_hashref; |
100 |
$sth->finish; |
100 |
$sth->finish; |
101 |
} |
101 |
} |
102 |
$template->param( $_ => $data->{$_} ) |
102 |
$template->param( $_ => $data->{$_} ) |
103 |
for (qw( host port db userid password checked rank timeout encoding )); |
103 |
for (qw( host port db userid password checked rank timeout encoding opac )); |
104 |
$template->param( $_ . $data->{$_} => 1 ) for (qw( syntax recordtype )); |
104 |
$template->param( $_ . $data->{$_} => 1 ) for (qw( syntax recordtype )); |
105 |
|
105 |
|
106 |
# END $OP eq ADD_FORM |
106 |
# END $OP eq ADD_FORM |
Lines 113-119
if ( $op eq 'add_form' ) {
Link Here
|
113 |
my $checked = $input->param('checked') ? 1 : 0; |
113 |
my $checked = $input->param('checked') ? 1 : 0; |
114 |
if ($sth->rows) { |
114 |
if ($sth->rows) { |
115 |
$template->param(confirm_update => 1); |
115 |
$template->param(confirm_update => 1); |
116 |
$sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=?,timeout=?,recordtype=? where name=?"); |
116 |
$sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=?,timeout=?,recordtype=?,opac=? where name=?"); |
117 |
$sth->execute($input->param('host'), |
117 |
$sth->execute($input->param('host'), |
118 |
$input->param('port'), |
118 |
$input->param('port'), |
119 |
$input->param('db'), |
119 |
$input->param('db'), |
Lines 126-131
if ( $op eq 'add_form' ) {
Link Here
|
126 |
$input->param('encoding'), |
126 |
$input->param('encoding'), |
127 |
$input->param('timeout'), |
127 |
$input->param('timeout'), |
128 |
$input->param('recordtype'), |
128 |
$input->param('recordtype'), |
|
|
129 |
($input->param('opac') || 0), |
129 |
$input->param('searchfield'), |
130 |
$input->param('searchfield'), |
130 |
); |
131 |
); |
131 |
} |
132 |
} |
Lines 133-147
if ( $op eq 'add_form' ) {
Link Here
|
133 |
$template->param(confirm_add => 1); |
134 |
$template->param(confirm_add => 1); |
134 |
$sth=$dbh->prepare( |
135 |
$sth=$dbh->prepare( |
135 |
"INSERT INTO z3950servers " . |
136 |
"INSERT INTO z3950servers " . |
136 |
"(host,port,db,userid,password,name,checked,rank,syntax,encoding,timeout,recordtype) " . |
137 |
"(host,port,db,userid,password,name,checked,rank,syntax,encoding,timeout,recordtype,opac) " . |
137 |
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ); |
138 |
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ); |
138 |
$sth->execute( |
139 |
$sth->execute( |
139 |
$input->param('host'), $input->param('port'), |
140 |
$input->param('host'), $input->param('port'), |
140 |
$input->param('db'), $input->param('userid'), |
141 |
$input->param('db'), $input->param('userid'), |
141 |
$input->param('password'), $input->param('searchfield'), |
142 |
$input->param('password'), $input->param('searchfield'), |
142 |
$checked, $input->param('rank'), |
143 |
$checked, $input->param('rank'), |
143 |
$input->param('syntax'), $input->param('encoding'), |
144 |
$input->param('syntax'), $input->param('encoding'), |
144 |
$input->param('timeout'), $input->param('recordtype') |
145 |
$input->param('timeout'), $input->param('recordtype'), |
|
|
146 |
($input->param('opac') || 0), |
145 |
); |
147 |
); |
146 |
} |
148 |
} |
147 |
$sth->finish; |
149 |
$sth->finish; |
Lines 154-160
if ( $op eq 'add_form' ) {
Link Here
|
154 |
my $dbh = C4::Context->dbh; |
156 |
my $dbh = C4::Context->dbh; |
155 |
|
157 |
|
156 |
my $sth2 = $dbh->prepare( |
158 |
my $sth2 = $dbh->prepare( |
157 |
"select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype from z3950servers where (name = ?) order by rank,name" |
159 |
"select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype,opac from z3950servers where (name = ?) order by rank,name" |
158 |
); |
160 |
); |
159 |
$sth2->execute($searchfield); |
161 |
$sth2->execute($searchfield); |
160 |
my $data = $sth2->fetchrow_hashref; |
162 |
my $data = $sth2->fetchrow_hashref; |
Lines 171-176
if ( $op eq 'add_form' ) {
Link Here
|
171 |
syntax => $data->{'syntax'}, |
173 |
syntax => $data->{'syntax'}, |
172 |
timeout => $data->{'timeout'}, |
174 |
timeout => $data->{'timeout'}, |
173 |
recordtype => $data->{'recordtype'}, |
175 |
recordtype => $data->{'recordtype'}, |
|
|
176 |
opac => $data->{'opac'}, |
174 |
encoding => $data->{'encoding'} |
177 |
encoding => $data->{'encoding'} |
175 |
); |
178 |
); |
176 |
|
179 |
|
Lines 203-209
if ( $op eq 'add_form' ) {
Link Here
|
203 |
rank => $results->[$i]{'rank'}, |
206 |
rank => $results->[$i]{'rank'}, |
204 |
syntax => $results->[$i]{'syntax'}, |
207 |
syntax => $results->[$i]{'syntax'}, |
205 |
encoding => $results->[$i]{'encoding'}, |
208 |
encoding => $results->[$i]{'encoding'}, |
206 |
timeout => $results->[$i]{'timeout'}, |
209 |
timeout => $results->[$i]{'timeout'}, |
|
|
210 |
opac => $results->[$i]{'opac'}, |
207 |
recordtype => $results->[$i]{'recordtype'}); |
211 |
recordtype => $results->[$i]{'recordtype'}); |
208 |
push @loop, \%row; |
212 |
push @loop, \%row; |
209 |
|
213 |
|