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

(-)a/C4/Breeding.pm (-37 / +41 lines)
Lines 221-239 sub Z3950Search { Link Here
221
        $oConnection[$_]->destroy();
221
        $oConnection[$_]->destroy();
222
    }
222
    }
223
223
224
    @servers = ();
225
    foreach my $id (@id) {
226
        push @servers, {id => $id};
227
    }
228
229
    $template->param(
224
    $template->param(
230
        breeding_loop => \@breeding_loop,
225
        breeding_loop => \@breeding_loop,
231
        servers => \@servers,
226
        servers => \@servers,
232
        errconn       => \@errconn
227
        errconn       => \@errconn
233
    );
228
    );
234
    $template->param(
235
        additionalFields => '1'
236
    ) if C4::Context->preference('AdditionalFieldsInZ3950ResultSearch');
237
}
229
}
238
230
239
sub _build_query {
231
sub _build_query {
Lines 348-386 sub _add_rowdata { Link Here
348
    $row->{date}//= $row->{date2};
340
    $row->{date}//= $row->{date2};
349
    $row->{isbn}=_isbn_replace($row->{isbn});
341
    $row->{isbn}=_isbn_replace($row->{isbn});
350
342
351
    my $pref_addnumber = C4::Context->preference('AdditionalFieldsInZ3950ResultSearch');
343
    $row = _add_custom_field_rowdata($row, $record);
344
345
    return $row;
346
}
347
348
sub _add_custom_field_rowdata
349
{
350
    my ( $row, $record ) = @_;
351
    my $pref_newtags = C4::Context->preference('AdditionalFieldsInZ3950ResultSearch');
352
353
    $pref_newtags =~ s/^\s+|\s+$//g;
354
    $pref_newtags =~ s/\h+/ /g;
352
355
353
    $pref_addnumber =~ s/^\s+|\s+$//g;
356
    my @addnumber_array = split / /, $pref_newtags;
354
    $pref_addnumber =~ s/\h+/ /g;
355
    my @addnumber_array = split / /, $pref_addnumber;
356
    my @addnumberfields;
357
    my @addnumberfields;
358
357
    foreach (@addnumber_array) {
359
    foreach (@addnumber_array) {
358
        my $length = length($_);
360
        my $length = length($_);
359
        my $adTag = substr($_, 0, 3);
361
        my $adTag = substr( $_, 0, 3 );
360
        if ($record->field($adTag)) {
362
361
           my $field = $record->field($adTag);
363
        if ( $record->field($adTag) ) {
362
           my $fieldContent='';
364
            my $field        = $record->field($adTag);
363
           if ($length > 3){
365
            my $fieldContent = '';
364
               my $adSubfield;
366
365
               for (my $i=0; $i<$length-4; $i++){ # 4 because 3 digits, 1 dollar sign ($)
367
            if ( $length > 3 ) {
366
                  $adSubfield = substr($_, 4+$i, 1);
368
                my $adSubfield;
367
                  $fieldContent = $fieldContent.$field->subfield($adSubfield).' ';
369
                for ( my $i = 4; $i < $length; $i++ ) {    # 4 because 3 digits, 1 dollar sign ($)
368
               }
370
                    $adSubfield = substr( $_, $i, 1 );
369
               push(@addnumberfields, $_);
371
                    $fieldContent = $fieldContent . $field->subfield($adSubfield) . ' ';
370
               $row->{$_} = $fieldContent;
372
                }
371
           }
373
                push( @addnumberfields, $_ );
372
           else {
374
                $row->{$_} = $fieldContent;
373
               if($adTag <= 10){
375
            }
374
                   my $data = $field->data();
376
            else {
375
                   push(@addnumberfields, $_);
377
                if ( $adTag <= 10 ) {
376
                   $row->{$_} = $data;
378
                    my $data = $field->data();
377
               }
379
                    push( @addnumberfields, $_ );
378
               else {
380
                    $row->{$_} = $data;
379
                   my $subfields_text = $field->as_string();
381
                }
380
                   push(@addnumberfields, $_);
382
                else {
381
                   $row->{$_} = $subfields_text;
383
                    my $subfields_text = $field->as_string();
382
               }
384
                    push( @addnumberfields, $_ );
383
           }
385
                    $row->{$_} = $subfields_text;
386
                }
387
            }
384
        }
388
        }
385
    }
389
    }
386
390
(-)a/installer/data/mysql/sysprefs.sql (-2 / +1 lines)
Lines 6-14 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
6
('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo'),
6
('AcquisitionDetails', '1', '', 'Hide/Show acquisition details on the biblio detail page.', 'YesNo'),
7
('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: his own only, any within his branch or all','Choice'),
7
('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: his own only, any within his branch or all','Choice'),
8
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
8
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
9
('AddressFormat','us','','Choose format to display postal addresses', 'Choice'),
10
('AdditionalFieldsInZ3950ResultSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of a search Z3950', 'Free'),
9
('AdditionalFieldsInZ3950ResultSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of a search Z3950', 'Free'),
11
('AddPatronLists','categorycode','categorycode|category_type','Allow user to choose what list to pick up from when adding patrons','Choice'),
10
('AddressFormat','us','us|de|fr','Choose format to display postal addresses', 'Choice'),
12
('advancedMARCeditor','0','','If ON, the MARC editor won\'t display field/subfield descriptions','YesNo'),
11
('advancedMARCeditor','0','','If ON, the MARC editor won\'t display field/subfield descriptions','YesNo'),
13
('AdvancedSearchLanguages','','','ISO 639-2 codes of languages you wish to see appear as an Advanced search option.  Example: eng|fre|ita','Textarea'),
12
('AdvancedSearchLanguages','','','ISO 639-2 codes of languages you wish to see appear as an Advanced search option.  Example: eng|fre|ita','Textarea'),
14
('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice'),
13
('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Select which set of fields comprise the Type limit in the advanced search','Choice'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt (-2 / +3 lines)
Lines 1-3 Link Here
1
[% USE Koha %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Acquisitions &rsaquo; [% IF ( opsearch ) %]Order from external source[% ELSE %]Order from external source &rsaquo; Search results[% END %]</title>
3
<title>Koha &rsaquo; Acquisitions &rsaquo; [% IF ( opsearch ) %]Order from external source[% ELSE %]Order from external source &rsaquo; Search results[% END %]</title>
3
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
4
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
Lines 132-138 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : Link Here
132
        <th>Author</th>
133
        <th>Author</th>
133
        <th>ISBN</th>
134
        <th>ISBN</th>
134
        <th>LCCN</th>
135
        <th>LCCN</th>
135
        [% IF additionalFields %]
136
        [% IF Koha.Preference('AdditionalFieldsInZ3950ResultSearch') != '' %]
136
        <th>Additional fields</th>
137
        <th>Additional fields</th>
137
        [% END %]
138
        [% END %]
138
        <th>Preview</th>
139
        <th>Preview</th>
Lines 147-153 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : Link Here
147
            <td>[% breeding_loo.author %]</td>
148
            <td>[% breeding_loo.author %]</td>
148
            <td>[% breeding_loo.isbn %]</td>
149
            <td>[% breeding_loo.isbn %]</td>
149
            <td>[% breeding_loo.lccn %]</td>
150
            <td>[% breeding_loo.lccn %]</td>
150
            [% IF additionalFields %]
151
            [% IF Koha.Preference('AdditionalFieldsInZ3950ResultSearch') != '' %]
151
            <td>
152
            <td>
152
               <dl>
153
               <dl>
153
                  [% FOREACH addnumberfield IN breeding_loo.addnumberfields %]
154
                  [% FOREACH addnumberfield IN breeding_loo.addnumberfields %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tt (-2 / +3 lines)
Lines 1-3 Link Here
1
[% USE Koha %]
1
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Z39.50/SRU search results</title>
3
<title>Koha &rsaquo; Z39.50/SRU search results</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
Lines 144-150 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : Link Here
144
        <th>Edition</th>
145
        <th>Edition</th>
145
        <th>ISBN</th>
146
        <th>ISBN</th>
146
        <th>LCCN</th>
147
        <th>LCCN</th>
147
        [% IF additionalFields %]
148
        [% IF Koha.Preference('AdditionalFieldsInZ3950ResultSearch') != '' %]
148
        <th>Additional fields</th>
149
        <th>Additional fields</th>
149
        [% END %]
150
        [% END %]
150
        <th>MARC</th>
151
        <th>MARC</th>
Lines 162-168 tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : Link Here
162
            <td>[% breeding_loo.edition %]</td>
163
            <td>[% breeding_loo.edition %]</td>
163
            <td>[% breeding_loo.isbn %]</td>
164
            <td>[% breeding_loo.isbn %]</td>
164
            <td>[% breeding_loo.lccn %]</td>
165
            <td>[% breeding_loo.lccn %]</td>
165
            [% IF additionalFields %]
166
            [% IF Koha.Preference('AdditionalFieldsInZ3950ResultSearch') != '' %]
166
            <td>
167
            <td>
167
               <dl>
168
               <dl>
168
                  [% FOREACH addnumberfield IN breeding_loo.addnumberfields %]
169
                  [% FOREACH addnumberfield IN breeding_loo.addnumberfields %]
(-)a/t/db_dependent/Breeding.t (-2 / +1 lines)
Lines 195-201 sub test_do_xslt { Link Here
195
195
196
sub test_add_rowdata {
196
sub test_add_rowdata {
197
197
198
	my $old_preference = C4::Context->preference("AdditionalFieldsInZ3950ResultSearch");
198
    my $old_preference = C4::Context->preference("AdditionalFieldsInZ3950ResultSearch");
199
    C4::Context->set_preference("AdditionalFieldsInZ3950ResultSearch","");
199
    C4::Context->set_preference("AdditionalFieldsInZ3950ResultSearch","");
200
200
201
    my $row = {
201
    my $row = {
202
- 

Return to bug 12747