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

(-)a/C4/Breeding.pm (-3 / +3 lines)
Lines 440-448 sub Z3950Search { Link Here
440
440
441
=head2 ImportBreedingAuth
441
=head2 ImportBreedingAuth
442
442
443
	ImportBreedingAuth($marcrecords,$overwrite_auth,$filename,$encoding,$z3950random,$batch_type);
443
ImportBreedingAuth($marcrecords,$overwrite_auth,$filename,$encoding,$z3950random,$batch_type);
444
444
445
	TODO description
445
TODO description
446
446
447
=cut
447
=cut
448
448
Lines 464-470 sub ImportBreedingAuth { Link Here
464
    my $breedingid;
464
    my $breedingid;
465
    for (my $i=0;$i<=$#marcarray;$i++) {
465
    for (my $i=0;$i<=$#marcarray;$i++) {
466
        my ($marcrecord, $charset_result, $charset_errors);
466
        my ($marcrecord, $charset_result, $charset_errors);
467
        ($marcrecord, $charset_result, $charset_errors) = 
467
        ($marcrecord, $charset_result, $charset_errors) =
468
            MarcToUTF8Record($marcarray[$i]."\x1D", C4::Context->preference("marcflavour"), $encoding);
468
            MarcToUTF8Record($marcarray[$i]."\x1D", C4::Context->preference("marcflavour"), $encoding);
469
469
470
        # Normalize the record so it doesn't have separated diacritics
470
        # Normalize the record so it doesn't have separated diacritics
(-)a/admin/z3950servers.pl (-78 / +78 lines)
Lines 85-174 $template->param(script_name => $script_name, Link Here
85
85
86
################## ADD_FORM ##################################
86
################## ADD_FORM ##################################
87
# called by default. Used to create form to add or  modify a record
87
# called by default. Used to create form to add or  modify a record
88
if ($op eq 'add_form') {
88
if ( $op eq 'add_form' ) {
89
	$template->param(add_form => 1);
89
    $template->param( add_form => 1 );
90
	#---- if primkey exists, it's a modify action, so read values to modify...
90
91
	my $data;
91
    #---- if primkey exists, it's a modify action, so read values to modify...
92
	if ($searchfield) {
92
    my $data;
93
		my $dbh = C4::Context->dbh;
93
    if ($searchfield) {
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");
94
        my $dbh = C4::Context->dbh;
95
		$sth->execute($searchfield);
95
        my $sth = $dbh->prepare(
96
		$data=$sth->fetchrow_hashref;
96
"select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype from z3950servers where (name = ?) order by rank,name"
97
		$sth->finish;
97
        );
98
	}
98
        $sth->execute($searchfield);
99
    $template->param( $_ => $data->{$_} ) 
99
        $data = $sth->fetchrow_hashref;
100
        for ( qw( host port db userid password checked rank timeout encoding ) );
100
        $sth->finish;
101
    $template->param( $_ . $data->{$_} => 1)
101
    }
102
        for ( qw( syntax recordtype ) );
102
    $template->param( $_ => $data->{$_} )
103
													# END $OP eq ADD_FORM
103
      for (qw( host port db userid password checked rank timeout encoding ));
104
    $template->param( $_ . $data->{$_} => 1 ) for (qw( syntax recordtype ));
105
106
    # END $OP eq ADD_FORM
104
################## ADD_VALIDATE ##################################
107
################## ADD_VALIDATE ##################################
105
# called by add_form, used to insert/modify data in DB
108
    # called by add_form, used to insert/modify data in DB
106
} elsif ($op eq 'add_validate') {
109
} elsif ($op eq 'add_validate') {
107
	$template->param(add_validate => 1);
110
    $template->param( add_validate => 1 );
108
	my $dbh=C4::Context->dbh;
111
    my $dbh = C4::Context->dbh;
109
	my $sth=$dbh->prepare("select * from z3950servers where name=?");
112
    my $sth = $dbh->prepare("select * from z3950servers where name=?");
110
	$sth->execute($input->param('searchfield'));
113
    $sth->execute( $input->param('searchfield') );
111
	my $checked = $input->param('checked') ? 1 : 0;
114
    my $checked = $input->param('checked') ? 1 : 0;
112
	if ($sth->rows) {
115
    if ( $sth->rows ) {
113
		$sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=?,timeout=?,recordtype=? where name=?");
116
        $sth = $dbh->prepare(
114
		$sth->execute($input->param('host'),
117
"update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=?,timeout=?,recordtype=? where name=?"
115
		      $input->param('port'),
118
        );
116
		      $input->param('db'),
117
		      $input->param('userid'),
118
		      $input->param('password'),
119
		      $input->param('searchfield'),
120
		      $checked,
121
		      $input->param('rank'),
122
			  $input->param('syntax'),
123
              $input->param('encoding'),
124
              $input->param('timeout'),
125
              $input->param('recordtype'),
126
		      $input->param('searchfield'),
127
		      );
128
	} 
129
	else {
130
		$sth=$dbh->prepare(
131
		  "INSERT INTO z3950servers " .
132
		  "(host,port,db,userid,password,name,checked,rank,syntax,encoding,timeout,recordtype) " .
133
		  "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" );
134
        $sth->execute(
119
        $sth->execute(
135
            $input->param( 'host' ),
120
            $input->param('host'),     $input->param('port'),
136
            $input->param( 'port' ),
121
            $input->param('db'),       $input->param('userid'),
137
            $input->param( 'db' ),
122
            $input->param('password'), $input->param('searchfield'),
138
            $input->param( 'userid' ),
123
            $checked,                  $input->param('rank'),
139
            $input->param( 'password' ),
124
            $input->param('syntax'),   $input->param('encoding'),
140
            $input->param( 'searchfield' ),
125
            $input->param('timeout'),  $input->param('recordtype'),
141
            $checked,
126
            $input->param('searchfield'),
142
            $input->param( 'rank' ),
127
        );
143
            $input->param( 'syntax' ),
128
    }
144
            $input->param( 'encoding' ),
129
    else {
145
            $input->param( 'timeout' ),
130
        $sth =
146
            $input->param( 'recordtype' ) );
131
          $dbh->prepare( "INSERT INTO z3950servers "
147
	}
132
              . "(host,port,db,userid,password,name,checked,rank,syntax,encoding,timeout,recordtype) "
148
	$sth->finish;
133
              . "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" );
149
													# END $OP eq ADD_VALIDATE
134
        $sth->execute(
135
            $input->param('host'),     $input->param('port'),
136
            $input->param('db'),       $input->param('userid'),
137
            $input->param('password'), $input->param('searchfield'),
138
            $checked,                  $input->param('rank'),
139
            $input->param('syntax'),   $input->param('encoding'),
140
            $input->param('timeout'),  $input->param('recordtype')
141
        );
142
    }
143
    $sth->finish;
144
145
    # END $OP eq ADD_VALIDATE
150
################## DELETE_CONFIRM ##################################
146
################## DELETE_CONFIRM ##################################
151
# called by default form, used to confirm deletion of data in DB
147
# called by default form, used to confirm deletion of data in DB
152
} elsif ($op eq 'delete_confirm') {
148
} elsif ($op eq 'delete_confirm') {
153
	$template->param(delete_confirm => 1);
149
    $template->param( delete_confirm => 1 );
154
	my $dbh = C4::Context->dbh;
150
    my $dbh = C4::Context->dbh;
155
151
156
	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");
152
    my $sth2 = $dbh->prepare(
157
	$sth2->execute($searchfield);
153
"select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout,recordtype from z3950servers where (name = ?) order by rank,name"
158
	my $data=$sth2->fetchrow_hashref;
154
    );
159
	$sth2->finish;
155
    $sth2->execute($searchfield);
160
156
    my $data = $sth2->fetchrow_hashref;
161
        $template->param(host => $data->{'host'},
157
    $sth2->finish;
162
                         port => $data->{'port'},
158
163
                         db   => $data->{'db'},
159
    $template->param(
164
                         userid => $data->{'userid'},
160
        host       => $data->{'host'},
165
                         password => $data->{'password'},
161
        port       => $data->{'port'},
166
                         checked => $data->{'checked'},
162
        db         => $data->{'db'},
167
                         rank => $data->{'rank'},
163
        userid     => $data->{'userid'},
168
                         syntax => $data->{'syntax'},
164
        password   => $data->{'password'},
169
                         timeout => $data->{'timeout'},
165
        checked    => $data->{'checked'},
170
                         recordtype => $data->{'recordtype'},
166
        rank       => $data->{'rank'},
171
                         encoding => $data->{'encoding'}            );
167
        syntax     => $data->{'syntax'},
168
        timeout    => $data->{'timeout'},
169
        recordtype => $data->{'recordtype'},
170
        encoding   => $data->{'encoding'}
171
    );
172
172
173
													# END $OP eq DELETE_CONFIRM
173
													# END $OP eq DELETE_CONFIRM
174
################## DELETE_CONFIRMED ##################################
174
################## DELETE_CONFIRMED ##################################
(-)a/cataloguing/z3950_auth_search.pl (-1 / +1 lines)
Lines 23-29 Link Here
23
23
24
use strict;
24
use strict;
25
use warnings;
25
use warnings;
26
use CGI qw( -utf8 );
26
use CGI qw / -utf8 /;
27
27
28
use C4::Auth;
28
use C4::Auth;
29
use C4::Output;
29
use C4::Output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt (-5 / +7 lines)
Lines 238-244 Link Here
238
		<input type="text" name="timeout" id="timeout" size="4" value="[% timeout %]" onblur="isNum(this)" /> seconds
238
		<input type="text" name="timeout" id="timeout" size="4" value="[% timeout %]" onblur="isNum(this)" /> seconds
239
	</li>
239
	</li>
240
    <li><label for="recordtype">Record type: </label>
240
    <li><label for="recordtype">Record type: </label>
241
		<select name="recordtype" id="recordtype">
241
    <select name="recordtype" id="recordtype">
242
            [% IF ( recordtypebiblio ) %]
242
            [% IF ( recordtypebiblio ) %]
243
            <option value="biblio" selected="selected">Bibliographic</option>
243
            <option value="biblio" selected="selected">Bibliographic</option>
244
            [% ELSE %]
244
            [% ELSE %]
Lines 250-256 Link Here
250
                   <option value="authority">Authority</option>
250
                   <option value="authority">Authority</option>
251
            [% END %]
251
            [% END %]
252
        </select>
252
        </select>
253
	</li>
253
    </li>
254
</ol>
254
</ol>
255
        </fieldset>
255
        </fieldset>
256
		
256
		
Lines 304-310 Link Here
304
304
305
        [% IF ( searchfield ) %]
305
        [% IF ( searchfield ) %]
306
                You searched for [% searchfield %]
306
                You searched for [% searchfield %]
307
        [% END %]		
307
        [% END %]
308
<table id="serverst">
308
<table id="serverst">
309
                <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>Record type</th><th>&nbsp;</th><th>&nbsp;</th>
309
                <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>Record type</th><th>&nbsp;</th><th>&nbsp;</th>
310
                </tr></thead>
310
                </tr></thead>
Lines 314-322 Link Here
314
                [% ELSE %]
314
                [% ELSE %]
315
                    <tr>
315
                    <tr>
316
                [% END %]
316
                [% END %]
317
<td><a href="[% loo.script_name %]?op=add_form&amp;searchfield=[% loo.name |url %]">[% loo.name %]</a></td><td>[% loo.host %]:[% loo.port %]</td><td>[% loo.db %]</td><td>[% loo.userid %]</td><td>[% loo.password %]</td><td>[% IF ( loo.checked ) %]Yes[% ELSE %]No[% END %]</td><td>[% loo.rank %]</td>			<td>[% loo.syntax %]</td><td>[% loo.encoding %]</td><td>[% loo.timeout %]</td><td>[% loo.recordtype %]</td><td><a href="[% loo.script_name %]?op=add_form&amp;searchfield=[% loo.name |url %]">Edit</a></td><td><a href="[% loo.script_name %]?op=delete_confirm&amp;searchfield=[% loo.name |url %]">Delete</a></td>                </tr>
317
<td><a href="[% loo.script_name %]?op=add_form&amp;searchfield=[% loo.name |url %]">[% loo.name %]</a></td><td>[% loo.host %]:[% loo.port %]</td><td>[% loo.db %]</td><td>[% loo.userid %]</td><td>[% loo.password %]</td><td>[% IF ( loo.checked ) %]Yes[% ELSE %]No[% END %]</td><td>[% loo.rank %]</td>
318
319
<td>[% loo.syntax %]</td><td>[% loo.encoding %]</td><td>[% loo.timeout %]</td><td>[% loo.recordtype %]</td><td><a href="[% loo.script_name %]?op=add_form&amp;searchfield=[% loo.name |url %]">Edit</a></td><td><a href="[% loo.script_name %]?op=delete_confirm&amp;searchfield=[% loo.name |url %]">Delete</a></td>                </tr>
318
                [% END %]</tbody>
320
                [% END %]</tbody>
319
	</table>
321
</table>
320
322
321
[% IF ( offsetgtzero ) %]<form action="[% script_name %]" method="get">
323
[% IF ( offsetgtzero ) %]<form action="[% script_name %]" method="get">
322
	<input type="hidden" name="offset" value="[% prevpage %]" />
324
	<input type="hidden" name="offset" value="[% prevpage %]" />
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt (-5 / +4 lines)
Lines 101-107 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : Link Here
101
        <div>
101
        <div>
102
    [% END %]
102
    [% END %]
103
    <div id="bd">
103
    <div id="bd">
104
	[% IF ( opsearch ) %]
104
    [% IF ( opsearch ) %]
105
        <h2>Z39.50 Authority search points</h2>
105
        <h2>Z39.50 Authority search points</h2>
106
        <form method="post" action="z3950_auth_search.pl" name="f" class="checkboxed">
106
        <form method="post" action="z3950_auth_search.pl" name="f" class="checkboxed">
107
        <input type="hidden" name="op" id="op" value="do_search" />
107
        <input type="hidden" name="op" id="op" value="do_search" />
Lines 160-166 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : Link Here
160
    </tr></thead>
160
    </tr></thead>
161
    <tbody>[% FOREACH breeding_loo IN breeding_loop %]
161
    <tbody>[% FOREACH breeding_loo IN breeding_loop %]
162
        [% IF ( breeding_loo.breedingid ) %]
162
        [% IF ( breeding_loo.breedingid ) %]
163
	    <tr id="row[% breeding_loo.breedingid %]">
163
        <tr id="row[% breeding_loo.breedingid %]">
164
            <td>[% breeding_loo.server %] <div class="linktools"><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" rel="gb_page_center[600,500]">Preview MARC</a> <a href="#" onclick="Import([% breeding_loo.breedingid %],'[% breeding_loo.heading_code %]'); return false">Import</a><a href="#" onclick="closemenu();return false;" title="Close this menu"> X </a></div> </td>
164
            <td>[% breeding_loo.server %] <div class="linktools"><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% breeding_loo.breedingid %]" rel="gb_page_center[600,500]">Preview MARC</a> <a href="#" onclick="Import([% breeding_loo.breedingid %],'[% breeding_loo.heading_code %]'); return false">Import</a><a href="#" onclick="closemenu();return false;" title="Close this menu"> X </a></div> </td>
165
            <td>[% breeding_loo.heading %]</td>
165
            <td>[% breeding_loo.heading %]</td>
166
            <td>[% breeding_loo.heading_code %]</td>
166
            <td>[% breeding_loo.heading_code %]</td>
Lines 214-224 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : Link Here
214
            </div>
214
            </div>
215
         [% END %]
215
         [% END %]
216
   <div class="dialog message">Nothing found.</div>
216
   <div class="dialog message">Nothing found.</div>
217
	<p><form method="get" action="/cgi-bin/koha/cataloguing/z3950_auth_search.pl"><input type="submit" value="Try Another Search"/></form></p>
217
    <p><form method="get" action="/cgi-bin/koha/cataloguing/z3950_auth_search.pl"><input type="submit" value="Try Another Search"/></form></p>
218
    [% END %]
218
    [% END %]
219
219
220
[% END %]
220
[% END %]
221
	</div>
221
</div>
222
</div>
222
</div>
223
223
224
[% IF ( numberpending ) %]<h3 align="center">Still [% numberpending %] servers to search</h3>[% END %]
224
[% IF ( numberpending ) %]<h3 align="center">Still [% numberpending %] servers to search</h3>[% END %]
225
- 

Return to bug 10096