View | Details | Raw Unified | Return to bug 6140
Collapse All | Expand All

(-)a/admin/z3950servers.pl (-10 / +14 lines)
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
	}
(-)a/cataloguing/z3950_search.pl (+1 lines)
Lines 179-184 warn "query ".$query if $DEBUG; Link Here
179
            $option1->option('user',         $server->{userid}  ) if $server->{userid};
179
            $option1->option('user',         $server->{userid}  ) if $server->{userid};
180
            $option1->option('password',     $server->{password}) if $server->{password};
180
            $option1->option('password',     $server->{password}) if $server->{password};
181
            $option1->option('preferredRecordSyntax', $server->{syntax});
181
            $option1->option('preferredRecordSyntax', $server->{syntax});
182
            $option1->option( 'timeout', $server->{timeout} ) if ($server->{timeout});
182
            $oConnection[$s] = create ZOOM::Connection($option1)
183
            $oConnection[$s] = create ZOOM::Connection($option1)
183
              || $DEBUG
184
              || $DEBUG
184
              && warn( "" . $oConnection[$s]->errmsg() );
185
              && warn( "" . $oConnection[$s]->errmsg() );
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 1990-1995 CREATE TABLE `z3950servers` ( Link Here
1990
  `checked` smallint(6) default NULL,
1990
  `checked` smallint(6) default NULL,
1991
  `rank` int(11) default NULL,
1991
  `rank` int(11) default NULL,
1992
  `syntax` varchar(80) default NULL,
1992
  `syntax` varchar(80) default NULL,
1993
  `timeout` int(11) NOT NULL DEFAULT '0',
1993
  `icon` text,
1994
  `icon` text,
1994
  `position` enum('primary','secondary','') NOT NULL default 'primary',
1995
  `position` enum('primary','secondary','') NOT NULL default 'primary',
1995
  `type` enum('zed','opensearch') NOT NULL default 'zed',
1996
  `type` enum('zed','opensearch') NOT NULL default 'zed',
(-)a/installer/data/mysql/updatedatabase.pl (-4 / +5 lines)
Lines 4261-4273 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
4261
4261
4262
$DBversion = "3.03.00.047";
4262
$DBversion = "3.03.00.047";
4263
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4263
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
4264
    $dbh->do("
4264
    $dbh->do(qq{
4265
	ALTER TABLE `marc_subfield_structure` ADD `punctuation` VARCHAR( 5 ) NULL , ADD `help` VARCHAR( 255 ) NULL;
4265
       ALTER TABLE `z3950servers` ADD `timeout` INT( 11 ) NOT NULL DEFAULT '0' AFTER `syntax`;
4266
    ");
4266
    });
4267
    print "Upgrade to $DBversion done (Punctuation and cataloguing help)\n";
4267
    print "Upgrade to $DBversion done (New timeout field in z3950servers)\n";
4268
    SetVersion($DBversion);
4268
    SetVersion($DBversion);
4269
}
4269
}
4270
4270
4271
4271
=head1 FUNCTIONS
4272
=head1 FUNCTIONS
4272
4273
4273
=head2 DropAllForeignKeys($table)
4274
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tmpl (-3 / +5 lines)
Lines 226-231 Link Here
226
<!-- /TMPL_IF -->
226
<!-- /TMPL_IF -->
227
</select>
227
</select>
228
</li>
228
</li>
229
		<li><label for="timeout">Timeout (0 its like not set): </label>	<input type="text" name="timeout" id="timeout" size="4" value="<!-- TMPL_VAR NAME="timeout" -->" onblur="isNum(this)" />
230
		</li>	
229
</ol>
231
</ol>
230
        </fieldset>
232
        </fieldset>
231
		
233
		
Lines 254-259 Link Here
254
                <li><strong>Rank: </strong><!-- TMPL_VAR NAME="rank" --></li>
256
                <li><strong>Rank: </strong><!-- TMPL_VAR NAME="rank" --></li>
255
                <li><strong>Syntax: </strong><!-- TMPL_VAR NAME="syntax" --></li>
257
                <li><strong>Syntax: </strong><!-- TMPL_VAR NAME="syntax" --></li>
256
                <li><strong>Encoding: </strong><!-- TMPL_VAR NAME="encoding" --></li>
258
                <li><strong>Encoding: </strong><!-- TMPL_VAR NAME="encoding" --></li>
259
                <li><strong>Timeout: </strong><!-- TMPL_VAR NAME="timeout" --></li>
