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"; |
43 |
my $query = "SELECT host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype"; |
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 91-97
if ($op eq 'add_form') {
Link Here
|
91 |
my $data; |
91 |
my $data; |
92 |
if ($searchfield) { |
92 |
if ($searchfield) { |
93 |
my $dbh = C4::Context->dbh; |
93 |
my $dbh = C4::Context->dbh; |
94 |
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"); |
94 |
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"); |
95 |
$sth->execute($searchfield); |
95 |
$sth->execute($searchfield); |
96 |
$data=$sth->fetchrow_hashref; |
96 |
$data=$sth->fetchrow_hashref; |
97 |
$sth->finish; |
97 |
$sth->finish; |
Lines 99-105
if ($op eq 'add_form') {
Link Here
|
99 |
$template->param( $_ => $data->{$_} ) |
99 |
$template->param( $_ => $data->{$_} ) |
100 |
for ( qw( host port db userid password checked rank timeout encoding ) ); |
100 |
for ( qw( host port db userid password checked rank timeout encoding ) ); |
101 |
$template->param( $_ . $data->{$_} => 1) |
101 |
$template->param( $_ . $data->{$_} => 1) |
102 |
for ( qw( syntax ) ); |
102 |
for ( qw( syntax recordtype ) ); |
103 |
# END $OP eq ADD_FORM |
103 |
# END $OP eq ADD_FORM |
104 |
################## ADD_VALIDATE ################################## |
104 |
################## ADD_VALIDATE ################################## |
105 |
# called by add_form, used to insert/modify data in DB |
105 |
# called by add_form, used to insert/modify data in DB |
Lines 110-116
if ($op eq 'add_form') {
Link Here
|
110 |
my $checked = $input->param('checked') ? 1 : 0; |
110 |
my $checked = $input->param('checked') ? 1 : 0; |
111 |
if ($sth->rows) { |
111 |
if ($sth->rows) { |
112 |
$template->param(confirm_update => 1); |
112 |
$template->param(confirm_update => 1); |
113 |
$sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=?,timeout=? where name=?"); |
113 |
$sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=?,timeout=?,recordtype=? where name=?"); |
114 |
$sth->execute($input->param('host'), |
114 |
$sth->execute($input->param('host'), |
115 |
$input->param('port'), |
115 |
$input->param('port'), |
116 |
$input->param('db'), |
116 |
$input->param('db'), |
Lines 122-127
if ($op eq 'add_form') {
Link Here
|
122 |
$input->param('syntax'), |
122 |
$input->param('syntax'), |
123 |
$input->param('encoding'), |
123 |
$input->param('encoding'), |
124 |
$input->param('timeout'), |
124 |
$input->param('timeout'), |
|
|
125 |
$input->param('recordtype'), |
125 |
$input->param('searchfield'), |
126 |
$input->param('searchfield'), |
126 |
); |
127 |
); |
127 |
} |
128 |
} |
Lines 129-136
if ($op eq 'add_form') {
Link Here
|
129 |
$template->param(confirm_add => 1); |
130 |
$template->param(confirm_add => 1); |
130 |
$sth=$dbh->prepare( |
131 |
$sth=$dbh->prepare( |
131 |
"INSERT INTO z3950servers " . |
132 |
"INSERT INTO z3950servers " . |
132 |
"(host,port,db,userid,password,name,checked,rank,syntax,encoding,timeout) " . |
133 |
"(host,port,db,userid,password,name,checked,rank,syntax,encoding,timeout,recordtype) " . |
133 |
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ); |
134 |
"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" ); |
134 |
$sth->execute( |
135 |
$sth->execute( |
135 |
$input->param( 'host' ), |
136 |
$input->param( 'host' ), |
136 |
$input->param( 'port' ), |
137 |
$input->param( 'port' ), |
Lines 142-148
if ($op eq 'add_form') {
Link Here
|
142 |
$input->param( 'rank' ), |
143 |
$input->param( 'rank' ), |
143 |
$input->param( 'syntax' ), |
144 |
$input->param( 'syntax' ), |
144 |
$input->param( 'encoding' ), |
145 |
$input->param( 'encoding' ), |
145 |
$input->param( 'timeout' ) ); |
146 |
$input->param( 'timeout' ), |
|
|
147 |
$input->param( 'recordtype' ) ); |
146 |
} |
148 |
} |
147 |
$sth->finish; |
149 |
$sth->finish; |
148 |
# END $OP eq ADD_VALIDATE |
150 |
# END $OP eq ADD_VALIDATE |
Lines 152-158
if ($op eq 'add_form') {
Link Here
|
152 |
$template->param(delete_confirm => 1); |
154 |
$template->param(delete_confirm => 1); |
153 |
my $dbh = C4::Context->dbh; |
155 |
my $dbh = C4::Context->dbh; |
154 |
|
156 |
|
155 |
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"); |
157 |
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"); |
156 |
$sth2->execute($searchfield); |
158 |
$sth2->execute($searchfield); |
157 |
my $data=$sth2->fetchrow_hashref; |
159 |
my $data=$sth2->fetchrow_hashref; |
158 |
$sth2->finish; |
160 |
$sth2->finish; |
Lines 166-171
if ($op eq 'add_form') {
Link Here
|
166 |
rank => $data->{'rank'}, |
168 |
rank => $data->{'rank'}, |
167 |
syntax => $data->{'syntax'}, |
169 |
syntax => $data->{'syntax'}, |
168 |
timeout => $data->{'timeout'}, |
170 |
timeout => $data->{'timeout'}, |
|
|
171 |
recordtype => $data->{'recordtype'}, |
169 |
encoding => $data->{'encoding'} ); |
172 |
encoding => $data->{'encoding'} ); |
170 |
|
173 |
|
171 |
# END $OP eq DELETE_CONFIRM |
174 |
# END $OP eq DELETE_CONFIRM |
Lines 197-203
if ($op eq 'add_form') {
Link Here
|
197 |
rank => $results->[$i]{'rank'}, |
200 |
rank => $results->[$i]{'rank'}, |
198 |
syntax => $results->[$i]{'syntax'}, |
201 |
syntax => $results->[$i]{'syntax'}, |
199 |
encoding => $results->[$i]{'encoding'}, |
202 |
encoding => $results->[$i]{'encoding'}, |
200 |
timeout => $results->[$i]{'timeout'}); |
203 |
timeout => $results->[$i]{'timeout'}, |
|
|
204 |
recordtype => $results->[$i]{'recordtype'}); |
201 |
push @loop, \%row; |
205 |
push @loop, \%row; |
202 |
|
206 |
|
203 |
} |
207 |
} |