257
 	</ul>                <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post"><input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="searchfield" value="<!-- TMPL_VAR NAME="searchfield" -->" /><input type="submit" value="Delete this Server" /></form>  <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post"><input type="submit" value="Do Not Delete" /></form>
260
 	</ul>                <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post"><input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="searchfield" value="<!-- TMPL_VAR NAME="searchfield" -->" /><input type="submit" value="Delete this Server" /></form>  <form action="<!-- TMPL_VAR NAME="script_name" -->" method="post"><input type="submit" value="Do Not Delete" /></form>
258
261
259
262
Lines 297-303 Link Here
297
                You searched for <!-- TMPL_VAR NAME="searchfield" -->
300
                You searched for <!-- TMPL_VAR NAME="searchfield" -->
298
        <!-- /TMPL_IF -->		
301
        <!-- /TMPL_IF -->		
299
<table id="serverst">
302
<table id="serverst">
300
                <thead><tr><th>Target</th><th>Hostname/Port</th><th>Database</th><th>Userid</th><th>Password</th><th>Checked</th><th>Rank</th>       			<th>Syntax</th><th>Encoding</th><th colspan="2">&nbsp;</th>
303
                <thead><tr><th>Target</th><th>Hostname/Port</th><th>Database</th><th>Userid</th><th>Password</th><th>Checked</th><th>Rank</th>       			<th>Syntax</th><th>Encoding</th><th>Timeout</th><th colspan="2">&nbsp;</th>
301
                </tr></thead>
304
                </tr></thead>
302
                <tbody><!-- TMPL_LOOP NAME="loop" -->
305
                <tbody><!-- TMPL_LOOP NAME="loop" -->
303
                <!-- TMPL_UNLESS NAME="__odd__" -->
306
                <!-- TMPL_UNLESS NAME="__odd__" -->
Lines 305-311 Link Here
305
                <!-- TMPL_ELSE -->
308
                <!-- TMPL_ELSE -->
306
                    <tr>
309
                    <tr>
307
                <!-- /TMPL_UNLESS -->
310
                <!-- /TMPL_UNLESS -->
308
<td><a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&amp;searchfield=<!-- TMPL_VAR NAME="name" ESCAPE="url" -->"><!-- TMPL_VAR NAME="name" --></a></td><td><!-- TMPL_VAR NAME="host" -->:<!-- TMPL_VAR NAME="port" --></td><td><!-- TMPL_VAR NAME="db" --></td><td><!-- TMPL_VAR NAME="userid" --></td><td><!-- TMPL_VAR NAME="password" --></td><td><!-- TMPL_VAR NAME="checked" --></td><td><!-- TMPL_VAR NAME="rank" --></td>			<td><!-- TMPL_VAR NAME="syntax" --></td><td><!-- TMPL_VAR NAME="encoding" --></td><td><a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&amp;searchfield=<!-- TMPL_VAR NAME="name" ESCAPE="url" -->">Edit</a></td><td><a href="<!-- TMPL_VAR name="script_name" -->?op=delete_confirm&amp;searchfield=<!-- TMPL_VAR NAME="name" ESCAPE="url" -->">Delete</a></td>                </tr>
311
<td><a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&amp;searchfield=<!-- TMPL_VAR NAME="name" ESCAPE="url" -->"><!-- TMPL_VAR NAME="name" --></a></td><td><!-- TMPL_VAR NAME="host" -->:<!-- TMPL_VAR NAME="port" --></td><td><!-- TMPL_VAR NAME="db" --></td><td><!-- TMPL_VAR NAME="userid" --></td><td><!-- TMPL_VAR NAME="password" --></td><td><!-- TMPL_VAR NAME="checked" --></td><td><!-- TMPL_VAR NAME="rank" --></td>			<td><!-- TMPL_VAR NAME="syntax" --></td><td><!-- TMPL_VAR NAME="encoding" --></td><td><!-- TMPL_VAR NAME="timeout" --></td><td><a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&amp;searchfield=<!-- TMPL_VAR NAME="name" ESCAPE="url" -->">Edit</a></td><td><a href="<!-- TMPL_VAR name="script_name" -->?op=delete_confirm&amp;searchfield=<!-- TMPL_VAR NAME="name" ESCAPE="url" -->">Delete</a></td>                </tr>
309
                <!-- /TMPL_LOOP --></tbody>
312
                <!-- /TMPL_LOOP --></tbody>
310
	</table>
313
	</table>
311
314
312
- 

Return to bug 6140